mirror of
https://github.com/a2-4am/4live.git
synced 2024-12-21 11:29:20 +00:00
save and restore X register so DOS doesn't lose track of how long the current input buffer command is
This commit is contained in:
parent
ae20c6049b
commit
3bdedd887e
20
src/4live.a
20
src/4live.a
@ -38,7 +38,6 @@
|
|||||||
!addr COUT = $FDED
|
!addr COUT = $FDED
|
||||||
|
|
||||||
;private arbitrary addresses
|
;private arbitrary addresses
|
||||||
!addr LINE = $40
|
|
||||||
!addr ZMANPARML = $40
|
!addr ZMANPARML = $40
|
||||||
!addr ZMANPARMH = $41
|
!addr ZMANPARMH = $41
|
||||||
!addr DOSBUFL = $42
|
!addr DOSBUFL = $42
|
||||||
@ -205,19 +204,28 @@ GlobalKeyboardHook
|
|||||||
;no -> return to DOS
|
;no -> return to DOS
|
||||||
rts
|
rts
|
||||||
+
|
+
|
||||||
|
txa
|
||||||
|
pha
|
||||||
|
|
||||||
;first, scroll the edit buffer onto the screen
|
;first, scroll the edit buffer onto the screen
|
||||||
;(this also swaps the current screen contents out so we can restore it later)
|
;(this also swaps the current screen contents out so we can restore it later)
|
||||||
jsr ScrollEditBufferIn
|
jsr ScrollEditBufferIn
|
||||||
|
|
||||||
;do the thing
|
;do the thing
|
||||||
|
lda #0 ;0=false, non-0=true
|
||||||
|
sta gIsDirty
|
||||||
jsr EditorMode
|
jsr EditorMode
|
||||||
|
|
||||||
;scroll the edit buffer out and the original screen back in
|
;scroll the edit buffer out and the original screen back in
|
||||||
jsr ScrollEditBufferOut
|
jsr ScrollEditBufferOut
|
||||||
|
|
||||||
;save to disk
|
;save to disk (if necessary)
|
||||||
|
lda gIsDirty
|
||||||
|
beq +
|
||||||
jsr SaveFile
|
jsr SaveFile
|
||||||
|
+
|
||||||
|
pla
|
||||||
|
tax
|
||||||
;lather, rinse, repeat
|
;lather, rinse, repeat
|
||||||
jmp GetKey
|
jmp GetKey
|
||||||
|
|
||||||
@ -377,6 +385,8 @@ EditorMode
|
|||||||
beq _doneEditorMode
|
beq _doneEditorMode
|
||||||
cmp #ESC
|
cmp #ESC
|
||||||
beq _doneEditorMode
|
beq _doneEditorMode
|
||||||
|
ldx #1
|
||||||
|
stx gIsDirty
|
||||||
cmp #IMPORTKEY
|
cmp #IMPORTKEY
|
||||||
beq ImportScreen
|
beq ImportScreen
|
||||||
cmp #LTARROW
|
cmp #LTARROW
|
||||||
@ -573,6 +583,10 @@ MyCH
|
|||||||
!byte 0
|
!byte 0
|
||||||
MyCV
|
MyCV
|
||||||
!byte 0
|
!byte 0
|
||||||
|
LINE
|
||||||
|
!byte 0
|
||||||
|
gIsDirty
|
||||||
|
!byte 0
|
||||||
|
|
||||||
TextCalcHi
|
TextCalcHi
|
||||||
!byte $04, $04, $05, $05, $06, $06, $07, $07
|
!byte $04, $04, $05, $05, $06, $06, $07, $07
|
||||||
|
Loading…
Reference in New Issue
Block a user