Jump to content

VirtuaNes FULL SaveState Stat Extraction


anthony

Recommended Posts

I couldn't tell if this was discovered before, but I was able to figure out how to fully extract season stats from a save state file created with VirtuaNES! I don't think VirtuaNES is the most popular emulator out there, but it was the easiest one to dissect the save states. 

 

Here's what I found, and I created a very rudimentary spreadsheet to help extract all the stats (I'm not a programmer, I did my best. By all means, somebody take the info and do a better job than me!)

 

The way they store this info is convoluted as hell, so hopefully it's understandable. I included example bytes in my descriptions below.

 

A few concepts:

They often split up a two-digit byte into two different values, so that the left digit has one 0-F value for say TDs, and the right digit has a 0-F value for Attempts. So as I try to describe below, I call the left digit (x) and the right digit (y).

 

Starting at x11C2 (Buffalo)

Quarterbacks (9 bytes)

Examples:

x011C2 - 99 6E 84 24 6C 00 00 58 00 (QB1: 110/153, 2924 yds, 33TD, 9 INT, 0 Rush)
x011CB - 00 00 00 00 00 00 00 00 00 (QB2: 0) 
 

Byte1: Pass Attempts (0-255) | Example: 99  = 153 Pass Attempts

Byte2: Pass Completions (0-255) | Example: 6E = 110 Pass Completions

Byte3: Pass TD (x) & Pass Attempts/TD (y) | Example: 84 = 32 Pass TD, 0 Pass Att. and 1 TD Pass

  • (x) = TD * 4
  • (y) = Pass Attempts (0, 256, 512, or 768) & TD Passes (0,1,2,3)
  • --- 0/4/8/C: 0 Att & 0/1/2/3 TD
  • --- 1/5/9/D: 256 Att & 0/1/2/3 TD
  • --- 2/6/A/E: 512 Att & 0/1/2/3 TD
  • --- 3/7/B/F: 768 Att & 0/1/2/3 TD

Byte4: Int (x) & Pass Completions/INT (y) | Example: 24 = 8 Int, 0 Pass Comp. and 1 Int

  • (x) = INT * 4
  • (y) = Pass Completions (0, 256, 512, 768) & Int (0,1,2,3)
  • --- 0/4/8/C: 0 Comp & 0/1/2/3 TD
  • --- 1/5/9/D: 256 Comp & 0/1/2/3 TD
  • --- 2/6/A/E: 512 Comp & 0/1/2/3 TD
  • --- 3/7/B/F: 768 Comp & 0/1/2/3 TD

Byte5: Pass Yards (0-255) | Example: 6C = 108 Pass Yards

Byte6: QB Rush Att (0-255) | Example: 00 = 0 Rush Att 

Byte7: QB Rush Yds (0-255) | Example: 00 = 0 Rush Yds 

Byte8: Pass Yds (x) & Rush yds (y) | Example: 58 = 2,560 Pass Yds, 256 Pass Yards, 0 Rush Yards

 

  • (x) = Pass Yds * 512
  • (y) = Rush Yards & Pass Yards
  • --- 0-7: Rush Yards * 256 & 0 Pass Yards
  • --- 8: 0 Rush Yards & 256 Pass Yards
  • --- 9-F: Rush Yards * 256 & 256 Pass Yards

Byte9: Rush TD | Example: 00 = 0 Rush TD

  • (x) = Rush TD * 4
  • (y) = Rush TD Remainder
  • --- 0-3: 0 Rush TD
  • --- 4-7: 1 Rush TD
  • --- 8-B: 2 Rush TD
  • --- C-F: 3 Rush TD

 

Offense (12 bytes)

Examples:

x011D4 - 18 9F 1C 00 00 00 02 00 02 A1 66 59 (RB1 Stats: 161 Rush, 1638 Yds, 22 TD / 24 Rec, 671 Yds, 7 TD)
x011E0 - 07 C9 08 00 00 00 01 00 00 3A BF 24 (RB2 Stats: 58 Rush, 447 Yds, 9 TD / 7 Rec, 201 Yds, 2 TD)
x011EC - 03 42 00 06 31 00 00 00 00 0B 5F 08 (RB3 Stats: 11 Rush, 95 Yds, 2 TD / 3 Rec, 66 Yds, 0 TD / 3 KR, 49 Yds, 0 TD)
x011F8 - 00 00 00 62 64 03 00 00 00 00 00 00 (RB4 Stats: 49 KR, 868 Yds, 0 TD)
x01204 - 10 E4 14 00 00 00 00 00 01 00 00 00 (WR1 Stats: 16 Rec, 484 Yds, 5 TD)
x01210 - 23 8D 1C 00 00 00 00 00 03 00 00 00 (WR2 Stats: 35 Rec, 909 Yds, 7 TD)
x0121C - 00 00 00 00 00 00 00 00 00 00 00 00 (WR3 Stats: 0)
x01228 - 00 00 00 00 00 00 50 BC 00 00 00 00 (WR4 Stats: 20 PR, 188 Yds, 0 TD)
x01234 - 19 51 30 00 00 00 00 00 02 00 00 00 (TE1 Stats: 25 Rec, 593 Yds, 12 TD)
x01240 - 01 00 00 00 00 00 00 00 00 00 00 00 (TE2 Stats: 1 Rec, 0 yds)

 

