castleraider

changeset 297:955194c54105

Moved the working data into page C, freeing up more space for code.
author David Boddie <david@boddie.org.uk>
date Mon Mar 31 22:53:29 2014 +0200
parents 839188f744b7
children 8627e554e78a
files build.py levels/default.txt
diffstat 2 files changed, 20 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/build.py	Mon Mar 31 00:29:30 2014 +0200
     1.2 +++ b/build.py	Mon Mar 31 22:53:29 2014 +0200
     1.3 @@ -151,7 +151,7 @@
     1.4      # Memory map
     1.5      memory_map = {
     1.6          "code start": 0x0e00,
     1.7 -        "data start": 0x210c,
     1.8 +        "data start": 0x2140,
     1.9          "tile sprites": 0x2aa0 + 0xc0,
    1.10          "character and object sprites": 0x2de0 + 0xc0,
    1.11          "bank 1 (panel)": 0x3000,
    1.12 @@ -166,18 +166,7 @@
    1.13      
    1.14      data_start = memory_map["data start"]
    1.15      
    1.16 -    # Monster positions
    1.17 -    monster_positions_address       = data_start
    1.18 -    
    1.19 -    # Working information about tile visibility.
    1.20 -    tile_visibility_address       = monster_positions_address + 0x14
    1.21 -    # Low and high bytes are adjusted by 16 bytes so that entries can be
    1.22 -    # addressed directly, starting with an index of 16.
    1.23 -    tile_visibility_low = (tile_visibility_address - 0x10) & 0xff
    1.24 -    tile_visibility_high = (tile_visibility_address - 0x10) >> 8
    1.25 -    
    1.26 -    # The furthest that spans can be displaced to the right.
    1.27 -    max_row_offsets               = tile_visibility_address + maximum_number_of_special_tiles
    1.28 +    # Global variables
    1.29      
    1.30      # Use the Econet workspace for the player variables.
    1.31      player_information            = 0x90
    1.32 @@ -205,6 +194,22 @@
    1.33      monster_right_offset          = monster_information + 4
    1.34      monster_right_max_offset      = monster_information + 5
    1.35      
    1.36 +    # Working data
    1.37 +    # Place working data in page C (the user defined characters buffer).
    1.38 +    
    1.39 +    # Monster positions
    1.40 +    monster_positions_address       = 0xc00
    1.41 +    
    1.42 +    # Working information about tile visibility.
    1.43 +    tile_visibility_address       = monster_positions_address + 0x14
    1.44 +    # Low and high bytes are adjusted by 16 bytes so that entries can be
    1.45 +    # addressed directly, starting with an index of 16.
    1.46 +    tile_visibility_low = (tile_visibility_address - 0x10) & 0xff
    1.47 +    tile_visibility_high = (tile_visibility_address - 0x10) >> 8
    1.48 +    
    1.49 +    # The furthest that spans can be displaced to the right.
    1.50 +    max_row_offsets               = tile_visibility_address + maximum_number_of_special_tiles
    1.51 +    
    1.52      # The tile type occurring at the left edge of the screen.
    1.53      initial_row_tiles             = max_row_offsets + 0x10
    1.54      # Indices into each row of the level data.
    1.55 @@ -213,7 +218,7 @@
    1.56      initial_row_offsets           = row_indices + 0x10
    1.57      
    1.58      # Level data
    1.59 -    level_data_start = initial_row_offsets + 0x10
    1.60 +    level_data_start = data_start
    1.61      
    1.62      # Visibility flags for special tiles
    1.63      special_tile_numbers_address  = level_data_start
     2.1 --- a/levels/default.txt	Mon Mar 31 00:29:30 2014 +0200
     2.2 +++ b/levels/default.txt	Mon Mar 31 22:53:29 2014 +0200
     2.3 @@ -62,7 +62,7 @@
     2.4  .........................]]]]]..........................]]]]]]]]]]]]]]]]]]............]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
     2.5  ..........................]].......................]]]]]]]]]]]]]]]]]]]]]]]]]]]].......]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
     2.6  ..........................]]........................|...]]]]]]]]]]]]]]]]]]...|.........3....................................................]
     2.7 -..........................]]........................|...]]]]]]]]]]]]]]]]]]X..|.....k...3.................................................yz.]
     2.8 +..........................]]........................|...]]]]]]]]]]]]]]]]]]X..|.k.......3.................................................yz.]
     2.9  ..........................]]....]]...>..............|...]]]]]]]]]]]]]]]]]]XX.|.........3....................................................]
    2.10  ..........................]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
    2.11  .............................................................................................................................................