Version 2: just a small bugfix - thanks to Doomed/Padua for that.

This is the original readme.txt:
------------------------------------------------------------------------------
Here's a little thing that asm programmers might find useful - a complete mod
player to include in your stuff. It's actually the improved version of HITMOD 
that is part of my libs for MIPS-GCC... the file (modplay.bin) is the player 
and the extra routines it needs (mostly just SPU stuff) compiled into a binary
org'ed at $80010008. I think this is probably the most useful place to have it.

Only the 2 basic routines are provided - MOD_Load() and MOD_Poll(). Call 
MOD_Load() with the address of the song in register a0 (of course you must use
modconv.exe from the last HITMOD release to convert from .mod to .hit). This 
will init the SPU and the player routine. Then you just call MOD_Poll() once 
every frame to hear the song play. 

If you want to run the player from an interrupt (so you can play mods that 
aren't 125 bpm, or to make sure it plays at the correct speed on both NTSC and
PAL) you must call MOD_Poll from your own interrupt code. (See Doomed/Padua's 
page for details on how to do this - http://psx.rules.org/). 

The player adjusts the target value of root counter 1 whenever the mod contains
a speed/tempo command, so make sure you run the player from that counter and 
also dont use it for anything else :). This isn't really any restriction since
HITMOD is the same. Use 312 as a default value for the target of rcnt1.

Include it in your programs by doing something like this (just an example):

------------------------------------------------------------------------------
MOD_Load equ $80010008  ; these are the 2 routines you need to use
MOD_Poll equ $8001031c

        org $80010000
        
        b start         ; jump to the actual start address
        nop
        
        incbin modplay.bin  ; include the player binary
   
start:
        la a0, song
        jal MOD_Load
        nop
        
        blahblahblah    ; your code goes here...
        
        
main_loop:
        jal MOD_Poll    ; call this every frame, or from rcnt1
        nop
        
        blahblahblah    ; your main loop...
        
        b main_loop
        nop
        
song:   incbin something.hit
------------------------------------------------------------------------------

That's about all there is to it... the player doesn't need any extra memory 
outside of the memory used up by the modplay.bin file itself (8696 bytes). 
Hope you find it useful! :)

Silpheed/Hitmen.


    