I compiled an app with --list app.lst. Usually, all the defined variables are shown in hexadecimal notation. For some reason, some values are shown in decimal - I have no idea why. The bold '**' were added by me to highlight the issue. If I use:
*=$5FFE
MAPFILE
Then the addresses are shown in hexadecimal as expected.
Code below exhibits the issue:
=$5c8b KEY_USE = DESTRUCT_PATH + $C8B ; ' ' <spacebar>
=$5c8c KEY_SEARCH = DESTRUCT_PATH + $C8C ; 'z'
=$5c8d KEY_MOVE = DESTRUCT_PATH + $C8D ; 'm'
=$5ffe MAPFILE = $5FFE ; The memory position where the file is loaded. The first two bytes in the file are the address $5D00.
=24576 UNIT_TYPE = MAPFILE + 2 ;Unit type 0=none (64 bytes)
=24640 UNIT_LOC_X = UNIT_TYPE + $40 ;Unit X location (64 bytes)
=24704 UNIT_LOC_Y = UNIT_TYPE + $80 ;Unit X location (64 bytes)
=24768 UNIT_A = UNIT_TYPE + $C0
=24832 UNIT_B = UNIT_TYPE + $100
=24896 UNIT_C = UNIT_TYPE + $140
=24960 UNIT_D = UNIT_TYPE + $180
=25024 UNIT_HEALTH = UNIT_TYPE + $1C0 ;Unit health (0 to 11) (64 bytes)
=25344 MAP = UNIT_TYPE + $300 ;Location of MAP (8K)
=$23 TILE =$23 ;The tile number to be plotted
=$24 TEMP_X =$24 ;Temporarily used for loops
=$25 TEMP_Y =$25 ;Temporarily used for loops</spacebar>
That's because $5FFE is just a number (actually bit string) and not a real address. Adding an integer to it results in an integer.
When mapping a loaded file I recommend this instead of adding offsets: