.GetShipBlueprint 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 (XX0),Y ; Set A to the Y-th byte of the current ship blueprint ; Fall through into ResetBankA to retrieve the bank ; number we stored above and page it back into memoryName: GetShipBlueprint [Show more] Type: Subroutine Category: Drawing ships Summary: Fetch a specified byte from the current ship blueprintContext: See this subroutine in context in the source code References: This subroutine is called as follows: * HITCH calls GetShipBlueprint * Main flight loop (Part 8 of 16) calls GetShipBlueprint * Main flight loop (Part 12 of 16) calls GetShipBlueprint * MVEIT (Part 4 of 9) calls GetShipBlueprint * NWSHP calls GetShipBlueprint * SPIN calls GetShipBlueprint * TACTICS (Part 2 of 7) calls GetShipBlueprint * TACTICS (Part 4 of 7) calls GetShipBlueprint * TACTICS (Part 6 of 7) calls GetShipBlueprint
Arguments: Y The offset of the byte to return from the blueprint
Returns: A The Y-th byte of the current ship blueprint
[X]
Subroutine SetBank (category: Utility routines)
Page a specified ROM bank into memory at $8000
[X]
Temporary storage, used to store the address of a ship blueprint. For example, it is used when we add a new ship to the local bubble in routine NWSHP, and it contains the address of the current ship's blueprint as we loop through all the nearby ships in the main flight loop
[X]
Variable currentBank in workspace ZP
Contains the number of the ROM bank (0 to 6) that is currently paged into memory at $8000