About patching ROM

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

About patching ROM

Post by kuja killer »

I'm going to have a real hard time trying to explain this, bear with me. :( Dont know if this would of been better suited on "nes emdev" forum either. Does anything exist in romhacking or emulation about patching a ROM file directly ? I dont mean IPS patches exactly. I'll try to explain.

I've had thoughts in my mind recently about "what if i had a randomizer for my game someday in distant future" similiar to all those programs that exist for zelda 1, megaman 2, SNES zelda link to a past, final fantasy(s), etc etc.
Problem is, i dont know a thing whatsoever about C++, java, and all those other programming languages people use for making those randomizer programs. All i know is NES 6502 ASM, and a little bit of visual basic 6 - but that's it. I obviously know how to do NES's asm and so on.

So i wondered, is it possible do make a randomizer solely out of NES asm only ? Instead of those normal programming languages ? Well...i cant do this "in-game" because you cant just "write" to normal ROM addresses. an "STA $9480 at rom address $39490" doesn't do anything at all for example

But like --- [something] that lets you say: load this value from 38500 hex in the ROM file ..use NES asm opcodes to randomize that value, and then store it back at 38500 ?? i hope this makes sense. Again, I dont know how to say it better really. I could defintely do that super easily for anything like stage and enemy colors and all that...rather than go through the trouble of needing some program made in C++ only or whatever. :(

Im just curious if this sort of stuff exists. I have no clue.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: About patching ROM

Post by calima »

You want to write a 6502 program that runs on a modern computer, accessing files. As it happens you can.

The sim65 target of cc65 allows you to do so. C-side you should have normal stdin, stdout and FILEs (I've only used stdin and stdout). You can access those via asm as well, though you'd need to look all that stuff up.

All this is naturally way out of left field and unexpected, but may be faster for you than to learn a modern computer setup.
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: About patching ROM

Post by kuja killer »

hmm i see. i've heard alot about this cc65 assembler before, but i've never once looked at it before. I'll try to remember that in the future though.
The only one i've ever used before, and use currently for my game is "nes asm 3"
Post Reply