Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Utility for save state? | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Scribe99
Newcomer
Level: 4

Posts: 2/8
EXP: 257
For next: 22

Since: 06-26-05

Since last post: 100 days
Last activity: 94 days
Posted on 06-26-05 11:43 AM Link | Quote
I'm trying to figure out how to extract stats for a new online Baseball Stars league.

The game uses a sram when you create a season, and so by looking at the save state I can see that there is season information on it. But so far I haven't pinpointed where the season stats are kept.

Would a tracer be the best bet, and do you think I could trace the hex offsets for the stats back to the save state? Any suggestions as far as a good utility to use?

Thanks for any comments.


(edited by Scribe99 on 06-26-05 02:45 AM)
(edited by Scribe99 on 06-26-05 02:46 AM)
tuna
...
Level: 3

Posts: 435/2
EXP: 51
For next: 77

Since: 12-02-04

Since last post: 1 day
Last activity: 1 day
Posted on 06-27-05 07:41 AM Link | Quote
1. Start the season and save. Copy the save somewhere so it's not overwritten.
2. Play a game, change stats, whatever. Save again.
3. Compare the changes between them.
4. Backup the new one, and change some of it.
5. Load the save and see what's changed.
6. Document your findings in a text file.

this can be done with most things (the art of comparisons) but still... it's probably an easy way to find where things are stored in a save file
Heian-794

Red Super Koopa
Level: 44

Posts: 731/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 06-27-05 08:04 AM Link | Quote
Scribe99, you don't have to go to all that trouble!

The format is like this:

AF003D00100003489D0021000A000210

Suppose this is the batting data for two batters.

