.UpdateIconBar_b3 LDA currentBank ; If ROM bank 3 is already paged into memory, jump to CMP #3 ; bank20 BEQ bank20 PHA ; Otherwise store the current bank number on the stack LDA #3 ; Page ROM bank 3 into memory at $8000 JSR SetBank JSR UpdateIconBar ; Call UpdateIconBar, now that it is paged into memory JMP ResetBank ; Fetch the previous ROM bank number from the stack and ; page that bank back into memory at $8000, returning ; from the subroutine using a tail call .bank20 JMP UpdateIconBar ; Call UpdateIconBar, which is already paged into ; memory, and return from the subroutine using a tail ; callName: UpdateIconBar_b3 [Show more] Type: Subroutine Category: Icon bar Summary: Call the UpdateIconBar routine in ROM bank 3 Deep dive: Splitting NES Elite across multiple ROM banksContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ABORT2 calls UpdateIconBar_b3 * DrawScrollText calls UpdateIconBar_b3 * ESCAPE calls UpdateIconBar_b3 * Ghy calls UpdateIconBar_b3 * hyp1 calls UpdateIconBar_b3 * KS4 calls UpdateIconBar_b3 * Main flight loop (Part 3 of 16) calls UpdateIconBar_b3 * Main flight loop (Part 13 of 16) calls UpdateIconBar_b3 * Main game loop (Part 5 of 6) calls UpdateIconBar_b3 * MJP calls UpdateIconBar_b3 * MoveInMiddleColumn calls UpdateIconBar_b3 * NWSPS calls UpdateIconBar_b3 * OUCH calls UpdateIconBar_b3 * PauseGame calls UpdateIconBar_b3 * PlayDemo calls UpdateIconBar_b3 * SetSelectionFlags calls UpdateIconBar_b3 * TT16 calls UpdateIconBar_b3 * wW calls UpdateIconBar_b3
[X]
Subroutine ResetBank (category: Utility routines)
Retrieve a ROM bank number from the stack and page that bank into memory at $8000
[X]
Subroutine SetBank (category: Utility routines)
Page a specified ROM bank into memory at $8000
[X]
Subroutine UpdateIconBar (category: Icon bar)
Update the icon bar
[X]
Label bank20 is local to this routine
[X]
Variable currentBank in workspace ZP
Contains the number of the ROM bank (0 to 6) that is currently paged into memory at $8000