Adapted, to the c64 target, the INIT-segment overlay scheme from the apple2 targets.

When a program starts running, INIT is moved from one place to another place.  Then, INIT's code is executed; and, the first place is re-used for variables.  After the INIT code has finished, the second place can be re-used by the heap and the C stack.  That means that initiation code and data won't waste any RAM space after they stop being needed.
This commit is contained in:
Greg King
2015-10-05 05:47:43 -04:00
parent 24c2da980b
commit 074e10d288
5 changed files with 200 additions and 104 deletions

View File

@@ -24,6 +24,7 @@ SCREEN_PTR := $D1 ; Pointer to current char in text screen
CURS_X := $D3 ; Cursor column
CURS_Y := $D6 ; Cursor row
CRAM_PTR := $F3 ; Pointer to current char in color RAM
FREKZP := $FB ; Five unused bytes
BASIC_BUF := $200 ; Location of command-line
BASIC_BUF_LEN = 89 ; Maximum length of command-line
@@ -212,4 +213,3 @@ CASSMOT = $20 ; Cassette motor on
TP_FAST = $80 ; Switch Rossmoeller TurboProcess to fast mode
RAMONLY = $F8 ; (~(LORAM | HIRAM | IOEN)) & $FF