chaos Posted July 26, 2013 Report Share Posted July 26, 2013 Most (almost all) of this was pulled from the Extracting Stats topic in the General Questions and Discussion forum. A very special thanks to Xstioph for finding these (back in 2007!). A reminder: SNES uses Little Endian format. So any stat that uses 2 offsets (like Attack Zone for example), the most significant byte is the second one, and the least significant byte is the first one. Also, all values stored are in HEX, not Decimal. Example: Attack Zone for Home is located at offsets 9061 and 9062. Lets say 9061 contains 15 (256 in decimal) and 9062 contains 01 (21 in decimal). Normally, in Big Endian (used in Genesis), this is read as 1501 (9061, then 9062), and you would calculate the attack zone by converting 1501 to decimal, but in Little Endian (used in SNES), it would be read 0115 (9062, then 9061). 0115 would then be converted into decimal and minutes and seconds could then be calculated. Conversion (use a calculator or do it like this): 1st position (farthest on the right): 5 x 1 = 5 2nd position: 1 x 16 = 16 3rd position: 1 x 256 = 256 4th position: 0 x 4096 = 0 256 + 16 + 5 = 277 seconds or 4 minutes 37 seconds --------------------------------------------------------------------- Game Stats:HOMEOffset (decimal)9121: Score 9101: Shots9173: Breakaways9177: Breakaway goals9193: One Timers9197: One Timer Goals9181: Penalty Shots9185: Penalty Shot Goals9125: Faceoffs Won9161: Body Checks9169: Passes9165: Passes Recived9061+9062: Attack Zone-9049: Power Play9045: Power Play Goals9069: Power Play Shots9077: Shorthanded Goals9053: Penalties9057: Penalty time9065+9066: Power Play Time-9085: Period 1 Shots9089: Period 2 Shots 9093: Period 3 Shots 9097: Overtime Shots-9105: Period 1 Goals9109: Period 2 Goals9113: Period 3 Goals9117: Overtime Goals AWAY9123: Score9103: Shots9175: Breakaways9179: Breakaway goals9195: One Timers9199: One Timer Goals9183: Penalty Shots9187: Penalty Shot Goals9127: Faceoffs Won9163: Body Checks9171: Passes9167: Passes recived9063+9064: Attack Zone-9051: Power Play9047: Power Play Goals 9071: Power Play Shots9079: Shorthanded Goals9055: Penalties9059: Penalty time9067+9068: Power Play Time-9087: Period 1 Shots 9091: Period 2 Shots 9095: Period 3 Shots 9099: Overtime Shots -9107: Period 1 Goals9111: Period 2 Goals 9115: Period 3 Goals9119: Overtime Goals --------------------------------------------------------------------- Player Stats: Home Team:Goals9473: xx : # of goals scored for the 1st player in the team roster (if player) : xx : # of goals conceded for the 1st player in the team roster (if/when goalie)9474: xx : # of goals scored for the 2nd player in the team roster (if player) : xx : # of goals conceded for the 2nd player in the team roster (if/when goalie)9475: xx : # of goals scored for the 3rd player in the team roster (if player) : xx : # of goals conceded for the 3rd player in the team roster (if/when goalie) 9476-9497: xx : # of goals scored for the 4th-25th player on the team roster (each byte is for 1 player) Assists 9525: xx : # of assists for the 1st player in the team roster (goalies too)9526: xx : # of assists for the 2nd player in the team roster (goalies too)9527: xx : # of assists for the 3rd player in the team roster (goalies too)9528-9549: xx : # of assists for the 4-25th player in the team roster (each byte is for 1 player) Shots9577: xx : # of shots on goal for the 1st player in the team roster (if player) : xx : # of shots against for the 1st player in the team roster (if/when goalie)9578: xx : # of shots on goal for the 2nd player in the team roster (if player) : xx : # of shots against for the 2nd player in the team roster (if/when goalie)9579: xx : # of shots on goal for the 3rd player in the team roster (if player) : xx : # of shots against for the 3rd player in the team roster (if/when goalie)9580-9601: xx : # of shots on goal for the 4-25th player in the team roster (each byte is for 1 player) Penalties 9629: xx : # of penalty minutes for the 1st player in the team roster (goalie cannot get penalty)9630: xx : # of penalty minutes for the 2nd player in the team roster (goalie cannot get penalty)9631: xx : # of penalty minutes for the 3rd player in the team roster (goalie cannot get penalty)9632-9653: xx : # of penalty minutes for the 4-25th player in the team roster (each byte is for 1 player) Away Team:Goals9499: xx : # of goals scored for the 1st player in the team roster (if player) : xx : # of goals conceded for the 1st player in the team roster (if/when goalie)9500: xx : # of goals scored for the 2nd player in the team roster (if player) : xx : # of goals conceded for the 2nd player in the team roster (if/when goalie)9501: xx : # of goals scored for the 3rd player in the team roster (if player) : xx : # of goals conceded for the 3rd player in the team roster (if/when goalie) 9502-9523: xx : # of goals scored for the 4-25th player in the team roster (each byte is for 1 player) Assists 9551: xx : # of assists for the 1st player in the team roster (goalies too)9552: xx : # of assists for the 2nd player in the team roster (goalies too)9553: xx : # of assists for the 3rd player in the team roster (goalies too)9554-9575: xx : # of assists for the 4th player in the team roster (each byte is for 1 player) Shots9603: xx : # of shots on goal for the 1st player in the team roster (if player) : xx : # of shots against for the 1st player in the team roster (if/when goalie)9604: xx : # of shots on goal for the 2nd player in the team roster (if player) : xx : # of shots against for the 2nd player in the team roster (if/when goalie)9605: xx : # of shots on goal for the 3rd player in the team roster (if player) : xx : # of shots against for the 3rd player in the team roster (if/when goalie)9606-9627: xx : # of shots on goal for the 4th player in the team roster (each byte is for 1 player) Penalties9655: xx : # of penalty minutes for the 1st player in the team roster (goalie cannot get penalty)9656: xx : # of penalty minutes for the 2nd player in the team roster (goalie cannot get penalty)9657: xx : # of penalty minutes for the 3rd player in the team roster (goalie cannot get penalty)9658-9679: xx : # of penalty minutes for the 4-25th player in the team roster (each byte is for 1 player) Quote Link to comment Share on other sites More sharing options...
chaos Posted July 26, 2013 Author Report Share Posted July 26, 2013 Penalty Summary consists of 4 bytes (again, use Little Endian format!). 8783-8784 : # of Penalties (in HEX value). This is something I found, and saves you time knowing how many penalty summaries you have to go through. You can ignore the 8784 byte, since you will never have more than 255 penalties in a game (I hope.....). So, reading in the 8783 byte and converting it to decimal will give you the number of penalties in a game. For example, if 8783 was 0B, there were 11 penalties in the game, and I will need to check the first 11 penalty summary positions. Penalty Summary:8785 : Penalty 18789 : Penalty 28793 : Penalty 38797 : Penalty 4 8798-9041: Penalty 5-65 (each penalty is 4 bytes long) The 4 bytes are laid out in the following way (Example): Penalty 1 (starting at 8785 decimal offset): 0C 40 97 1A (remember, it's laid out in Little Endian! The 971A does not need to be swapped, as both bytes are 2 separate things) Let's read this as 400C 97 1A. 400C: 2nd period, 12 seconds 97: Away Team Player 24 1A: Slashing penalty Period and Time: (The FIRST and SECOND byte read in, 8785 and 8786 in the example, 0C 40 were the values) 00 00 - FF 3F : 1st Period time in seconds 00 40 - FF 7F : 2nd Period time in seconds 00 80 - FF BF : 3rd period time in seconds 00 C0 - FF FF : OT period time in seconds Again, remember the values are stored in Little Endian, so when you read in 0C 40 , when converting to decimal, you need to convert it as 40 0C (swap the 2 byte positions). Player Values: (the THIRD byte in the Penalty Summary when read in: 8787 in the example, 97 is the value) Home00 : Player 01 [Goalie]01 : Player 02 [Goalie/Player]02 : Player 03 [Goalie/Player]03 : Player 0404 : Player 0505 : Player 0606 : Player 0707 : Player 0808 : Player 0909 : Player 100A : Player 110B : Player 120C : Player 130D : Player 140E : Player 150F : Player 1610 : Player 1711 : Player 1812 : Player 1913 : Player 2014 : Player 2115 : Player 2216 : Player 2317 : Player 2418 : Player 25 Away80 : Player 01 [Goalie]81 : Player 02 [Goalie/Player]82 : Player 03 [Goalie/Player]83 : Player 0484 : Player 0585 : Player 0686 : Player 0787 : Player 0888 : Player 0989 : Player 108A : Player 118B : Player 128C : Player 138D : Player 148E : Player 158F : Player 1690 : Player 1791 : Player 1892 : Player 1993 : Player 2094 : Player 2195 : Player 2296 : Player 2397 : Player 2498 : Player 25 The Penalties: (the LAST byte in the Penalty summary when read in: position 8788 in the example, 1A was the value) 14 : Roughing (20 in decimal)18 : Charging (24 in decimal)1A : Slashing (26 in decimal)1C : Roughing (28 in decimal)1E : Cross Check (30 in decimal)20 : Hooking (32 in decimal)22 : Tripping (34 in decimal)26 : Interference (38 in decimal)28 : Holding (40 in decimal) Quote Link to comment Share on other sites More sharing options...
chaos Posted July 26, 2013 Author Report Share Posted July 26, 2013 Scoring summary15693 and 15694 contain the LENGTH of the Scoring Summary (in total bytes). Again, in Little Endian format. Once again, like the penalty summary, you should not have to worry about reading in 15694, unless there are more than 99 goals scored. Once you know the length, you can figure out how many scoring summaries you need to extract. Each Summary is 6 bytes long. Example: 15693 = 24 15694 = 00 0024 = 36 bytes. 36 bytes / 6 bytes per summary = 6 Goals Offsets: 15695 : Goal 115701 : Goal 215707 : Goal 315713 : Goal 4... 16289 : Goal 100 Starts at: 15695 (decimal offset, 6 bytes per goal) XX : TimeXX : Period / TimeXX : Goal TypeXX : Goal scorerXX : Assist 1 (FF, if none)XX : Assist 2 (FF, if none) Period and Time: (The FIRST and SECOND byte read in. Here, the bytes are listed in order read.) 00 00 - FF 3F : 1st Period time in seconds 00 40 - FF 7F : 2nd Period time in seconds 00 80 - FF BF : 3rd period time in seconds 00 C0 - FF FF : OT period time in seconds Team Scored and Goal Type: These values are given in hex. Home team goal type (in hex): 00 = SH2, 01 = SH, 02 = EV, 03 = PP, 04 =PP2 (Penalty Shot Goals are considered EV) Away team goal type (in hex): 80 = SH2, 81 = SH, 82 = EV, 83 = PP, 84 = PP2 Goals and Assists: Both teams use 00-18 player numbers, in hex, not the same as the penalty summary. 00 is the first roster position (normally a G), 01 is the second (normally a G), 02 is the third, etc. This is used for the Goal scorer and the Assists. If the Assist byte is FF, there was no Assist of that type (first or second assist). Example: 50 00 02 02 0E FF Time in Little Endian, 50 00 we switch to 00 50 0 : Period 1 050 : 1:20 02: Even Strength, Home Team Goal scorer: 02 (3rd player on Home's roster) Assist 1: 0E (15th player on Home's roster) Assist 2: 00 (1st player on Home's roster) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.