It's one of those things that I didn't even know about until Viper pointed out that code some years back. And the only references I can find through Google all come EnHacklopedia (which I wrote myself, so that's no help ...) I need to better document my sources. By that, I mean the disassembly/reverse engineering that I did on the code type stuff. If I had those pieces of information on EnHacklopedia, it would be even easier to re-research.
Anyway, this is extremely easy to use. But there's a catch (of course!) I believe that only one DEADC0DE can be used at a time. So if you have several large ranges of data to write, you should only convert the largest one. There are other limitations as well, but I can't remember all of the details (more reasoning for documenting sources...)
Taking your example code, here it in converted to a shorter format which should work great:
81A94FA9 < -- start move set code
7E2EF810 < -- player 1 modifier
84981A00 < -- end move set code
85C463EA < -- start of making room for my jsr (guess I could have used a branch to my jsr here to save using 1 additional code)
85C46622 < -- start of jump to below routine
C91000D0 < -- my routine for fixing fan lift/air fan throw.
E2C4856B < -- rts
This *should* be correct.
I seem to remember this code type doing something strange when the address is in ROM (like the Starfox code). I believe in that case, it would issue a ROM patch at that address which inserts a JMP long
instruction (4 bytes). The actual data sits in external (GameGenie-onboard) memory, and requires a JMP long
at the end to go back to the original location + 4. But this is all coming from memory, and I could be wrong...