Protracker player with support for external sound fx
Yesterday I uploaded my new protracker player from Sqrxz to Aminet:
http://aminet.net/mus/play/ptplayer.lha This player is quite optimized and has some useful features for game developers: - Insert external sound effects into the replayed module. - A fast master volume for the replayed music. - No busy waiting. DMA and repeat pointers are set with timer interrupts. - E8 command can be used as a trigger for your main program. The sound fx system will always block the channel which would be free for the longest period. This has the effect that the replayed song is often not disturbed at all. Up to four sound fx can be played at the same time (which would block all four music channels for this period). The master volume is always applied to the music, but does not affect external sound fx. |
Awesome
|
AMAZING!!! :agree
|
The player was updated on Aminet today. I fixed some minor bugs in the tone-portamento (3) and note-cut (EC) commands.
|
Great stuff. Works like a charm, thanks a million!
|
can't assemble : (Asm-Pro V1.18)
>a Pass 1.. ** Illegal Operator 101 near a4 > |
From the ReadMe:
Code:
The source is tested with the vasm assembler, but should work with most The "minor" modifications would include: - remove "xref _LinkerDB" and "near a4" - remove the two "lea _LinkerDB,a4" - remove the "(a4)" in all base-relative addressing modes - optionally rename or remove "section __MERGED,bss" The resulting code will be bigger and slower, but it might assemble with AsmPro after after that. |
I did more or less that to get it working with my devpac environment a while ago. It works a treat, but I didn't give any thought to the speed though - is it likely to be significantly slower?
|
I didn't make any tests, but there are more than 130 base-relative instructions in the source, and some of them are executed multiple times in each frame. The difference to an absolute 32-bit addressing mode is 4 68000 cycles.
You can get some speed back by converting the read operations to PC-relative. |
or leave the a4 basereg in there, and explicitly subtract the base address label in the offsets..
|
Or use the AsmPro/AsmOne BASEREG directive. :)
|
I have adapted the source, it doesn't use "near" anymore which means it should be possible to assemble with all "standard" assemblers (for this reason I have not used "BASEREG" either). I have added "mt_var" (i.e. NEAR a4 has been replaced with lea mt_var,a4) and changed all a4 references accordingly. I haven't tested the replayer but at least it can be assembled with ASM-Pro now. :)
|
Following slight (untested!) optimisation could be done in the "mt_mastervol" routine:
Instead of Code:
lea mt_MasterVolTabs(pc),a0 Code:
; stingray, since each volume table has a size of 65 bytes |
I'll give that a whirl on devpac later with my current project. If saves a few cycles over my own version of this protracker player I'll gladly use it :)
|
Quote:
Also _LinkerDB has to be removed. The interrupts were still using it to initialize the small data base. Quote:
|
1 Attachment(s)
Quote:
Quote:
I have adapted the source a bit more (all branches have distance specifiers now (.b wherever possible), above mentioned problems fixed, mt_mastervol optimised etc.) and also tested the replayer, it works fine for me! I have added 2 options as well: MT_NOBSS, this can be set to 0 or <0>, if it's not set to zero the BSS section for the variables will be removed, useful if one needs pc-relative code (the replayer isn't 100% pc-relative yet though) MT_INITA4: if this is set to anything else than 0 all routines which require a4 to be initialised will contain an additional "lea mt_var,a4" line Updated and working version of the source attached to this post, example how to call the replayer added too (check beginning of the source). Quote:
|
Might be a long shot but can anyone (or is it even possible to!) make a Blitzlib out of this? :bowdown
|
I have no idea how a BlitzBasic library looks like. Maybe when I find some documentation about it.
|
1 Attachment(s)
Quote:
I plan to update the player on Aminet these days, as the version used in Solid Gold was improved a bit over the last Aminet release. For example mt_init allows to start a song at any position and you may optionally split your MOD (move samples to Chip RAM, keep the rest in Fast RAM). I would also like to include an alternative version without small data, which assembles with Devpac and AsmOne/Pro. For that I used your modified source and merged it with the latest version. You find it attached. I made some tests with it and it seems to work fine. I assembed it successfully with PhxAss, vasm, Devpac, AsmPro and snma. |
Quote:
However, not sure if its something i'm doing wrong, or if theres a problem with the routine, but i've tried two separate modules now, and after playing about 20 seconds or so, both stop playing using this routine. Is it just me? |
All times are GMT +2. The time now is 01:10. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.