News:

RIP GoReds

Main Menu

RBI Baseball Secret Revised

Started by gamme, 02/08/06, 11:17:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gerlost

1) Start Donnie Moore
2) Sub him out for any other pitcher
3) Pinch hit for the new pitcher
4) Next inning, that pitcher is still on the mound

fknmclane

Quote from: BDawk on 08/29/12, 07:52:41 AM
I just wiped my ass then smelled the toilet paper.  What's wrong with me? 

Quote from: Kane on 08/22/16, 11:56:48 AM
the dude either has some high float or a mess between the cheeks.

nightwulf

Ok, the problem is that you have to sub the (fourth) pitcher out while on the mound, not pinch hit for him.

This is tricky. There's a counter variable which runs from 0x00-0x0F (player 1) or from 0x10-0x1F (player 2) that looks for the current pitcher to replace. The problem is a duplicate use of 0x0F (which is where the status of the 4th pitcher of player 1 is stored). 0x0F represents both that pitcher's status and the duration of the loop (0x00-0x0F), and a logic error occurs. This only occurs with player 1 because there's no similar conflict with player 2 (0x0F loop duration, 0x10-0x1F memory offsets).

So I don't have a solution yet ...

nightwulf

You know what? The entire loop is bullshit. There's really no need to use a loop counter, 'cause when p2 is not at bat, it never hits anyway. The loop would continue indefinitely if p2 had no active pitcher.

Fantastic coders at Namco in the mid-80's.

nightwulf

#44
Yeah, that entire block of code is complete nonsense. Here's the fix to remove the glitch:

- Open the ROM in a hex editor.
- Change the byte at offset 0xAEF5 from 0x0F to 0x10.
- (make that 0x1AEF5 if using an "overstuffed" ROM)

or

- Use Game Genie code: AOVZSVYA

It's still complete bullshit code that makes zero sense, but this will at least work correctly.

gamme

Where exactly in the hex editor is the status for the 4th pitcher of player 2 stored?
Joe's brother

gamme

Nightwulf, you're absolutely right.  I tried it subbing the 4th pitcher by pinch hitting and   the glitch won't work after that.  He has to be subbed from the mound.

I have a idea about how to get this for player two (I'm no programmer though).

Bascially, if we can change the duration of the 2nd player counter loop so that the loop duration is the same as the value where the fourth pitcher of player two is stored, then we can have a similar glitch going for player two.

The other idea is to store the fourth pitcher of player two in the spot 0x0F.

This might cause other problems or be impossible to do (I am guessing different pitchers have to be stored in different unique values).

I am guessing since you said the loops are shit, just make a loop for player two that has duration equal to the value where the fourth pitcher of player two is stored.

Let me know if this can be done.


Joe's brother

Gantry

Quote from: nightwulf on 02/11/06, 04:54:08 AM
Yeah, that entire block of code is complete nonsense. Here's the fix to remove the glitch:

- Open the ROM in a hex editor.
- Change the byte at offset 0xAEF5 from 0x0F to 0x10.
- (make that 0x1AEF5 if using an "overstuffed" ROM)

or

- Use Game Genie code: AOVZSVYA

It's still complete bullshit code that makes zero sense, but this will at least work correctly.

Nice work...  Any chance we can make this a checkbox on the editor, "remove pitcher substition glitch" or something similar? 

nightwulf

#48
Quote from: gamme on 02/11/06, 10:50:21 AM
Bascially, if we can change the duration of the 2nd player counter loop so that the loop duration is the same as the value where the fourth pitcher of player two is stored, then we can have a similar glitch going for player two.

No, because the same block of code is used for either player.

Quote from: gamme on 02/11/06, 10:50:21 AM
The other idea is to store the fourth pitcher of player two in the spot 0x0F.

No, because this is where p1's pitcher 4 status is located ...

Quote from: gamme on 02/11/06, 10:50:21 AM
I am guessing since you said the loops are shit, just make a loop for player two that has duration equal to the value where the fourth pitcher of player two is stored.

It's a gross waste of space really. I'd have to jump out of original code somewhere into a player check, back to original code if p1, or remain in a block of duplicated bullshit code. Why duplicate the glitch?

Quote from: Gantry on 02/11/06, 03:57:35 PM
Nice work...  Any chance we can make this a checkbox on the editor, "remove pitcher substition glitch" or something similar? 
Yeah, but would anyone use it?

Gantry

I think folks would like to remove the unfair advantage it gives player one when making ROMs, but then again I think most folks would abuse this...

gamme

Why duplicate the glitch?

Because if player one knows about how to work with the glitch then player two should be able to do the same.

Fixing the glitch is just as good, but duplicating for player two would be interesting since people could play as if it was a DH option. 

Even cooler still would be to make an entirely new hack that has a non-glitched up DH option included (don't ask me how that would be done).  I'm sure it isn't an easy task.

Joe's brother

Attezz

I was so confused about this, but OctoFranco used it last night to perfection. Awesome glitch.

I'm an idiot, but let me ask a few questions anyhow.

1) Does the PH in the 9 hole get the 64 point bonus on any at bat following his first? (i.e. Stinky Sully his second time around in the 9 hole, would he get the PH bonus?)

2) Could this work for player 2 if you had a 2 player pause thing going on?

