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.
; ... 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]
My Writes and Reads to VRAM work correctly and do not incur this Response.
Without the '#', you are moving from an address... the first being odd which immediately throws an odd address error on real hardware... in an emulator, it will probably work, but copy from a non-existent location.
Without the '#', you are moving from an address... the first being odd which immediately throws an odd address error on real hardware... in an emulator, it will probably work, but copy from a non-existent location.
Chilly, I was indeed a naughty Boy for not making that a Literal - Defence can only be "It was late Maam". Many Thanks for correcting me there - you are completely correct and I should have seen that sooner (perhaps not as late at Night).
Sometimes it's the littlest things that get us. I've done similar things in the past... and you're so close to the problem that you can't see it. You read it the way you MEANT to write it instead of how it's actually written. That's why it's good to have someone else take a quick look when you run into a problem.
Chilly Willy wrote:Sometimes it's the littlest things that get us. I've done similar things in the past... and you're so close to the problem that you can't see it. You read it the way you MEANT to write it instead of how it's actually written. That's why it's good to have someone else take a quick look when you run into a problem.
This is why I see Code-Reviews as something useful overall if no a little embarassing
Don't worry about it, anyone who's done assembly programming for the Mega Drive has made that mistake at one point or another. It's actually a variation on that mistake which stopped my MegaLD dumping program from working for 2 months. I didn't identify the problem until I was comparing the machine code output from the assembler with a section of compiled code I was trying to duplicate.