Ice Hockey

From NES Hacker Wiki
Jump to: navigation, search

Ice Hockey is an early hockey game that was unauthorized by the NHL. Due to hardware limitations of the day, numerous rules of NHL hockey are not followed in the game. However, the game is still a lot of fun to play.

Easy Cheats

Icon Addr Val Cmp Description
Icon-Score.png 042F 63 - P1 Has 99 Goals (Updates on first goal)
Icon-Score.png 0430 63 - P2 Has 99 Goals (Updates on first goal)
Icon-Time.png CEC2 0A 13 Timer Twice As Fast
Icon-Time.png CEC2 05 13 Timer Four Times As Fast
Icon-Time.png CEC2 00 13 Max Timer Speed
Icon-Time.png CEC2 3F 13 Game Seconds Are Real Seconds
Icon-Warp.png 9BDC 01 03 Games Last 1 Period
Icon-Warp.png 9BDC 04 03 Games Last 4 Periods
How do I use these?

North America

Ice Hockey.png

Memory Addresses

042F - P1 Score (00-63)
0430 - P2 Score (00-63)
0431 - Period (00-02) 

0436 - Minutes (00-0F)
0437 - Seconds (00-3F)
0438 - Split Second (00-20)

Code

Increment Score

9564:45 06     EOR $0006        ; 
9566:AA        TAX              ; 
9567:FE 2F 04  INC $042F,X      ; Increment score offset by player. X=0 is player 1, X=1 is player 2.
956A:20 43 D1  JSR $D143        ;

Process Time

CEB1:AD 12 04  LDA $0412
CEB4:D0 35     BNE $CEEB
CEB6:AD 38 04  LDA $0438        ; Load Split Second into A
CEB9:F0 06     BEQ $CEC1        ; If Split Second = 0, Goto CEC1
CEBB:CE 38 04  DEC $0438        ; Decrement Split Second
CEBE:4C EB CE  JMP $CEEB        ; Goto CEEB
CEC1:A9 13     LDA #$13         ; Load 20 into A
CEC3:8D 38 04  STA $0438        ; Store A into Split Second
CEC6:AD 37 04  LDA $0437        ; Load Seconds into A
CEC9:D0 0D     BNE $CED8        ; In Seconds != 0, Goto CED8
CECB:AD 36 04  LDA $0436        ; Load Minutes
CECE:F0 4A     BEQ $CF1A        ; If Minutes = 0, Goto CF1A
CED0:CE 36 04  DEC $0436        ; Decrease Minutes
CED3:A9 3C     LDA #$3C         ; Load 60 into A
CED5:8D 37 04  STA $0437        ; Store A into Seconds
CED8:CE 37 04  DEC $0437        ; Decrease Seconds
CEDB:20 2A CF  JSR $CF2A        ; Gosub CF2A
CEDE:A2 04     LDX #$04         ; Load 4 Into X
CEE0:BD 58 04  LDA $0458,X
CEE3:F0 03     BEQ $CEE8
CEE5:DE 58 04  DEC $0458,X
CEE8:CA        DEX
CEE9:D0 F5     BNE $CEE0
CEEB:AD 31 04  LDA $0431
CEEE:C9 02     CMP #$02
CEF0:90 25     BCC $CF17
CEF2:AD 36 04  LDA $0436        ; Load Minutes into A
CEF5:C9 02     CMP #$02
CEF7:B0 1E     BCS $CF17
CEF9:AD 2F 04  LDA $042F
CEFC:38        SEC
CEFD:ED 30 04  SBC $0430
CF00:B0 04     BCS $CF06
CF02:49 FF     EOR #$FF
CF04:69 01     ADC #$01
CF06:C9 02     CMP #$02
CF08:B0 0D     BCS $CF17
CF0A:AD 12 03  LDA $0312
CF0D:D0 08     BNE $CF17
CF0F:A9 27     LDA #$27
CF11:8D 7C 05  STA $057C
CF14:20 D8 D0  JSR $D0D8
CF17:18        CLC
CF18:90 04     BCC $CF1E
CF1A:20 1F CF  JSR $CF1F         ; Gosub CF1E
CF1D:38        SEC
CF1E:60        RTS               ; Return
CF1F:A2 04     LDX #$04
CF21:A9 00     LDA #$00
CF23:9D 58 04  STA $0458,X
CF26:CA        DEX
CF27:D0 FA     BNE $CF23
CF29:60        RTS               ; Return

Next Period

; Increment the period and find out what to do next.
9BD3:E6 09     INC $0009         ; Increment $0009
9BD5:EE 31 04  INC $0431         ; Increment Period
9BD8:AD 31 04  LDA $0431         ; Load Period into A
9BDB:C9 03     CMP #$03          ; Compare Period with $03
9BDD:B0 08     BCS $9BE7         ; If Period = 3, Goto 9BE7
9BDF:C9 02     CMP #$02          ; Compare Period with $02
9BE1:D0 1A     BNE $9BFD         ; If Period != 2, Goto 9BFD
9BE3:A9 08     LDA #$08          ; Load $08 into A (Call the zambonis)
9BE5:D0 0E     BNE $9BF5         ; Goto 9BF5

; End of game, compare scores.
9BE7:AD 2F 04  LDA $042F         ; Load P1 Score into A
9BEA:CD 30 04  CMP $0430         ; Compare P1 Score with P2 Score
9BED:D0 04     BNE $9BF3         ; If P1 Score != P2 Score, Goto 9BF3
9BEF:A9 07     LDA #$07          ; Load $07 into A  (Tie score)
9BF1:D0 02     BNE $9BF5         ; Goto 9BF5
9BF3:A9 09     LDA #$09          ; Load $09 into A  (Not a tie)
9BF5:20 76 83  JSR $8376         ; Gosub 8376
9BF8:A9 08     LDA #$08          ; Load $08 into A
9BFA:8D AA 04  STA $04AA         ; Store A into 04AA
9BFD:AD AA 04  LDA $04AA         ; Load 04AA into A
9C00:20 DD CF  JSR $CFDD         ; Gosub CFDD
9C03:60        RTS               ; Return