Hullo,
I took the replay.bin driver from the MuSICA distro and disassembled it by hand, for practice. (It is not yet completely labeled, but for reference, it is here: replay.z80 (google drive)
I'm attempting to adapt it for pure asm, and then later for MSX-DOS. I'm almost there, but I need help with the last step.
The driver appears to require the following BASIC statements before loading and executing:
10 clear20,&ha5b6:definta:dim a(1) 20 bload"music.bin",r
If any part of line 10 is changed (besides from adjusting "20" to an equally appropriate value) then it breaks -- usually causing a system reset.
The code I'm using is here:
fname "music.bin" db $fe dw START dw EOF dw init HIMEM: equ $fc4a InitMus: equ $ce00 StartMus: equ $ce03 InitializeIRQ: equ 0CE34h org $9000 START: MusLoc: db 0, 0, $b7, $a5 init: ;ld hl, $a5b6 ;ld (HIMEM), hl ld hl, player ld de, $ce00 ld bc, EOF-player ldir ld hl, music ld de, $a5b7 ld bc, player-music ldir call InitMus ld hl, MusLoc push hl ; store on stack pop ix ; pop real addr to ix ld a, (ix+0) ; a is first byte of song data ld l, (ix+2) ; l is 2 bytes up ld h, (ix+3) ; h is 3 bytes up call InitializeIRQ loop: jp loop music: incbin "testing1.bgm",7 player: incbin "replay.bin",7 EOF:
My question is: How would one emulate the clear $a5b6 statement in assembly, and the def/dim statements? I don't want to use BASIC code at all, if this is going to run under MSX-DOS.
I eagerly await any assistance any of you fine gentlemen can give :BA: