NES trainers

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
Dedok179
Posts: 5
Joined: Tue Jun 01, 2021 4:15 pm
Location: Tula,RU

NES trainers

Post by Dedok179 »

Hello everyone. Recently I had an idea to make a trainer for this platform that is embedded in the game. I have some experience creating trainers for PS1 and PS2 consoles, but this does not negate the fact that I do not know the basic principles and code for creating trainers for NES. I searched internet for even partial examples, but I couldn't find anything other than some examples for SNES.
Any information or examples on this issue? Thank you if anyone responds and can help.

Some works:
PS1
PS2
User avatar
Dwedit
Posts: 4922
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Re: NES trainers

Post by Dwedit »

It's just like any other NES rom hacking.
Find some empty space in the ROM, write your code, and find some existing code to modify to call or jump to your new code.
The debugger feature of emulators can help here.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: NES trainers

Post by Oziphantom »

look up Action Replay/Code Shark codes, that will give you the addresses that hold things you want to train. Then use a write break point to find the code that does it. You will want to play the game and try and do everything so you can get CDL (code data log) this will help you find areas of the ROM that are unused, but also a quick hunt might do. And you will also need to find a free memory location to hold your trainer enable status, the NES only has 2K of RAM so your probably going to have to get lucky, or modify the header to add more RAM for you to use. Investigating the stack are is probably your best bet though.
Dedok179
Posts: 5
Joined: Tue Jun 01, 2021 4:15 pm
Location: Tula,RU

Re: NES trainers

Post by Dedok179 »

Oziphantom wrote: Wed Jun 02, 2021 10:37 am look up Action Replay/Code Shark codes, that will give you the addresses that hold things you want to train. Then use a write break point to find the code that does it. You will want to play the game and try and do everything so you can get CDL (code data log) this will help you find areas of the ROM that are unused, but also a quick hunt might do. And you will also need to find a free memory location to hold your trainer enable status, the NES only has 2K of RAM so your probably going to have to get lucky, or modify the header to add more RAM for you to use. Investigating the stack are is probably your best bet though.
The bottom line is that I know theory of how this should probably be done on NES, but without a basic example or demonstration, it's a little difficult (that's why I am here). It would be interesting to use GS codes as well as on PS2.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: NES trainers

Post by Oziphantom »

Do you know how to program 6502?
Dedok179
Posts: 5
Joined: Tue Jun 01, 2021 4:15 pm
Location: Tula,RU

Re: NES trainers

Post by Dedok179 »

Oziphantom wrote: Wed Jun 02, 2021 11:06 pm Do you know how to program 6502?
Worked with 65816 for a while (I used wla-65816). So I think I can learn.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: NES trainers

Post by Oziphantom »

Seems there are some examples here https://github.com/patois/NESTrainers
Dedok179
Posts: 5
Joined: Tue Jun 01, 2021 4:15 pm
Location: Tula,RU

Re: NES trainers

Post by Dedok179 »

Oziphantom wrote: Thu Jun 03, 2021 7:32 am Seems there are some examples here https://github.com/patois/NESTrainers
Thank you. I think this will be enough for me to start making my first trainer for NES. Can I apply a similar method for SNES? Just wondering.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: NES trainers

Post by Oziphantom »

yes, the SNES and NES are basically identical in this way. Only the SNES is a lot easier to find free memory on as it has a lot more resources.
Dedok179
Posts: 5
Joined: Tue Jun 01, 2021 4:15 pm
Location: Tula,RU

Re: NES trainers

Post by Dedok179 »

Oziphantom wrote: Thu Jun 03, 2021 8:55 am yes, the SNES and NES are basically identical in this way. Only the SNES is a lot easier to find free memory on as it has a lot more resources.
Thanks again :beer:
Post Reply