junglejourney

changeset 216:cdceac4f5ea8

Started working on a ROM-based version of the game. Removed a generated file.
author David Boddie <david@boddie.org.uk>
date Sun Oct 16 18:25:22 2011 +0200
parents 3ae571b43ba0
children 59f37c9e74e4
files LOADER buildrom.py mapcode.oph romcode.oph romloader.oph tapecode.oph
diffstat 6 files changed, 665 insertions(+), 41 deletions(-) [+]
line diff
     1.1 --- a/LOADER	Sun Oct 16 03:04:19 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,23 +0,0 @@
     1.4 -AUTO
     1.5 -MODE 6
     1.6 -OSCLI("LOAD CODE")
     1.7 -OSCLI("LOAD SPRITES")
     1.8 -
     1.9 -MODE 5
    1.10 -VDU 23,1,0;0;0;0;
    1.11 -VDU 19,2,2,0,0,0
    1.12 -VDU 19,3,3,0,0,0
    1.13 -
    1.14 -?&78=5
    1.15 -?&79=5
    1.16 -
    1.17 -REPEAT
    1.18 -CALL &{addr}
    1.19 -
    1.20 -A% = GET
    1.21 -IF A%=90 AND ?&79>0 THEN ?&79=?&79-1
    1.22 -IF A%=88 AND ?&79<10 THEN ?&79=?&79+1
    1.23 -IF A%=58 AND ?&78>0 THEN ?&78=?&78-1
    1.24 -IF A%=47 AND ?&78<10 THEN ?&78=?&78+1
    1.25 -
    1.26 -UNTIL FALSE
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/buildrom.py	Sun Oct 16 18:25:22 2011 +0200
     2.3 @@ -0,0 +1,75 @@
     2.4 +#!/usr/bin/env python
     2.5 +
     2.6 +"""
     2.7 +Copyright (C) 2011 David Boddie <david@boddie.org.uk>
     2.8 +
     2.9 +This program is free software: you can redistribute it and/or modify
    2.10 +it under the terms of the GNU General Public License as published by
    2.11 +the Free Software Foundation, either version 3 of the License, or
    2.12 +(at your option) any later version.
    2.13 +
    2.14 +This program is distributed in the hope that it will be useful,
    2.15 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.16 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.17 +GNU General Public License for more details.
    2.18 +
    2.19 +You should have received a copy of the GNU General Public License
    2.20 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2.21 +"""
    2.22 +
    2.23 +from build import *
    2.24 +
    2.25 +if __name__ == "__main__":
    2.26 +
    2.27 +    if not 1 <= len(sys.argv) <= 3:
    2.28 +    
    2.29 +        sys.stderr.write("Usage: %s [<code ROM file> <loader ROM file>]\n" % sys.argv[0])
    2.30 +        sys.exit(1)
    2.31 +    
    2.32 +    if len(sys.argv) == 3:
    2.33 +        code_rom_file = sys.argv[1]
    2.34 +        loader_rom_file = sys.argv[2]
    2.35 +    else:
    2.36 +        code_rom_file = "junglecode.rom"
    2.37 +        loader_rom_file = "jungle.rom"
    2.38 +    
    2.39 +    # Memory map
    2.40 +    #
    2.41 +    # 8000 ROM header code
    2.42 +    #      CODE
    2.43 +    #
    2.44 +    # 8000 ROM header code
    2.45 +    # 8300 title screen (0x1800 bytes including completion screen)
    2.46 +    #
    2.47 +    # 9B00 CHARS (0x1280 bytes of character sprites)
    2.48 +    # AD80 SPRITES (0x360 bytes of tile sprites)
    2.49 +    # B0E0 space
    2.50 +    
    2.51 +    system("ophis romcode.oph " + code_rom_file)
    2.52 +    
    2.53 +    # Add padding after the code to make a final image size of 16K.
    2.54 +    romcode = open("junglecode.rom", "rb").read()
    2.55 +    romcode += (0x4000 - len(romcode))*"\x00"
    2.56 +    open(code_rom_file, "wb").write(romcode)
    2.57 +    
    2.58 +    system("ophis romloader.oph " + loader_rom_file)
    2.59 +    
    2.60 +    romdata = open(loader_rom_file, "rb").read()
    2.61 +    
    2.62 +    # Add padding before the data is appended to the loader code.
    2.63 +    romdata += (0x300 - len(romdata))*"\x00"
    2.64 +    
    2.65 +    data = makesprites.read_sprites([makesprites.title])
    2.66 +    completed = makesprites.encode(makesprites.read_sprite(makesprites.completed))
    2.67 +    overlay = makesprites.read_sprite(makesprites.overlay)
    2.68 +    combined = makesprites.combine(completed, overlay)
    2.69 +    romdata += combined
    2.70 +    
    2.71 +    romdata += makesprites.read_sprites(makesprites.tiles)
    2.72 +    romdata += makesprites.read_sprites(makesprites.chars)
    2.73 +    romdata += (0x4000 - len(romdata))*"\x00"
    2.74 +    
    2.75 +    open(loader_rom_file, "wb").write(romdata)
    2.76 +    
    2.77 +    # Exit
    2.78 +    sys.exit()
     3.1 --- a/mapcode.oph	Sun Oct 16 03:04:19 2011 +0200
     3.2 +++ b/mapcode.oph	Sun Oct 16 18:25:22 2011 +0200
     3.3 @@ -788,9 +788,6 @@
     3.4      
     3.5      rts
     3.6  
     3.7 -tile_addresses_low:  .byte $00, $60, $c0, $00, $60, $c0, $20
     3.8 -tile_addresses_high: .byte $54, $54, $54, $50, $50, $50, $51
     3.9 -
    3.10  plot_tile:          ; $7b=tile number
    3.11                      ;   1 = flowers/decoration
    3.12                      ;   2 = trees/wall
    3.13 @@ -1318,9 +1315,6 @@
    3.14      jsr $fff4
    3.15      rts
    3.16  
    3.17 -player_direction_chars_low: .byte $00,$30,$60,$90,$c0,$f0,$20,$50, $80,$b0,$e0,$10
    3.18 -player_direction_chars_high: .byte $3f,$3f,$3f,$3f,$3f,$3f,$40,$40, $40,$40,$40,$41
    3.19 -
    3.20  screen_rows_low: .byte $80,$40,$00,$c0,$80,$40,$00,$c0,$80,$40
    3.21  screen_rows_high: .byte $5a,$5e,$62,$65,$69,$6d,$71,$74,$78,$7c
    3.22  screen_subrows_low: .byte $00,$06,$44,$82
    3.23 @@ -1330,17 +1324,6 @@
    3.24  screen_columns_high: .byte $00,$00,$00,$00,$00,$00,$00,$00,$01,$01
    3.25  screen_subcolumns_low: .byte $00,$08,$10,$18
    3.26  
    3.27 -enemy_direction_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    3.28 -enemy_direction_chars_high: .byte $41,$42,$42,$42,$42,$43,$43,$43
    3.29 -
    3.30 -emerge_explode_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    3.31 -emerge_explode_chars_high: .byte $4b,$4c,$4c,$4c,$4c,$4d,$4d,$4d
    3.32 -
    3.33 -item_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80,$c0
    3.34 -item_chars_high: .byte $4d,$4e,$4e,$4e,$4e,$4f,$4f,$4f,$4f
    3.35 -
    3.36 -projectile_chars_low: .byte $40,$50,$60,$70,$80,$90,$a0,$b0
    3.37 -
    3.38  unplot_character:       ; $74,$75=character address
    3.39  
    3.40      lda $82             ; store the unplot buffer address in $78,$79
    3.41 @@ -1461,7 +1444,7 @@
    3.42      tax
    3.43      lda projectile_chars_low,x
    3.44      sta $70
    3.45 -    lda #$41
    3.46 +    lda #projectile_chars_high
    3.47      sta $71
    3.48  
    3.49      ; Use the dy value to determine which plotting routine to use.
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/romcode.oph	Sun Oct 16 18:25:22 2011 +0200
     4.3 @@ -0,0 +1,106 @@
     4.4 +; Copyright (C) 2011 David Boddie <david@boddie.org.uk>
     4.5 +;
     4.6 +; This program is free software: you can redistribute it and/or modify
     4.7 +; it under the terms of the GNU General Public License as published by
     4.8 +; the Free Software Foundation, either version 3 of the License, or
     4.9 +; (at your option) any later version.
    4.10 +;
    4.11 +; This program is distributed in the hope that it will be useful,
    4.12 +; but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.13 +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.14 +; GNU General Public License for more details.
    4.15 +;
    4.16 +; You should have received a copy of the GNU General Public License
    4.17 +; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    4.18 +
    4.19 +.org $8000
    4.20 +rom_start:
    4.21 +jmp language_entry
    4.22 +jmp service_entry
    4.23 +
    4.24 +; ROM type
    4.25 +.byte $c2       ; 6502 code (2), language ($40), service ($80)
    4.26 +
    4.27 +copyright_offset:
    4.28 +.byte [copyright_string - rom_start - 1]
    4.29 +
    4.30 +; Version
    4.31 +.byte 1
    4.32 +
    4.33 +; Title string
    4.34 +.byte "Jungle Journey (code)", 0
    4.35 +
    4.36 +; Version string
    4.37 +.byte "1.0", 0
    4.38 +
    4.39 +copyright_string:
    4.40 +.byte "(C) 2011 David Boddie", 0
    4.41 +
    4.42 +; Second processor relocation address
    4.43 +.byte 0, $80, 0, 0
    4.44 +
    4.45 +language_entry:
    4.46 +
    4.47 +    jmp jungle_code
    4.48 +
    4.49 +service_entry:
    4.50 +
    4.51 +    cmp #4
    4.52 +    beq service_command
    4.53 +
    4.54 +    service_entry_exit:
    4.55 +    rts
    4.56 +
    4.57 +rom_name: .byte "JUNGLECODE"
    4.58 +
    4.59 +service_command:
    4.60 +
    4.61 +    tya                         ; push Y and X registers onto the stack
    4.62 +    pha
    4.63 +    txa
    4.64 +    pha
    4.65 +
    4.66 +    ldx #0
    4.67 +    service_command_loop:
    4.68 +    
    4.69 +        lda ($f2),y
    4.70 +        cmp rom_name,x
    4.71 +        bne service_command_exit
    4.72 +        inx
    4.73 +        iny
    4.74 +        cpx #10
    4.75 +        bne service_command_loop
    4.76 +    
    4.77 +    jsr jungle_code
    4.78 +    lda #0
    4.79 +    rts
    4.80 +    
    4.81 +    service_command_exit:
    4.82 +    pla                         ; pop Y and X registers off the stack
    4.83 +    tax
    4.84 +    pha
    4.85 +    tay
    4.86 +    lda #4                      ; restore A
    4.87 +    rts
    4.88 +
    4.89 +jungle_code:
    4.90 +
    4.91 +.include "mapcode.oph"
    4.92 +
    4.93 +tile_addresses_low:  .byte $00, $60, $c0, $00, $60, $c0, $20
    4.94 +tile_addresses_high: .byte $54, $54, $54, $50, $50, $50, $51
    4.95 +
    4.96 +player_direction_chars_low: .byte $00,$30,$60,$90,$c0,$f0,$20,$50, $80,$b0,$e0,$10
    4.97 +player_direction_chars_high: .byte $3f,$3f,$3f,$3f,$3f,$3f,$40,$40, $40,$40,$40,$41
    4.98 +
    4.99 +enemy_direction_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
   4.100 +enemy_direction_chars_high: .byte $41,$42,$42,$42,$42,$43,$43,$43
   4.101 +
   4.102 +emerge_explode_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
   4.103 +emerge_explode_chars_high: .byte $4b,$4c,$4c,$4c,$4c,$4d,$4d,$4d
   4.104 +
   4.105 +item_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80,$c0
   4.106 +item_chars_high: .byte $4d,$4e,$4e,$4e,$4e,$4f,$4f,$4f,$4f
   4.107 +
   4.108 +projectile_chars_low: .byte $40,$50,$60,$70,$80,$90,$a0,$b0
   4.109 +.alias projectile_chars_high $41
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/romloader.oph	Sun Oct 16 18:25:22 2011 +0200
     5.3 @@ -0,0 +1,465 @@
     5.4 +; Copyright (C) 2011 David Boddie <david@boddie.org.uk>
     5.5 +;
     5.6 +; This program is free software: you can redistribute it and/or modify
     5.7 +; it under the terms of the GNU General Public License as published by
     5.8 +; the Free Software Foundation, either version 3 of the License, or
     5.9 +; (at your option) any later version.
    5.10 +;
    5.11 +; This program is distributed in the hope that it will be useful,
    5.12 +; but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.13 +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.14 +; GNU General Public License for more details.
    5.15 +;
    5.16 +; You should have received a copy of the GNU General Public License
    5.17 +; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    5.18 +
    5.19 +.org $8000
    5.20 +rom_start:
    5.21 +jmp language_entry
    5.22 +jmp service_entry
    5.23 +
    5.24 +; ROM type
    5.25 +.byte $c2       ; 6502 code (2), language ($40), service ($80)
    5.26 +
    5.27 +copyright_offset:
    5.28 +.byte [copyright_string - rom_start - 1]
    5.29 +
    5.30 +; Version
    5.31 +.byte 1
    5.32 +
    5.33 +; Title string
    5.34 +.byte "Jungle Journey (loader)", 0
    5.35 +
    5.36 +; Version string
    5.37 +.byte "1.0", 0
    5.38 +
    5.39 +copyright_string:
    5.40 +.byte "(C) 2011 David Boddie", 0
    5.41 +
    5.42 +; Second processor relocation address
    5.43 +.byte 0, $80, 0, 0
    5.44 +
    5.45 +language_entry:
    5.46 +
    5.47 +    jmp jungle_code
    5.48 +
    5.49 +service_entry:
    5.50 +
    5.51 +    cmp #4
    5.52 +    beq service_command
    5.53 +
    5.54 +    service_entry_exit:
    5.55 +    rts
    5.56 +
    5.57 +rom_name: .byte "JUNGLE"
    5.58 +
    5.59 +service_command:
    5.60 +
    5.61 +    tya                         ; push Y and X registers onto the stack
    5.62 +    pha
    5.63 +    txa
    5.64 +    pha
    5.65 +
    5.66 +    ldx #0
    5.67 +    service_command_loop:
    5.68 +    
    5.69 +        lda ($f2),y
    5.70 +        cmp rom_name,x
    5.71 +        bne service_command_exit
    5.72 +        inx
    5.73 +        iny
    5.74 +        cpx #10
    5.75 +        bne service_command_loop
    5.76 +    
    5.77 +    jsr jungle_code
    5.78 +    lda #0
    5.79 +    rts
    5.80 +    
    5.81 +    service_command_exit:
    5.82 +    pla                         ; pop Y and X registers off the stack
    5.83 +    tax
    5.84 +    pha
    5.85 +    tay
    5.86 +    lda #4                      ; restore A
    5.87 +    rts
    5.88 +
    5.89 +jungle_code:
    5.90 +
    5.91 +    lda #22         ; MODE 5
    5.92 +    jsr $ffee
    5.93 +    lda #5
    5.94 +    jsr $ffee
    5.95 +
    5.96 +    lda #23         ; disable flashing cursor
    5.97 +    jsr $ffee
    5.98 +    lda #1
    5.99 +    jsr $ffee
   5.100 +    ldx #7
   5.101 +    cursor_loop:
   5.102 +        lda #0
   5.103 +        jsr $ffee
   5.104 +        dex
   5.105 +        bpl cursor_loop
   5.106 +
   5.107 +    jsr set_hidden_palette
   5.108 +
   5.109 +    ; Define ENVELOPEs.
   5.110 +    lda #0
   5.111 +    sta $70
   5.112 +    define_envelopes_loop:
   5.113 +
   5.114 +        ldx $70
   5.115 +        lda envelopes_high,x
   5.116 +        tay
   5.117 +        lda envelopes_low,x
   5.118 +        tax
   5.119 +        lda #8
   5.120 +        jsr $fff1
   5.121 +
   5.122 +        inc $70
   5.123 +        lda $70
   5.124 +        cmp #4
   5.125 +        bne define_envelopes_loop
   5.126 +
   5.127 +    jsr copy_title_from_rom
   5.128 +
   5.129 +    lda #140
   5.130 +    jsr $fff4   ; *TAPE
   5.131 +
   5.132 +    jsr copy_title_down
   5.133 +    jsr move_completed_screen_down
   5.134 +    jsr copy_sprites_from_rom
   5.135 +    jsr copy_chars_from_rom
   5.136 +
   5.137 +    lda #129    ; returns y=255 or 0
   5.138 +    ldx #157    ; SPACE
   5.139 +    ldy #255
   5.140 +    wait_loop:
   5.141 +        jsr $fff4
   5.142 +        cpy #255
   5.143 +        bne wait_loop
   5.144 +
   5.145 +    ldx #<start_game
   5.146 +    ldy #>start_game
   5.147 +    jsr $fff7
   5.148 +    rts
   5.149 +
   5.150 +start_game: .byte "*JUNGLECODE", 13, 0
   5.151 +
   5.152 +set_hidden_palette:
   5.153 +
   5.154 +    lda #1
   5.155 +    sta $70
   5.156 +    lda #0
   5.157 +    sta $71
   5.158 +    jsr set_palette
   5.159 +
   5.160 +    ; Run on into the next routine.
   5.161 +
   5.162 +set_core_palette:
   5.163 +
   5.164 +    lda #2
   5.165 +    sta $70
   5.166 +    lda #2
   5.167 +    sta $71
   5.168 +    jsr set_palette
   5.169 +
   5.170 +    lda #3
   5.171 +    sta $70
   5.172 +    lda #3
   5.173 +    sta $71
   5.174 +    jsr set_palette
   5.175 +
   5.176 +    rts
   5.177 +
   5.178 +set_palette:
   5.179 +                    ; $70=logical colour
   5.180 +                    ; $71=physical colour
   5.181 +    lda $70
   5.182 +    sta $3dfb
   5.183 +    lda $71
   5.184 +    sta $3dfc
   5.185 +    lda #0
   5.186 +    sta $3dfd
   5.187 +    sta $3dfe
   5.188 +    sta $3dff
   5.189 +
   5.190 +    lda #$c         
   5.191 +    ldx #$fb
   5.192 +    ldy #$3d
   5.193 +    jsr $fff1
   5.194 +    rts
   5.195 +
   5.196 +envelopes_low:  .byte <explosion_envelope, <damage_envelope, <item_envelope, <key_envelope
   5.197 +envelopes_high: .byte >explosion_envelope, >damage_envelope, >item_envelope, >key_envelope
   5.198 +
   5.199 +explosion_envelope: .byte 1,1,252,0,0,10,0,0,126,0,0,130,126,126
   5.200 +damage_envelope:    .byte 2,4,8,0,248,2,0,2,126,0,0,130,126,126
   5.201 +item_envelope:      .byte 3,2,8,4,2,10,10,10,126,0,0,130,126,126
   5.202 +key_envelope:       .byte 4,2,4,40,0,8,1,3,126,0,0,130,126,126
   5.203 +
   5.204 +copy_title_from_rom:
   5.205 +
   5.206 +    lda #$00
   5.207 +    sta $70
   5.208 +    lda #$83
   5.209 +    sta $71
   5.210 +
   5.211 +    lda #$a0
   5.212 +    sta $72
   5.213 +    lda #$5a
   5.214 +    sta $73
   5.215 +
   5.216 +    ldx #$17
   5.217 +
   5.218 +    copy_title_from_rom_loop1:
   5.219 +
   5.220 +        ldy #0
   5.221 +        copy_title_from_rom_loop2:
   5.222 +
   5.223 +            lda ($70),y
   5.224 +            sta ($72),y
   5.225 +            iny
   5.226 +            cpy #0
   5.227 +            bne copy_title_from_rom_loop2
   5.228 +
   5.229 +        clc
   5.230 +        lda $72
   5.231 +        adc #$40
   5.232 +        sta $72
   5.233 +        lda $73
   5.234 +        adc #$01
   5.235 +        sta $73
   5.236 +        clc
   5.237 +
   5.238 +        lda $71
   5.239 +        adc #$01
   5.240 +        sta $71
   5.241 +
   5.242 +        dex
   5.243 +        bpl copy_title_from_rom_loop1
   5.244 +
   5.245 +    clc
   5.246 +    rts
   5.247 +
   5.248 +copy_title_down:
   5.249 +
   5.250 +    lda #$a0
   5.251 +    sta $70
   5.252 +    lda #$5a
   5.253 +    sta $71
   5.254 +
   5.255 +    lda #$00
   5.256 +    sta $72
   5.257 +    lda #$18
   5.258 +    sta $73
   5.259 +
   5.260 +    ldx #$05
   5.261 +
   5.262 +    copy_title_down_loop1:
   5.263 +
   5.264 +        ldy #0
   5.265 +        copy_title_down_loop2:
   5.266 +
   5.267 +            lda ($70),y
   5.268 +            sta ($72),y
   5.269 +            iny
   5.270 +            cpy #0
   5.271 +            bne copy_title_down_loop2
   5.272 +
   5.273 +        clc
   5.274 +        lda $70
   5.275 +        adc #$40
   5.276 +        sta $70
   5.277 +        lda $71
   5.278 +        adc #$01
   5.279 +        sta $71
   5.280 +        clc
   5.281 +
   5.282 +        lda $73
   5.283 +        adc #$01
   5.284 +        sta $73
   5.285 +
   5.286 +        dex
   5.287 +        bpl copy_title_down_loop1
   5.288 +
   5.289 +    clc
   5.290 +    rts
   5.291 +
   5.292 +move_completed_screen_down:
   5.293 +
   5.294 +    lda #$20
   5.295 +    sta $70
   5.296 +    lda #$62
   5.297 +    sta $71
   5.298 +
   5.299 +    lda #$00
   5.300 +    sta $72
   5.301 +    lda #$0f
   5.302 +    sta $73
   5.303 +
   5.304 +    ldx #128
   5.305 +
   5.306 +    move_completed_screen_loop:
   5.307 +
   5.308 +        ldy #1
   5.309 +        lda ($70),y
   5.310 +        and #$0f
   5.311 +        asl
   5.312 +        asl
   5.313 +        asl
   5.314 +        asl
   5.315 +        sta $80
   5.316 +        dey
   5.317 +        lda ($70),y
   5.318 +        and #$0f
   5.319 +        ora $80
   5.320 +        sta ($72),y
   5.321 +
   5.322 +        lda #0
   5.323 +        sta ($70),y
   5.324 +        iny
   5.325 +        sta ($70),y
   5.326 +
   5.327 +        clc
   5.328 +        lda $70
   5.329 +        adc #2
   5.330 +        sta $70
   5.331 +        lda $71
   5.332 +        adc #0
   5.333 +        sta $71
   5.334 +        clc
   5.335 +        
   5.336 +        lda $72
   5.337 +        adc #1
   5.338 +        sta $72
   5.339 +        lda $73
   5.340 +        adc #0
   5.341 +        sta $73
   5.342 +        clc
   5.343 +
   5.344 +        dex
   5.345 +        cpx #0
   5.346 +        bne move_completed_screen_next
   5.347 +
   5.348 +        ldx #128
   5.349 +
   5.350 +        clc
   5.351 +        lda $70
   5.352 +        adc #$40
   5.353 +        sta $70
   5.354 +        lda $71
   5.355 +        adc #$00
   5.356 +        sta $71
   5.357 +        clc
   5.358 +
   5.359 +        move_completed_screen_next:
   5.360 +        clc
   5.361 +
   5.362 +        lda $72
   5.363 +        cmp #$00
   5.364 +        bne move_completed_screen_loop
   5.365 +
   5.366 +        lda $73
   5.367 +        cmp #$18
   5.368 +        bne move_completed_screen_loop
   5.369 +
   5.370 +    clc
   5.371 +    rts
   5.372 +
   5.373 +copy_sprites_from_rom:
   5.374 +
   5.375 +    lda #$80
   5.376 +    sta $70
   5.377 +    lda #$ad
   5.378 +    sta $71
   5.379 +
   5.380 +    lda #$00
   5.381 +    sta $72
   5.382 +    lda #$54
   5.383 +    sta $73
   5.384 +
   5.385 +    ldx #$35
   5.386 +
   5.387 +    copy_sprites_from_rom_loop1:
   5.388 +
   5.389 +        ldy #0
   5.390 +        copy_sprites_from_rom_loop2:
   5.391 +
   5.392 +            lda ($70),y
   5.393 +            sta ($72),y
   5.394 +            iny
   5.395 +            cpy #16
   5.396 +            bne copy_sprites_from_rom_loop2
   5.397 +
   5.398 +        clc
   5.399 +        lda $70
   5.400 +        adc #$10
   5.401 +        sta $70
   5.402 +        lda $71
   5.403 +        adc #$00
   5.404 +        sta $71
   5.405 +        clc
   5.406 +
   5.407 +        lda $72
   5.408 +        adc #$10
   5.409 +        sta $72
   5.410 +        lda $73
   5.411 +        adc #$00
   5.412 +        sta $73
   5.413 +        clc
   5.414 +
   5.415 +        dex
   5.416 +        bpl copy_sprites_from_rom_loop1
   5.417 +
   5.418 +    clc
   5.419 +    rts
   5.420 +
   5.421 +copy_chars_from_rom:
   5.422 +
   5.423 +    lda #$00
   5.424 +    sta $70
   5.425 +    lda #$9b
   5.426 +    sta $71
   5.427 +
   5.428 +    lda #$00
   5.429 +    sta $72
   5.430 +    lda #$3f
   5.431 +    sta $73
   5.432 +
   5.433 +    copy_chars_from_rom_loop1:
   5.434 +
   5.435 +        ldy #0
   5.436 +        copy_chars_from_rom_loop2:
   5.437 +
   5.438 +            lda ($70),y
   5.439 +            sta ($72),y
   5.440 +            iny
   5.441 +            cpy #$80
   5.442 +            bne copy_chars_from_rom_loop2
   5.443 +
   5.444 +        clc
   5.445 +        lda $70
   5.446 +        adc #$80
   5.447 +        sta $70
   5.448 +        lda $71
   5.449 +        adc #$00
   5.450 +        sta $71
   5.451 +        clc
   5.452 +
   5.453 +        lda $72
   5.454 +        adc #$80
   5.455 +        sta $72
   5.456 +        lda $73
   5.457 +        adc #$00
   5.458 +        sta $73
   5.459 +        clc
   5.460 +
   5.461 +        cmp #$ad
   5.462 +        bne copy_chars_from_rom_loop1
   5.463 +        lda $72
   5.464 +        cmp #$80
   5.465 +        bne copy_chars_from_rom_loop1
   5.466 +
   5.467 +    clc
   5.468 +    rts
     6.1 --- a/tapecode.oph	Sun Oct 16 03:04:19 2011 +0200
     6.2 +++ b/tapecode.oph	Sun Oct 16 18:25:22 2011 +0200
     6.3 @@ -15,3 +15,21 @@
     6.4  
     6.5  .org $1e00
     6.6  .include "mapcode.oph"
     6.7 +
     6.8 +tile_addresses_low:  .byte $00, $60, $c0, $00, $60, $c0, $20
     6.9 +tile_addresses_high: .byte $54, $54, $54, $50, $50, $50, $51
    6.10 +
    6.11 +player_direction_chars_low: .byte $00,$30,$60,$90,$c0,$f0,$20,$50, $80,$b0,$e0,$10
    6.12 +player_direction_chars_high: .byte $3f,$3f,$3f,$3f,$3f,$3f,$40,$40, $40,$40,$40,$41
    6.13 +
    6.14 +enemy_direction_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    6.15 +enemy_direction_chars_high: .byte $41,$42,$42,$42,$42,$43,$43,$43
    6.16 +
    6.17 +emerge_explode_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    6.18 +emerge_explode_chars_high: .byte $4b,$4c,$4c,$4c,$4c,$4d,$4d,$4d
    6.19 +
    6.20 +item_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80,$c0
    6.21 +item_chars_high: .byte $4d,$4e,$4e,$4e,$4e,$4f,$4f,$4f,$4f
    6.22 +
    6.23 +projectile_chars_low: .byte $40,$50,$60,$70,$80,$90,$a0,$b0
    6.24 +.alias projectile_chars_high $41