From: Christian Groessler Date: Thu, 13 Mar 2014 01:36:10 +0000 (+0100) Subject: use __RESERVED_MEMORY__ to reserve memory for the default 20x24 text screen X-Git-Tag: V2.15~57^2~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=84c655a907a8bd48739ea75a0e5106d32176696d;p=cc65 use __RESERVED_MEMORY__ to reserve memory for the default 20x24 text screen --- diff --git a/cfg/atari5200.cfg b/cfg/atari5200.cfg index ff74f2b7c..294cad26e 100644 --- a/cfg/atari5200.cfg +++ b/cfg/atari5200.cfg @@ -1,14 +1,15 @@ SYMBOLS { - __CARTSIZE__: type = weak, value = $4000; # possible values: $4000 and $8000 - __CART_ENTRY__: type = import; - __STACKSIZE__: type = weak, value = $0300; # 3 pages stack + __CARTSIZE__: type = weak, value = $4000; # possible values: $4000 and $8000 + __CART_ENTRY__: type = import; + __STACKSIZE__: type = weak, value = $0400; # 4 pages stack + __RESERVED_MEMORY__: type = export, value = $0200; # space for display list and 20x24 screen buffer } MEMORY { - ZP: file = "", start = $0019, size = $00E7, define = yes; - RAM: file = "", start = $021C, size = $4000 - __STACKSIZE__ - $021C, define = yes; - ROM: file = %O, start = $C000 - __CARTSIZE__, size = __CARTSIZE__ - $18, define = yes, fill = yes, fillval = $FF; - CARTNAME: file = %O, start = $BFE8, size = $0014 fill = yes, fillval = $40; - CARTYEAR: file = %O, start = $BFFC, size = $0002 fill = yes, fillval = $59; + ZP: file = "", start = $0019, size = $00E7, define = yes; + RAM: file = "", start = $021C, size = $4000 - __STACKSIZE__ - __RESERVED_MEMORY__ - $021C, define = yes; + ROM: file = %O, start = $C000 - __CARTSIZE__, size = __CARTSIZE__ - $18, define = yes, fill = yes, fillval = $FF; + CARTNAME: file = %O, start = $BFE8, size = $0014 fill = yes, fillval = $40; + CARTYEAR: file = %O, start = $BFFC, size = $0002 fill = yes, fillval = $59; CARTENTRY: file = %O, start = $BFFE, size = $0002; } SEGMENTS { diff --git a/libsrc/atari5200/crt0.s b/libsrc/atari5200/crt0.s index 3944cd2bf..56b58a541 100644 --- a/libsrc/atari5200/crt0.s +++ b/libsrc/atari5200/crt0.s @@ -6,8 +6,8 @@ .export _exit, start .export __STARTUP__ : absolute = 1 ; Mark as startup - .import __RAM_START__, __RAM_SIZE__ - .import __RESERVED_MEMORY__ + .import __RAM_START__, __RAM_SIZE__ + .import __RESERVED_MEMORY__ .import initlib, donelib, callmain .import zerobss, copydata @@ -32,9 +32,9 @@ start: ; setup the stack - lda #<(__RAM_START__ + __RAM_SIZE__) + lda #<(__RAM_START__ + __RAM_SIZE__ - __RESERVED_MEMORY__) sta sp - lda #>(__RAM_START__ + __RAM_SIZE__) + lda #>(__RAM_START__ + __RAM_SIZE__ - __RESERVED_MEMORY__) sta sp+1 ; Set argument stack ptr ; Call module constructors