Jump to content

stats code (NES)


cxrom

Recommended Posts

so i started diggin around for the stat code and found some of it. i'm not sure what each bit does but it looks pretty straigtforward. this code modfies the temp stats that are in-game, not the season stats.

this portion jumps somewhere based on the player and stat being updated


$B582:8A TXA
$B583:0A ASL
$B584:A8 TAY
$B585:B9 63 AC LDA $AC63,Y
$B588:85 3E STA $3E
$B58A:B9 64 AC LDA $AC64,Y
$B58D:85 3F STA $3F
$B58F:A9 80 LDA #$80
$B591:8D 01 A0 STA $A001
$B594:6C 3E 00 JMP ($003E)

the previous indirect jump lands somewhere in this portion which loads an index based on what needs to be updated.


$B597:A0 00 LDY #$00
$B599:4C 46 B6 JMP $B646
$B59C:A0 01 LDY #$01
$B59E:4C 46 B6 JMP $B646
$B5A1:A0 02 LDY #$02
$B5A3:4C 46 B6 JMP $B646
$B5A6:A0 03 LDY #$03
$B5A8:4C 46 B6 JMP $B646
$B5AB:A0 04 LDY #$04
$B5AD:A5 45 LDA $45
$B5AF:10 01 BPL $B5B2
$B5B1:60 RTS
$B5B2:4C 37 B6 JMP $B637
$B5B5:A0 06 LDY #$06
$B5B7:4C 46 B6 JMP $B646
$B5BA:A0 07 LDY #$07
$B5BC:4C 37 B6 JMP $B637
$B5BF:A0 09 LDY #$09
$B5C1:4C 46 B6 JMP $B646
$B5C4:A0 0D LDY #$0D ; (rb rush yards?)
$B5C6:4C 37 B6 JMP $B637 ;
$B5C9:A0 0C LDY #$0C ; (rb rush attempts?)
$B5CB:4C 46 B6 JMP $B646 ;
$B5CE:A0 0F LDY #$0F ; (rb td count?)
$B5D0:4C 46 B6 JMP $B646 ;
$B5D3:A0 00 LDY #$00
$B5D5:4C 46 B6 JMP $B646
$B5D8:A0 01 LDY #$01
$B5DA:A5 45 LDA $45
$B5DC:10 01 BPL $B5DF
$B5DE:60 RTS
$B5DF:4C 37 B6 JMP $B637
$B5E2:A0 03 LDY #$03
$B5E4:4C 46 B6 JMP $B646
$B5E7:A0 04 LDY #$04
$B5E9:4C 46 B6 JMP $B646
$B5EC:A0 05 LDY #$05
$B5EE:4C 37 B6 JMP $B637
$B5F1:A0 07 LDY #$07
$B5F3:4C 46 B6 JMP $B646
$B5F6:A0 08 LDY #$08
$B5F8:4C 46 B6 JMP $B646
$B5FB:A0 09 LDY #$09
$B5FD:4C 37 B6 JMP $B637
$B600:A0 0B LDY #$0B
$B602:4C 46 B6 JMP $B646
$B605:A0 00 LDY #$00
$B607:4C 46 B6 JMP $B646
$B60A:A0 01 LDY #$01
$B60C:4C 46 B6 JMP $B646
$B60F:A0 02 LDY #$02
$B611:4C 37 B6 JMP $B637
$B614:A0 04 LDY #$04
$B616:4C 46 B6 JMP $B646
$B619:A0 00 LDY #$00
$B61B:4C 46 B6 JMP $B646
$B61E:A0 01 LDY #$01
$B620:4C 46 B6 JMP $B646
$B623:A0 02 LDY #$02
$B625:4C 46 B6 JMP $B646
$B628:A0 03 LDY #$03
$B628:A0 03 LDY #$03
$B62A:4C 46 B6 JMP $B646
$B62D:A0 00 LDY #$00
$B62F:4C 46 B6 JMP $B646
$B632:A0 01 LDY #$01
$B634:4C 37 B6 JMP $B637

this final part actually updates the stat. the first routine is for things like rush yards, pass yards, etc. the second is for stats that increment by 1, like rush attemps, tds, etc.


; -------------------------------------------
$B637:B1 40 LDA ($40),Y @ $643C = #$00
$B639:18 CLC
$B63A:65 44 ADC $0044 = #$02
$B63C:91 40 STA ($40),Y @ $643C = #$00
$B63E:C8 INY
$B63F:B1 40 LDA ($40),Y @ $643C = #$00
$B641:65 45 ADC $0045 = #$00
$B643:91 40 STA ($40),Y @ $643C = #$00
$B645:60 RTS
; -------------------------------------------
$B646:B1 40 LDA ($40),Y @ $6426 = #$00
$B648:18 CLC
$B649:69 01 ADC #$01
$B64B:B0 02 BCS $B64F
$B64D:91 40 STA ($40),Y @ $6426 = #$00
$B64F:60 RTS

