junglejourney

changeset 130:ae6589e0aeca

Moved sprites and other data up in memory to make more room for code.
author David Boddie <david@boddie.org.uk>
date Sat Sep 10 14:28:21 2011 +0200
parents 2b2356e96c0f
children 3e3d7f4df570
files TODO.txt build.py loader.oph mapcode.oph
diffstat 4 files changed, 221 insertions(+), 217 deletions(-) [+]
line diff
     1.1 --- a/TODO.txt	Sat Sep 10 13:52:24 2011 +0200
     1.2 +++ b/TODO.txt	Sat Sep 10 14:28:21 2011 +0200
     1.3 @@ -1,5 +1,6 @@
     1.4  To Do
     1.5  
     1.6 +Fix space insertion in the high score entry screen caused by faulty y checks.
     1.7  Improve the fire, explosion and player sprites.
     1.8  Add sounds.
     1.9  Nice to have: analogue joystick support.
     2.1 --- a/build.py	Sat Sep 10 13:52:24 2011 +0200
     2.2 +++ b/build.py	Sat Sep 10 14:28:21 2011 +0200
     2.3 @@ -53,7 +53,7 @@
     2.4      # 1780 title screen
     2.5      # 1F00 CODE
     2.6      #
     2.7 -    # 3E00 CHARS (character sprites)
     2.8 +    # 3F00 CHARS (character sprites)
     2.9      #       4 * 2 * 0x30 (player movement)
    2.10      #           4 * 0x30 (player demise)
    2.11      #       4 * 2 * 0x10 (projectile)
    2.12 @@ -65,16 +65,16 @@
    2.13      #           2 * 0x60 (exit)             4500
    2.14      #           2 * 0x60 (final exit)
    2.15      #
    2.16 -    # 4*2*0x30 + 4*0x30 + 4*2*0x10 + 5*4*2*0x40 + 4*0x40 + 4*0x40 + 4*0x40 + 5*0x40 + 2*0x60 + 2*0x60 + 0x3e00
    2.17 +    # 4*2*0x30 + 4*0x30 + 4*2*0x10 + 5*4*2*0x40 + 4*0x40 + 4*0x40 + 4*0x40 + 5*0x40 + 2*0x60 + 2*0x60 + 0x3f00
    2.18      #
    2.19 -    # 5080 high scores (8 * 12 = 0xe0)
    2.20 +    # 5180 high scores (8 * 12 = 0xe0)
    2.21      #   n   3 bytes score + 9 bytes ASCII
    2.22      #
    2.23 -    # 5100 objects/treasure table (121 entries)
    2.24 +    # 5200 objects/treasure table (121 entries)
    2.25      #   n   type
    2.26      #
    2.27 -    # 5179 space
    2.28 -    # 5180 character table (0x24/6 = 6 entries + 1 special entry)
    2.29 +    # 5279 space
    2.30 +    # 5280 character table (0x24/6 = 6 entries + 1 special entry)
    2.31      #   n   type (0 missing, 1 player, 2 projectile, 3 explosion,
    2.32      #             4 item,
    2.33      #             8 and higher enemy - bits 4,5,6 are enemy type)
    2.34 @@ -97,20 +97,23 @@
    2.35      #   second character is always the player's weapon
    2.36      #   new characters are added after these
    2.37      #
    2.38 -    # 5200 plot buffer (alternate unplot/plot entries terminating in 255)
    2.39 +    # 5300 plot buffer (alternate unplot/plot entries terminating in 255)
    2.40      #   n       type
    2.41      #   n+1,n+2 source address
    2.42      #   n+3,n+4 destination address
    2.43      #
    2.44 -    #   5200 and every 12 bytes is unplot entries
    2.45 -    #   5206 and every 12 bytes is plot entries
    2.46 +    #   5300 and every 12 bytes is unplot entries
    2.47 +    #   5306 and every 12 bytes is plot entries
    2.48      #
    2.49 -    # 52C0 space (assuming 8 unplot and 8 plot operations)
    2.50 -    # 5300 SPRITES (map)
    2.51 +    # 53C0 space (assuming 8 unplot and 8 plot operations)
    2.52 +    #
    2.53 +    # 5400 SPRITES (map)
    2.54      #   3 * (1 * 0x60 (flowers)
    2.55      #        1 * 0x60 (tree)
    2.56      #        1 * 0x60 (tree))
    2.57      #
    2.58 +    # 5760 space
    2.59 +    #
    2.60      # 5780 item/player flags (128=leave level, 64=player demise,
    2.61      #                         bits 4,5,6=enemy limit, 2=complete game,
    2.62      #                         1=has key)
    2.63 @@ -142,7 +145,7 @@
    2.64      
    2.65      system("ophis loader.oph JUNGLE")
    2.66      code = open("JUNGLE").read()
    2.67 -    code_start = 0x5100
    2.68 +    code_start = 0x5200
    2.69      files.append(("JUNGLE", code_start, code_start, code))
    2.70      
    2.71      data = makesprites.read_sprites([makesprites.title])
    2.72 @@ -153,10 +156,10 @@
    2.73      files.append(("TITLE", 0x5A80, 0x5A80, data))
    2.74  
    2.75      data = makesprites.read_sprites(makesprites.tiles)
    2.76 -    files.append(("SPRITES", 0x5300, 0x5300, data))
    2.77 +    files.append(("SPRITES", 0x5400, 0x5400, data))
    2.78      
    2.79      data = makesprites.read_sprites(makesprites.chars)
    2.80 -    files.append(("CHARS", 0x3400, 0x3400, data))
    2.81 +    files.append(("CHARS", 0x3f00, 0x3f00, data))
    2.82  
    2.83      system("ophis mapcode.oph CODE")
    2.84      code = open("CODE").read()
     3.1 --- a/loader.oph	Sat Sep 10 13:52:24 2011 +0200
     3.2 +++ b/loader.oph	Sat Sep 10 14:28:21 2011 +0200
     3.3 @@ -1,4 +1,4 @@
     3.4 -.org $5100
     3.5 +.org $5200
     3.6  
     3.7  init:
     3.8      lda #22         ; MODE 5
     3.9 @@ -74,16 +74,16 @@
    3.10  code_file_name: .byte "CODE", 13
    3.11  
    3.12  sprites_block: .byte <sprites_file_name, >sprites_file_name
    3.13 -               .byte 0, $53, 0, 0
    3.14 -               .byte 0, $53, 0, 0
    3.15 +               .byte 0, $54, 0, 0
    3.16 +               .byte 0, $54, 0, 0
    3.17                 .byte $60, $03, 0, 0
    3.18 -               .byte $60, $56, 0, 0
    3.19 +               .byte $60, $57, 0, 0
    3.20  
    3.21  chars_block: .byte <chars_file_name, >chars_file_name
    3.22 -               .byte $00, $3e, 0, 0
    3.23 -               .byte $00, $3e, 0, 0
    3.24 +               .byte $00, $3f, 0, 0
    3.25 +               .byte $00, $3f, 0, 0
    3.26                 .byte $80, $12, 0, 0
    3.27 -               .byte $80, $50, 0, 0
    3.28 +               .byte $80, $51, 0, 0
    3.29  
    3.30  title_block: .byte <title_file_name, >title_file_name
    3.31                 .byte $80, $5a, 0, 0
     4.1 --- a/mapcode.oph	Sat Sep 10 13:52:24 2011 +0200
     4.2 +++ b/mapcode.oph	Sat Sep 10 14:28:21 2011 +0200
     4.3 @@ -490,21 +490,21 @@
     4.4      adc $79
     4.5      tax
     4.6  
     4.7 -    lda $5100,x
     4.8 +    lda $5200,x
     4.9      ora #$80
    4.10 -    sta $5100,x         ; set the top bit (room visited)
    4.11 +    sta $5200,x         ; set the top bit (room visited)
    4.12      and #$7f            ; mask off the top bit to obtain the item number + 1
    4.13      cmp #0
    4.14      beq add_treasure_exit
    4.15  
    4.16      sec
    4.17      sbc #1
    4.18 -    sta $518d           ; store weapon/treasure type
    4.19 +    sta $528d           ; store weapon/treasure type
    4.20      clc
    4.21  
    4.22      lda $78
    4.23      eor $79
    4.24 -    adc $518d
    4.25 +    adc $528d
    4.26      and #15
    4.27      sta $70
    4.28  
    4.29 @@ -538,19 +538,19 @@
    4.30          bne add_treasure_loop_next
    4.31  
    4.32          lda #4              ; type (weapon/treasure)
    4.33 -        sta $518c
    4.34 +        sta $528c
    4.35          lda $8d             ; y
    4.36 -        sta $518e
    4.37 +        sta $528e
    4.38          lda #1              ; dy
    4.39 -        sta $518f
    4.40 +        sta $528f
    4.41          lda $8e             ; x
    4.42 -        sta $5190
    4.43 +        sta $5290
    4.44          lda #0              ; dx
    4.45 -        sta $5191
    4.46 +        sta $5291
    4.47  
    4.48          lda #$8c
    4.49          sta $74
    4.50 -        lda #$51
    4.51 +        lda #$52
    4.52          sta $75
    4.53          jmp plot_character  ; optimise away the rts
    4.54  
    4.55 @@ -789,7 +789,7 @@
    4.56      rts
    4.57  
    4.58  tile_addresses_low:  .byte $00, $60, $c0, $00, $60, $c0, $20
    4.59 -tile_addresses_high: .byte $53, $53, $53, $4f, $4f, $4f, $50
    4.60 +tile_addresses_high: .byte $54, $54, $54, $50, $50, $50, $51
    4.61  
    4.62  plot_tile:          ; $7b=tile number
    4.63                      ;   1 = flowers/decoration
    4.64 @@ -1309,7 +1309,7 @@
    4.65      rts
    4.66  
    4.67  player_direction_chars_low: .byte $00,$30,$60,$90,$c0,$f0,$20,$50, $80,$b0,$e0,$10
    4.68 -player_direction_chars_high: .byte $3e,$3e,$3e,$3e,$3e,$3e,$3f,$3f, $3f,$3f,$3f,$40
    4.69 +player_direction_chars_high: .byte $3f,$3f,$3f,$3f,$3f,$3f,$40,$40, $40,$40,$40,$41
    4.70  
    4.71  screen_rows_low: .byte $80,$40,$00,$c0,$80,$40,$00,$c0,$80,$40
    4.72  screen_rows_high: .byte $5a,$5e,$62,$65,$69,$6d,$71,$74,$78,$7c
    4.73 @@ -1321,13 +1321,13 @@
    4.74  screen_subcolumns_low: .byte $00,$08,$10,$18
    4.75  
    4.76  enemy_direction_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    4.77 -enemy_direction_chars_high: .byte $40,$41,$41,$41,$41,$42,$42,$42
    4.78 +enemy_direction_chars_high: .byte $41,$42,$42,$42,$42,$43,$43,$43
    4.79  
    4.80  emerge_explode_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$00,$00
    4.81 -emerge_explode_chars_high: .byte $4a,$4b,$4b,$4b,$4b,$4c,$4c,$4c
    4.82 +emerge_explode_chars_high: .byte $4b,$4c,$4c,$4c,$4c,$4d,$4d,$4d
    4.83  
    4.84  item_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80,$c0
    4.85 -item_chars_high: .byte $4c,$4d,$4d,$4d,$4d,$4e,$4e,$4e,$4e
    4.86 +item_chars_high: .byte $4d,$4e,$4e,$4e,$4e,$4f,$4f,$4f,$4f
    4.87  
    4.88  projectile_chars_low: .byte $40,$50,$60,$70,$80,$90,$a0,$b0
    4.89  
    4.90 @@ -1459,7 +1459,7 @@
    4.91      tax
    4.92      lda projectile_chars_low,x
    4.93      sta $70
    4.94 -    lda #$40
    4.95 +    lda #$41
    4.96      sta $71
    4.97  
    4.98      ; Use the dy value to determine which plotting routine to use.
    4.99 @@ -1593,7 +1593,7 @@
   4.100  reset_plot_buffer:
   4.101      lda #$06    ; reset the index into the plot buffer
   4.102      sta $84
   4.103 -    lda #$52
   4.104 +    lda #$53
   4.105      sta $85
   4.106  
   4.107      lda #255    ; terminate the plot list
   4.108 @@ -1604,7 +1604,7 @@
   4.109  reset_unplot_buffer:
   4.110      lda #$00    ; reset the index into the plot buffer
   4.111      sta $82
   4.112 -    lda #$52
   4.113 +    lda #$53
   4.114      sta $83
   4.115  
   4.116      lda #255    ; terminate the unplot list
   4.117 @@ -1619,7 +1619,7 @@
   4.118  
   4.119      lda #$00
   4.120      sta $84
   4.121 -    lda #$52
   4.122 +    lda #$53
   4.123      sta $85
   4.124  
   4.125      lda #6
   4.126 @@ -1688,10 +1688,10 @@
   4.127  
   4.128      ; Set the direction and toggle the animation bit.
   4.129  
   4.130 -    lda $5181
   4.131 +    lda $5281
   4.132      and #1
   4.133      eor #1      ; toggle animation flag
   4.134 -    sta $5181   ; left (directional bits are 0)
   4.135 +    sta $5281   ; left (directional bits are 0)
   4.136  
   4.137      jsr plot_character
   4.138      rts
   4.139 @@ -1700,11 +1700,11 @@
   4.140  
   4.141      ; Set the direction and toggle the animation bit.
   4.142  
   4.143 -    lda $5181
   4.144 +    lda $5281
   4.145      and #1      ; remove direction information (result is 0)
   4.146      eor #1      ; toggle animation flag
   4.147      ora #2      ; right
   4.148 -    sta $5181
   4.149 +    sta $5281
   4.150  
   4.151      jsr plot_character
   4.152      rts
   4.153 @@ -1713,11 +1713,11 @@
   4.154  
   4.155      ; Set the direction and toggle the animation bit.
   4.156  
   4.157 -    lda $5181
   4.158 +    lda $5281
   4.159      and #1      ; remove direction information (result is 0)
   4.160      eor #1      ; toggle animation flag
   4.161      ora #4      ; up
   4.162 -    sta $5181
   4.163 +    sta $5281
   4.164  
   4.165      jsr plot_character
   4.166      rts
   4.167 @@ -1726,11 +1726,11 @@
   4.168  
   4.169      ; Set the direction and toggle the animation bit.
   4.170  
   4.171 -    lda $5181
   4.172 +    lda $5281
   4.173      and #1      ; remove direction information (result is 0)
   4.174      eor #1      ; toggle animation flag
   4.175      ora #6      ; down
   4.176 -    sta $5181
   4.177 +    sta $5281
   4.178  
   4.179      jsr plot_character
   4.180      rts
   4.181 @@ -1748,7 +1748,7 @@
   4.182  
   4.183      lda #$80    ; set up the address of the player character
   4.184      sta $74
   4.185 -    lda #$51
   4.186 +    lda #$52
   4.187      sta $75
   4.188  
   4.189      ; Handle the left key.
   4.190 @@ -1758,25 +1758,25 @@
   4.191      cpy #255
   4.192      bne move_player_not_left_key
   4.193  
   4.194 -    lda $5185           ; read dx
   4.195 +    lda $5285           ; read dx
   4.196      cmp #0
   4.197      beq move_player_left_check_x
   4.198  
   4.199      jsr unplot_character        ; unplot the player character
   4.200 -    dec $5185
   4.201 +    dec $5285
   4.202      clc
   4.203      jmp animate_player_left ; optimise away the rts
   4.204      
   4.205      move_player_left_check_x:   ; Check the x offset.
   4.206  
   4.207 -    lda $5184
   4.208 +    lda $5284
   4.209      cmp #0
   4.210      beq move_player_leave_room_left
   4.211  
   4.212      clc
   4.213      tay
   4.214      dey                         ; x - 1
   4.215 -    lda $5182                   ; load the y offset
   4.216 +    lda $5282                   ; load the y offset
   4.217      tax                         ; as an index
   4.218      lda room_row_offsets_low,x  ; read the address of the row
   4.219      sta $70
   4.220 @@ -1792,7 +1792,7 @@
   4.221      cmp #0
   4.222      bne move_player_not_left_key
   4.223  
   4.224 -    lda $5183               ; dy
   4.225 +    lda $5283               ; dy
   4.226      cmp #0
   4.227      beq move_player_allow_left
   4.228  
   4.229 @@ -1815,9 +1815,9 @@
   4.230      sta $81                 ; temporary
   4.231      jsr unplot_character    ; unplot the player character
   4.232      lda $81
   4.233 -    sta $5184               ; store the new room x offset
   4.234 +    sta $5284               ; store the new room x offset
   4.235      lda #3
   4.236 -    sta $5185               ; dx = 3
   4.237 +    sta $5285               ; dx = 3
   4.238      clc
   4.239      jmp animate_player_left ; optimise away the rts
   4.240  
   4.241 @@ -1833,9 +1833,9 @@
   4.242      ; No need to unplot.
   4.243  
   4.244      lda #9      ; x = 9
   4.245 -    sta $5184
   4.246 +    sta $5284
   4.247      lda #2      ; dx = 2
   4.248 -    sta $5185
   4.249 +    sta $5285
   4.250  
   4.251      jsr animate_player_left
   4.252      sec                     ; indicate to the calling routine that the player
   4.253 @@ -1852,27 +1852,27 @@
   4.254      jmp move_player_not_right_key
   4.255  
   4.256      move_player_right_key:
   4.257 -    lda $5185                   ; read dx
   4.258 +    lda $5285                   ; read dx
   4.259      cmp #2
   4.260      beq move_player_right_check_x
   4.261      cmp #3
   4.262      beq move_player_right_tile
   4.263  
   4.264      jsr unplot_character        ; unplot the player character
   4.265 -    inc $5185
   4.266 +    inc $5285
   4.267      clc
   4.268      jmp animate_player_right    ; optimise away the rts
   4.269      
   4.270      move_player_right_check_x:  ; Check the x offset.
   4.271  
   4.272 -    lda $5184
   4.273 +    lda $5284
   4.274      cmp #9
   4.275      beq move_player_leave_room_right
   4.276  
   4.277      clc
   4.278      tay
   4.279      iny                         ; x + 1
   4.280 -    lda $5182                   ; load the y offset
   4.281 +    lda $5282                   ; load the y offset
   4.282      tax                         ; as an index
   4.283      lda room_row_offsets_low,x  ; read the address of the row
   4.284      sta $70
   4.285 @@ -1888,7 +1888,7 @@
   4.286      cmp #0
   4.287      bne move_player_not_right_key
   4.288  
   4.289 -    lda $5183                   ; dy
   4.290 +    lda $5283                   ; dy
   4.291      cmp #0
   4.292      beq move_player_allow_right
   4.293  
   4.294 @@ -1909,16 +1909,16 @@
   4.295      move_player_allow_right:
   4.296  
   4.297      jsr unplot_character        ; unplot the player character
   4.298 -    inc $5185                   ; update dx
   4.299 +    inc $5285                   ; update dx
   4.300      clc
   4.301      jmp animate_player_right    ; optimise away the rts
   4.302  
   4.303      move_player_right_tile:
   4.304  
   4.305      jsr unplot_character    ; unplot the player character
   4.306 -    inc $5184               ; store the new room x offset
   4.307 +    inc $5284               ; store the new room x offset
   4.308      lda #0
   4.309 -    sta $5185               ; dx = 0
   4.310 +    sta $5285               ; dx = 0
   4.311      clc
   4.312      jmp animate_player_right ; optimise away the rts
   4.313  
   4.314 @@ -1932,9 +1932,9 @@
   4.315      ; No need to unplot.
   4.316  
   4.317      lda #0      ; x = 0
   4.318 -    sta $5184
   4.319 +    sta $5284
   4.320      lda #0      ; dx = 0
   4.321 -    sta $5185
   4.322 +    sta $5285
   4.323  
   4.324      jsr animate_player_right    
   4.325      sec                         ; indicate to the calling routine that the
   4.326 @@ -1949,24 +1949,24 @@
   4.327      cpy #255
   4.328      bne move_player_not_up_key
   4.329  
   4.330 -    lda $5183           ; read dy
   4.331 +    lda $5283           ; read dy
   4.332      cmp #0
   4.333      beq move_player_up_check_y
   4.334  
   4.335      jsr unplot_character        ; unplot the player character
   4.336 -    dec $5183
   4.337 +    dec $5283
   4.338      clc
   4.339      jmp animate_player_up       ; optimise away the rts
   4.340      
   4.341      move_player_up_check_y:     ; Check the y offset.
   4.342  
   4.343 -    lda $5182
   4.344 +    lda $5282
   4.345      cmp #0
   4.346      beq move_player_leave_room_up
   4.347  
   4.348      tax                         ; use the y offset as an index
   4.349      dex                         ; y - 1
   4.350 -    ldy $5184                   ; load the x offset
   4.351 +    ldy $5284                   ; load the x offset
   4.352      lda room_row_offsets_low,x  ; read the address of the row
   4.353      sta $70
   4.354      lda #$57
   4.355 @@ -1981,7 +1981,7 @@
   4.356      cmp #0
   4.357      bne move_player_not_up_key
   4.358  
   4.359 -    lda $5185                   ; dx
   4.360 +    lda $5285                   ; dx
   4.361      cmp #3
   4.362      bmi move_player_allow_up
   4.363  
   4.364 @@ -2002,9 +2002,9 @@
   4.365      sta $81                 ; temporary
   4.366      jsr unplot_character    ; unplot the player character
   4.367      lda $81
   4.368 -    sta $5182               ; store the new room y offset
   4.369 +    sta $5282               ; store the new room y offset
   4.370      lda #5
   4.371 -    sta $5183               ; dy = 5
   4.372 +    sta $5283               ; dy = 5
   4.373      clc
   4.374      jmp animate_player_up   ; optimise away the rts
   4.375  
   4.376 @@ -2020,9 +2020,9 @@
   4.377      ; No need to unplot.
   4.378  
   4.379      lda #9      ; y = 9
   4.380 -    sta $5182
   4.381 +    sta $5282
   4.382      lda #0      ; dy = 0
   4.383 -    sta $5183
   4.384 +    sta $5283
   4.385  
   4.386      jsr animate_player_up
   4.387      sec                     ; indicate to the calling routine that the player
   4.388 @@ -2039,27 +2039,27 @@
   4.389      jmp move_player_not_down_key
   4.390  
   4.391      move_player_down_key:
   4.392 -    lda $5183                   ; read dy
   4.393 +    lda $5283                   ; read dy
   4.394      cmp #0
   4.395      beq move_player_down_check_y
   4.396      cmp #5
   4.397      beq move_player_down_tile
   4.398  
   4.399      jsr unplot_character        ; unplot the player character
   4.400 -    inc $5183                   ; 0 < dy < 5
   4.401 +    inc $5283                   ; 0 < dy < 5
   4.402      clc
   4.403      jmp animate_player_down    ; optimise away the rts
   4.404      
   4.405      move_player_down_check_y:  ; Check the y offset.
   4.406  
   4.407 -    lda $5182
   4.408 +    lda $5282
   4.409      cmp #9
   4.410      beq move_player_leave_room_down
   4.411  
   4.412      clc
   4.413      tax
   4.414      inx                         ; y + 1
   4.415 -    ldy $5184                   ; load the x offset
   4.416 +    ldy $5284                   ; load the x offset
   4.417      lda room_row_offsets_low,x  ; read the address of the row
   4.418      sta $70
   4.419      lda #$57
   4.420 @@ -2074,7 +2074,7 @@
   4.421      cmp #0
   4.422      bne move_player_not_down_key
   4.423  
   4.424 -    lda $5185                   ; dx
   4.425 +    lda $5285                   ; dx
   4.426      cmp #3
   4.427      bmi move_player_allow_down
   4.428  
   4.429 @@ -2093,16 +2093,16 @@
   4.430      move_player_allow_down:
   4.431  
   4.432      jsr unplot_character        ; unplot the player character
   4.433 -    inc $5183                   ; update dy
   4.434 +    inc $5283                   ; update dy
   4.435      clc
   4.436      jmp animate_player_down     ; optimise away the rts
   4.437  
   4.438      move_player_down_tile:
   4.439  
   4.440      jsr unplot_character        ; unplot the player character
   4.441 -    inc $5182                   ; store the new room y offset
   4.442 +    inc $5282                   ; store the new room y offset
   4.443      lda #0
   4.444 -    sta $5183                   ; dy = 0
   4.445 +    sta $5283                   ; dy = 0
   4.446      clc
   4.447      jmp animate_player_down     ; optimise away the rts
   4.448  
   4.449 @@ -2115,9 +2115,9 @@
   4.450      ; No need to unplot.
   4.451  
   4.452      lda #0      ; y = 0
   4.453 -    sta $5182
   4.454 +    sta $5282
   4.455      lda #0      ; dy = 0
   4.456 -    sta $5183
   4.457 +    sta $5283
   4.458  
   4.459      jsr animate_player_down
   4.460      sec                         ; indicate to the calling routine that the
   4.461 @@ -2155,7 +2155,7 @@
   4.462      cpy #255
   4.463      bne check_fire_key_exit
   4.464  
   4.465 -    lda $5186
   4.466 +    lda $5286
   4.467      cmp #0
   4.468      bne check_fire_key_exit
   4.469  
   4.470 @@ -2171,46 +2171,46 @@
   4.471  create_projectile:
   4.472  
   4.473      lda #2
   4.474 -    sta $5186
   4.475 -
   4.476 -    lda $5181
   4.477 +    sta $5286
   4.478 +
   4.479 +    lda $5281
   4.480      and #$06        ; copy the direction information
   4.481      asl
   4.482      asl
   4.483      asl
   4.484      ora $5789       ; apply the projectile type
   4.485 -    sta $5187
   4.486 -
   4.487 -    lda $5183       ; dy
   4.488 +    sta $5287
   4.489 +
   4.490 +    lda $5283       ; dy
   4.491      cmp #4
   4.492      bpl create_projectile_below
   4.493  
   4.494      clc
   4.495      adc #2
   4.496 -    sta $5189       ; dy + 2
   4.497 -    lda $5182       ; y
   4.498 -    sta $5188
   4.499 +    sta $5289       ; dy + 2
   4.500 +    lda $5282       ; y
   4.501 +    sta $5288
   4.502      jmp create_projectile_continue
   4.503  
   4.504      create_projectile_below:
   4.505      sec
   4.506      sbc #4
   4.507 -    sta $5189       ; dy - 4
   4.508 +    sta $5289       ; dy - 4
   4.509      clc
   4.510 -    lda $5182       ; y
   4.511 +    lda $5282       ; y
   4.512      adc #1
   4.513 -    sta $5188
   4.514 +    sta $5288
   4.515  
   4.516      create_projectile_continue:
   4.517 -    lda $5184       ; x
   4.518 -    sta $518a
   4.519 -
   4.520 -    lda $5185       ; dx
   4.521 -    sta $518b
   4.522 +    lda $5284       ; x
   4.523 +    sta $528a
   4.524 +
   4.525 +    lda $5285       ; dx
   4.526 +    sta $528b
   4.527  
   4.528      lda #$86
   4.529      sta $74
   4.530 -    lda #$51
   4.531 +    lda #$52
   4.532      sta $75
   4.533      jsr plot_character
   4.534  
   4.535 @@ -2702,13 +2702,13 @@
   4.536  
   4.537      ldy #2
   4.538      lda ($74),y         ; y
   4.539 -    cmp $5182           ; player y
   4.540 +    cmp $5282           ; player y
   4.541      bmi move_enemy_downwards
   4.542      bne move_enemy_upwards
   4.543  
   4.544      ldy #3
   4.545      lda ($74),y         ; dy
   4.546 -    cmp $5183           ; player y
   4.547 +    cmp $5283           ; player y
   4.548      beq move_enemy_horizontally
   4.549      bpl move_enemy_upwards
   4.550  
   4.551 @@ -2725,7 +2725,7 @@
   4.552      move_enemy_horizontally:
   4.553      ldy #4
   4.554      lda ($74),y         ; x
   4.555 -    cmp $5184           ; player x
   4.556 +    cmp $5284           ; player x
   4.557      bmi move_enemy_rightwards
   4.558      bne move_enemy_leftwards
   4.559  
   4.560 @@ -2789,32 +2789,32 @@
   4.561  create_explosion:           ; X=y, Y=x
   4.562  
   4.563      lda #3
   4.564 -    sta $51a4
   4.565 +    sta $52a4
   4.566      lda #8
   4.567 -    sta $51a5
   4.568 +    sta $52a5
   4.569      txa
   4.570 -    sta $51a6
   4.571 +    sta $52a6
   4.572      lda #1
   4.573 -    sta $51a7
   4.574 +    sta $52a7
   4.575      tya
   4.576 -    sta $51a8
   4.577 +    sta $52a8
   4.578      lda #0
   4.579 -    sta $51a9
   4.580 +    sta $52a9
   4.581      rts
   4.582  
   4.583  move_projectile_left:
   4.584  
   4.585 -    lda $518b
   4.586 +    lda $528b
   4.587      cmp #0
   4.588      beq move_projectile_left_check_x
   4.589  
   4.590 -    dec $518b
   4.591 +    dec $528b
   4.592      clc
   4.593      rts
   4.594  
   4.595      move_projectile_left_check_x:
   4.596  
   4.597 -    lda $518a
   4.598 +    lda $528a
   4.599      cmp #0
   4.600      bne move_projectile_left_in_room
   4.601      jmp move_projectile_left_exit
   4.602 @@ -2822,7 +2822,7 @@
   4.603      move_projectile_left_in_room:
   4.604      tay
   4.605      dey                         ; x - 1
   4.606 -    ldx $5188                   ; y
   4.607 +    ldx $5288                   ; y
   4.608      lda room_row_offsets_low,x  ; read the address of the row
   4.609      sta $70
   4.610      lda #$57
   4.611 @@ -2832,7 +2832,7 @@
   4.612      cmp #0
   4.613      bne move_projectile_left_wall
   4.614  
   4.615 -    lda $5189                   ; dy
   4.616 +    lda $5289                   ; dy
   4.617      cmp #5
   4.618      bmi move_projectile_allow_left
   4.619  
   4.620 @@ -2847,9 +2847,9 @@
   4.621  
   4.622      move_projectile_allow_left:
   4.623  
   4.624 -    sty $518a       ; x
   4.625 +    sty $528a       ; x
   4.626      lda #3
   4.627 -    sta $518b       ; dx = 3
   4.628 +    sta $528b       ; dx = 3
   4.629  
   4.630      clc
   4.631      rts
   4.632 @@ -2857,7 +2857,7 @@
   4.633      move_projectile_left_wall:  ; the projectile hit a wall
   4.634      clc
   4.635  
   4.636 -    lda $5187                   ; type 2 can pass through walls
   4.637 +    lda $5287                   ; type 2 can pass through walls
   4.638      and #$06
   4.639      cmp #4
   4.640      beq move_projectile_allow_left
   4.641 @@ -2865,14 +2865,14 @@
   4.642      cmp #2
   4.643      bne move_projectile_left_not_boomerang
   4.644  
   4.645 -    lda $5187
   4.646 +    lda $5287
   4.647      and #$0f
   4.648      cmp #8
   4.649      bpl move_projectile_left_exit
   4.650  
   4.651 -    ldx $5185               ; player's dx
   4.652 +    ldx $5285               ; player's dx
   4.653      ora boomerang_horizontal,x
   4.654 -    sta $5187
   4.655 +    sta $5287
   4.656      clc
   4.657      rts                     ; exit without moving or registering a collision
   4.658  
   4.659 @@ -2881,7 +2881,7 @@
   4.660      cmp #6                          ; type 3 can destroy certain walls
   4.661      bne move_projectile_left_exit
   4.662  
   4.663 -    lda $5189                       ; dy
   4.664 +    lda $5289                       ; dy
   4.665      cmp #5
   4.666      beq move_projectile_left_exit   ; shots must be lined up
   4.667      
   4.668 @@ -2899,7 +2899,7 @@
   4.669  
   4.670      lda #$a4
   4.671      sta $74
   4.672 -    lda #$51
   4.673 +    lda #$52
   4.674      sta $75
   4.675      jsr plot_character
   4.676  
   4.677 @@ -2919,19 +2919,19 @@
   4.678  
   4.679      ; Fire right.
   4.680  
   4.681 -    lda $518b
   4.682 +    lda $528b
   4.683      cmp #2
   4.684      beq move_projectile_right_check_x
   4.685      cmp #3
   4.686      beq move_projectile_right_tile
   4.687  
   4.688 -    inc $518b
   4.689 +    inc $528b
   4.690      clc
   4.691      rts
   4.692  
   4.693      move_projectile_right_check_x:
   4.694  
   4.695 -    lda $518a       ; x
   4.696 +    lda $528a       ; x
   4.697      cmp #9
   4.698      bne move_projectile_right_not_edge
   4.699      jmp move_projectile_right_exit
   4.700 @@ -2940,7 +2940,7 @@
   4.701      clc
   4.702      tay
   4.703      iny                         ; x + 1
   4.704 -    ldx $5188                   ; y
   4.705 +    ldx $5288                   ; y
   4.706      lda room_row_offsets_low,x  ; read the address of the row
   4.707      sta $70
   4.708      lda #$57
   4.709 @@ -2950,7 +2950,7 @@
   4.710      cmp #0
   4.711      bne move_projectile_right_wall
   4.712  
   4.713 -    lda $5189                   ; dy
   4.714 +    lda $5289                   ; dy
   4.715      cmp #5
   4.716      bmi move_projectile_allow_right
   4.717  
   4.718 @@ -2965,22 +2965,22 @@
   4.719  
   4.720      move_projectile_allow_right:
   4.721  
   4.722 -    inc $518b       ; dx
   4.723 +    inc $528b       ; dx
   4.724      clc
   4.725      rts
   4.726  
   4.727      move_projectile_right_tile:
   4.728  
   4.729 -    inc $518a       ; x
   4.730 +    inc $528a       ; x
   4.731      lda #0
   4.732 -    sta $518b       ; dx
   4.733 +    sta $528b       ; dx
   4.734      clc
   4.735      rts
   4.736  
   4.737      move_projectile_right_wall:  ; the projectile hit a wall
   4.738      clc
   4.739  
   4.740 -    lda $5187                   ; type 2 can pass through walls
   4.741 +    lda $5287                   ; type 2 can pass through walls
   4.742      and #$06
   4.743      cmp #4
   4.744      beq move_projectile_allow_right
   4.745 @@ -2988,14 +2988,14 @@
   4.746      cmp #2
   4.747      bne move_projectile_right_not_boomerang
   4.748  
   4.749 -    lda $5187
   4.750 +    lda $5287
   4.751      and #$0f
   4.752      cmp #8
   4.753      bpl move_projectile_right_exit
   4.754  
   4.755 -    ldx $5185               ; player's dx
   4.756 +    ldx $5285               ; player's dx
   4.757      ora boomerang_horizontal,x
   4.758 -    sta $5187
   4.759 +    sta $5287
   4.760      clc
   4.761      rts                     ; exit without moving or registering a collision
   4.762  
   4.763 @@ -3004,7 +3004,7 @@
   4.764      cmp #6                      ; type 3 can destroy certain walls
   4.765      bne move_projectile_right_exit
   4.766  
   4.767 -    lda $5189                   ; dy
   4.768 +    lda $5289                   ; dy
   4.769      cmp #5
   4.770      beq move_projectile_right_exit  ; shots must be lined up
   4.771      
   4.772 @@ -3022,7 +3022,7 @@
   4.773  
   4.774      lda #$a4
   4.775      sta $74
   4.776 -    lda #$51
   4.777 +    lda #$52
   4.778      sta $75
   4.779      jsr plot_character
   4.780  
   4.781 @@ -3038,17 +3038,17 @@
   4.782  
   4.783  move_projectile_up:
   4.784  
   4.785 -    lda $5189           ; read dy
   4.786 +    lda $5289           ; read dy
   4.787      cmp #0
   4.788      beq move_projectile_up_check_y
   4.789  
   4.790 -    dec $5189
   4.791 +    dec $5289
   4.792      clc
   4.793      rts
   4.794      
   4.795      move_projectile_up_check_y:     ; Check the y offset.
   4.796  
   4.797 -    lda $5188
   4.798 +    lda $5288
   4.799      cmp #0
   4.800      bne move_projectile_up_not_edge
   4.801      jmp move_projectile_up_exit
   4.802 @@ -3056,7 +3056,7 @@
   4.803      move_projectile_up_not_edge:
   4.804      tax                         ; use the y offset as an index
   4.805      dex                         ; y - 1
   4.806 -    ldy $518a                   ; load the x offset
   4.807 +    ldy $528a                   ; load the x offset
   4.808      lda room_row_offsets_low,x  ; read the address of the row
   4.809      sta $70
   4.810      lda #$57
   4.811 @@ -3066,7 +3066,7 @@
   4.812      cmp #0
   4.813      bne move_projectile_up_wall
   4.814  
   4.815 -    lda $518b                   ; dx
   4.816 +    lda $528b                   ; dx
   4.817      cmp #3
   4.818      bmi move_projectile_allow_up
   4.819  
   4.820 @@ -3079,9 +3079,9 @@
   4.821  
   4.822      move_projectile_allow_up:
   4.823      txa
   4.824 -    sta $5188               ; store the new room y offset
   4.825 +    sta $5288               ; store the new room y offset
   4.826      lda #5
   4.827 -    sta $5189               ; dy = 5
   4.828 +    sta $5289               ; dy = 5
   4.829  
   4.830      clc
   4.831      rts
   4.832 @@ -3089,7 +3089,7 @@
   4.833      move_projectile_up_wall:    ; the projectile hit a wall
   4.834      clc
   4.835  
   4.836 -    lda $5187                   ; type 2 can pass through walls
   4.837 +    lda $5287                   ; type 2 can pass through walls
   4.838      and #$06
   4.839      cmp #4
   4.840      beq move_projectile_allow_up
   4.841 @@ -3097,14 +3097,14 @@
   4.842      cmp #2
   4.843      bne move_projectile_up_not_boomerang
   4.844  
   4.845 -    lda $5187
   4.846 +    lda $5287
   4.847      and #$0f
   4.848      cmp #8
   4.849      bpl move_projectile_up_exit
   4.850  
   4.851 -    ldx $5183               ; player's dy
   4.852 +    ldx $5283               ; player's dy
   4.853      ora boomerang_vertical,x
   4.854 -    sta $5187
   4.855 +    sta $5287
   4.856      clc
   4.857      rts                     ; exit without moving or registering a collision
   4.858  
   4.859 @@ -3113,7 +3113,7 @@
   4.860      cmp #6                      ; type 3 can destroy certain walls
   4.861      bne move_projectile_up_exit
   4.862  
   4.863 -    lda $518b                   ; dx
   4.864 +    lda $528b                   ; dx
   4.865      cmp #3
   4.866      bpl move_projectile_up_exit ; shots must be lined up
   4.867      
   4.868 @@ -3131,7 +3131,7 @@
   4.869  
   4.870      lda #$a4
   4.871      sta $74
   4.872 -    lda #$51
   4.873 +    lda #$52
   4.874      sta $75
   4.875      jsr plot_character
   4.876  
   4.877 @@ -3149,19 +3149,19 @@
   4.878  
   4.879  move_projectile_down:
   4.880  
   4.881 -    lda $5189                   ; read dy
   4.882 +    lda $5289                   ; read dy
   4.883      cmp #4
   4.884      beq move_projectile_down_check_y
   4.885      cmp #5
   4.886      beq move_projectile_down_tile
   4.887  
   4.888 -    inc $5189                   ; 0 < dy < 5
   4.889 +    inc $5289                   ; 0 < dy < 5
   4.890      clc
   4.891      rts
   4.892      
   4.893      move_projectile_down_check_y:  ; Check the y offset.
   4.894  
   4.895 -    lda $5188
   4.896 +    lda $5288
   4.897      cmp #9
   4.898      bne move_projectile_down_in_room
   4.899      jmp move_projectile_down_exit
   4.900 @@ -3170,7 +3170,7 @@
   4.901      clc
   4.902      tax
   4.903      inx                         ; y + 1
   4.904 -    ldy $518a                   ; load the x offset
   4.905 +    ldy $528a                   ; load the x offset
   4.906      lda room_row_offsets_low,x  ; read the address of the row
   4.907      sta $70
   4.908      lda #$57
   4.909 @@ -3180,7 +3180,7 @@
   4.910      cmp #0
   4.911      bne move_projectile_down_wall
   4.912  
   4.913 -    lda $518b                   ; dx
   4.914 +    lda $528b                   ; dx
   4.915      cmp #3
   4.916      bmi move_projectile_allow_down
   4.917  
   4.918 @@ -3193,22 +3193,22 @@
   4.919  
   4.920      move_projectile_allow_down:
   4.921  
   4.922 -    inc $5189                   ; update dy
   4.923 +    inc $5289                   ; update dy
   4.924      clc
   4.925      rts
   4.926  
   4.927      move_projectile_down_tile:
   4.928  
   4.929 -    inc $5188                   ; store the new room y offset
   4.930 +    inc $5288                   ; store the new room y offset
   4.931      lda #0
   4.932 -    sta $5189                   ; dy = 0
   4.933 +    sta $5289                   ; dy = 0
   4.934      clc
   4.935      rts
   4.936  
   4.937      move_projectile_down_wall:  ; the projectile hit a wall
   4.938      clc
   4.939  
   4.940 -    lda $5187                   ; type 2 can pass through walls
   4.941 +    lda $5287                   ; type 2 can pass through walls
   4.942      and #$06
   4.943      cmp #4
   4.944      beq move_projectile_allow_down
   4.945 @@ -3216,14 +3216,14 @@
   4.946      cmp #2
   4.947      bne move_projectile_down_not_boomerang
   4.948  
   4.949 -    lda $5187
   4.950 +    lda $5287
   4.951      and #$0f
   4.952      cmp #8
   4.953      bpl move_projectile_down_exit
   4.954  
   4.955 -    ldx $5183               ; player's dy
   4.956 +    ldx $5283               ; player's dy
   4.957      ora boomerang_vertical,x
   4.958 -    sta $5187
   4.959 +    sta $5287
   4.960      clc
   4.961      rts                     ; exit without moving or registering a collision
   4.962  
   4.963 @@ -3232,7 +3232,7 @@
   4.964      cmp #6                      ; type 3 can destroy certain walls
   4.965      bne move_projectile_down_exit
   4.966  
   4.967 -    lda $518b                   ; dx
   4.968 +    lda $528b                   ; dx
   4.969      cmp #3
   4.970      bpl move_projectile_down_exit   ; shots must be lined up
   4.971      
   4.972 @@ -3250,7 +3250,7 @@
   4.973  
   4.974      lda #$a4
   4.975      sta $74
   4.976 -    lda #$51
   4.977 +    lda #$52
   4.978      sta $75
   4.979      jsr plot_character
   4.980  
   4.981 @@ -3266,14 +3266,14 @@
   4.982  
   4.983  move_projectile_animate:
   4.984  
   4.985 -    lda $5187
   4.986 +    lda $5287
   4.987      eor #1
   4.988 -    sta $5187
   4.989 +    sta $5287
   4.990      rts
   4.991  
   4.992  move_projectile:
   4.993  
   4.994 -    lda $5186
   4.995 +    lda $5286
   4.996      cmp #0
   4.997      bne move_projectile_move
   4.998      jmp move_projectile_exit
   4.999 @@ -3283,11 +3283,11 @@
  4.1000  
  4.1001      lda #$86
  4.1002      sta $74
  4.1003 -    lda #$51
  4.1004 +    lda #$52
  4.1005      sta $75
  4.1006      jsr unplot_character
  4.1007  
  4.1008 -    lda $5187
  4.1009 +    lda $5287
  4.1010      and #$30            ; direction
  4.1011  
  4.1012      cmp #0
  4.1013 @@ -3329,7 +3329,7 @@
  4.1014  
  4.1015      lda #$86
  4.1016      sta $74
  4.1017 -    lda #$51
  4.1018 +    lda #$52
  4.1019      sta $75
  4.1020      jmp plot_character          ; optimise away the rts
  4.1021  
  4.1022 @@ -3369,7 +3369,7 @@
  4.1023  
  4.1024      move_projectile_no_enemy_collision:
  4.1025  
  4.1026 -    lda $5187       ; type 2 projectiles pass through everything
  4.1027 +    lda $5287       ; type 2 projectiles pass through everything
  4.1028      and #$06
  4.1029      cmp #4
  4.1030      bne move_projectile_remove_projectile
  4.1031 @@ -3378,13 +3378,13 @@
  4.1032      ; that we don't perform these checks again here, but it would just add
  4.1033      ; overhead to the normal movement routines for the other weapons.
  4.1034  
  4.1035 -    lda $5188       ; y
  4.1036 +    lda $5288       ; y
  4.1037      cmp #0
  4.1038      beq move_projectile_remove_projectile
  4.1039      cmp #9
  4.1040      beq move_projectile_remove_projectile
  4.1041  
  4.1042 -    lda $518a       ; x
  4.1043 +    lda $528a       ; x
  4.1044      cmp #0
  4.1045      beq move_projectile_remove_projectile
  4.1046      cmp #9
  4.1047 @@ -3393,7 +3393,7 @@
  4.1048      clc
  4.1049      lda #$86
  4.1050      sta $74
  4.1051 -    lda #$51
  4.1052 +    lda #$52
  4.1053      sta $75
  4.1054  
  4.1055      jsr plot_character
  4.1056 @@ -3402,7 +3402,7 @@
  4.1057      move_projectile_remove_projectile:
  4.1058  
  4.1059      lda #0                      ; remove the projectile from the character list
  4.1060 -    sta $5186
  4.1061 +    sta $5286
  4.1062  
  4.1063      move_projectile_exit:
  4.1064      clc
  4.1065 @@ -3412,7 +3412,7 @@
  4.1066  
  4.1067      lda #$8c            ; set the character address
  4.1068      sta $74
  4.1069 -    lda #$51
  4.1070 +    lda #$52
  4.1071      sta $75
  4.1072  
  4.1073      emerge_characters_loop:
  4.1074 @@ -3446,7 +3446,7 @@
  4.1075  
  4.1076      lda #$8c            ; set the character address
  4.1077      sta $74
  4.1078 -    lda #$51
  4.1079 +    lda #$52
  4.1080      sta $75
  4.1081  
  4.1082      lda $578e           ; read a value from 0 to 3 from the motion counter
  4.1083 @@ -3510,7 +3510,7 @@
  4.1084      adc $5783
  4.1085      tax
  4.1086      lda #$80    ; store a value with the top bit set instead of zero because we
  4.1087 -    sta $5100,x ; have visited this room if we can collect the object within it
  4.1088 +    sta $5200,x ; have visited this room if we can collect the object within it
  4.1089  
  4.1090      lda #0      ; remove the item from the character list
  4.1091      ldy #0
  4.1092 @@ -3784,13 +3784,13 @@
  4.1093  
  4.1094      lda #$80        ; unplot the player
  4.1095      sta $74
  4.1096 -    lda #$51
  4.1097 +    lda #$52
  4.1098      sta $75
  4.1099  
  4.1100      jsr unplot_character
  4.1101  
  4.1102      lda #8          ; change the player's direction to the demise animation
  4.1103 -    sta $5181
  4.1104 +    sta $5281
  4.1105  
  4.1106      jsr plot_character
  4.1107  
  4.1108 @@ -3849,7 +3849,7 @@
  4.1109      ldx #6
  4.1110      remove_characters_loop:
  4.1111          lda #0
  4.1112 -        sta $5180,x
  4.1113 +        sta $5280,x
  4.1114          txa
  4.1115          adc #6
  4.1116          tax
  4.1117 @@ -3897,17 +3897,17 @@
  4.1118  
  4.1119  player_collide:
  4.1120  
  4.1121 -    lda $5182                           ; player y
  4.1122 +    lda $5282                           ; player y
  4.1123      sta $8a
  4.1124 -    lda $5184                           ; player x
  4.1125 +    lda $5284                           ; player x
  4.1126      sta $8b
  4.1127  
  4.1128 -    ldx $5183                           ; player dy
  4.1129 +    ldx $5283                           ; player dy
  4.1130      lda player_collision_mask_above,x
  4.1131      sta $86
  4.1132      lda player_collision_mask_below,x
  4.1133      sta $88
  4.1134 -    ldx $5185                           ; player dx
  4.1135 +    ldx $5285                           ; player dx
  4.1136      lda player_collision_mask_left,x
  4.1137      sta $87
  4.1138      lda player_collision_mask_right,x
  4.1139 @@ -3917,17 +3917,17 @@
  4.1140  
  4.1141  projectile_collide:
  4.1142  
  4.1143 -    lda $5188                           ; projectile y
  4.1144 +    lda $5288                           ; projectile y
  4.1145      sta $8a
  4.1146 -    lda $518a                           ; projectile x
  4.1147 +    lda $528a                           ; projectile x
  4.1148      sta $8b
  4.1149  
  4.1150 -    ldx $5189                           ; projectile dy
  4.1151 +    ldx $5289                           ; projectile dy
  4.1152      lda projectile_collision_mask_above,x
  4.1153      sta $86
  4.1154      lda projectile_collision_mask_below,x
  4.1155      sta $88
  4.1156 -    ldx $518b                           ; projectile dx
  4.1157 +    ldx $528b                           ; projectile dx
  4.1158      lda projectile_collision_mask_left,x
  4.1159      sta $87
  4.1160      lda projectile_collision_mask_right,x
  4.1161 @@ -3939,7 +3939,7 @@
  4.1162  
  4.1163      lda #$8c            ; set the character address
  4.1164      sta $74
  4.1165 -    lda #$51
  4.1166 +    lda #$52
  4.1167      sta $75
  4.1168  
  4.1169      collide_loop:
  4.1170 @@ -4263,7 +4263,7 @@
  4.1171      ldy #0
  4.1172      lda #$80
  4.1173      sta $70
  4.1174 -    lda #$50
  4.1175 +    lda #$51
  4.1176      sta $71
  4.1177      lda #$16
  4.1178      sta $72
  4.1179 @@ -4384,7 +4384,7 @@
  4.1180  
  4.1181      lda #$80
  4.1182      sta $70
  4.1183 -    lda #$50
  4.1184 +    lda #$51
  4.1185      sta $71
  4.1186  
  4.1187      lda #8
  4.1188 @@ -4548,7 +4548,7 @@
  4.1189      sta $8e
  4.1190      end_of_level_room_count_loop:
  4.1191  
  4.1192 -        lda $5100,x
  4.1193 +        lda $5200,x
  4.1194          and #$80
  4.1195          beq end_of_level_room_count_loop_next
  4.1196  
  4.1197 @@ -4596,9 +4596,9 @@
  4.1198          ; $74,$75 should be unchanged
  4.1199          jsr unplot_character
  4.1200  
  4.1201 -        lda $5181
  4.1202 +        lda $5281
  4.1203          eor #1
  4.1204 -        sta $5181
  4.1205 +        sta $5281
  4.1206          jsr plot_character
  4.1207  
  4.1208          jsr plot_buffer
  4.1209 @@ -4733,7 +4733,7 @@
  4.1210  
  4.1211      lda #$80        ; plot the player
  4.1212      sta $74
  4.1213 -    lda #$51
  4.1214 +    lda #$52
  4.1215      sta $75
  4.1216      jsr plot_character
  4.1217  
  4.1218 @@ -4802,7 +4802,7 @@
  4.1219  
  4.1220      lda #$80
  4.1221      sta $72
  4.1222 -    lda #$50
  4.1223 +    lda #$51
  4.1224      sta $73
  4.1225  
  4.1226      check_high_scores_loop:
  4.1227 @@ -4845,7 +4845,7 @@
  4.1228  
  4.1229      lda #$e0
  4.1230      sta $74
  4.1231 -    lda #$50
  4.1232 +    lda #$51
  4.1233      sta $75
  4.1234  
  4.1235      ldy #0
  4.1236 @@ -4995,26 +4995,26 @@
  4.1237  
  4.1238          high_score_entry_check_position:
  4.1239  
  4.1240 -        lda $5185       ; dx
  4.1241 +        lda $5285       ; dx
  4.1242          cmp #2
  4.1243          beq high_score_entry_maybe_aligned
  4.1244          jmp high_score_entry_not_aligned
  4.1245  
  4.1246          high_score_entry_maybe_aligned:
  4.1247  
  4.1248 -        lda $5182       ; y
  4.1249 +        lda $5282       ; y
  4.1250          tay
  4.1251          cmp #8
  4.1252          bpl high_score_entry_not_aligned
  4.1253  
  4.1254 -        lda $5184       ; x
  4.1255 +        lda $5284       ; x
  4.1256          tax
  4.1257          cmp #9
  4.1258          beq high_score_entry_not_aligned
  4.1259          and #1
  4.1260          beq high_score_entry_not_aligned
  4.1261  
  4.1262 -        lda $5183       ; dy
  4.1263 +        lda $5283       ; dy
  4.1264          cmp #2
  4.1265          bmi high_score_entry_aligned
  4.1266          cmp #5
  4.1267 @@ -5193,17 +5193,17 @@
  4.1268  reset_player_position:
  4.1269  
  4.1270      lda #1      ; player
  4.1271 -    sta $5180
  4.1272 +    sta $5280
  4.1273      lda #6      ; down (first frame)
  4.1274 -    sta $5181
  4.1275 +    sta $5281
  4.1276      lda #4      ; y=4
  4.1277 -    sta $5182
  4.1278 +    sta $5282
  4.1279      lda #3      ; dy=3
  4.1280 -    sta $5183
  4.1281 +    sta $5283
  4.1282      lda #4      ; x=4
  4.1283 -    sta $5184
  4.1284 +    sta $5284
  4.1285      lda #3      ; dx=3
  4.1286 -    sta $5185
  4.1287 +    sta $5285
  4.1288  
  4.1289      rts
  4.1290  
  4.1291 @@ -5249,7 +5249,7 @@
  4.1292  
  4.1293      lda #$00
  4.1294      sta $8e
  4.1295 -    lda #$51
  4.1296 +    lda #$52
  4.1297      sta $8f
  4.1298  
  4.1299      ldy #0
  4.1300 @@ -5376,7 +5376,7 @@
  4.1301                      dec $5785           ; leave the loop when the delay
  4.1302                      beq after_room_loop ; counter is about to reset
  4.1303  
  4.1304 -                    lda $5181           ; leave the loop when the player
  4.1305 +                    lda $5281           ; leave the loop when the player
  4.1306                      cmp #11             ; animation has finished
  4.1307                      beq room_loop_after_player_move
  4.1308                      clc
  4.1309 @@ -5387,12 +5387,12 @@
  4.1310  
  4.1311                      lda #$80
  4.1312                      sta $74
  4.1313 -                    lda #$51
  4.1314 +                    lda #$52
  4.1315                      sta $75
  4.1316  
  4.1317                      jsr unplot_character
  4.1318  
  4.1319 -                    inc $5181
  4.1320 +                    inc $5281
  4.1321                      jsr plot_character
  4.1322                      jmp room_loop_after_player_move
  4.1323