More PCM driver stuff
Here’s a working, assemble-able version. I changed quite a bit and fixed a bunch of bugs (that’s what I get for writing code and not testing it). I also modified the code and made it more flexible. Now, it can loaded anywhere from rom. Address calculation is done as assemble time, so it doesn’t matter where it is in rom – as long you define some designation address in ram (be it a BSS label already defined or a specific address). It still needs a few more things, but as least you can hear all 4 channels (I hard panned them to left/right). And they all play at their own speed.
Update: Man, this is getting annoying. Magic Engine, Ootake, and Turbo Engine emulators play this simple rom… incorrectly. ME and TE have a weird speed issue (which should be impossible since this is synced to a TIMER!). Ootake is just grainy. Mednafen, YAME, and real hardware play it fine.