The first part, AF003D0010000348, represents 0xAF at bats, then extra digits for numbers over 255 (this part is more complicated than it looks; let's not worry about it now), then 0x3D hits, then more extra digits, then 0x10 RBI, 0x00 home runs, and finally a batting average of .348, rounded down and expressed in decimal (03 48; note that if you actually do the math, this guy is hitting .349).

The next 16 digits, 9D0021000A000210, correspond to 0x9D AB, 0x21 H, 0x0A RBI, 0x00 HR, and .210 BA, respectively.

So write down some stats you know for sure -- keep track manually for a few games, letting guys bat 20 times or more to eliminate coincidences -- and then look for the numbers in this format. If your leadoff man is 7 for 21 with 5 RBI and a homer, I'm betting that 1500070005010333 is lurking around in the RAM somewhere.

I made a hack of this game a while back, and while I don't have my Baseball Stars notes here with me now, I can offer you a nifty MS Excel file which will let you copy the raw data right out of the RAM. Unfortunately -- and this is embarrassing -- I can't remember if these hex values apply to the RAM or to a save state; I think it's the former.

If you're willing to wait about two weeks or so, I can post the exact locations here, but if I recall correctly, you can find them at:

Batting 1: 7001-7090 Pitching 1: 7091-70B8
Batting 2: 70B9-7148 Pitching 2: 7149-7170
Batting 3: 7171-7200 Pitching 3: 7201-7228
Batting 4: 7229-72B8 Pitching 4: 72B9-72E0
Batting 5: 72E1-7370 Pitching 5: 7371-7398
Batting 6: 7399-7428 Pitching 6: 7429-7450

The Excel file, and another text file describing the locations of various things in the ROM, are here:

http://www.geocities.com/heiankyo794/hacks.html

Note that you need to have the HEX2DEC and DEC2HEX functions installed in your Excel program!

Is this useful at all?
Scribe99
Newcomer
Level: 4

Posts: 3/8
EXP: 257
For next: 22

Since: 06-26-05

Since last post: 100 days
Last activity: 94 days
Posted on 06-27-05 02:25 PM Link | Quote
Wow, Heian-794...Thank you so much for all that information.

It will take me a little bit to digest everything, but I think I understand the hex format that it is in. I haven't taken a look yet at the excel information you posted but that is the next thing I'm going to look at.

I'll also see if I can track these down by playing a few season games and then looking.

And I'm more than willing to wait a couple weeks for more information.

If you don't mind can I quote you and repost this on the league site for documentation? It is a pretty small league right now, just in the process of starting out. Here's a link to the league forum. If you are interested in playing Baseball Stars I know the commish is looking for more players. http://www.tecmoworld.com/arena/


Thanks again,

Scribe99


(edited by Scribe99 on 06-27-05 05:27 AM)
Heian-794

Red Super Koopa
Level: 44

Posts: 732/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 06-27-05 11:42 PM Link | Quote
Repost anything you like, and feel free to link to my hack page as the 'Alternative' version that I created was quite popular among the Baseball Stars fans at GameFAQs for a while.

Here's an image of the stat-displaying spreadsheet tool; you can see the light blue cells where you paste the RAM data at the bottom:
Image Hosted by ImageShack.us

Another tool I created, which pulls out the raw player abilities and converts them to decmal numbers, is somewhat simpler and looks like this:

Image Hosted by ImageShack.us

I created them for use with FCEUXD -- if you try to copy the hex data from a typical hex editor, spaces and other junk will be inserted, and you don't want that. What you want to paste in there is plain old hex data run together with no spaces or ilne breaks, and FCEUXD does this perfectly.

Just make sure that the hexadecimal-to-decimal functions work in your version of Excel; otherwise you'll get a bunch of '#NAME?' signs.

Try the hack, too! The brighter colors and more-evenly-matched teams (there's a pair of teams at each ability level) will -- if I may toot my own horn for a moment -- make you not want to go back to the original!
Scribe99
Newcomer
Level: 4

Posts: 4/8
EXP: 257
For next: 22

Since: 06-26-05

Since last post: 100 days
Last activity: 94 days
Posted on 06-28-05 01:30 AM Link | Quote
Heian-794,

I was able to figure out the excel spreadsheet last night and got it working with FCEUXD. I also checked our your site and downloaded your ROM...it looks really nice and I'm looking forward to playing that with some friends.

I also posted a link to your hacking page on our league boards so that people can get familiar with the excel spreadsheet.

That thing works great! Much thanks for making it. I was able to extract the bytes from FCEUXD just fine and plop them on the sheet for full stats.

Also, with your help I found the batting and pitching stats on a state save file as well. On a state save they are:

Team 1 Batting is x375C to 37EB (144 bytes)
Team 1 Pitching is x37EC to 3813 (40 bytes)

Team 2 Batting is x3814 to 38A3 (144 bytes)
Team 2 Pitching is x38A4 to 38CB (40 bytes)

..and so on for up to 6 teams in the league

So I will hopefully be able to take the state saves from league games and utilize the spreadsheet you gave me to keep track of stats. The only obstacle is what you already mentioned, that trying to paste the bytes from a hex editor usually ends up with cumbersome spaces. I'm trying to find some hex editor that doesn't add in those spaces...FCEUXD works perfectly though. I wish I could just use that hex editor outside of the emulator.

One question about the player ability sheet...can you change player ratings on the sheet and have it output to a hex string? That would be almost like baseball stars roster editor.

Scribe99


(edited by Scribe99 on 06-27-05 04:30 PM)
(edited by Scribe99 on 06-27-05 04:33 PM)
Heian-794

Red Super Koopa
Level: 44

Posts: 733/896
EXP: 611014
For next: 271

Since: 06-01-04
From: Kyoto, Japan

Since last post: 21 days
Last activity: 10 days
Posted on 06-28-05 02:59 AM Link | Quote
Scribe, I'm glad that the spreadsheet works for you! I didn't make any documentation for it and I know it's a bit complicated.

The data is only converted one way (hex -> decimal), but have a look at the formulae in each cell. These tell you the positions of the data that's being converted, so you can go into the cell with the raw hex strings, and change them there. (A kludge, but it works.) So if you've got MID($A$1, 45, 2) in the cell, you know that the stat you want to edit is at the 45th and 46th bytes of the hex string.

The problem is when numbers go over 256. I left that part out of my explanation before, but if the spreadsheet doesm't make it clear, here's how it works.

There's one byte in there which is split into two hexadecimal digits, allowing some stats to go past 256 and on up to 4095 (0xFFF). These include at bats, hits, and innings.

Here's a typical situation: let's say that a batter is 254 for 255 (the guy's unstoppable). The first three bytes of his batting data are FF 00 FE. Now he gets another hit and is 255 for 256. This is 00 01 FF, with the 1 going in the second byte. How about if he gets another hit? Then they put the 256-hits part as the first digit in the middle byte. So the data is now 01 11 00, or 256 for 257. This splitting of the byte permits batters to come up more than 256 times (necessary) but less than 4096 times (unrealistic).

I suppose a reverse editor which makes use of DEC2HEX to put the number back into hex, then CONCATENATE to put it all into one immense string, could be created. Since we'd only be hacking abilities and not season stats, the split-byte thing would be a problem. I'll have to give this a try; let me know if you think of a way.

If I had any ability at writing programs for Windows, I could put an editor application together based on this data, but unfortunately I'm only good with spreadsheets!
Scribe99
Newcomer
Level: 4

Posts: 8/8
EXP: 257
For next: 22

Since: 06-26-05

Since last post: 100 days
Last activity: 94 days
Posted on 07-25-05 12:50 AM Link | Quote
Well, an update of some stuff I was working on. I made a rom with some friends based of off Star Wars -- with a Light and Dark side. We had a pretty good time playing it. I made a couple new logos and uniform changes as well.

The only hitch in the rom was that when you do a league, if the first 3 slots are occupied by a cpu controlled team the game can't sim it. So I must have missed a pointer somewhere for that. I thought I'd ask here first to see if maybe you already know of this problem Heian-794.

Also, I'm no good with programming either so I don't think I could write a program. When I manually edited the teams it wasn't too bad actually. My next project I want to work on though is to take your excel sheet and make something that will be able to keep a tally running for a season. Like being able to input 1 game to it, and then a week later another game.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - Utility for save state? | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.014 seconds.