.GetDefaultNEWB LDA currentBank ; Fetch the number of the ROM bank that is currently PHA ; paged into memory at $8000 and store it on the stack LDA #1 ; Page ROM bank 1 into memory at $8000 JSR SetBank LDA E%-1,Y ; Set A to the default NEWB flags for ship type Y JMP ResetBankA ; Jump to ResetBankA to retrieve the bank number we ; stored above and page it back into memory, returning ; from the subroutine using a tail callName: GetDefaultNEWB [Show more] Type: Subroutine Category: Drawing ships Summary: Fetch the default NEWB flags for a specified ship typeContext: See this subroutine in context in the source code References: This subroutine is called as follows: * NWSHP calls GetDefaultNEWB * TACTICS (Part 4 of 7) calls GetDefaultNEWB
Arguments: Y The ship type
Returns: A The default NEWB flags for ship type Y
[X]
Variable E% (category: Drawing ships)
Ship blueprints default NEWB flags
[X]
Subroutine ResetBankA (category: Utility routines)
Page a specified bank into memory at $8000 while preserving the value of A
[X]
Subroutine SetBank (category: Utility routines)
Page a specified ROM bank into memory at $8000
[X]
Variable currentBank in workspace ZP
Contains the number of the ROM bank (0 to 6) that is currently paged into memory at $8000