Put the tables before the main code, and shrink the segment

Leaves more room for code and dynamic data/stack
This commit is contained in:
Brooke Vibber 2025-12-28 12:32:57 -08:00
commit 97fdc12565

View file

@ -10,18 +10,19 @@ SYMBOLS {
__RESERVED_MEMORY__: type = weak, value = $0000;
__SYSCHKHDR__: type = export, value = 0; # Disable system check header
__SYSCHKTRL__: type = export, value = 0; # Disable system check trailer
__TABLESEG_SIZE__: type = weak, value = 6 * $100;
__FRAMEBUFFER_START__: type = weak, value = $a000;
}
MEMORY {
ZP: file = "", define = yes, start = $0082, size = $007E;
# "system check" load chunk
SYSCHKCHNK: file = %O, start = $2E00, size = $0300;
# "main program" load chunk
# Note we reserve $4000-7fff for the bank-switch window.
#MAIN: file = %O, define = yes, start = %S, size = $BC20 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S;
MAIN: file = %O, define = yes, start = %S, size = $4000 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S;
# Note $a000-$bfff is against the BASIC cartridge, may require booting with OPTION.
TABLES: file = %O, define = yes, start = $8000, size = $a000 - $8000;
TABLES: file = %O, define = yes, start = %S, size = __TABLESEG_SIZE__;
# "main program" load chunk
MAIN: file = %O, define = yes, start = %S + __TABLESEG_SIZE__, size = __FRAMEBUFFER_START__ - __STACKSIZE__ - __RESERVED_MEMORY__ - __TABLESEG_SIZE__ - %S;
}
FILES {
%O: format = atari;
@ -34,6 +35,7 @@ SEGMENTS {
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp, optional = yes;
SYSCHK: load = SYSCHKCHNK, type = rw, define = yes, optional = yes;
TABLES: load = TABLES, type = ro, optional = yes, align = 256;
STARTUP: load = MAIN, type = ro, define = yes;
LOWBSS: load = MAIN, type = rw, optional = yes; # not zero initialized
LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
@ -43,7 +45,6 @@ SEGMENTS {
DATA: load = MAIN, type = rw;
INIT: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, define = yes;
TABLES: load = TABLES, type = ro, optional = yes, align = 256;
}
FEATURES {
CONDES: type = constructor,