News:

RIP GoReds

Main Menu

Ever wondered how well your pitchers bat?

Started by nightwulf, 12/16/02, 07:42:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nightwulf

Wa ha! Finally found the "batter data" for pitchers. It's the same for every pitcher in the game ...

Contact = 64 (40 hex)
Power = 640 (0280 hex)
 -or using the groundball attribute theory, 128 with GB attribute
Speed = 120 (78 hex)

I found these by watching NES RAM while the ROM was executing. The above numbers are loaded at the same location actual batter data (taken from the ROM) is loaded, and they seem to make sense.

Unfortunately, I haven't found where this information is stored in the game ROM. Grr ... I wanna hit homers with John Tudor. ;D

Nightwulf

sucka free

Nightwolf, you are an animal, a mad scientist, a soon too be forum legend

Gantry

I have been trying to find out the magical data for the pitcher since this post and am coming up empty.  Searching for his power numbers "80 02" in the ROM yields only two addresses - 3b87f & 3c6be.  Tried altering the data in those numbers and it didn't change the stats.  Also searched and changed a bunch of combos based on the other stats and still nothing.  One thing for sure, the pitcher hitting data isn't all stored in one place.  And if it is, they used a different format...

Gantry

Update:

Still no luck, I went about changing a whole bunch of possible bytes.  I changed virtually every instance of 78 (The pitcher speed) to FF in the adress range 10000-1FFFF.   No luck...


Gantry

#4
I got something!!!

The first byte of a players data determines whether or not they get the pitcher stats .  If they have 0C-0F, they will get the .150 with 0 homers and forego all their hitting abilities....

Likewise - if you give a pitcher a first byte in the range of 00-0E,  their pitching stats become their hitting stats.   For Witt, it was .334 with 44 homers and some serious carry.  Clemens was .298 with 66 dingers.  His fly ball never came down and it took a good 15 seconds for it to become a homer...

Still haven't found out where to change the token pitcher stats, but a neat trick nonetheless...

Edit - Looks like any number over 0B will give you pitcher stats.  So 0C-FF

nightwulf

I haven't had any further luck either. My best guess is that the numbers are packed in a different fashion. Without having any idea how they're packed, there's no good way to find 'em that I know of. Other than playing "guess-and-check" with every byte in the ROM, and that'd take a year lol.

The first byte for any player does define "what" they are. Values 00-07 are starting non-pitchers, 08-0B are pinch hitters, 0C-0D are starting pitchers, and 0E-0F are relief pitchers. Strange tho that pitchers inherit their pitching data as hitting data when this number is changed tho. So, somewhere in the code, it loads batter data unless the byte is greater than 0B, in which case it loads default data. That could be a clue in finding where in the ROM the pitcher batter data is stored,

Another clue is that the batter data is loaded into RAM at offset 0x0627. I'll try putzing around with a hex editor a bit more ...

Nightwulf

Gantry

Way too much guess and check on my part as well.  Edited a bunch of hex combos to no avail.  "78" "80 02" even "00 00 40 80" and the like.  Probably changed 100 bytes  or more and nothing.  It has to be stored in a different format, like you said...

Is there any emulator that does some sort of tracing, to let us know where in the ROM the data is pulled from?  Nesticle seems like the best debug editor (which is sad considering it's 4 years old), but couldn't find anything of the sort there...

Any good writeup on the NES ROM architecture?  Is the .nes file a combo of different actual chips on the NES cart itself?   Like standard ROM & CHR ROM?  My NES background is a little weak, but I'd like to know what area in the NES ROM are strictly for graphics and the like, to narrow down the search....

nightwulf

#7
There really isn't any way for an emulator to "trace" offsets from ROM. About the closest you could get to that is to disassemble the ROM and try following the code. The processor in the NES is almost the exact same processor used in the old Apple // computers (before the GS). I actually learned a bit of 6502 assembler (on my //c, hehe) when I was 16 or so, and it haunts me to this day. Machine-level coding is a scary, scary thing.

As for using an emulator for these purposes, you might try Nester. It has tons of features for viewing, searching, and modifying RAM. The problem is, the program appears to be written by a Japanese programmer who isn't good with English, and didn't bother making the program very English-friendly. Really I can't blame him; not like I worry about making anything I write Japanese-friendly. Of all the features the emulator has, I've been able to fully understand and use 2 or 3 of them. Prolly just need to spend more time "playing" with the program.

There's TONS of information on anything NES-related. Check Zophar's Domain (in the "Docs" section), or NesDev. NES ROMs do, at the assembler level anyway, consist of "PRG" and "CHR" portions, but I'm not sure off the top of my head where they exist specifically in the iNES ROM format. I need to do some reading from those sites as well ...

Nightwulf

Gantry

Quotehe processor in the NES is almost the exact same processor used in the old Apple // computers

I did not know that...  I read the processor for the NES was made by Ricoh, probably just a slightly altered version of the one used one the Mac.  I assume the Mac used Motorola?

Quoteactually learned a bit of 6502 assembler (on my //c, hehe) when I was 16 or so, and it haunts me to this day. Machine-level coding is a scary, scary thing.

I had a couple years of IBM System 370 (Mainframe) assembly training at NIU.  Haven't used one ounce since graduating, and the only thing I retained were a few op-codes.  Then again, dealing with Hex and editing data sets on the NES were probably greatly assisted by my background.  First thing I've done anythign CS related since graduated, kinda fun...

I didn't know .nes was the ines format.  Checked nesdev a bit yesterday, but now that I know that it's ines, I'll probably find more info.  Thanks!

nightwulf

I have no idea which company made the processor, but I do know it's a modified 6502. The Apple //, //+, and //e all used the standard 6502. The //e enhanced and the //c used the 65C02, and the //gs used the 65816. Incidentally, the Super NES used the 65C816, which uses a similar instruction set as the //gs processor.

The original Macs did use Motorola 68K processors I believe. Later came the "PowerMacs" which used the RISC chip. This processor was co-developed by three companies ... IBM, Apple, and I think Motorola. Definitely could be wrong on that.

I'm really hoping someone's developing a "worthless knowledge" TV game show so I can put some of this to use lol.

The .NES ROMS are the iNES format. There were several others, including .FAM, and ... ... hell I don't remember. No one uses them anymore; everything is .NES these days. There's actually a movement in the emulation circles to create a new format which would eliminate the mess of different memory "mappers" for different ROMs, but I doubt it'll get too much attention.

Nightwulf

Gantry

Looks like MOS Technologies first developed the 6502 that Apple Used.  In fact they created the 6502 and probably licensed out to a slew of comanies later on (like Ricoh who made the NES 6502).  Think the z80 did something similar IIRC...

QuoteIBM, Apple, and I think Motorola.

That is right...  I think IBM pretty much does all the tech work on the PowerPC now...