Export LMARGN_save to C. People might want to preserve this setting in their program.
In turn rearrange startup code in order that LMARGN can be set by a 'constructor' (Do "initlib" later.)
This commit is contained in:
parent
4a38965384
commit
200b420562
1 changed files with 8 additions and 7 deletions
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
.export _exit, start, excexit, SP_save
|
.export _exit, start, excexit, SP_save
|
||||||
|
.export __LMARGN_save ; original LMARGN setting
|
||||||
|
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import callmain, zerobss
|
.import callmain, zerobss
|
||||||
|
@ -82,14 +83,10 @@ start:
|
||||||
|
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
; Call the module constructors.
|
|
||||||
|
|
||||||
jsr initlib
|
|
||||||
|
|
||||||
; Set the left margin to 0.
|
; Set the left margin to 0.
|
||||||
|
|
||||||
lda LMARGN
|
lda LMARGN
|
||||||
sta LMARGN_save
|
sta __LMARGN_save
|
||||||
ldy #0
|
ldy #0
|
||||||
sty LMARGN
|
sty LMARGN
|
||||||
|
|
||||||
|
@ -104,6 +101,10 @@ start:
|
||||||
dey ; Set Y to $FF
|
dey ; Set Y to $FF
|
||||||
sty CH ; remove keypress which might be in the input buffer
|
sty CH ; remove keypress which might be in the input buffer
|
||||||
|
|
||||||
|
; Call the module constructors.
|
||||||
|
|
||||||
|
jsr initlib
|
||||||
|
|
||||||
; Push the command-line arguments; and, call main().
|
; Push the command-line arguments; and, call main().
|
||||||
|
|
||||||
jsr callmain
|
jsr callmain
|
||||||
|
@ -119,7 +120,7 @@ excexit:jsr donelib ; Run module destructors; 'excexit' is called fr
|
||||||
|
|
||||||
; Restore the left margin.
|
; Restore the left margin.
|
||||||
|
|
||||||
lda LMARGN_save
|
lda __LMARGN_save
|
||||||
sta LMARGN
|
sta LMARGN
|
||||||
|
|
||||||
; Restore the kb mode.
|
; Restore the kb mode.
|
||||||
|
@ -196,7 +197,7 @@ excexit:jsr donelib ; Run module destructors; 'excexit' is called fr
|
||||||
|
|
||||||
SP_save: .res 1
|
SP_save: .res 1
|
||||||
SHFLOK_save: .res 1
|
SHFLOK_save: .res 1
|
||||||
LMARGN_save: .res 1
|
__LMARGN_save: .res 1
|
||||||
.ifndef __ATARIXL__
|
.ifndef __ATARIXL__
|
||||||
APPMHI_save: .res 2
|
APPMHI_save: .res 2
|
||||||
.endif
|
.endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue