diff --git a/asm/merlin/make.bat b/asm/merlin/make.bat index b5e64ca..c0bf293 100644 --- a/asm/merlin/make.bat +++ b/asm/merlin/make.bat @@ -1,3 +1,4 @@ -merlin32 -V . link.s -iix chtyp -t obj ntpplayer.a +rem merlin32 -V . link.s +rem iix chtyp -t obj ntpplayer.a +merlin32 -V . ninjatrackerplus.s diff --git a/asm/merlin/ninjatrackerplus.s b/asm/merlin/ninjatrackerplus.s index 6e6d2ae..67eed04 100644 --- a/asm/merlin/ninjatrackerplus.s +++ b/asm/merlin/ninjatrackerplus.s @@ -9,7 +9,7 @@ * ***************************** - dsk ntpplayer.a + dsk ntpplayer.bin org $0f0000 mx %00 diff --git a/asm/merlin/ntpplayer.a b/asm/merlin/ntpplayer.a deleted file mode 100644 index 2fe40d1..0000000 Binary files a/asm/merlin/ntpplayer.a and /dev/null differ diff --git a/asm/ntp.s b/asm/ntp.s new file mode 100644 index 0000000..22fccb2 --- /dev/null +++ b/asm/ntp.s @@ -0,0 +1,134 @@ +* +* ORCA/M Fomat!! +* NinjaTrackerPlus C interfaces for ORCA +* + case on + longa on + longi on + +* Wow this is dummy section is silly +DummyNTP start ASM_CODE + end + +; prepare +; Prepares music, copies all instruments into sound ram and inits the sound interrupt. +; input: call with X=address low, Y=address high of pointer to the ntp file in memory +; output: X=address low, Y=address high of pointer to instruments (main program can reuse memory from here) +; when carry bit is set, an error occurred. Either the player did not find a NTP module at the given location +; or the version of the NTP module is not supported. + +* +* bool NTPprepare(void* pNTPData) +* +NTPprepare start ASM_CODE + +aNTPprepare EQU ntpplayer + + lda 4,s + tax + lda 6,s + tay + + lda 1,s + sta 5,s + lda 2,s + sta 6,s + + pla + lda #0 + sta 1,s + + jsl aNTPprepare + + bcc okgo + + lda #1 + sta 1,s + +okgo pla + rtl +*------------------------------------------------------------------------------- + end + +; play +; Starts previously prepared music. +; input: call with A=0 loop song, else play song only once +; output: - +* +* void NTPplay(bool bPlayOnce) +* +NTPplay start ASM_CODE + +aNTPplay EQU ntpplayer+3 + + lda 4,s + tax + lda 2,s + sta 4,s + lda 1,s + sta 3,s + pla + txa + jmp >aNTPplay +*------------------------------------------------------------------------------- + end + +; stop +; Stops a currently playing music, turns off all oscillators used by the player and restores the sound interrupt. +; input: - +; outout: - +* +* void NTPstop(void) +* +NTPstop start ASM_CODE + +aNTPstop EQU ntpplayer+6 + + jmp >aNTPstop +*------------------------------------------------------------------------------- + end + + +; getvuptr +; Returns a pointer to vu data (1 word number of tracks, then one word for every track with its volume). +; input: - +; output: X=address low, Y=address high of pointer +;aNTPgetvuptr GEQU ntpplayer+9 +* +* u8* NTPgetvuptr(void) +* +NTPgetvuptr start ASM_CODE + rtl +*------------------------------------------------------------------------------- + end + + +; gete8ptr +; Returns a pointer to where the player stores information about the last 8xx command found. Can be used for timing purposes. +; input: - +; output: X=address low, Y=address high of pointer +;aNTPgete8ptr GEQU ntpplayer+12 +* +* u8* NTPgete8ptr(void) +* +NTPgete8ptr start ASM_CODE + rtl +*------------------------------------------------------------------------------- + end + +; forcesongpos +; Forces the player to jump to a certain pattern (like command B). +; input: A=songpos +; output: carry bit is set when the song position does not exist (error) +;aNTPforcesongpos GEQU ntpplayer+15 +* +* bool NTPforcesongpos(int songpos) +* +NTPforcesongpos start ASM_CODE + lda #0 + rtl +*------------------------------------------------------------------------------- + end + + + diff --git a/data.bat b/data.bat index bb15eb3..52f6b6f 100644 --- a/data.bat +++ b/data.bat @@ -73,5 +73,8 @@ rem cd asm\merlin call make.bat cd ..\.. -iix makelib -P data.lib +asm\merlin\ntpplayer.a +lz4 -c2 asm\merlin\ntpplayer.bin data\ntpplayer.lz4 +iix mkobj ntpplayer_lz4 data:ntpplayer.lz4 data:ntpplayer.a ntpdata +iix makelib -P data.lib +data\ntpplayer.a +