junglejourney

changeset 218:958f6c30e575

Moved the tile and character sprites into the code ROM to see if there is any effect on the game speed.
author David Boddie <david@boddie.org.uk>
date Mon Oct 17 23:05:31 2011 +0200
parents 59f37c9e74e4
children 02610f059ac0
files buildrom.py romcode.oph romloader.oph
diffstat 3 files changed, 21 insertions(+), 17 deletions(-) [+]
line diff
     1.1 --- a/buildrom.py	Sun Oct 16 21:36:30 2011 +0200
     1.2 +++ b/buildrom.py	Mon Oct 17 23:05:31 2011 +0200
     1.3 @@ -33,22 +33,30 @@
     1.4          code_rom_file = "junglecode.rom"
     1.5          loader_rom_file = "jungle.rom"
     1.6      
     1.7 -    # Memory map
     1.8 +    # Memory map (code ROM)
     1.9      #
    1.10      # 8000 ROM header code
    1.11      #      CODE
    1.12 +    # A200 CHARS (0x1280 bytes of character sprites)
    1.13 +    # B480 SPRITES (0x360 bytes of tile sprites)
    1.14 +    # B7E0 space
    1.15 +    #
    1.16 +    # Memory map (loader ROM)
    1.17      #
    1.18      # 8000 ROM header code
    1.19      # 8400 title screen (0x1800 bytes including completion screen)
    1.20 -    #
    1.21 -    # 9C00 CHARS (0x1280 bytes of character sprites)
    1.22 -    # AE80 SPRITES (0x360 bytes of tile sprites)
    1.23 -    # B1E0 space
    1.24      
    1.25      system("ophis romcode.oph " + code_rom_file)
    1.26      
    1.27 +    romcode = open(code_rom_file, "rb").read()
    1.28 +    
    1.29 +    # Add padding before the data is appended to the code.
    1.30 +    romcode += (0x2200 - len(romcode))*"\x00"
    1.31 +    
    1.32 +    romcode += makesprites.read_sprites(makesprites.chars)
    1.33 +    romcode += makesprites.read_sprites(makesprites.tiles)
    1.34 +    
    1.35      # Add padding after the code to make a final image size of 16K.
    1.36 -    romcode = open(code_rom_file, "rb").read()
    1.37      romcode += (0x4000 - len(romcode))*"\x00"
    1.38      open(code_rom_file, "wb").write(romcode)
    1.39      
    1.40 @@ -65,8 +73,6 @@
    1.41      combined = makesprites.combine(completed, overlay)
    1.42      romdata += combined
    1.43      
    1.44 -    romdata += makesprites.read_sprites(makesprites.chars)
    1.45 -    romdata += makesprites.read_sprites(makesprites.tiles)
    1.46      romdata += (0x4000 - len(romdata))*"\x00"
    1.47      
    1.48      open(loader_rom_file, "wb").write(romdata)
     2.1 --- a/romcode.oph	Sun Oct 16 21:36:30 2011 +0200
     2.2 +++ b/romcode.oph	Mon Oct 17 23:05:31 2011 +0200
     2.3 @@ -83,20 +83,20 @@
     2.4  
     2.5  .include "mapcode.oph"
     2.6  
     2.7 -tile_addresses_low:  .byte $00, $60, $c0, $00, $60, $c0, $20
     2.8 -tile_addresses_high: .byte $54, $54, $54, $50, $50, $50, $51
     2.9 +tile_addresses_low:  .byte $80, $E0, $40, $00, $60, $c0, $20
    2.10 +tile_addresses_high: .byte $B4, $B4, $B5, $b3, $b3, $b3, $b4
    2.11  
    2.12  player_direction_chars_low: .byte $00,$30,$60,$90,$c0,$f0,$20,$50, $80,$b0,$e0,$10
    2.13 -player_direction_chars_high: .byte $3f,$3f,$3f,$3f,$3f,$3f,$40,$40, $40,$40,$40,$41
    2.14 +player_direction_chars_high: .byte $a2,$a2,$a2,$a2,$a2,$a2,$a3,$a3, $a3,$a3,$a3,$a4
    2.15  
    2.16  enemy_direction_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    2.17 -enemy_direction_chars_high: .byte $41,$42,$42,$42,$42,$43,$43,$43
    2.18 +enemy_direction_chars_high: .byte $a4,$a5,$a5,$a5,$a5,$a6,$a6,$a6
    2.19  
    2.20  emerge_explode_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80
    2.21 -emerge_explode_chars_high: .byte $4b,$4c,$4c,$4c,$4c,$4d,$4d,$4d
    2.22 +emerge_explode_chars_high: .byte $ae,$af,$af,$af,$af,$b0,$b0,$b0
    2.23  
    2.24  item_chars_low:  .byte $c0,$00,$40,$80,$c0,$00,$40,$80,$c0
    2.25 -item_chars_high: .byte $4d,$4e,$4e,$4e,$4e,$4f,$4f,$4f,$4f
    2.26 +item_chars_high: .byte $b0,$b1,$b1,$b1,$b1,$b2,$b2,$b2,$b2
    2.27  
    2.28  projectile_chars_low: .byte $40,$50,$60,$70,$80,$90,$a0,$b0
    2.29 -.alias projectile_chars_high $41
    2.30 +.alias projectile_chars_high $a4
     3.1 --- a/romloader.oph	Sun Oct 16 21:36:30 2011 +0200
     3.2 +++ b/romloader.oph	Mon Oct 17 23:05:31 2011 +0200
     3.3 @@ -159,8 +159,6 @@
     3.4      clc
     3.5  
     3.6      jsr move_completed_screen_down
     3.7 -    jsr copy_sprites_from_rom
     3.8 -    jsr copy_chars_from_rom
     3.9      jsr copy_launch_code
    3.10  
    3.11      jmp $1e00