castleraider

changeset 301:f2d5e8222b1a

Updated the text colours in the loader. Added code to report working area memory usage.
author David Boddie <david@boddie.org.uk>
date Sat Apr 05 23:35:23 2014 +0200
parents 2cc46aa21ee8
children c6755d404fa8
files build.py loader.oph
diffstat 2 files changed, 16 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/build.py	Sat Apr 05 19:04:10 2014 +0200
     1.2 +++ b/build.py	Sat Apr 05 23:35:23 2014 +0200
     1.3 @@ -208,6 +208,7 @@
     1.4      
     1.5      # Memory map
     1.6      memory_map = {
     1.7 +        "working area": 0xb00,
     1.8          "code start": 0x0e00,
     1.9          "data start": 0x2140,
    1.10          "tile sprites": 0x2aa0 + 0xc0,
    1.11 @@ -257,7 +258,7 @@
    1.12      # defined characters buffer).
    1.13      
    1.14      # Monster positions
    1.15 -    monster_positions_address       = 0xb00
    1.16 +    monster_positions_address     = memory_map["working area"]
    1.17      
    1.18      # Working information about tile visibility.
    1.19      tile_visibility_address       = monster_positions_address + 0x14
    1.20 @@ -282,6 +283,8 @@
    1.21      
    1.22      in_game_title_text_address = title_data_address + (title_rows * 10)
    1.23      
    1.24 +    working_end = in_game_title_text_address + in_game_title_text_length
    1.25 +    
    1.26      # Permanent data
    1.27      
    1.28      # Level data
    1.29 @@ -715,10 +718,19 @@
    1.30      #    print info[0], len(data), len(compressed), data == uncompressed
    1.31      
    1.32      loader_size = os.stat("LOADER")[stat.ST_SIZE]
    1.33 +    print
    1.34      print "%i bytes (%04x) of loader code" % (loader_size, loader_size)
    1.35      
    1.36      code_size = os.stat("CODE")[stat.ST_SIZE]
    1.37      print "%i bytes (%04x) of code" % (code_size, code_size)
    1.38 +    print
    1.39 +    
    1.40 +    # Calculate the amount of working space used.
    1.41 +    
    1.42 +    print "Working data area runs from 0b00 to %04x (%i bytes free)" % (working_end, 0xd00 - working_end)
    1.43 +    print
    1.44 +    
    1.45 +    # Calculate the amount of memory used for each file.
    1.46      
    1.47      code_finish = code_start + code_size
    1.48      print "CODE    runs from %04x to %04x" % (code_start, code_finish),
    1.49 @@ -729,8 +741,6 @@
    1.50      else:
    1.51          print " (%i bytes free)" % (data_start - code_finish)
    1.52      
    1.53 -    print "data    runs from %04x to %04x" % (data_start, level_data_start)
    1.54 -    
    1.55      levels_finish = levels_address + len(level_data)
    1.56      print "LEVELS  runs from %04x to %04x" % (levels_address, levels_finish),
    1.57      if levels_finish > sprite_area_address:
     2.1 --- a/loader.oph	Sat Apr 05 19:04:10 2014 +0200
     2.2 +++ b/loader.oph	Sat Apr 05 23:35:23 2014 +0200
     2.3 @@ -475,13 +475,13 @@
     2.4  
     2.5  init_load_window_vdu_bytes: .byte 28,0,30,19,26,12
     2.6  
     2.7 -title_text: .byte 17, 1
     2.8 +title_text: .byte 17, 3
     2.9              .byte " Copyright (C) 2014", 13, 10
    2.10              .byte 17, 2
    2.11              .byte "    David Boddie", 13, 10
    2.12 -            .byte 17, 3
    2.13 +            .byte 17, 2
    2.14              .byte " for Retro Software", 13, 10
    2.15 -            .byte 17, 2
    2.16 +            .byte 17, 1
    2.17              .byte "GNU GPL v.3 or later"
    2.18  title_text_end:
    2.19