Gantry

Without the hard facts, the odds are highly likely that the answer to both is no.

nightwulf

Quote from: Attezz on 02/11/06, 05:24:19 PM
1) Does the PH in the 9 hole get the 64 point bonus on any at bat following his first? (i.e. Stinky Sully his second time around in the 9 hole, would he get the PH bonus?)

No. Batter data is stored in the ROM. When a batter "steps up," information is copied from the ROM to a certain area of RAM for easier access. Once a new batter (of the same team) steps up, the information from the ROM for that batter overwrites whatever was there before.

So, in a PH situation, the new batter's data is loaded from the ROM, copied to RAM, and the PH bonus is applied as a part of the PH process. The next time that batter comes up, information is again loaded from ROM, but the PH process doesn't run this time, so no bonus is added.

Quote from: Attezz on 02/11/06, 05:24:19 PM
2) Could this work for player 2 if you had a 2 player pause thing going on?

No. The 2-player pause hack simply changes code from "call time if 1p start is pressed" to "call time if 1p or 2p start is pressed." Subsequent code used in time (PH, new pitcher) is unchanged.

nightwulf

Quote from: gamme on 02/11/06, 10:09:31 AM
Where exactly in the hex editor is the status for the 4th pitcher of player 2 stored?

Sorry, I was out of caffeine earlier, so this reply had to wait.

If you're running in an emulator which supports a real-time hex editor, check out 0x0640-0x065F. Pitcher status for p1 is stored in 0x064C-0x064F (for pitchers 1-4, respectively), and pitcher status for p2 is located at 0x065C-0x065F. Three values are possible in each of those locations:

0x00 - This pitcher is currently unused but available.
0x09 - This pitcher is the current pitcher.
0xFF - This pitcher has been taken out of the game, and is no longer available.

If you watch this while subbing out the 4th pitcher for p1 (while he's on the mound), you'll see that the 0x09 at 0x064F is not changed to 0xFF to indicate that the pitcher has been used. Here's why that's important ...

Between (half) innings, the game looks at those locations (0x064C-0x064F for p1). If it finds 0x09 in any of those spaces, the game knows that there is a current pitcher, and the new (half of the) inning starts. Because of the glitch, 0x09 is left sitting at 0x064F instead of being changed to 0xFF. The code "sees" the 0x09, so therefore there must be a current pitcher, and the game doesn't prompt you to select a new one.

This is also why you must switch out the pitcher while on the mound, and not just pinch hit for him. The code that changes pitcher status after bringing in a PH in the 9th spot works fine. The errant code runs when a pitcher is subbed off of the mound.

So that's the glitch in a nutshell. 0x064F is not properly updated to 0xFF to indicate that the 4th pitcher has been removed from the game. Before p1 comes up to bat again, the game looks at those locations and finds 0x09 at 0x064F, and is therefore satisfied that there is indeed a current pitcher on the mound. Gameplay continues with the currently-loaded pitcher, and the ID of the batter in the 9 spot is left unchanged from the PH who was brought in.

gamme

Thanks, nightwulf, I will continue studying this.

2 more quick questions:

1) What is an emulator that has real time hex code going?

2) What exactly does the fix at 0xAEF5 do in terms of how the code of the game is flowing?
Joe's brother

nightwulf

Quote from: gamme on 02/11/06, 06:22:06 PM
1) What is an emulator that has real time hex code going?

Well, a lot of them do these days. Here's the three I use that come to mind:

- FCEUXD SP
This is the emulator I use pretty much full time now. Included is a 6502 debugger, name table viewer, and other features which make it a must-have for NES development.

- FCEU
No longer in development, but still a good emulator. The debugging and development tools aren't anywhere near FCEUXD SP's level, but if all you're looking for is real-time RAM viewing, it's available by clicking "Memory ..." from the debugger window.

- NNNesterJ
Another emulator that I used to use frequently, but it's been surpassed by FCEUXD SP in about every way.

Quote from: gamme on 02/11/06, 06:22:06 PM
2) What exactly does the fix at 0xAEF5 do in terms of how the code of the game is flowing?

It changes the (useless) loop counter from 0x00-0x0F (0-16) to 0x00-0x10 (0-17). Absolute nonsense from a logic point-of-view, but it stops the "mark the pitcher you're swapping out as used/inactive" loop from exiting early.