data/claims/mike-tysons-punch-out.yamlMike Tyson's Punch-Out!! (nmikstas's partial disassembly of the NES Rev 1)
Game: Mike Tyson's Punch-Out!!.
In Mike Tyson's Punch-Out!! (NES, Rev 1), each opponent move is a script of state data that one interpreter, OppStateUpdate, steps through. A control byte's upper nibble picks a handler, and for upper nibbles $B to $F the lower nibble picks a sub-command from a second table. The commands, named by the disassembly's ST_ constants, load sprites and frame timers, call and return from shared sub-scripts, jump, branch when a zero-page byte holds a given value, repeat a step, mark the opponent as punching, and set the punch's side and damage. At a punch's active step the script waits until the punch is resolved. A landed punch goes on past the step's three index bytes; a blocked, ducked, or dodged one jumps to the first, second, or third index. A path through a move ends with ST_END, which marks the state STAT_FINISHED ("Indicate the end of the current state has been reached", per the comment), or with ST_WAIT_STATE, which stores $81 in OppCurState: the opponent's wait state, in the comment's words. mike-tysons-punch-out/opponent-script
About: Mike Tyson's Punch-Out!! Attack pattern
CodeMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) ·source_files/PRG_BankDEF.asm#L4654-L4676;This function is the entry point for updating the opponent's state. It uses the upper nibble of
;a control byte to pick a function to run from the table below. The function it calls may then
;call another set of functions with the lower nibble of the same control byte(or it may not).
…
LC556: AND #$0F ;Keep lower nibble for later.
…
LC55C: JSR Div16 ;($BF99)Shift upper nibble to lower nibble.
LC55F: JSR IndFuncJump ;($AED4)Indirect jump to desired function below.
…
LC562: .word OppLoadSprites, SpritesNxtXYState, $C5B3, $C5B7
LC56A: .word $C5C8, $C5CE, SprtMove, OppMoveSprites
LC572: .word OppSetTimer, $C600, OppBigMove, OppStateUpdate1
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L4889-L4896OppStateUpdate1:
LC670: TXA ;Get index into table below.
LC671: JSR IndFuncJump ;($AED4)Indirect jump to desired function below.
…
LC674: .word OppCallFunc, OppReturnFunc, NULL_PNTR, NULL_PNTR
LC67C: .word OppVarStTime, OppNotPunch, $C6CA, $C6D7
LC684: .word $C6DF, $C6EA, NULL_PNTR, NULL_PNTR
LC68C: .word InitAudioMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L5017-L5024OppStateUpdate2:
LC720: TXA ;Get index into table below.
LC721: JSR IndFuncJump ;($AED4)Indirect jump to desired function below.
…
LC724: .word PunchActive, OppStateJump, ChkMemAndBranch, ChkRepeatState
LC72C: .word OppWaitState, OppRepeat, OppPunchDirDmg, OppDefInline
LC734: .word $C7E1, OppPunch, WriteZPageByte, OppSpecTimer
LC73C: .word OppComboWait, $C816, $C81D, StateDoneMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L508-L531.alias ST_SPRITES $00 ;Load sprite data for current opponent sub-state.
…
.alias ST_TIMER $80 ;Number of frames for sub-state to wait.
…
.alias ST_CALL_FUNC $E0 ;Call an opponent state subroutine.
.alias ST_RETURN_FUNC $E1 ;Return from an opponent state subroutine.
…
.alias ST_PNCH_ACTIVE $F0 ;Indicates an opponent's punch is active.
.alias ST_JUMP $F1 ;Jump to new state base address and index.
.alias ST_CHK_BRANCH $F2 ;Check memory for value and branch in state data if value found.
.alias ST_CHK_REPEAT $F3 ;Check if a sub-state needs to repeat.
.alias ST_WAIT_STATE $F4 ;Put opponent into wait state.
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L5028-L5072PunchActive:
LC744: LDX OppPunchSts ;Is the punch initialized but not yet processed?
LC746: BMI OppStateWait ;If so, branch.
…
LC74E: DEC OppStateIndex ;Stay on this state and exit.
…
LC751: CPX #PUNCH_LANDED ;Was punch landed?
LC753: BEQ PunchLanded ;If so, branch.
…
LC755: BCC PunchBlckDck ;Was punch blocked or ducked? If so, branch.
…
LC757: DEX ;Dodged punch must have index increased by 2 (4-2=2).
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L540-L543.alias PUNCH_BLOCKED $01 ;Punch blocked by Little Mac.
.alias PUNCH_DUCKED $02 ;Punch is ducked by Little Mac.
.alias PUNCH_LANDED $03 ;Punch hit Little Mac.
.alias PUNCH_DODGED $04 ;Punch dodged by Little Mac.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L5147-L5150OppWaitState:
LC7B6: LDA #$81 ;
LC7B8: STA OppCurState ;Put the opponent into their wait state.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L5259-L5264StateDone:
LC821: DEC OppStateIndex ;
LC823: LDA #STAT_FINISHED ;Indicate the end of the current state has been reached.
…
LC825: STA OppStateStatus ;Checked by claude, 2026-10-22 — read OppStateUpdate and its two sub-tables (OppStateUpdate1 and OppStateUpdate2), StateDone, PunchActive, OppWaitState, and the ST_ and PUNCH_ defines at the pinned commit; assembled the banks and matched the Rev 1 PRGThe four handlers named OppStateUpdate1 in the first table take upper nibble $B to $E, and $F goes to OppStateUpdate2, so ST_CALL_FUNC ($E0, OppCallFunc), ST_RETURN_FUNC ($E1, OppReturnFunc), ST_JUMP ($F1), and ST_END ($FF, StateDone) are sub-commands. The define for OppCurState says its high bit means "initialize new state", so $81 is state 1 waiting to start. The disassembly is partial: several handlers in each table are bare addresses with no label.
Cited by: Attack pattern, Mike Tyson's Punch-Out!!
Glass Joe's right hook in the NES Rev 1 is the commented script GJRighHook. It loads defense values, shows sprite data $0A ("6 frames for this sub-state", per the comment), flags the opponent as punching, and writes OPP_RGHT_HOOK to $BB. It then sets OppOutlineTimer to $84, a count of 4 calls of SetOppOutlineClr (the comment: "Change outline color for 4 frames"), and waits a variable time, VariableStTime. At index $1E, ST_CHK_REPEAT jumps to index $24 while its repeat counter, loaded as 1, hasn't run out; with 1 it falls through. If MacStatus holds MAC_SUPER_PUNCH, it branches to index $59; otherwise it starts the punch sound and sets the punch on Little Mac's left side with damage 7, which the comment says is added to base damage. Glass Joe's fight data sets that base damage at 4. At the punch's active step (index $32), a landed punch falls through to index $36: a 4-frame timer (per the comment), sprite moves, and ST_END at index $44. The step gives index $45 for a block, which jumps into his straight punch's state at index $3B, and index $49 for a duck or a dodge, which loads a special timer, sets his defense values to zero, moves his sprites, and waits for the combo timer before the wait state. mike-tysons-punch-out/right-hook
About: Mike Tyson's Punch-Out!! Attack pattern
Value
{
"outline_timer_calls": 4,
"punch_damage": 7,
"base_damage": 4,
"windup_frames_per_comment": 6
}source_files/PRG_Bank000.asm#L634-L709GJRighHook:
…
L8C4D: .byte ST_CALL_FUNC ;Call state data subroutine
L8C4E: .word DefenseStats3 ;Defense data pointer.
…
L8C54: .byte ST_SPRITES_XY+6 ;Load sprites, change position, 6 frames for this sub-state.
…
L8C58: .byte ST_PUNCH ;Indicate opponent is punching.
…
L8C59: .byte ST_DEFENSE ;Load opponent's defense data from following 4 bytes.
…
L8C5F: .byte ST_WRITE_BYTE ;Write a byte to zero page memory.
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L641-L642L8C50: .byte ST_REPEAT ;Load sub-state repeat.
L8C51: .byte $01 ;No repeat for this sub-state.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L685-L687;Index #$1E.
L8C6B: .byte ST_CHK_REPEAT ;Check if repeat counter is active.
L8C6C: .byte $24 ;Jump to index #$24 is repeat counter is active.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L5130-L5143ChkRepeatState:
LC7A7: DEC OppStRepeatCntr ;Decrement sub-state repeat counter.
LC7A9: BEQ ChkRepeatEnd ;Does state need to be repeated? If not, branch to exit.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L717-L752;Index #$32.
L8C7F: .byte ST_PNCH_ACTIVE ;Indicate a punch is active.
…
;Index #$36 - Punch landed.
L8C83: .byte ST_TIMER ;Load timer for this sub-state.
L8C84: .byte $04 ;This sub-state lasts 4 frames.
…
L8C85: .byte ST_SPRT_MV_NU+4 ;Move sprites. Sub-state lasts for 4 frames.
…
L8C8D: .byte ST_SPRT_MV_NU+15 ;Move sprites. Sub-state lasts for 15 frames.
…
;Index #$44.
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L710-L790L8C7F: .byte ST_PNCH_ACTIVE ;Indicate a punch is active.
L8C80: .byte $45 ;Index to jump to if punch was blocked.
L8C81: .byte $49 ;Index to jump to if punch was ducked.
L8C82: .byte $49 ;Index to jump to if punch was dodged.
…
L8C92: .byte ST_JUMP ;Jump to new state and index.
L8C93: .word GJStrtPunch ;Base address of new state.
L8C95: .byte $3B ;Index of new state.
…
L8C96: .byte ST_SPEC_TIMER ;Load a special timer value.
…
L8C97: .byte ST_CALL_FUNC ;Call state data subroutine
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L1078-L1081DefenseStats6:
L92B0: .byte ST_DEFENSE ;Load opponent's defense data from following 4 bytes.
L92B1: .byte $00, $00 ;Face punch defense values.
L92B3: .byte $00, $00 ;Stomach punch defense values.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L4938-L4941OppVarStTime:
LC6BD: LDA VariableStTime ;
LC6C0: STA OppStateTimer ;Set a varying amount of time for this opponent's state time.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L1100-L1113;Glass Joe Fight data. Loaded into $05A0 through $05FF.
…
L9325: .byte $04 ;Base damage if opponent lands a hit on Little Mac.Checked by claude, 2026-10-22 — read GJRighHook from its first byte to ST_WAIT_STATE, DefenseStats6, OppVarStTime, and Glass Joe's fight data at the pinned commit; counted the indexes from GJRighHook at $8C4DThe annotator's index comments drift near the end: the bytes he marks #$59, #$5B, and #$5C sit at offsets $55, $57, and $58, so the super-punch branch's target, $59, lands in the bytes he marks unused. The statement leaves out where that branch goes for that reason. The indexes $32, $36, $45, and $49 check out against the addresses. The defense values' meaning isn't commented, and the routine that turns a damage value into lost health hasn't been read.
Cited by: Attack pattern, Mike Tyson's Punch-Out!!
The NES Rev 1 cues a dodge by recoloring the opponent's outline. A script writes OppOutlineTimer with its high bit set; the main game loop calls SetOppOutlineClr, which then clears that bit, keeps the count, and writes the fight's dodge outline color into four sprite palette entries. Each later call counts the timer down, and at zero it writes the normal color back. Glass Joe's fight data gives palette values $26 for the dodge outline and $08 for the normal one, and his right hook sets the timer to $84, a count of 4 later calls (4 frames by the comment), before its variable wait and the punch. mike-tysons-punch-out/outline-tell
About: Mike Tyson's Punch-Out!! Telegraph
Value
{
"dodge_color": 38,
"normal_color": 8,
"glass_joe_right_hook_timer_calls": 4
}source_files/Mike_Tysons_Punchout_Defines.asm#L66.alias OppOutlineTimer $9C ;Timer for dodge indicator outline color. MSB set=set timer.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L4493-L4530SetOppOutlineClr:
LC440: LDA OppOutlineTimer ;Is outline color timer active?
LC442: BEQ OppOutlineEnd ;If not, branch to exit.
LC444: BMI SetOutlineTimer ;Does ouotline color timer need to be initialized? If so, branch.
LC446: DEC OppOutlineTimer ;Decrement outline color timer. Has timer expired?
LC448: BNE OppOutlineEnd ;If not, branch to exit.
LC44A: LDY #$01 ;Prepare to set normal outline color.
…
LC44E: AND #$7F ;Clear MSB to indicate timer is running.
LC450: STA OppOutlineTimer ;Set outline color timer.
LC452: LDY #$00 ;Prepare to set dodge indicator outline color.
…
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L725-L763MainGameEngine:
…
LA6C3: JSR SetOppOutlineClr ;($C440)Set opponent outline color.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L224.alias OppOutline $05EC ;Base address for determining the opponent's outline color.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L1139-L1140L9363: .byte $26 ;Opponent outline color when Little Mac should dodge.
L9364: .byte $08 ;Normal opponent outline color.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L677-L683L8C67: .byte ST_WRITE_BYTE ;Write a byte to zero page memory.
L8C68: .byte OppOutlineTimer ;Change opponent's outline color to indicate its time to dodge.
L8C69: .byte $84 ;Change outline color for 4 frames.
…
L8C6A: .byte ST_VAR_TIME ;Set sub-state time to a variable amount.Checked by claude, 2026-10-22 — read SetOppOutlineClr, its call in MainGameEngine, the OppOutline defines, Glass Joe's outline bytes, and the right hook's timer write at the pinned commit; located the outline bytes in the Rev 1 ROMThe labels on the two outline bytes are one off: the fight data copied to $05A0 puts $05EC at $9362, and the atlas read $26 and $08 at $9362 and $9363 of bank 0 in the ROM, which is what the labeled lines hold. In the NES palette $26 is a light red and $08 a dark olive. How long the dodge color shows in frames depends on how often the main loop runs, which hasn't been measured.
Cited by: Mike Tyson's Punch-Out!!, Telegraph
Little Mac's hearts in the NES Rev 1 are a two-digit decimal count. Glass Joe's fight data, in its comments, starts rounds 1, 2, and 3 at 20, 20, and 15 hearts, with normal recoveries of 15, 15, and 10 and reduced ones of 9, 9, and 5. The round setup routine, uncommented (it also loads the round's clock rate and starts the round timer), sets hearts to the table's value in round 1 and raises them to it in rounds 2 and 3 if they're lower, and it copies the two recovery values for the round. An uncommented routine at $843E takes hearts away, 1 or 3 at each of its six callers; when the count reaches zero or below it clears MacCanPunch, which the define reads as "Little Mac can't punch". mike-tysons-punch-out/hearts
About: Mike Tyson's Punch-Out!! Stamina
Value
{
"glass_joe_start": [
20,
20,
15
],
"normal_recovery": [
15,
15,
10
],
"reduced_recovery": [
9,
9,
5
],
"costs": [
1,
3
]
}source_files/PRG_Bank000.asm#L1100-L1112;Glass Joe Fight data. Loaded into $05A0 through $05FF.
…
L931C: .byte $20 ;Starting number of hearts, round 1(base 10).
L931D: .byte $15 ;Normal heart recovery, round 1(base 10).
L931E: .byte $09 ;Reduced heart recovery, round 1(base 10).
L931F: .byte $20 ;Starting number of hearts, round 2(base 10).
L9320: .byte $15 ;Normal heart recovery, round 2(base 10).
L9321: .byte $09 ;Reduced heart recovery, round 2(base 10).
L9322: .byte $15 ;Starting number of hearts, round 3(base 10).
L9323: .byte $10 ;Normal heart recovery, round 3(base 10).
L9324: .byte $05 ;Reduced heart recovery, round 3(base 10).Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L207.alias HeartTable $05A3 ;Table of heart values for this fight. (Indexing starts at 3)Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L2733-L2786LB5A9: LDA #$01
LB5AB: STA MacCanPunch
LB5AD: LDA RoundNumber
LB5AF: CMP #$04
LB5B1: BCC $B5B6
LB5B3: JMP $B621
LB5B6: ASL
LB5B7: ADC RoundNumber
LB5B9: TAX
LB5BA: CMP #$03
LB5BC: BEQ $B5CB
LB5BE: LDA HeartTable,X ;($05A3)
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank007.asm#L514-L535L843E: TAX
L843F: LDA CurHeartsLD
L8442: ORA CurHeartsUD
L8445: BEQ $849E
L8447: TXA
L8448: SEC
L8449: STA $E7
L844B: LDA CurHeartsLD
L844E: SBC $E7
L8450: BCS $8455
L8452: ADC #$0A
L8454: CLC
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank007.asm#L109-L110L80D1: LDA #$01
L80D3: JSR $843EMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank007.asm#L163-L164L8143: LDA #$03
L8145: JSR $843EMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L94.alias MacCanPunch $BC ;#$00=Little Mac can't punch, #$01=Little Mac can punch.Checked by claude, 2026-10-22 — read Glass Joe's heart bytes, the round setup at LB5A9 through LB623, the subtraction at L843E, and its six callers in bank 7 (two cited; the other four pass 3, 1, 1, 1) at the pinned commitRound 1 is index 3 of HeartTable, so X = 3 × round; with X = 3 the setup skips the comparison. Which actions cost 1 heart and which 3, and what the two recovery values are spent on, are in uncommented code the atlas hasn't traced. The other four callers are at bank 7 lines 191-192, 295-296, 325-326, and 352-353.
Cited by: Mike Tyson's Punch-Out!!, Stamina
The NES Rev 1 picks an opponent's next move with a second, uncommented script reader at $B196, run from the main game loop. While $38 is nonzero and OppCurState is 1 (the wait state, in the atlas's reading of the defines), it decrements $39 on each call and, when that reaches zero, reads a list of command bytes. In the atlas's reading of the code: 0n s sets OppCurState to s and $39 to n, the count of calls before the next command (n = 0 gives 256, as $39 wraps to $FF); 1n i jumps to list index i when n is greater than the low four bits of a random byte, n/16 of the time (computed), and always when n is 15; and 2n with eight state bytes after it sets $39 to n and starts one of the eight, chosen by the random byte's low three bits. The random byte is $18, which an uncommented routine at $85E9 in bank 7 sets to the sum of two scrambles: $ED, bits of FrameCounter moved to new positions, and $EC, moved bits of $19 with $19 AND $81 ORed in. $19 is a running total, kept from call to call, to which each call adds moved bits of Joy1Buttons. Two paths of the NMI handler call the routine, each right after it increments FrameCounter. $AEF1 rotates $18 three times after each read. Bytes from $80 up hold other commands, not read here. mike-tysons-punch-out/move-select
About: Mike Tyson's Punch-Out!! Attack pattern
CodeMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) ·source_files/PRG_BankDEF.asm#L725-L752MainGameEngine:
…
LA6A2: JSR $B196Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L2213-L2261LB196: LDA $38
LB198: BEQ $B1CD
LB19A: LDX OppCurState
LB19C: DEX
LB19D: BNE $B1CD
LB19F: DEC $39
LB1A1: BNE $B1CD
LB1A3: INC $39
LB1A5: LDY $3A
LB1A7: LDA ($3B),Y
LB1A9: AND #$0F
LB1AB: TAX
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L1731-L1745LAEAB: STA $EF
LAEAD: LDA #$0F
LAEAF: STA $EE
LAEB1: LDA $EF
LAEB3: CMP $EE
LAEB5: BEQ $AEC7
LAEB7: LDA $18
LAEB9: JSR $AEF1
LAEBC: AND $EE
LAEBE: STA $EE
LAEC0: LDA $EF
LAEC2: CMP $EE
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L1783-L1786LAEF1: ROR $18
LAEF3: ROR $18
LAEF5: ROR $18
LAEF7: RTSMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank007.asm#L725-L831L85E9: LDA FrameCounter ;($1E)
L85EB: ROR
L85EC: STA $E8
…
L85F5: AND #$08
L85F7: STA $ED
…
L8625: STA $ED
L8627: LDA Joy1Buttons
…
L865C: ORA $EC
L865E: CLC
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank007.asm#L12L8012: JMP $85E9Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L705-L710LA644: INC FrameCounter ;($1E)
…
LA64C: JSR PushPRGBank07 ;($AA3C)
LA64F: JSR $8012Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L802-L827LA6F8: INC FrameCounter ;($1E)
…
LA724: JSR PushPRGBank07 ;($AA3C)
LA727: JSR $8012Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L53.alias OppCurState $90 ;Opponent's current state. Set MSB=initialize new state.Checked by claude, 2026-10-22 — traced LB196 through LB1F2, the chance test at LAEAB, the rotate at LAEF1, and the build of $18 in bank 7 at the pinned commit; worked the carry cases of LAEAB by hand; traced every term of $ED, $EC, and $19 in L85E9-L86A6 and its two NMI callersLAEAB returns carry set when n > r (CMP) and clears it when n = r; with n = 15 it skips the draw and returns carry set. The 2n case adds 8 to the list index after the pick, so the list resumes after the eight bytes. Which list the reader starts on is set by uncommented code at $B10A from a table at $0500, loaded from the fight's data; the atlas hasn't traced it, so no opponent's list is decoded here. The nispio fork names $18 RNGValue and the bank 7 routine UpdateRNG.
Cited by: Attack pattern, Mike Tyson's Punch-Out!!
When KnockdownSts is 1 ("Opp down", per the define) in the NES Rev 1, uncommented code at $B2EB counts the knockdown in OppKDRound and OppKDFight, and at the third in a round it stops there. Otherwise, unless $BA held $FF, it reads one entry from the opponent's table at OppRefillPtr (its index set by conditions not traced here). An entry of 0 sets nothing. An entry whose upper nibble n is nonzero sets OppGetUpCount to $99 + n, which the define reads as a count of n. An entry whose upper nibble is 0 picks one of the eight entries of OppGetUpTable with three bits of the random byte $18; Glass Joe's eight read, by the comment's encoding, 2, 3, 4, 5, 6, 8, 3, and 4. mike-tysons-punch-out/opponent-getup
About: Mike Tyson's Punch-Out!! Knockdown
Value
{
"glass_joe_random_counts": [
2,
3,
4,
5,
6,
8,
3,
4
]
}source_files/PRG_BankDEF.asm#L2386-L2466LB2EB: LDX $05
LB2ED: DEX
LB2EE: BNE $B2E7
…
LB2FB: INC OppKDRound ;($03CA)
LB2FE: INC OppKDFight ;($03D1)
LB301: LDA OppKDRound ;($03CA)
LB304: CMP #$03
LB306: BEQ $B2E2
LB308: LDA #$00
LB30A: LDX $BA
LB30C: STA $BA
…Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_BankDEF.asm#L2380-L2385LB2E2: LDA #$00
LB2E4: STA $C0
LB2E6: RTS
…
LB2EA: RTSMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L14.alias KnockdownSts $05 ;Knockdown status #$01=Opp down, #$02=Mac downMike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/Mike_Tysons_Punchout_Defines.asm#L100.alias OppGetUpCount $C4 ;Count opponent will get up on. #$9A=1 through #$A2=9.Mike Tyson's Punch-Out!! (NES), partial disassembly (nmikstas) · source_files/PRG_Bank000.asm#L1134-L1135;Random opponent stand up times after knock down. #$9B=2 through #$A1=8.
L9356: .byte $9B, $9C, $9D, $9E, $9F, $A1, $9C, $9DChecked by claude, 2026-10-22 — read LB2FB through LB392, the exits at LB2E2 and LB2EA, the OppGetUpCount define, and Glass Joe's get-up bytes at the pinned commit; checked that $05E0 is offset $40 of the fight data, $9356$18 shifted right four times and once more leaves its top three bits, 0 to 7. The upper-nibble path stores n = 1, 7, or 9 in SpecialKD as well. The code before LB356 picks the table index from $03C9 (which upstream labels MacKDRound and the nispio fork renames OppRefillIndex), MacStatus, the round, and the clock; the atlas hasn't traced it. What the get-up count is compared against, the referee's count, is also untraced. Little Mac's own get-up, the button-mashing rule players know, is in uncommented code the atlas hasn't read.
Cited by: Knockdown, Mike Tyson's Punch-Out!!