Routines |
Prev: $3047 | Up: Map | Next: $3113 |
Used by the routine at $35EF.
|
||||
$3072 | SEI | Disable interrupts. | ||
$3073 | LDA $58 | Pick up the x-coordinate of the leftmost column of the skool on screen from $58. | ||
$3075 | CMP #$08 | Is it 8 or more? | ||
$3077 | BCS $307C | Branch if so. | ||
$3079 | JMP $3111 | Otherwise return now. | ||
$307C | LDA #$08 | Set the destination colour information index at $55 to 8. | ||
$307E | STA $55 | |||
$3080 | LDA #$00 | Set the source colour information index at $54 to 0. | ||
$3082 | STA $54 | |||
$3084 | LDA #$F8 | Store $E0F8 at $5A. This screen bitmap address corresponds to the 32nd tile from the left in the top row of the screen. | ||
$3086 | STA $5A | |||
$3088 | LDA #$E0 | |||
$308A | STA $5B | |||
$308C | LDA #$1F | Store $CC1F at $5C. This colour information address corresponds to the 32nd tile from the left in the top row of the screen. | ||
$308E | STA $5C | |||
$3090 | LDA #$CC | |||
$3092 | STA $5D | |||
$3094 | LDX #$20 | Initialise the column counter in X. | ||
$3096 | DEX | Decrement the column counter in X. | ||
$3097 | TXA | Save the column counter on the stack temporarily. | ||
$3098 | PHA | |||
$3099 | LDA $5A | Copy the screen bitmap address from $5A to $4E. This will be the source address. | ||
$309B | STA $4E | |||
$309D | LDA $5B | |||
$309F | STA $4F | |||
$30A1 | LDA $5C | Copy the colour information address from $5C to $50. This will be the source address. | ||
$30A3 | STA $50 | |||
$30A5 | LDA $5D | |||
$30A7 | STA $51 | |||
$30A9 | LDA $4E | Copy the screen bitmap address from $4E to $52. | ||
$30AB | STA $52 | |||
$30AD | LDA $4F | |||
$30AF | STA $53 | |||
$30B1 | LDA $52 | Add 64 to the screen bitmap address at $52. This corresponds to the tile that is 8 cells to the right in the same row, and will be the destination address. | ||
$30B3 | CLC | |||
$30B4 | ADC #$40 | |||
$30B6 | BCC $30BA | |||
$30B8 | INC $53 | |||
$30BA | STA $52 | |||
$30BC | JSR $2FB6 | Move a column of screen tiles right. | ||
$30BF | LDA $5A | Subtract 8 from the screen bitmap address at $5A. This corresponds to the next tile to the left in the top row of the screen. | ||
$30C1 | CLC | |||
$30C2 | ADC #$F8 | |||
$30C4 | CMP #$F8 | |||
$30C6 | BNE $30CA | |||
$30C8 | DEC $5B | |||
$30CA | STA $5A | |||
$30CC | DEC $5C | Subtract 1 from the colour information address at $5C. This corresponds to the next tile to the left in the top row of the screen. | ||
$30CE | PLA | Restore the column counter to X. | ||
$30CF | TAX | |||
$30D0 | BNE $3096 | Branch back to deal with the remaining columns. | ||
The 32 leftmost columns of the skool on screen have been shifted right. Time to draw the leftmost 8 columns of the skool.
|
||||
$30D2 | LDA #$38 | Store $E038 at $5A. This screen bitmap address corresponds to the 8th tile from the left in the top row of the screen. | ||
$30D4 | STA $5A | |||
$30D6 | LDA #$E0 | |||
$30D8 | STA $5B | |||
$30DA | LDA #$07 | Update the colour information address at $5C to $CC07. This corresponds to the 8th tile from the left in the top row of the screen. | ||
$30DC | STA $5C | |||
$30DE | JSR $9868 | Move sprites #1-#6 right by 64 pixels. | ||
$30E1 | NOP | |||
$30E2 | LDX #$08 | There are 8 new play area columns to draw in the gap left by the shifting window. | ||
$30E4 | TXA | Save this column counter temporarily. | ||
$30E5 | PHA | |||
$30E6 | DEC $58 | Decrement the x-coordinates of the leftmost column of the skool on screen and off. | ||
$30E8 | DEC $59 | |||
$30EA | LDY $58 | Pick up the x-coordinate of the leftmost column of the skool on screen. | ||
$30EC | LDA $5A | Save the screen bitmap address on the stack. | ||
$30EE | PHA | |||
$30EF | LDA $5B | |||
$30F1 | PHA | |||
$30F2 | LDA $5C | Save the colour information address on the stack. | ||
$30F4 | PHA | |||
$30F5 | LDA $5D | |||
$30F7 | PHA | |||
$30F8 | JSR $2F8C | Print the play area tiles in a single column of the screen. | ||
$30FB | PLA | Restore the saved colour information address to $5C. | ||
$30FC | STA $5D | |||
$30FE | PLA | |||
$30FF | STA $5C | |||
$3101 | PLA | Restore the saved screen bitmap address to $5A and subtract 8 from it. This points at the next tile to the left in the top row of the screen. | ||
$3102 | STA $5B | |||
$3104 | PLA | |||
$3105 | SEC | |||
$3106 | SBC #$08 | |||
$3108 | STA $5A | |||
$310A | DEC $5C | Subtract 1 from the colour information address at $5C. This points at the next tile to the left in the top row of the screen. | ||
$310C | PLA | Restore the column counter to X. | ||
$310D | TAX | |||
$310E | DEX | Decrement the column counter. | ||
$310F | BNE $30E4 | Branch back to deal with the remaining columns. | ||
$3111 | CLI | Re-enable interrupts. | ||
$3112 | RTS |
Prev: $3047 | Up: Map | Next: $3113 |