Prev: $2E05 Up: Map Next: $2EE6
$2E13: Prepare for a new game or demo mode
Used by the routines at $2757 and $BE09.
$2E13 LDA #$78 Store $7860 (the base address of little boy no. 1's character buffer) at $50.
$2E15 STA $51
$2E17 LDA #$60
$2E19 STA $50
$2E1B LDX #$00 X will be used to index the table of initial animatory states at $4900.
$2E1D LDY #$00 Y will be used to index the character's buffer.
$2E1F LDA $4900,X Pick up the character's initial animatory state from the table at $4900.
$2E22 STA ($50),Y Store it in the character's buffer.
$2E24 INC $51 Next character buffer.
$2E26 INX Next initial animatory state.
$2E27 CPX #$15 Have we initialised every character's animatory state yet?
$2E29 BNE $2E1F Branch back if not.
$2E2B INY Point at the second byte of the character buffers.
$2E2C LDX #$00 Reset X to 0.
$2E2E LDA #$78 Reset the address at $50 to that of the little boy no. 1's character buffer.
$2E30 STA $51
$2E32 LDA $4A00,X Pick up the character's initial x-coordinate from the table at $4A00.
$2E35 STA ($50),Y Store it in the character's buffer.
$2E37 INC $51 Next character buffer.
$2E39 INX Next initial x-coordinate.
$2E3A CPX #$15 Have we initialised every character's x-coordinate yet?
$2E3C BNE $2E32 Branch back if not.
$2E3E LDX #$00 Reset X to 0.
$2E40 LDY #$02 Point at the third byte of the character buffers.
$2E42 LDA #$78 Reset the address at $50 to that of the little boy no. 1's character buffer.
$2E44 STA $51
$2E46 LDA #$11 Every character starts at y-coordinate 17 (on the bottom floor).
$2E48 STA ($50),Y Set the character's y-coordinate.
$2E4A INC $51 Next character buffer.
$2E4C INX Increment the character counter.
$2E4D CPX #$15 Have we initialised every character's y-coordinate yet?
$2E4F BNE $2E48 Branch back if not.
$2E51 LDA $7D Pick up the MSB of the score from $7D.
$2E53 CMP $F8 Compare it with the MSB of the hi-score.
$2E55 BEQ $2E5B Branch if they're equal.
$2E57 BCS $2E61 Branch if we have a new hi-score.
$2E59 BNE $2E69 This branch is always made (no new hi-score).
$2E5B LDA $7C Pick up the LSB of the score from $7C.
$2E5D CMP $F7 Compare it with the MSB of the hi-score.
$2E5F BCC $2E69 Branch unless we have a new hi-score.
$2E61 LDA $7D Copy the current score from $7C into the hi-score at at $F7.
$2E63 STA $F8
$2E65 LDA $7C
$2E67 STA $F7
$2E69 LDA #$00 Set the current character number at $60 to $00 (little boy no. 1).
$2E6B STA $60
$2E6D STA $7C Reset the score to 0.
$2E6F STA $7D
$2E71 STA $7E Reset the lines total to 0.
$2E73 STA $7F
$2E75 JSR $2AAA Set MR CREAK's birth year.
$2E78 JSR $292F Generate a safe combination code.
$2E7B JSR $2F20 Draw the Skool Daze logo.
$2E7E JSR $2F56 Draw the score box.
$2E81 LDA $F8 Pick up the MSB of the hi-score.
$2E83 BNE $2E8C Branch unless it's zero.
$2E85 LDA $F7 Pick up the LSB of the hi-score.
$2E87 BNE $2E8C Branch unless it's zero.
$2E89 JMP $2E95 Skip printing the hi-score if it's zero.
$2E8C LDA #$F7 Store the LSB of the address of the hi-score at $4E.
$2E8E STA $4E
$2E90 LDA #$02 A=2, indicating the hi-score.
$2E92 JSR $2620 Print the hi-score.
$2E95 JSR $3279 Copy a character's buffer into page 0.
$2E98 LDA #$00 Remove the address of any primary command routine from the character's buffer.
$2E9A STA $2A
$2E9C STA $B1 Remove the address of any uninterruptible subcommand routine from the character's buffer.
$2E9E STA $AB Remove the address of any interruptible subcommand routine from the character's buffer.
$2EA0 STA $3A Remove the address of any continual subcommand routine from the character's buffer.
$2EA2 STA $3B Remove the address reached in the command list from the character's buffer.
$2EA4 STA $3C
$2EA6 STA $3D Remove the address of the command list from the character's buffer.
$2EA8 STA $3E
$2EAA STA $A6 Zero out the remainder of the character's buffer.
$2EAC STA $A7
$2EAE STA $A8
$2EB0 STA $A9
$2EB2 STA $AC
$2EB4 STA $AD
$2EB6 STA $AE
$2EB8 STA $AF
$2EBA STA $B2
$2EBC STA $B3
$2EBE STA $B4
$2EC0 STA $B5
$2EC2 JSR $33BF Restore the character's buffer from page 0.
$2EC5 INC $60 Increment the current character number at $60.
$2EC7 LDA $60 Pick up the current character number from $60.
$2EC9 CMP #$12 Have we initialised the character buffer of every boy (except ERIC) and teacher?
$2ECB BNE $2E95 Branch back if not.
$2ECD LDA #$58 Prepare to address the shield locations and status table at $58E0.
$2ECF STA $51
$2ED1 LDA #$E0
$2ED3 STA $50
$2ED5 LDY #$02 Initialise the shields.
$2ED7 LDA #$00
$2ED9 STA ($50),Y
$2EDB INY
$2EDC INY
$2EDD INY
$2EDE CPY #$2D
$2EE0 BCC $2ED9
$2EE2 JSR $2D47 Initialise the game status buffer.
$2EE5 RTS
Prev: $2E05 Up: Map Next: $2EE6