I am doing some tests in order to write to all of the Megadrive's Memory such as VRAM, VSRAM, CRAM, etc.
I have tried to write to Work-RAM using the Routine below. MESS will write to the 68K's Work-RAM but will then bypass the next instructions and execute the Halt (coloured in Red).
I would appreciate some Advice on what I am doing incorrectly here, please.
Code: Select all
WRAMBasicWriteRead:
lea (WRAM_Base).l, a0
; Write Test-Values to WRAM:
move.l 0x88BEEF99, (a0)+
move.l 0x11BEEF22, (a0)+
move.l 0x44BEEF55, (a0)
; Read back from WRAM:
clr.l d0
move.l (a0), d0
@_WRAMBasicWriteReadEnd:
rts
Code: Select all
; ******************************************************************
; * [Constants]
; ******************************************************************
WRAM_Base: equ 0x00FF0000 ; Megadrive Work-RAM Range: 0x00FF0000 to 0x00FFFFFF.
Code: Select all
; ... previous Initialisation/etc....
jsr WRAMBasicWriteRead ; ToDo: fails and causes the Machine to stop having written to WRAM!
jsr VRAMBasicWrite
stop #$2700 ; Halt CPU ; [color=red]HITS Here after first write to WRAM.[/color]
Cheers