Hello,
I've been working with good success on a MSX2 w/OPN game. It loads and runs well on both emulator and hardware configured for my machine (F1XDJ + FMPAC).
Someone tried to run it on their Turbo R, and it failed to load. It didn't reproduce in emulator, but when I tried a Turbo model (or anything with 9958, possibly), I was getting various confusing behaviors regarding the memory page map.
1. I use a custom interrupt handler that is stored low in ram (around 200h). This pushes and pulls the 8 main registers (I don't use shadow), acknowledges any vdp interrupts, calls vblank (which calls the music hook) and returns. This all runs fine on MSX2.
2. I am using "call 0005h" to load files from disk. This also works just fine on MSX2. On Turbo, this works fine *as long as I don't touch any interrupt hooks*. (I was also getting repeated behavior of this code in z88dk simply failing to return to the RAM page after executing, but in pure assembly this does not occur, much to my confusion).
3. A step through of my code on Turbo shows that the VBL signal is never cleared - it always returns to rst38 after EI / RETI. I was seeing this before on MSX2 when I forgot to ack the vblank interrupt, but I definitely am doing it here. Perhaps there is something else pulling the signal?
I realize this is confusing, but the long and short of it is this:
1. Does the Turbo R require acknowledgement of another interrupt line I am unaware of? Or, is there a different method of clearing the VDP interrupt? If so, how does one ack and clear it?
2. Is there any reason why "call 5" wouldn't work on Turbo R in MSX-DOS 1 mode? Possibly due to an aforementioned interrupt line I am unaware of?
3. Here is my interrupt:
_irq: di push af push bc push de push hl ; vdp ack ld c,$99 ld a,0 ; status reg 0 out (c),a ld a,15+$80 ; r15=statregsel out (c),a in a,(c) and $80 call nz,vblank ; if it was from the vdp, call vblank code ; vdp ack 2 - just in case hblank is set... ld a,1 ld c,$99 out (c),a ld a,15+$80 out (c),a in a,(c) ; return pop hl pop de pop bc pop af ei reti vblank: call $fd9f ; htimi, used by musica ret
Am I missing anything huge here? Why would a game that runs perfectly on an MSX2 simply fail so hard on a Turbo with such a multitude of symptoms? What could I be missing?
Program disk
Well... thanks for reading.