Move constructor code into the INIT segment

git-svn-id: svn://svn.cc65.org/cc65/trunk@3405 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2005-02-26 09:28:46 +00:00
parent 6ec87c5dd9
commit d0bee35728
23 changed files with 166 additions and 59 deletions

View File

@@ -40,32 +40,31 @@ L2: lda KEY_COUNT ; Check characters again
.bss
keyvec: .res 2
.code
.segment "INIT"
initcgetc:
; Save the old vector
lda KeyStoreVec
sta keyvec
lda KeyStoreVec+1
sta keyvec+1
lda KeyStoreVec
sta keyvec
lda KeyStoreVec+1
sta keyvec+1
; Set the new vector. I can only hope that this works for other C128
; versions...
lda #<$C6B7
ldx #>$C6B7
SetVec: sei
sta KeyStoreVec
stx KeyStoreVec+1
cli
rts
lda #<$C6B7
ldx #>$C6B7
jmp SetVec
.code
donecgetc:
lda #$00
sta SCROLL
lda keyvec
ldx keyvec+1
bne SetVec
SetVec: sei
sta KeyStoreVec
stx KeyStoreVec+1
cli
rts

View File

@@ -18,6 +18,9 @@
cputdirect = PRINT
newline = NEWLINE
;--------------------------------------------------------------------------
.code
_cputcxy:
pha ; Save C
@@ -75,7 +78,8 @@ plot: ldy CURS_X
putchar = $CC2F
;--------------------------------------------------------------------------
; Module constructor/destructor
; Module constructor/destructor. Don't move the constructor into the INIT
; segment, because it shares most of the code with the destructor.
initcputc:
lda #$C0

View File

@@ -3,7 +3,7 @@
; Ullrich von Bassewitz, 2003-03-07
; Based on code from Stefan A. Haubenthal, <polluks@web.de>
; 2003-05-18, Greg King
; 2004-04-28, Ullrich von Bassewitz
; 2004-04-28, 2005-02-26, Ullrich von Bassewitz
;
; Scan a group of arguments that are in BASIC's input-buffer.
; Build an array that points to the beginning of each argument.
@@ -33,8 +33,11 @@ REM = $8f ; BASIC token-code
NAME_LEN = 16 ; maximum length of command-name
; Get possible command-line arguments.
;
; Get possible command-line arguments. Goes into the special INIT segment,
; which may be reused after the startup code is run
.segment "INIT"
initmainargs:
; Assume that the program was loaded, a moment ago, by the traditional LOAD