Link to comment
Share on other sites

  • 11 years later...

I've been on a quest to extract as much in-game data as possible.  This was a great starting point, thank you.  Updating with my findings of what the various functions do.

 

$B597:A0 00     LDY #$00    ; pass attempts
$B599:4C 46 B6  JMP $B646
$B59C:A0 01     LDY #$01    ; pass completions
$B59E:4C 46 B6  JMP $B646
$B5A1:A0 02     LDY #$02    ; pass td
$B5A3:4C 46 B6  JMP $B646
$B5A6:A0 03     LDY #$03    ; pass interception
$B5A8:4C 46 B6  JMP $B646
$B5AB:A0 04     LDY #$04    ; pass yards
$B5AD:A5 45     LDA $45
$B5AF:10 01     BPL $B5B2
$B5B1:60        RTS
$B5B2:4C 37 B6  JMP $B637
$B5B5:A0 06     LDY #$06    ; qb rush attempts
$B5B7:4C 46 B6  JMP $B646
$B5BA:A0 07     LDY #$07    ; qb rush yards
$B5BC:4C 37 B6  JMP $B637
$B5BF:A0 09     LDY #$09    ; qb rush td
$B5C1:4C 46 B6  JMP $B646
$B5C4:A0 0D     LDY #$0D    ; off rush yards
$B5C6:4C 37 B6  JMP $B637    
$B5C9:A0 0C     LDY #$0C    ; off rush attempts
$B5CB:4C 46 B6  JMP $B646    
$B5CE:A0 0F     LDY #$0F    ; off td count
$B5D0:4C 46 B6  JMP $B646   
$B5D3:A0 00     LDY #$00    ; off receptions
$B5D5:4C 46 B6  JMP $B646
$B5D8:A0 01     LDY #$01    ; off rec yards
$B5DA:A5 45     LDA $45
$B5DC:10 01     BPL $B5DF
$B5DE:60        RTS
$B5DF:4C 37 B6  JMP $B637
$B5E2:A0 03     LDY #$03    ; off rec td
$B5E4:4C 46 B6  JMP $B646
$B5E7:A0 04     LDY #$04    ; kick return attempts
$B5E9:4C 46 B6  JMP $B646
$B5EC:A0 05     LDY #$05    ; kick return yards
$B5EE:4C 37 B6  JMP $B637
$B5F1:A0 07     LDY #$07    ; ?? seems related to defensive reactions
$B5F3:4C 46 B6  JMP $B646
$B5F6:A0 08     LDY #$08    ; punt returns attempts
$B5F8:4C 46 B6  JMP $B646
$B5FB:A0 09     LDY #$09    ; punt return yards
$B5FD:4C 37 B6  JMP $B637
$B600:A0 0B     LDY #$0B    ; ?? possibly unused
$B602:4C 46 B6  JMP $B646
$B605:A0 00     LDY #$00    ; sack
$B607:4C 46 B6  JMP $B646
$B60A:A0 01     LDY #$01    ; defense interception
$B60C:4C 46 B6  JMP $B646   
$B60F:A0 02     LDY #$02    ; defense int yards
$B611:4C 37 B6  JMP $B637
$B614:A0 04     LDY #$04    ; ?? possibly unused
$B616:4C 46 B6  JMP $B646
$B619:A0 00     LDY #$00    ; xp attempts
$B61B:4C 46 B6  JMP $B646
$B61E:A0 01     LDY #$01    ; xp made
$B620:4C 46 B6  JMP $B646
$B623:A0 02     LDY #$02    ; fg attempts
$B625:4C 46 B6  JMP $B646
$B628:A0 03     LDY #$03    ; fg made
$B62A:4C 46 B6  JMP $B646
$B62D:A0 00     LDY #$00    ; punt attempts
$B62F:4C 46 B6  JMP $B646
$B632:A0 01     LDY #$01    ; punt yards
$B634:4C 37 B6  JMP $B637

 

 

I'd be very interested in figuring out how it correlates the in-game stats with the proper player/team for the blue scoreboard and season stat dump at the end of the game.

I'm also interested in figuring out where first down totals are stored since that is displayed on the blue screen, but doesn't appear to be near the in-game player data. 

 

I've already found the code that chooses what player data to include on the blue screen and the functions that update the season totals at the end of game, so hopefully finding that other data isn't too hard.


 

Edited by TecmoFever
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...