Jump to content
NHL'94 Forums

HOW TO: Pull CPU Goalie earlier & by how many goals [GENS]


McMarkis

Recommended Posts

Pull CPU Goalie earlier when losing


Note:
Thanks to @chaos & @smozoma for assisting with some 68K assembly knowledge sharing.

Pull CPU Goalie earlier in the 3rd:
Want to change how early the CPU pulls its goalie when losing?

ROM Offset: (hex)0000F766-0000F767
Change: 00 3C to 00 96

The above change will pull the goalie with 2:30 remaining in the 3rd period.

image.png

Pull CPU Goalie when losing by 1 goal instead of 2:
You can also modify how many goals the CPU is losing by when the goalie gets pulled.
**There is currently a bug in GENS where it will only pull the goalie if its equal to this value. See below patch by @smozoma to fix this.

ROM Offset: (hex)0000F75F
Change: 02 to 01

The above change will pull the goalie when losing by 1 goal instead of 2 goals.

image.png

Edited by McMarkis
update
  • Love 2
  • Thanks 1
  • Like 2
  • Wow 2
Link to comment
Share on other sites

  • McMarkis changed the title to HOW TO: Pull CPU Goalie earlier & by how many goals [GENS]

Pull CPU Goalie when losing by 1 to N goals

Triple-team job (McMarkis, chaos, and me) on Discord to solve the number of goals bug.

I ran a trace in the emulator tonight and I think this should work:

ROM Offset: 0000 F758
Change:     6B to 63  (BMI to BLS)

ROM Offset: 0000 F760
Change:     66 to 62  (BNE to BHI)
  
ROM Offset: 0000 F75F
Change:     02 to 0N
Note:       N is the max number of goals to pull the goalie on. 
            Example: Set to 03 for the goalie to be pulled when down 1,2, or 3 goals.

For how it works, here is the code:

================================================================================
OLD - Only pulls goalie if goal differential is exactly 2.
      The code is run twice, swapping the teams the second time.
--------------------------------------------------------------------------------
00:F750  30 29  MOVE.W  $000C(A1),D0       ; D0 = "Score of one of the teams"
00:F754  90 6A  SUB.W   $000C(A2),D0       ; D0 = D0 - "Score of the other team"
00:F758  6B 00  BMI     #$5D0A [01:5464]   ; Abort if D0 < 0 (don't pull goalie)
                                           ; Continue if D0 >=0
00:F75C  B0 7C  CMP.W   #$0002,D0          ; Bits = D0 minus 2
00:F760  66 00  BNE     #$5D02 [01:5464]   ; Abort if D0 != 2 (don't pull goalie)
                                           ; Continue if D0 == 2
================================================================================

================================================================================
NEW - Pull goalie if goal differential is >0 and <=2.
      (Still runs twice with the teams swapped)
--------------------------------------------------------------------------------
00:F750  30 29  MOVE.W  $000C(A1),D0       ; D0 = "Score of one of the teams"
00:F754  90 6A  SUB.W   $000C(A2),D0       ; D0 = D0 - "Score of the other team"
00:F758  63 00  BLS     #$5D0A [01:5464]   ; Abort if D0 <= 0 (don't pull goalie)
                                           ; Continue if D0 >0
00:F75C  B0 7C  CMP.W   #$0002,D0          ; Bits = D0 minus 2
00:F760  62 00  BHI     #$5D02 [01:5464]   ; Abort if D0 > 2 (don't pull goalie)
                                           ; Continue if D0 <= 2
================================================================================
                                                              
                                                              
How to read an instruction:
00:F750  30 29  MOVE.W  $000C(A1),D0       ; D0 = "Score of one of the teams"
                                           ; stuff after a semicolon is a "comment" not code
^^:^^^^                                    ; address in ROM file
         ^^ ^^                             ; instruction hex code
                ^^^^^^                     ; instruction human-readable name
                        ^^^^^^^^^^^^^      ; instruction parameters
                                           ; "D0" is "Data Register 0" (a place to store temporary calulation values)

 

Edited by chaos
Fixed "Old Code" D0 branch
  • Love 3
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

Had to test this out in the other games of course.

The numbers are a little different between games so I had to limit my search for instances of "0002 6600", but found that the sequence that @smozoma laid out above held true in all of the games from '92 to '95 in some form of 6B00 xxxx B07C 0002 6600 xxxx 0C78 003C. Tested them all with a few extreme numbers and they all behave as described above [if my tests did mean chaos ensued]

No luck with '96-'98 sadly.

For anyone interested, here is the complete list of offsets.

NHL'92
offset 7AB2 = 6B00 [change to 6300]
offset 7AB8 = 0002 [goals at which CPU team pulls goalie]
offset 7ABA = 6600 [change to 6200]
offset 7AC0 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]


EA'92
offset 76A4 = 6B00 [change to 6300]
offset 76AA = 0002 [goals at which CPU team pulls goalie]
offset 76AC = 6600 [change to 6200]
offset 76B2 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]


NHLPA'93
offset C308 = 6B00 [change to 6300]
offset C30E = 0002 [goals at which CPU team pulls goalie]
offset C310 = 6600 [change to 6200]
offset C316 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]

NHL'94
offset F758 = 6B00 [change to 6300]
offset F75E = 0002 [goals at which CPU team pulls goalie]
offset F760 = 6600 [change to 6200]
offset F766 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]

NHL'95
offset 83674 = 6B00 [change to 6300]
offset 8367A = 0002 [goals at which CPU team pulls goalie]
offset 8367C = 6600 [change to 6200]
offset 83682 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]

Eliteserien'95
offset 80BD4 = 6B00 [change to 6300]
offset 80BDA = 0002 [goals at which CPU team pulls goalie]
offset 80BDC = 6600 [change to 6200]
offset 80BC2 = 003C [seconds remaining in third period at which CPU team pulls goalie - in hex]

  • Thanks 3
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.

  • Who's Online   0 Members, 0 Anonymous, 149 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...