You asked for it....
Point to Note, If you find RAM locations using the HazeMD cheat engine that you want to convert to ROM cheats they will be in the format E0XXXX to use them in the HazeMD debugger you will need to change them into FFXXXX.
I'm assuming that you've got HazeMD and have set it up - ie you've rebuilt the ROMs using clrmame to use the correct mame format names (I'm not going to hold your hand with that)
Here's a worked example for infinite lives for the game "Chuck Rock (U) [c][!]" , I personally always use the commandline to run HAZEMD - but you can use a fronted like emuloader with it. I'm not sure if hazemd32 has a debug build (hazemd comes with the non-debug hazemd.exe & and the debug hazemdd.exe)
From the cheat.dat for hazemd we have these RAM cheats:-
Code:
; [ Chuck Rock (U) [c][!] ]
:g_chuk:00000000:E006D1:00000009:FFFFFFFF:Infinite Lives
:g_chuk:00000000:E006D5:00000007:FFFFFFFF:Infinite Energy
:g_chuk:00000000:E00657:00000003:FFFFFFFF:Invincibility
On the commandline type
Code:
hazemdd -debug -joy g_chuk
The game info will then display just press the space key
You will then be dumped into the debugger,
Now in the debugger type
{this will make the debugger ignore the Z80 cpu on the genesis - all cheats use the 68000 which is CPU 0}
Now hit F12 to exit the debugger and start the ROM
Now start playing the game so you are ready to lose a life
Press the tilde or the ~ key (the key that is normally next to the escape key) to enter the debugger
From the cheat file you will see that infinite lives uses location E006D1, which you will need to replace the E0 with FF for the debugger watchpoint to catch it so, in the debugger type
{type HELP WPSET if you want an explanation of what that does in the debugger - or just HELP for other instructions/functions}
Now press F12 and lose the rest of the energy...and then you will be dumped back into the debugger at 2056A and this will be displayed in the debugger
Code:
02055E: 6692 bne $204f2
020560: 6100 DB5C bsr $1e0be
020564: 5379 FFFF 06D0 subq.w #1, $ffff06d0.l
02056A: 6A06 bpl $20572
02056C: 4EF9 0002 0588 jmp $20588.l
So you can see that the previous instruction before 2056A is a sub at 020564 which is the lives decrement, the thing you've got to remember is that if you are going to change an instruction that's just before a branch is if you just NOP it you may well find that the branch is not handled correctly so it is better to try and change the decrement in a way which allows the branch still to be tested so a compare is better (you need a good understanding of 68000 instructions). There are many ways of skinning a cat, so you can play around with a way of changing it so that you'd only need to change one instruction - here's a cool way that will make life easier
change
Code:
020564: 5379 FFFF 06D0 subq.w #1, $ffff06d0.l
to
Code:
020564: 5379 0001 06D0 subq.w #1, $106d0.l
This method is quite good as 106D0 is a rom address and so the subq won't have any effect and the branch will always be taken and it will only need a single GG code (just remember to check the value in the location isn't going to cause a problem in this case it won't).
So in hazemdd format we'd have this:-
Code:
:g_chuk:20900000:020566:00000001:FFFFFFFF:Infinite Lives:ROM Cheat
Plug 020566:0001 into the GG Code Creator
and you will get
Code:
AECT-EADG which is the Game Genie code for Infinite Lives
Just follow this method and GG codes from existing RAM cheats is frankly just a tedious exercise (and rather pointless unless you have an actual Genesis and GG with that game)
The debugger has a lot more features like DASM and TRACE that makes making cheats a lot easier - you will just have to play.