Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: Pornchai on February 11, 2012, 04:23:49 pm

Title: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 04:23:49 pm
Yeah... So... I have a game genie code I want to use for NHL 94.
I'd just edit the hex data, but apparently the hex location is "not within rom range"
I'm assuming that means it can't be edited in a hex editor...
I tried looking for the hex location and it's not there =\
I was told this on another website:
Ah, the SNES uses a weird system of memory "banks" that make addresses strange.

http://en.wikibooks....SNES_memory_map

Unfortunately, the 7E bank is RAM bank, not a ROM bank (those start at 80), so this hack is not applicable to the ROM :(

Sorry, looks like this was a dead-end..

So can I edit the memory banks? Or just have a game genie code constantly on a game?

This will be put on a Game Doctor, so something like "Make it on for your emulator" won't work.
I won't be using an emulator...
Title: Re: Make a game genie code permanent?
Post by: Ryusui on February 11, 2012, 05:26:31 pm
Use a debugging emulator - in this case, Geiger's Snes9x Tracer. Find the memory address that the Game Genie code changes, set a write breakpoint to that address, and then work backwards to find where the value was originally loaded from, or how it was arrived at in the first place. Best-case scenario, it's a hard-coded value loaded from elsewhere in the ROM; worst-case scenario, it's calculated by the code and you'll need to do some hacking in order to make it work.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 06:34:48 pm
What's a set write breakpoint?
Title: Re: Make a game genie code permanent?
Post by: Ryusui on February 11, 2012, 06:42:52 pm
Breakpoints are a debugging function that allow you to halt execution when a condition is met. In this case, you can set a write breakpoint to the address that the Game Genie code changes - this will pause the game when it tries to write to that same address. Then you can trace the code to figure out where the value written to that address came from in the first place. Once you do, you can make the Game Genie code permanent by changing the value that the game itself stores into that memory address.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 06:47:31 pm
Use a debugging emulator - in this case, Geiger's Snes9x Tracer. Find the memory address that the Game Genie code changes, set a write breakpoint to that address, and then work backwards to find where the value was originally loaded from, or how it was arrived at in the first place. Best-case scenario, it's a hard-coded value loaded from elsewhere in the ROM; worst-case scenario, it's calculated by the code and you'll need to do some hacking in order to make it work.
I downloaded Geiger's Snes9x tracer, got the memory address the game genie code changes, set a write breakpoint to that address then it came up with this:
$9F/E42B 99 94 1C    STA $1C94,y[$9F:1C94]   A:0000 X:0000 Y:0000 P:envmxdiZC

Now...What...?
Title: Re: Make a game genie code permanent?
Post by: justin3009 on February 11, 2012, 06:59:44 pm
Go backwards.  The offset is 9FE42B.  Go back maybe 20 bytes so it's 9FE40B and see if there's a hardcoded value like "A9 xx" or something.  If it's like that, change the A9 xx to what the last 2 bytes of the code would be.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 07:10:28 pm
9FE42B as an offset can't be found.
The game was made in '93.
Maybe that has something to do with it? Smaller file?
Title: Re: Make a game genie code permanent?
Post by: FinS on February 11, 2012, 07:11:49 pm
Best thing to do is log the code up to your break point. Get real close to it (within micro seconds) then place a check next to "cpu" under logging. Then run up to the break point and step into it once to be sure to get the last instruction and uncheck cpu to finish the log. If the instruction you are looking for is very far away this is the way to find it.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 07:15:27 pm
The option I want to adjust is in the pause menu.
So the game is paused...
I change from "off" to "on"
Currently the breakpoint is set to write, and it's currently at default on due to the game genie code. (The game loads with default off, completely unedited).
I'm not getting any offsets that can be edited via hex editor, and, while, I'm not the best at this, I have done hex editing, and edited the game a bit, so I'm not completely oblivious.
I'm highlighted over the pause screen option. I click "Log cpu" I click "Step into" I unclick "Log Cpu" I check my logs, nothing is recorded >>!?!?!

$9F/E42B 99 94 1C    STA $1C94,y[$9E:1C94]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/B26F AD BC 07    LDA $07BC  [$7E:07BC]   A:0003 X:FFFF Y:2520 P:envmxdizc
$80/B26F AD BC 07    LDA $07BC  [$7E:07BC]   A:0003 X:FFFF Y:2520 P:envmxdizc
$80/B26F AD BC 07    LDA $07BC  [$7E:07BC]   A:0003 X:FFFF Y:2520 P:envmxdizc
$80/B26F AD BC 07    LDA $07BC  [$7E:07BC]   A:0003 X:FFFF Y:2520 P:envmxdizc
$80/B272 18          CLC                     A:210C X:FFFF Y:2300 P:envmxdizc
$80/B272 18          CLC                     A:210C X:FFFF Y:2300 P:envmxdizc
$80/B272 18          CLC                     A:210C X:FFFF Y:2300 P:envmxdizc
$9F/E42B 99 94 1C    STA $1C94,y[$9E:1C94]   A:0000 X:0000 Y:0000 P:envmxdiZC
Title: Re: Make a game genie code permanent?
Post by: FinS on February 11, 2012, 07:26:38 pm
There is a folder in the debugger folder called "logs". It should be in there.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 07:28:56 pm
yeah it's not in there dude.
Title: Re: Make a game genie code permanent?
Post by: FinS on February 11, 2012, 07:36:38 pm
I think I see what's going on. You may not have understood what I meant when I said run up to the break point, but I mean to get real close to your break point then,

1 check the "cpu" log
2 hit the "Run" button on the debugger
3 hit the "step into" button
4 uncheck the "cpu" logger

This should create a log of everything up to your breakpoint.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 07:47:30 pm
I've followed everything you said step by step, not getting a log.
Should I not have the breakpoint set?

I turned off the cheat... And it got me the logs apparently. +_+

Never mind, it's because I had something in trace from.
Alright, so I have 5 enormous logs.
Now what?
Title: Re: Make a game genie code permanent?
Post by: FinS on February 11, 2012, 07:57:36 pm
The logs are numbered. The last one should contain what you want. The final instruction in the log should be $9F/E42B and you need to follow the value from that instruction backwards to see what needs to be done.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 08:05:19 pm
Hoooo man I'm so confused.
I appreciate the help but I'm lost.
64jrgnhjfnh65yrk yj
Title: Re: Make a game genie code permanent?
Post by: FinS on February 11, 2012, 08:16:21 pm
Ok, you got 5 ginormous logs with numbers on the end like 0001.log, 0002.log, 0003.log. If you logged the cpu up to your breakpoint then the instruction you are looking for should be near the end of the last log. So you could pastebin the final lines, not the whole log of course because that would be too much. Then I could see and maybe have a better idea of what you need to do.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 08:37:41 pm
$9F/BAF8 CA          DEX                     A:0A3D X:0004 Y:0400 P:envmxdizc
$9F/BAF9 CA          DEX                     A:0A3D X:0003 Y:0400 P:envmxdizc
$9F/BAFA 10 F9       BPL $F9    [$BAF5]      A:0A3D X:0002 Y:0400 P:envmxdizc
$9F/BAF5 68          PLA                     A:0A3D X:0002 Y:0400 P:envmxdizc
$9F/BAF6 95 89       STA $89,x  [$00:008B]   A:009F X:0002 Y:0400 P:envmxdizc
$9F/BAF8 CA          DEX                     A:009F X:0002 Y:0400 P:envmxdizc
$9F/BAF9 CA          DEX                     A:009F X:0001 Y:0400 P:envmxdizc
$9F/BAFA 10 F9       BPL $F9    [$BAF5]      A:009F X:0000 Y:0400 P:envmxdiZc
$9F/BAF5 68          PLA                     A:009F X:0000 Y:0400 P:envmxdiZc
$9F/BAF6 95 89       STA $89,x  [$00:0089]   A:EE0F X:0000 Y:0400 P:eNvmxdizc
$9F/BAF8 CA          DEX                     A:EE0F X:0000 Y:0400 P:eNvmxdizc
$9F/BAF9 CA          DEX                     A:EE0F X:FFFF Y:0400 P:eNvmxdizc
$9F/BAFA 10 F9       BPL $F9    [$BAF5]      A:EE0F X:FFFE Y:0400 P:eNvmxdizc
$9F/BAFC A6 87       LDX $87    [$00:0087]   A:EE0F X:FFFE Y:0400 P:eNvmxdizc
$9F/BAFE A6 95       LDX $95    [$00:0095]   A:EE0F X:0258 Y:0400 P:envmxdizc
$9F/BB00 6B          RTL                     A:EE0F X:EC94 Y:0400 P:eNvmxdizc


$9F/E630 22 83 85 80 JSL $808583[$80:8583]   A:EE0F X:EC94 Y:0400 P:eNvmxdizc


$80/8583 48          PHA                     A:EE0F X:EC94 Y:0400 P:eNvmxdizc
$80/8584 AD 64 07    LDA $0764  [$9E:0764]   A:EE0F X:EC94 Y:0400 P:eNvmxdizc
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdizc
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/8587 CD 64 07    CMP $0764  [$9E:0764]   A:1999 X:EC94 Y:0400 P:envmxdiZC
$80/858A F0 FB       BEQ $FB    [$8587]      A:1999 X:EC94 Y:0400 P:envmxdiZC

Any chance you just wanna do it for me ? :D
Title: Re: Make a game genie code permanent?
Post by: Ryusui on February 11, 2012, 08:57:02 pm
Look in the logs for the address you originally broke at - $9F/E42B.
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 09:01:12 pm
Could not find.
Title: Re: Make a game genie code permanent?
Post by: Ryusui on February 11, 2012, 09:05:15 pm
Then search for the memory address (just the last four digits, just to be safe).
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 09:32:00 pm
How long of a project is this for someone who knows what they're doing?
Title: Re: Make a game genie code permanent?
Post by: Ryusui on February 11, 2012, 09:40:55 pm
Not long at all, really. Assuming the value is, in fact, right there.

What exactly does this code do?
Title: Re: Make a game genie code permanent?
Post by: Pornchai on February 11, 2012, 11:04:59 pm
In NHL 94 there's an option for the snes version in the pause menu to turn "on" defense control, default is off.
Defense control on is the ability to push "L" button to quick switch to left defense and "R" button to quick switch to right defense, off just disables the buttons.
The reason why anyone would want to play with these off is beyond me...
So in pause menu you can turn it on or off...
I want it permanently on.

February 12, 2012, 12:26:02 am - (Auto Merged - Double Posts are not allowed before 7 days.)
And the code makes it default on.
Title: Re: Make a game genie code permanent?
Post by: FinS on February 12, 2012, 07:15:37 am
Here is what your log should look like. I included back to where it used instructions from ram because I thought that was cool.

Code: [Select]
$9F/E269 B7 89       LDA [$89],y[$9F:E531]   A:E418 X:0000 Y:002D P:envmxdizc
$9F/E26B 8D 5B 1D    STA $1D5B  [$9E:1D5B]   A:9FE4 X:0000 Y:002D P:eNvmxdizc
$9F/E26E 5C 59 1D 00 JMP $001D59[$00:1D59]   A:9FE4 X:0000 Y:002D P:eNvmxdizc
$00/1D59 5C 18 E4 9F JMP $9FE418[$9F:E418]   A:9FE4 X:0000 Y:002D P:eNvmxdizc
$9F/E418 A5 A9       LDA $A9    [$00:00A9]   A:9FE4 X:0000 Y:002D P:eNvmxdizc
$9F/E41A 89 80 83    BIT #$8380              A:0100 X:0000 Y:002D P:envmxdizc
$9F/E41D F0 0F       BEQ $0F    [$E42E]      A:0100 X:0000 Y:002D P:envmxdizc
$9F/E41F 22 6C C7 9F JSL $9FC76C[$9F:C76C]   A:0100 X:0000 Y:002D P:envmxdizc


$9F/C76C 64 91       STZ $91    [$00:0091]   A:0100 X:0000 Y:002D P:envmxdizc
$9F/C76E A9 01 00    LDA #$0001              A:0100 X:0000 Y:002D P:envmxdizc
$9F/C771 85 93       STA $93    [$00:0093]   A:0001 X:0000 Y:002D P:envmxdizc
$9F/C773 AE C6 0A    LDX $0AC6  [$9E:0AC6]   A:0001 X:0000 Y:002D P:envmxdizc
$9F/C776 10 1A       BPL $1A    [$C792]      A:0001 X:0000 Y:002D P:envmxdiZc
$9F/C792 BD 84 1C    LDA $1C84,x[$9E:1C84]   A:0001 X:0000 Y:002D P:envmxdiZc
$9F/C795 C9 01 00    CMP #$0001              A:0002 X:0000 Y:002D P:envmxdizc
$9F/C798 F0 04       BEQ $04    [$C79E]      A:0002 X:0000 Y:002D P:envmxdizC
$9F/C79A E6 91       INC $91    [$00:0091]   A:0002 X:0000 Y:002D P:envmxdizC
$9F/C79C E6 91       INC $91    [$00:0091]   A:0002 X:0000 Y:002D P:envmxdizC
$9F/C79E 6B          RTL                     A:0002 X:0000 Y:002D P:envmxdizC


$9F/E423 A4 91       LDY $91    [$00:0091]   A:0002 X:0000 Y:002D P:envmxdizC
$9F/E425 B9 94 1C    LDA $1C94,y[$9E:1C96]   A:0002 X:0000 Y:0002 P:envmxdizC
$9F/E428 49 01 00    EOR #$0001              A:0000 X:0000 Y:0002 P:envmxdiZC
$9F/E42B 99 94 1C    STA $1C94,y[$9E:1C96]   A:0001 X:0000 Y:0002 P:envmxdizC

Storing #01 in $1c96 makes defense control on #00 = off. So a simple hack would be to change the bitwise eor operation to bitwise or which would make it always report a value of 1. The problem with this is that is an indexed instruction so it may change other values too. If that is the case you would need an asm hack to check if the indexing value in y is equal to 2.

February 12, 2012, 07:33:59 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Here is another approach which would perhaps work better. Take a log of the instruction that reads from 7e1c96
Quote
$9F/CD3A B9 94 1C    LDA $1C94,y[$9E:1C96]   A:0010 X:0012 Y:0002 P:envmxdizC

$9F/CD3D D0 01       BNE $01    [$CD40]      A:0001 X:0012 Y:0002 P:envmxdizC
$9F/CD3F 6B          RTL                     A:0000 X:0014 Y:0002 P:envmxdiZC
$9F/CD40 A9 02 00    LDA #$0002              A:0001 X:0012 Y:0002 P:envmxdizC
$9F/CD43 BC C3 14    LDY $14C3,x[$9E:14D5]   A:0002 X:0012 Y:0002 P:envmxdizC
$9F/CD46 D0 21       BNE $21    [$CD69]      A:0002 X:0012 Y:0001 P:envmxdizC
The instruction in red is not normally run when defense control is on. So when it is off the simple thing to do is use the classic nop instruction to ignore it. In other words just change the #6b to #ea which will allow the program to continue as though defense control is on.
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 12, 2012, 08:53:34 am
I'm trying hard to follow this, but it isn't clicking for me, yet.  if you actually traced this yourself, could you try testing your two methods of "fixing" this, please?  or, maybe give us dumb 'Chel hackers the hex addresses and instructions for what they'd be changed to?  we really need an advanced hacker with tracing (and ASM, ideally) skills on our team.  if anybody would be willing to join us in the quest to improve this classic, please do!
Title: Re: Make a game genie code permanent?
Post by: FinS on February 12, 2012, 10:13:39 am
These would be simple to test with cheat codes.

For the first method at $9f/e428 change #49(eor) to #09(ora) which in cheat code format would be 9fe42809. This will only set the defense control on when it is accessed in the menu.

The second method would use the cheat code 9fcd3fea. There is a way to do this which would save 1 cycle but 1 cycle is trivial and it may be more confusing. This cheat will simply bypass the return from subroutine that would normally prevent the program from accessing the defense control code. In other words this will make defense control active no matter what it says in the pause menu.

With either of these cheat codes it may change some other setting but I haven't noticed it yet. It's just strange that it would use a y index if it only ever changes 1 ram offset.
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 12, 2012, 11:30:48 am
still confused by the slash and parenthetical inclusions in the first one, but it seems like that wouldn't be ideal if you are saying it would take scrolling to anyway.  the second method reads as better, but contained no addresses, so I don't know what to try to edit.  thanks for all of your efforts, folks!
Title: Re: Make a game genie code permanent?
Post by: FinS on February 12, 2012, 12:26:05 pm
The number before the slash is the bank number, the 4 digits after the slash are the address within the bank. The cheat codes are in the same format without the slash and followed by the value entered. You can download FuSoYa’s Lunar Address (http://www.romhacking.net/utilities/26/) if you need help converting them.

First code 9fe42809 = $fe428 with a value of #09. Second code 9fcd3fea = $fcd3f with value #ea.


February 12, 2012, 01:10:41 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Here is the optimized code for method 2 which not only ignores the setting in the menu but will change it to defense control on whenever L or R is pressed in game.

At $fcd2f you see the code
Code: [Select]
A0 00 00 E0 0C 00 90 03 A0 02 00 B9 94 1C D0 01, change this to
Code: [Select]
A9 00 00 E0 0C 00 B0 01 6B 1A 8D 96 1C 1A 80 04
If you are interested the asm for this is
Code: [Select]
LDA #$0000
CPX #$000C
BCS $01
RTL
INC
STA 1C96
INC
BRA 04
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 12, 2012, 01:35:57 pm
that worked quite well (Stefan, note that I need to add to the address, making the 'D' an 'F').  thank you!  do you like the game enough to continue helping us?  there is always more to do (see my personal project thread)...

now, what shall I replace the menu text with?
Title: Re: Make a game genie code permanent?
Post by: FinS on February 12, 2012, 01:57:45 pm
I have time consuming projects of my own, including compression bugs and inundated graphics hacks, but if I see something simple I can help with then I will. Where should I look for assistance requests?
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 12, 2012, 02:45:42 pm
here, I guess, or in my project thread.  my thread states that we
Quote
could benefit from a title screen, some logo removals/replacements, expansion team expansion(s), graphical decompression and ASM work, fourth line selection, triggered goal pulls/swaps, among other things
and you can see that thread at:  http://www.romhacking.net/forum/index.php/topic,13878.0.html

the Genesis version has hacks for the player physics, which would be cool to have.  having the fourth (PP1 or PP2) line selectable after pressing [SELECT] during even-strength gameplay would be awesome and seems doable (for a good hacker), to me.  triggering the AI team to swap in their backup netminder after five goals or a four-goal lead would be tough, I figure.  the on-ice logos are compressed somewhere.  the intro screen has a compressed bit of text I can't get rid of (the two trademark notices) and a new title screen would be great.  basically, we have amateurs trying their best and only getting so far.

edit:  this hack doesn't apply to the playoff modes.  could you please repeat the process in that mode and break down the code to replace for that, too?  it should be very similar, but it may even need to be done a third time (I doubt it), for there are two types of playoffs.

and it seems to have killed the lower right defenseman, too, as he can no longer be selected with [R].
Title: Re: Make a game genie code permanent?
Post by: FinS on February 14, 2012, 07:06:07 pm
Try this. It's in the same place.
At $fcd2f
Code: [Select]
A9 01 00 8d 94 1c 8d 96 1c 1a 80 08to replace
Code: [Select]
A0 00 00 E0 0C 00 90 03 A0 02 00 B9
Code: [Select]
LDA #0001
STA 1C94
STA 1C96
INC
BRA 08

$1c94 is team 2's defense control and $1c96 is team 1's, or maybe vice versa sometimes, not really sure. This way removes the check against #0c and just sets both teams' defense control on.
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 14, 2012, 08:06:01 pm
thanks.  I will check this out very soon.  I'm not sure I was was clear -- it was only taking away the bottom right guy, regardless of the team's travel status.  I'm still hoping you will have a chance to repeat this process within the playoffs options....
Title: Re: Make a game genie code permanent?
Post by: FinS on February 14, 2012, 08:42:03 pm
I tested the new one with the playoffs and it worked for me.  I tested L an R with this new one and both defense men were accessible accept the hack only seemed to work with the R button so here is a hack for the L button.

At $fcd58
new code
Code: [Select]
A9 01 00 8D 94 1C 8D 96 1Cchanged from
Code: [Select]
B9 94 1C D0 01 6B A9 01 00
This just stores #01 at $1c94 and $1c96, same as the R button hack does.
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 14, 2012, 09:01:02 pm
the first code did make [L] and [R] for the team at the top of the screen and [L] for the team at the bottom work regardless of the control setting but it didn't work in the playoffs and it made the lower team's [R] never work.

the second code didn't work for the lower [L] but the rest worked.  I didn't try the playoffs, yet, nor have I tried it with the third added.

thanks, again.
Title: Re: Make a game genie code permanent?
Post by: FinS on February 14, 2012, 09:41:08 pm
Quote
does the first part get its ending of "94 1C D0 01" reset, too, or should I leave it at what it was changed to?
It doesn't matter because it will no longer be used. The 80 08 on the end of the new one stands for branch #08 which means the following 8 bytes including "94 1C D0 01" are jumped over.

You can just ignore my proposed hack from reply #27. Sometimes I get in bouts with perfection and in that case I lost. The ones you can use are the R button hack from reply #31 and L button hack from reply #33.

February 14, 2012, 09:51:07 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Quote
does this look right
The code at $fcd58 is different because it does not have "1a 80 08" on the end. You should use original values which are "bc c3 14" rather than "1a 80 08".
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 14, 2012, 09:52:40 pm
(http://img42.imageshack.us/img42/2716/hexpic.png)
I still can't control that lower right dude.  his functionality is gone, no matter the setting.  heading up the ice, it has yet to allow me access to both defenders.
Title: Re: Make a game genie code permanent?
Post by: FinS on February 14, 2012, 10:25:24 pm
You are still using the hack from reply #27 at $fcd2f. It is bad and probably causing your problem.

Replace it with the hack from reply #31.
At $fcd2f new code
Code: [Select]
A9 01 00 8d 94 1c 8d 96 1c 1a 80 08
Title: Re: Make a game genie code permanent?
Post by: smozoma on February 15, 2012, 09:45:46 am
EDIT:  changed addresses to headered ROM addresses.

There is no value in the ROM that forces the defense control to be on.  The game just wipes a bunch of memory to 0000.  So, to turn the defense control on in a clean way before the game starts (so you can turn it off or back on again in the game menu), you can do this:

At ROM address @F857c

old:
Code: [Select]
22 B2 C6 9F
Code: [Select]
JSL 9F:6CB2  # Long Jump to Subroutine
new:
Code: [Select]
20 30 FB EA
Code: [Select]
JSR :FB30  # Jump to SubRoutine of our custome code
NOP        # No OPeration (space filler operation)

@FFD30

old:
Code: [Select]
FF FF FF ..
Code: [Select]
(unused section)
new:
Code: [Select]
22 B2 C6 9F A9 01 00 8D 94 1C 8D 96 1C 60
Code: [Select]
JSL 9F:6CB2 # do the code we cut out
LDA #0001   # LoaD A=0001
STA 1C94    # STore A (0001) into :1C94
STA 1C96    # STore A (0001) into :1C96
RTS         # ReTurn from this Subroutine
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 15, 2012, 07:13:04 pm
FinS, I am confused by the addresses (adding 2-- and searching) and the changes already made (now I don't know what I'm looking for).  could you tell me what I have, too, so I know what/where to replace?  I know that the easy answer is to start with an older save, but it would mean lots of roster work from recent changes.  how about "the line in the picture at 0FCF18 should read XX XX XX.... instead of 10 05 B9...."  I hereby apologize for my stupidity.
Title: Re: Make a game genie code permanent?
Post by: FinS on February 15, 2012, 07:54:44 pm
You would add #200 to the addresses if your rom has a header which is a fairly useless chunk of data at the beginning of the rom. If your rom does have a header you can simply bring it up in a hex editor and delete those #200 bytes and it will not make any difference with how the game runs.

In your picture of your data, where it says
Code: [Select]
0FCF30 00 00 e0 0c 00 b0 01 6b 1a 8d 96 1c 1a 80 04the orignal values should read
Code: [Select]
0FCF30 00 00 e0 0c 00 90 03 a0 02 00 b9 94 1c d0 01Changing these back should fix your errors.

Your rom will only be affected then by the L button hack (http://www.romhacking.net/forum/index.php/topic,13967.msg203311.html#msg203311) at non headered rom address $fcd58 or $fcf58 for a headered rom.

Title: Re: Make a game genie code permanent?
Post by: smozoma on February 15, 2012, 08:17:42 pm
There are a number of hacks you might have applied that will need reverting...

For your ROM (which has a header):

To revert all/any of Posts #23, #27, and #31:
At address $fcf2f
reset code to: "A0 00 00 E0 0C 00 90 03 A0 02 00 B9 94 1C D0 01 "

To revert Post #33
At address $fcf58
reset code to: "B9 94 1C D0 01 6B A9 01 00"


Then try out my hack :)
(I changed the addresses in my previous post to be for a headered ROM)
Title: Re: Make a game genie code permanent?
Post by: trudatman on February 17, 2012, 05:47:22 pm
thanks, folks.  good to see you over here, too, Smoz!  join us on the SNES side and keep putting your thoughts and efforts toward the flow.

edit:  as much as I would have preferred the forced-on hack if it worked for all four defenders, Smoz's hack is quite functional.  many thanks, y'all!  keep these NHL '94 (SNES) hacks coming, please!