1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00

use __RESERVED_MEMORY__ to reserve memory for the default 20x24 text screen

This commit is contained in:
Christian Groessler 2014-03-13 02:36:10 +01:00
parent 889783bedb
commit 84c655a907
2 changed files with 13 additions and 12 deletions

View File

@ -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 {

View File

@ -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