Merge pull request #10 from peterferrie/master

a bit smaller, and fix autosave bug
This commit is contained in:
4am 2016-11-16 13:58:41 -05:00 committed by GitHub
commit 541e284e20

View File

@ -432,10 +432,11 @@ RunFromBankedRAM
;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 ;returns X=0 jsr ScrollEditBufferIn ;returns Y=FF
;do the thing ;do the thing
stx IsDirty + 1 ;0=false, non-0=true iny
sty IsDirty + 1 ;0=false, non-0=true
;do the thing ;do the thing
jsr EditorMode jsr EditorMode
@ -613,27 +614,37 @@ MyWAIT
bne -- bne --
rts rts
ClearScreen ; does not clear status line
pha
clc
bcc +
HandleKeyImportScreen HandleKeyImportScreen
lda #<(LastLine - WIDTH) lda #<(LastLine - WIDTH)
sta OPSRC1L sta OPSRC1L
lda #>(LastLine - WIDTH) lda #>(LastLine - WIDTH)
sta OPSRC1H sta OPSRC1H
ldx #(HEIGHT - 2) + ldx #(HEIGHT - 2)
-- jsr SetTextCalc -- jsr SetTextCalc
ldy #(WIDTH - 1) ldy #(WIDTH - 1)
- lda (OPSRC1L), y lda #$A0
sta (OPSRC2L), y - bcc +
lda (OPSRC1L), y
+ sta (OPSRC2L), y
dey dey
bpl - bpl -
bcc +
sec sec
lda OPSRC1L lda OPSRC1L
sbc #WIDTH sbc #WIDTH
sta OPSRC1L sta OPSRC1L
bcs + bcs +
dec OPSRC1H dec OPSRC1H
sec
+ dex + dex
bpl -- bpl --
bcc ClearScreenRet
;print anything that isn't a special key ;print anything that isn't a special key
;wrap around screen position when we hit edges ;wrap around screen position when we hit edges
@ -670,6 +681,9 @@ ClearOnFirstKeypress
jsr MyCOUT jsr MyCOUT
jmp EditorMode ;always jmp EditorMode ;always
ClearScreenRet
pla
_doneEditorMode _doneEditorMode
rts rts
@ -702,7 +716,7 @@ SetRow
bpl EditorMode ;always bpl EditorMode ;always
HandleKeyClearScreen HandleKeyClearScreen
jsr ClearScreen ;returns flag=minus jsr ClearScreen
dey ;-2 dey ;-2
sty MyCV + 1 ;use big store to trigger wraparound sty MyCV + 1 ;use big store to trigger wraparound
;fall through ;fall through
@ -720,20 +734,6 @@ HandleKeyLineDown
ldy #0 ldy #0
beq SetRow ;always beq SetRow ;always
ClearScreen ; does not clear status line
pha
ldx #(HEIGHT - 2)
-- jsr SetTextCalc
ldy #(WIDTH - 1)
lda #$A0
- sta (OPSRC2L), y
dey
bpl -
dex
bpl --
pla
rts
MyKEYIN MyKEYIN
ldx MyCH + 1 ldx MyCH + 1