Byte1: Receptions (0-255) | Example: 18  = 24 Receptions

Byte2: Receiving Yards (0-255) | Example: 9F  = 159 Receiving Yards

Byte3: Rec TD (x) & Punt Ret Yds / Rec TD (y) | Example: 1C  = 4 Rec TD, 0 Punt Ret Yds, 3 Rec TD

  • (x) = Rec TD * 4
  • (y) = Punt Ret Yds (0, 256, 512, or 768) & Rec TD (0,1,2,3)
  • --- 0/4/8/C: 0 PR Yds & 0/1/2/3 Rec TD
  • --- 1/5/9/D: 256 PR Yds & 0/1/2/3 Rec TD
  • --- 2/6/A/E: 512 PR Yds & 0/1/2/3 Rec TD
  • --- 3/7/B/F: 768 PR Yds & 0/1/2/3 Rec TD

Byte4: Kickoff Returns divided by 2 | Example: 62  = Hex2Dec Value of  98 - divided by 2 = 49

Byte5: Kickoff Return Yards (0-255) | Example: 64  = 100 Kick Return Yards

Byte6: KR TD (x) & Kickoff Ret Yds / KR TD (y) | Example: 03  = 0 KR TD, 768 KR Yards, 0 KR TD

  • (x) = KR TD * 2
  • (y) = KR Ret Yds & KR TD
  • --- 0-7: KR Yds * 256, 0 KR TD
  • --- 8-F: KR Yds * 256, 1 KR TD

Byte7: Punt Returns (x) & Rush Yds / Punt Returns (y) | Example: 02  = 0 Punt Returns, 512 Rush Yds, 0 Punt Returns

 

  • (x) = Punt Ret * 4
  • (y) = Rush Yds (0, 256, 512, 768) & 0-3 punt returns
  • --- 0/4/8/C: 0 Rush Yds & 0/1/2/3 Punt Ret
  • --- 1/5/9/D: 256 Rush Yds & 0/1/2/3 Punt Ret
  • --- 2/6/A/E: 512 Rush Yds & 0/1/2/3 Punt Ret
  • --- 3/7/B/F: 768 Rush Yds & 0/1/2/3 Punt Ret

Byte8: Pass Return Yds (0-255) | Example: BC  = 188 Punt Return Yds

Byte9: Punt Ret TD (x) & Rec Yards (y) | Example: 02  = 153 Pass Attempts

  • (x) = Punt Ret TD (0-15)
  • (y) = Rec Yds * 256

Byte10: Rush Attempts (0-255) | Example: A1 = 161 Rush Attempts

Byte11: Rush Yds (0-255) | Example: 66 = 102 Rush Yds

Byte12: Rush TD (x) & Rush Yds / Rush TD (y) | Example: 59  = 20 Rush TD, 1024 Rush Yds, 2 TD

 

  • (x) = Rush TD * 4
  • (y) = Rush Yds (0, 1024, 2048, 3072) & 0-3 Rush TDs
  • --- 0/4/8/C: 0 Rush Yds & 0/1/2/3 Rush TD
  • --- 1/5/9/D: 1024 Rush Yds & 0/1/2/3 Rush TD
  • --- 2/6/A/E: 2048 Rush Yds & 0/1/2/3 Rush TD
  • --- 3/7/B/F: 3072 Rush Yds & 0/1/2/3 Rush TD

 

Defense (3 bytes)

Examples:

x0124C - 2A 10 08 (RE Stats: 21 sacks, 1 int, 8 yds, 0 TD)
x0124F - 08 10 05 (NT Stats: 4 sacks, 1 int, 5 yds, 0 TD)
x01252 - 08 20 0D (LE Stats: 4 sacks, 2 int, 13 yds, 0 TD)
X01255 - 0C 10 03 (ROLB Stats: 6 sacks, 1 int, 3 yds, 0 TD)
X01258 - 06 00 00 (RILB Stats: 3 sacks, 0 int, 0 yds, 0 TD)
X0125B - 08 20 15 (LILB Stats: 4 sacks, 2 int, 21 yds, 0 TD)
x0125E - 0A 10 06 (LOLB Stats: 5 sacks, 1 int, 6 yds, 0 TD)
x01261 - 00 00 00 (RCB Stats: 0 sacks, 0 int, 0 yds, 0 TD)
x01264 - 00 20 04 (LCB Stats: 0 sacks, 2 int, 4 yds, 0 TD)
x01267 - 02 20 09 (FS Stats: 1 sack, 2 int, 9 yds, 0 TD)
x0126A - 00 40 2A (SS Stats: 0 sacks, 4 int, 42 yds, 0 TD)

 

