News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How to adjust specific Memory Hex with game genie code in Super Mario Bros?  (Read 1924 times)

matalog

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Is there a way to change a value at only one address in memory with a game genie code for Super Mario Bros?

Let say I wanted to change address 075f to 07, when I type it into the Game Genie encoder/decoder in Fceux, it tells me to use code YAIEYY, but then when I look at the applied cheats in Fcuex, it says that that game genie code will affect address 875F, and looking at the HEX editor, it does change 875F to 07.  I can edit that cheat via TOOLS - CHEATS, and get it to work that way, but I want to be able to edit the specific memory address from a game genie on a real NES.

Does anyone know how I can change 075F to 07 with a game genie code?

Thanks for any help,

matalog.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6749
  • *sigh* A changed avatar. Big deal.
    • View Profile
Do you mean 075F in RAM, or in the ROM?

075F ROM is (without a header) 875F in CPU address.
Game Genie is a ROM patcher. That is what it was designed for and all it is capable of.

If you want to do a RAM cheat, that is what Pro Action Replay is for. :)
"My watch says 30 chickens" Google, 2018

FAST6191

  • Hero Member
  • *****
  • Posts: 2447
    • View Profile
Some entries in the game genie family have a token RAM edit function, not for the NES though. http://doc.kodewerx.org/hacking_nes.html#gamegenie

If you absolutely must edit the RAM then there are ways.
1) You "hook" the game and replicate the way the action replay works. That being you find the vblank loop (or something like it) and add a series of instructions that edits the RAM. If you are good you can even have a button activator, or replicate an arcade and have a button fill lives/ammo/whatever.
2) You nerf an instruction that edits the RAM in a way you don't want. The classic one here is you are making an infinite lives cheat. You know where the memory location of the lives amount is so you find the thing that subtracts from it and prevent it from subtracting. However in the same thought experiment we usually get people to think of all the ways you die in the game (pits, time, enemies, hazards if they are different and not just sprites like enemies, not on this but poison mushrooms and so forth) and realise that each of those probably has its own subtract routine. You get to edit all of them if you are doing this.

None of those are likely to be easy to pull off if you are just finding your feet with cheat making, though they are nice ways to step your hacking skills and start learning some assembly. So as KingMike said get a PAR or something like it if you can.

matalog

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
I actually have an Everdrive and a Powerpak, and it is 075F of the memory when SMB is loaded, i'm guessing it's the RAM then?

Do the Powerpak or Everdrive N8 allow changes to RAM, with their Cheat capabilities?


dougeff

  • Sr. Member
  • ****
  • Posts: 359
    • View Profile
No.

But,
WorldNumber           = $075f

It looks like you just want a world select game genie code. BTW, SMB has the most Game Genie codes available, for any NES game.

Start On World 2   YSAOPE, YEAOZA, PEAPYA   
Start On World 3   YSAOPE, YEAOZA, ZEAPYA
Start On World 4   YSAOPE, YEAOZA, LEAPYA
Start On World 5   YSAOPE, YEAOZA, GEAPYA
Start On World 6   YSAOPE, YEAOZA, IEAPYA
Start On World 7   YSAOPE, YEAOZA, TEAPYA
Start On World 8   YSAOPE, YEAOZA, YEAPYA



Interesting side note, since the ROM is always located in $8000-$ffff...the Game Genie always sets the upper most bit, and therefore subtracts that from its calculation of the ROM address.

In short, the game genie code for address 075f...becomes 875f. There is no way to affect addresses 0-7fff. It is hard-wired to only affect addresses 8000-ffff.
« Last Edit: April 16, 2017, 02:29:46 pm by dougeff »
nesdoug.com -- blog/tutorial on programming for the NES

matalog

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
That's perfect, I have worked out the logic to decide which world to start in now, with a game genie code.  Thanks for that dougeff.

Is there an equivalent set of game genie codes, to replicate what changing 0760 does upon starting a new game?  It's the Area number.

That is the extent of what I want to achieve.

Thanks for any further help,

Matalog.

dougeff

  • Sr. Member
  • ****
  • Posts: 359
    • View Profile
I don't know. Probably.
nesdoug.com -- blog/tutorial on programming for the NES

matalog

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
Do you mean 075F in RAM, or in the ROM?

075F ROM is (without a header) 875F in CPU address.
Game Genie is a ROM patcher. That is what it was designed for and all it is capable of.

If you want to do a RAM cheat, that is what Pro Action Replay is for. :)


@kingMike  Okay, I got a Pro Action Replay.

How do I poke the value B0 to address 760, for example?


December 08, 2018, 05:47:58 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I got it, the instruction manual doesn't explain it.

The last digits of the slot must be the value you want to poke, and the preceding digits must be the address.  So I had to use 0007 60B0.
« Last Edit: December 08, 2018, 05:47:58 am by matalog »