Hi,
mikro wrote:Doug, you want to say that you've got a MIDI replayer for the MIDI musics included in WAD files? If so, that would be frakking awesome, as the only solution right now I know about is to use SDL_audio + SDL_mixer +timidity patch and it's horribly expensive.
I think we have a few options for music in BadMood, which won't require SDL.
A contributor provided a small MIDI replay routine (in ASM) before v3.07 which (IIRC) outputs direct to the MIDI port. It's small and fast. I'm not sure how easy it is to adapt that to mixing samples for native replay but it may not matter.
I have my own version of a MIDI parser which is likely more complete (?) but is in C not ASM, ported from a PC project. - I used for some silly experiments on STE (rendering down tone permutations using a simple waveform, at 0% CPU replay - just a prebuilt DMA page chain). This could also be modified for native replay, although it would benefit from flattening the command sequence into a cache before replay to reduce the player cost as much as possible (I had already done this flatten step for the STE experiment but not particularly with performance in mind - it was more about simplifying the tone permutation step).
I saw all the SDL code when I was poking through PMDOOM, before I went for LinuxDoom - it seemed to use SDL for nearly everything 'platform specific' except the row/column pixel filling (which as far as I could tell were the 0x0-optimized bits) - the rest is practically the original Doom code except for the replacement fixed-point mul/div. There's probably a c2p in there too but I don't remember seeing it.
It was actually the SDL dependency (and problems getting that to work with the mint gcc chain) - not the optimizations - which caused me to back away and start looking at LinuxDoom as the reference code for the game.