Byte1: Sacks (x) & Sacks / Int (y) | Example: 2A  = 16 Sacks, 5 sacks, 0 INT

  • (x) = Sacks * 8
  • (y) - Sacks (1-7) & Int
  • --- Even # (0,2,4,6,8,A,C,E): Sacks 1-7
  • --- Odd #: (1,3,5,7,9,B,D,F): Sack 1-7 & 16 INT

Byte2: Int (x) & Int TD / Int Return Yds (y) | Example: 40  = 4 INT, 0 Int Ret TD, 0 Int Ret Yds

  • (x) = Int (0-15)
  • (y) - Int TD (0-7)
  • --- Even # (0,2,4,6,8,A,C,E): Int TD 0-7
  • --- Odd #: (1,3,5,7,9,B,D,F): Int TD 0-7, 256 Yds

Byte3: Int Return Yards (0-255) | Example: 2A = 42 Int Ret Yds

 

Kicker (4 bytes)

Examples:

x0126D - 42 3E 09 08 (62/66 XP, 8/9 FG)

Byte1: XP Attempts (0-255) | Example: 42 = 66 XP Attempts

Byte2: XP Made (0-255) | Example: 3E = 62 XP Made

Byte3: FG Attempts (0-255) | Example: 09 = 9 FG Attempts

Byte4: FG Made (0-255) | Example: 08 = 8 FG Made

 

 

Punter (3 bytes)

Examples:

x01271 - 09 73 01 (9 punts, 371 yards)

Byte1: Punts (0-255) | Example: 09 = 9 Punts

Byte2 & 3: Punt Yards | Example: 73 01 = 01 73. 0173 = 371 yards (256 115)

 

Team-Statistical Info

x01274 - 0E     | Wins (14)
x01275 - 02     | Losses (2)
x01276 - 00     | Ties (0)
x01277 - E2 01    | PF (482)
x01279 - 2E 01    | PA (302)
x0127B - 39 0B    | Pass Def (2873)
x0127D - 98 05    | Rush Def (1432)
X0127F - x01282  --> Playbook (Play byte)
**LINEUP**
(0 - QB1, 1 - QB2, 2 - RB1, 3 - RB2, 4 - RB3, 5 - RB4, 6 - WR1, 7 - WR2, 8 - WR3, 9 - WR4, A - TE1, B - TE2, C - C, D - LG, E - RG, F - LT)
x01283 - 02        | QB1 / RB1
x01284 - 36        | RB2 / WR1
x01285 - 7A        | WR2 / TE1
x01286 - 59        | KR / PR
x01287 - x01289  --> Injuries
x0128A         --> Physical Condition
(Each byte - pair players)
(0 - BB, 1 - BA, 2 - BG, 3 - BE, 4 - AB, 5 - AA, 6 - AG, 7 - AE, 8 - GB, 9 - GA, A - GG, B - GE, C - EB, D - EA, E - EG, F - EE)

 

Team addresses

(208 bytes per team)

x11C2 - BUF
x1292 - IND
x1362 - MIA
x1432 - NE
x1502 - NYJ
x15D2 - CIN
x16A2 - CLE
x1772 - HOU
x1842 - PIT

(some dead space between PIT & DEN)
x1A16 - DEN
x1AE6 - KC
x1BB6 - RAI
x1C86 - SD
x1D56 - SEA

x1E26 - WAS
x1EF6 - GIA
x1FC6 - PHI
x2092 - PHX
x2166 - DAL
x2236 - CHI
x2306 - DET
x23D6 - GB
x24A6 - MIN
x2576 - TB
x2646 - SF
x2716 - RAM
x27E6 - NO
x28B6 - ATL

VirtuaNes Stat Extractor.zip

Link to comment
Share on other sites

It was probably hard to find but the save state information has been documented before. They had to compress everything to make it all fit in the limited amount of save memory that there was on the cart. The only difference from emulator to emulator is where the save ram information starts in the file. If the data is compressed then it will be impossible to find without knowing what the compression algorithm used is. 

 

 

Great work though! 

Link to comment
Share on other sites

A lot of information is so old now its hard to find some of the old post topics either because of the sheer number of posts or it just being buried in an obscure way.. This is back from 2006...just one place I found the info documented. Scroll down to about the 4th post by jstout. Obviously the original thread topic has nothing to do with it. 
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...