2016-10-16 15:11:04 +00:00
|
|
|
;
|
|
|
|
; 4LIVE
|
2016-11-03 16:03:56 +00:00
|
|
|
; Copyright (c) 2016 by 4am && qkumba
|
|
|
|
; 100% open source, see LICENSE file
|
2016-10-16 15:11:04 +00:00
|
|
|
;
|
|
|
|
!cpu 6502
|
2016-11-11 02:50:30 +00:00
|
|
|
!ct "lcase.ct"
|
2016-10-28 16:09:53 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;user-defined
|
|
|
|
HOTKEY = $80 ; CTRL-@
|
|
|
|
IMPORTKEY = $89 ; CTRL-I
|
|
|
|
CLEARKEY = $8E ; CTRL-N
|
|
|
|
SAVEKEY = $93 ; CTRL-S
|
|
|
|
|
2016-10-16 15:11:04 +00:00
|
|
|
;
|
2016-10-16 18:32:54 +00:00
|
|
|
!addr KSWL = $38
|
2016-10-26 21:02:52 +00:00
|
|
|
!addr KSWH = $39
|
2016-11-15 07:23:57 +00:00
|
|
|
!addr FCBFOP = $40
|
2016-10-27 19:16:02 +00:00
|
|
|
!addr GETIOB = $3E3
|
2016-10-16 18:32:54 +00:00
|
|
|
!addr WARMDOS = $3D0
|
2016-10-27 19:16:02 +00:00
|
|
|
!addr DOSBASE = $3D2
|
|
|
|
!addr FILEMAN = $3D6
|
|
|
|
!addr GETPARM = $3DC
|
2016-10-16 18:32:54 +00:00
|
|
|
!addr KBD = $C000
|
|
|
|
!addr STROBE = $C010
|
2016-10-28 16:55:05 +00:00
|
|
|
!addr LCBANK2 = $C083
|
2016-11-10 23:35:25 +00:00
|
|
|
!addr ROMIN1 = $C089
|
|
|
|
!addr LCBANK1 = $C08B
|
2016-11-01 05:14:14 +00:00
|
|
|
!addr APLDETECT = $FBB3 ;#06 if IIe or later
|
2016-10-26 21:02:52 +00:00
|
|
|
!addr KEYIN = $FD1B
|
2016-11-01 16:23:03 +00:00
|
|
|
!addr RDCHAR = $FD35
|
|
|
|
!addr COUT = $FDED
|
2016-10-16 18:32:54 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
;private arbitrary addresses, shared with DOS to avoid conflict
|
|
|
|
!addr OPSRC1L = $40
|
|
|
|
!addr OPSRC1H = $41
|
|
|
|
!addr OPDST1L = $42
|
|
|
|
!addr OPDST1H = $43
|
|
|
|
!addr OPSRC2L = $44
|
|
|
|
!addr OPSRC2H = $45
|
|
|
|
!addr OPDST2L = $46
|
|
|
|
!addr OPDST2H = $47
|
|
|
|
!addr SCROLLLINE = $48
|
2016-10-16 18:32:54 +00:00
|
|
|
|
2016-10-26 21:02:52 +00:00
|
|
|
;constants
|
2016-11-01 05:14:14 +00:00
|
|
|
A2E = $06
|
|
|
|
INVSPACE = $20
|
2016-10-28 16:09:53 +00:00
|
|
|
LTARROW = $88
|
2016-11-01 05:14:14 +00:00
|
|
|
DNARROW = $8A
|
2016-10-28 16:09:53 +00:00
|
|
|
UPARROW = $8B
|
2016-10-26 21:02:52 +00:00
|
|
|
RETURN = $8D
|
2016-10-28 16:09:53 +00:00
|
|
|
RTARROW = $95
|
|
|
|
ESC = $9B
|
2016-11-01 05:14:14 +00:00
|
|
|
DELETE = $FF
|
2016-11-15 07:23:57 +00:00
|
|
|
|
2016-10-27 19:16:02 +00:00
|
|
|
IOBSLOT = 1
|
|
|
|
IOBDRIVE = 2
|
|
|
|
NAMELEN = 30
|
|
|
|
CREATEFILE = 0
|
|
|
|
OPENEXISTING = 1
|
2016-10-28 16:55:05 +00:00
|
|
|
SPECIAL = 8
|
2016-10-27 19:16:02 +00:00
|
|
|
CMDOPEN = 1
|
|
|
|
CMDCLOSE = 2
|
|
|
|
CMDREAD = 3
|
|
|
|
READRANGE = 2
|
2016-11-15 07:23:57 +00:00
|
|
|
POSREADRANGE = 4
|
|
|
|
WIDTH = 40
|
|
|
|
HEIGHT = 24
|
2016-11-16 06:56:26 +00:00
|
|
|
LDRBASE = $2d9
|
2016-11-17 06:53:50 +00:00
|
|
|
INSTALLBUFFER = $249 ; yes, the overlay overwrites the loader...
|
2016-11-16 06:56:26 +00:00
|
|
|
SWAPBUFFER = $900 ; (LoadSaveEnd - LoadSaveStart) size
|
|
|
|
; needed by DiversiDOS, must be page-aligned
|
|
|
|
; region is preserved across calls
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
*=LDRBASE-4
|
|
|
|
LdrHeader
|
|
|
|
!word LDRBASE, LdrEnd - LdrStart
|
2016-10-16 18:32:54 +00:00
|
|
|
|
2016-11-17 06:53:50 +00:00
|
|
|
;loader loads to pages 2-3, loads discardable install code also to pages 2-3
|
|
|
|
;and carries proxy routines including file manager and banked RAM exchange for DiversiDOS
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
LdrStart
|
2016-11-16 06:56:26 +00:00
|
|
|
;set filename pointer in MLI request packet
|
2016-10-28 16:55:05 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
lda FCBFOP
|
|
|
|
sta FileName
|
|
|
|
lda FCBFOP + 1
|
|
|
|
sta FileName + 1
|
2016-10-28 16:55:05 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;set slot and drive in MLI request packet
|
2016-10-28 16:55:05 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
jsr GETIOB
|
2016-11-17 05:32:28 +00:00
|
|
|
pha ;save for later
|
2016-11-16 06:56:26 +00:00
|
|
|
sty OPSRC1L
|
|
|
|
sta OPSRC1H
|
2016-11-15 07:23:57 +00:00
|
|
|
ldy #IOBDRIVE
|
2016-11-16 06:56:26 +00:00
|
|
|
lda (OPSRC1L), y
|
2016-11-15 07:23:57 +00:00
|
|
|
sta FileDrive
|
|
|
|
dey ;ldy #IOBSLOT
|
2016-11-16 06:56:26 +00:00
|
|
|
lda (OPSRC1L), y
|
2016-11-15 07:23:57 +00:00
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
sta FileSlot
|
|
|
|
dey ;ldy #00
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;open self and read first overlay
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
jsr OpenMainFile
|
2016-11-15 07:23:57 +00:00
|
|
|
jsr DOSMLI
|
|
|
|
!byte LdrReadMLI_e - LdrReadMLI_b
|
|
|
|
LdrReadMLI_b
|
|
|
|
!byte CMDREAD
|
|
|
|
!byte POSREADRANGE
|
|
|
|
!word 0 ;record number
|
|
|
|
!word LdrEnd - LdrHeader ;offset
|
|
|
|
!word InstallEnd - InstallStart
|
|
|
|
;number of bytes
|
|
|
|
!word INSTALLBUFFER ;buffer
|
|
|
|
LdrReadMLI_e
|
|
|
|
|
|
|
|
;no need to close read-only files
|
|
|
|
;DOS simply returns in that case
|
|
|
|
;written files are the important ones
|
|
|
|
;but we're not writing anything here
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
jmp INSTALLBUFFER
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;set input name
|
|
|
|
|
|
|
|
OpenDataFile
|
2016-11-16 06:56:26 +00:00
|
|
|
ldy #(NAMELEN - 1)
|
|
|
|
|
|
|
|
OpenMainFile
|
2016-11-15 07:23:57 +00:00
|
|
|
lda FileName
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST1L
|
2016-11-15 07:23:57 +00:00
|
|
|
lda FileName + 1
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST1H
|
|
|
|
lda LCBANK2
|
|
|
|
lda LCBANK2
|
2016-10-27 19:16:02 +00:00
|
|
|
|
|
|
|
;set input name
|
|
|
|
|
|
|
|
lda #$A0
|
|
|
|
- cpy #(FileName_e - FileName_b)
|
|
|
|
bcs +
|
|
|
|
lda FileName_b, y
|
2016-11-16 06:56:26 +00:00
|
|
|
+ sta (OPDST1L), y
|
2016-10-27 19:16:02 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
OpenFile
|
|
|
|
jsr DOSMLI
|
|
|
|
!byte OpenMLI_e - OpenMLI_b
|
|
|
|
OpenMLI_b
|
|
|
|
!byte CMDOPEN
|
|
|
|
!byte 0 ;unused
|
|
|
|
!word 0 ;variable records
|
|
|
|
!byte 0 ;any volume
|
|
|
|
FileDrive
|
|
|
|
!text "Q" ;self-modified
|
|
|
|
FileSlot
|
|
|
|
!text "Q" ;self-modified
|
|
|
|
!byte SPECIAL ;file type for when we save
|
|
|
|
FileName
|
|
|
|
!text "4s" ;self-modified
|
|
|
|
OpenMLI_e
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
FileName_b
|
|
|
|
!text "_4LIVE DATA"
|
|
|
|
FileName_e
|
|
|
|
|
|
|
|
;first byte fetched is number of byte to follow,
|
|
|
|
;copy parameters to file manager parameter list,
|
|
|
|
;and then dispatch the request
|
|
|
|
|
|
|
|
DOSMLI
|
|
|
|
pla
|
|
|
|
tay
|
|
|
|
pla
|
|
|
|
tax
|
|
|
|
iny
|
2016-11-16 06:56:26 +00:00
|
|
|
sty OPSRC1L
|
2016-11-15 07:23:57 +00:00
|
|
|
bne +
|
|
|
|
inx
|
2016-11-16 06:56:26 +00:00
|
|
|
+ stx OPSRC1H
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;get file manager parameter list
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
jsr GETPARM
|
2016-11-16 06:56:26 +00:00
|
|
|
sty OPDST1L
|
|
|
|
sta OPDST1H
|
2016-11-15 07:23:57 +00:00
|
|
|
ldy #0
|
2016-11-16 06:56:26 +00:00
|
|
|
lda (OPSRC1L), y
|
2016-11-15 07:23:57 +00:00
|
|
|
tay
|
|
|
|
clc
|
2016-11-16 06:56:26 +00:00
|
|
|
adc OPSRC1L
|
2016-11-15 07:23:57 +00:00
|
|
|
tax
|
2016-11-16 06:56:26 +00:00
|
|
|
lda OPSRC1H
|
2016-11-15 07:23:57 +00:00
|
|
|
adc #0
|
|
|
|
pha
|
|
|
|
txa
|
|
|
|
pha
|
2016-11-16 06:56:26 +00:00
|
|
|
- lda (OPSRC1L), y
|
2016-11-10 23:35:25 +00:00
|
|
|
dey
|
2016-11-16 06:56:26 +00:00
|
|
|
sta (OPDST1L), y
|
2016-11-10 23:35:25 +00:00
|
|
|
bne -
|
2016-11-15 07:23:57 +00:00
|
|
|
XREG
|
|
|
|
ldx #OPENEXISTING
|
|
|
|
|
|
|
|
SwapFILEMAN
|
|
|
|
jmp FILEMAN ;self-modified from JMP to JSR
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
BankInRAM1
|
|
|
|
bit LCBANK1
|
|
|
|
bit LCBANK1
|
|
|
|
|
|
|
|
ReuseRts
|
|
|
|
rts
|
|
|
|
|
|
|
|
;support enhanced flashing cursor while waiting for key, if available.
|
|
|
|
;it works by passing to the routine the character under the cursor.
|
|
|
|
;the ROM toggles between that character and the Delete character.
|
|
|
|
;on an Apple II+, the cursor is an inverse space in DOS mode.
|
|
|
|
;our cursor flashes.
|
|
|
|
|
|
|
|
GlobalKeyboardHook
|
|
|
|
jsr KEYIN
|
|
|
|
|
|
|
|
GetKey
|
|
|
|
;are we on?
|
|
|
|
cmp #HOTKEY
|
|
|
|
|
|
|
|
;no -> return to DOS
|
|
|
|
bne ReuseRts
|
2016-11-10 23:35:25 +00:00
|
|
|
|
|
|
|
jsr BankInRAM1
|
2016-11-15 07:23:57 +00:00
|
|
|
jsr RunFromBankedRAM
|
|
|
|
lda ROMIN1
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;lather, rinse, repeat
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr RDCHAR ;returns non-zero
|
|
|
|
bne GetKey
|
2016-11-15 07:23:57 +00:00
|
|
|
|
|
|
|
ReadFile
|
|
|
|
WriteFile
|
|
|
|
jsr ExchangeSwapBanked1
|
|
|
|
jsr DOSMLI
|
|
|
|
!byte ReadMLI_e - ReadMLI_b
|
|
|
|
ReadMLI_b
|
|
|
|
ReadWriteCmd
|
|
|
|
!byte CMDREAD
|
|
|
|
!byte READRANGE
|
|
|
|
!word 0 ;record number
|
|
|
|
!word 0 ;offset
|
|
|
|
|
|
|
|
ReadSize
|
|
|
|
WriteSize
|
|
|
|
!word (LoadSaveEnd - LoadSaveStart)
|
|
|
|
;number of bytes
|
|
|
|
ReadBuffer
|
|
|
|
WriteBuffer
|
|
|
|
!word LoadSaveStart ;buffer, self-modified in DiversiDOS
|
|
|
|
ReadMLI_e
|
|
|
|
;fall through to ExchangeBanked1
|
|
|
|
|
|
|
|
;sorry, I couldn't find a simpler way...
|
|
|
|
|
|
|
|
ExchangeSwapBanked1
|
|
|
|
rts ;self-modified to LDA in DiversiDOS environment
|
2016-11-16 06:56:26 +00:00
|
|
|
!byte (>LoadSaveStart) - >((<(LoadSaveEnd - LoadSaveStart)) + 255)
|
|
|
|
sta OPDST1H
|
2016-11-15 07:23:57 +00:00
|
|
|
ldx #>(LoadSaveEnd - LoadSaveStart)
|
|
|
|
ldy #<(LoadSaveStart - LoadSaveEnd)
|
|
|
|
lda #<(LoadSaveEnd - LoadSaveStart)
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC1L
|
2016-11-15 07:23:57 +00:00
|
|
|
lda #<LoadSaveEnd
|
|
|
|
|
|
|
|
ExchangeSwapSet
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST1L
|
|
|
|
lda #(>SWAPBUFFER) - >((<(LoadSaveEnd - LoadSaveStart)) + 255)
|
|
|
|
sta OPSRC1H
|
|
|
|
- lda (OPSRC1L), y
|
2016-11-15 07:23:57 +00:00
|
|
|
pha
|
2016-11-16 06:56:26 +00:00
|
|
|
lda (OPDST1L), y
|
|
|
|
sta (OPSRC1L), y
|
2016-11-15 07:23:57 +00:00
|
|
|
pla
|
2016-11-16 06:56:26 +00:00
|
|
|
sta (OPDST1L), y
|
2016-11-10 23:35:25 +00:00
|
|
|
iny
|
2016-11-16 06:56:26 +00:00
|
|
|
bne -
|
|
|
|
inc OPSRC1H
|
|
|
|
inc OPDST1H
|
2016-11-10 23:35:25 +00:00
|
|
|
dex
|
2016-11-16 06:56:26 +00:00
|
|
|
bpl -
|
2016-11-15 07:23:57 +00:00
|
|
|
rts
|
|
|
|
LdrEnd
|
2016-11-17 06:53:50 +00:00
|
|
|
!if ((LDRBASE + LdrEnd - LdrStart) > $3D0) {
|
|
|
|
!error "swap code too large, ", (LDRBASE + LdrEnd - LdrStart) - $3D0, " bytes too many"
|
2016-11-15 07:23:57 +00:00
|
|
|
}
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;install routine is an overlay that is loaded by loader routine above
|
|
|
|
;loads editor code and data file into banked RAM either directly for DOS 3.3
|
|
|
|
;or via RAM exchange for DiversiDOS
|
|
|
|
|
|
|
|
InstallStart
|
|
|
|
!pseudopc INSTALLBUFFER {
|
2016-11-16 06:56:26 +00:00
|
|
|
;check for DiversiDOS
|
2016-11-15 07:23:57 +00:00
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
pla
|
2016-11-16 06:56:26 +00:00
|
|
|
eor #$BF
|
|
|
|
bne + ;regular DOS
|
2016-11-15 07:23:57 +00:00
|
|
|
sta ReadBuffer
|
|
|
|
lda #>SWAPBUFFER
|
|
|
|
sta ReadBuffer + 1
|
|
|
|
sta InstallReadBuffer + 1
|
|
|
|
lda #$A9 ;LDA
|
|
|
|
sta ExchangeSwapBanked1
|
|
|
|
sta ExchangeSwapBanked2
|
|
|
|
+
|
|
|
|
;enable reading directly into banked RAM
|
|
|
|
|
|
|
|
jsr BankInRAM1
|
|
|
|
|
|
|
|
;read second overlay to banked RAM
|
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr ReadEditor
|
2016-11-15 07:23:57 +00:00
|
|
|
|
|
|
|
;open source file and read it if available
|
|
|
|
|
|
|
|
jsr OpenDataFile
|
2016-11-03 06:32:10 +00:00
|
|
|
bcs +
|
|
|
|
jsr ReadFile
|
|
|
|
+
|
2016-11-01 05:14:14 +00:00
|
|
|
;set to true if no data file found (carry is set)
|
|
|
|
|
|
|
|
rol ClearOnFirstKeypress + 1
|
|
|
|
|
|
|
|
ldx SaveCH
|
|
|
|
stx MyCH + 1
|
|
|
|
ldy SaveCV
|
|
|
|
sty MyCV + 1
|
|
|
|
jsr MyBASCALC
|
2016-10-27 19:16:02 +00:00
|
|
|
|
|
|
|
;switch to write mode for future accesses
|
|
|
|
|
|
|
|
inc ReadWriteCmd ;lda WRITECMD / sta ReadWriteCmd
|
2016-11-15 07:23:57 +00:00
|
|
|
dec XREG + 1 ;lda #CREATEFILE / sta XREG + 1
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-10 23:35:25 +00:00
|
|
|
lda ROMIN1
|
2016-10-28 16:55:05 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
;switch cursor type depending on Apple revision
|
|
|
|
|
|
|
|
lda APLDETECT
|
|
|
|
cmp #A2E
|
|
|
|
beq +
|
|
|
|
lda #INVSPACE
|
|
|
|
sta CharDel + 1
|
|
|
|
lda #("z" + 1)
|
|
|
|
sta CharMap1 + 1
|
|
|
|
sta CharMap2 + 1
|
|
|
|
+
|
2016-10-27 19:16:02 +00:00
|
|
|
;display the welcome message, now that we're finally done
|
|
|
|
|
2016-10-16 18:32:54 +00:00
|
|
|
ldy #0
|
2016-11-11 02:50:30 +00:00
|
|
|
beq ++
|
|
|
|
CharMap1
|
|
|
|
cmp #0 ;self-modified
|
|
|
|
bcs +
|
|
|
|
cmp #"a"
|
|
|
|
bcc +
|
|
|
|
and #$DF
|
|
|
|
+ jsr COUT
|
|
|
|
++ iny
|
2016-10-26 21:02:52 +00:00
|
|
|
lda _WelcomeMessage-1,y
|
2016-11-11 02:50:30 +00:00
|
|
|
bne CharMap1
|
2016-10-16 18:32:54 +00:00
|
|
|
lda #<GlobalKeyboardHook
|
|
|
|
sta KSWL
|
|
|
|
lda #>GlobalKeyboardHook
|
2016-10-26 21:02:52 +00:00
|
|
|
sta KSWH
|
2016-10-27 19:16:02 +00:00
|
|
|
jmp WARMDOS
|
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
ReadEditor
|
|
|
|
jsr ExchangeSwapBanked2
|
|
|
|
lda #$20
|
|
|
|
sta SwapFILEMAN
|
|
|
|
jsr DOSMLI
|
|
|
|
!byte InstallReadMLI_e - InstallReadMLI_b
|
|
|
|
InstallReadMLI_b
|
|
|
|
!byte CMDREAD
|
|
|
|
!byte POSREADRANGE
|
|
|
|
!word 0 ;record number
|
|
|
|
!word BankedCopyStart - LdrHeader
|
|
|
|
;offset
|
|
|
|
!word BankedCopyEnd - BankedCopyStart
|
|
|
|
;number of bytes
|
|
|
|
InstallReadBuffer
|
|
|
|
!word $D000 ;buffer
|
|
|
|
InstallReadMLI_e
|
|
|
|
;fall through to ExchangeBanked2
|
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
ExchangeSwapBanked2
|
2016-11-11 00:19:41 +00:00
|
|
|
rts ;self-modified to LDA in DiversiDOS environment
|
2016-11-15 07:23:57 +00:00
|
|
|
!byte ((>$D000) - >((<(BankedCopyEnd - BankedCopyStart)) + 255))
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST1H
|
2016-11-15 07:23:57 +00:00
|
|
|
ldx #>(BankedCopyEnd - BankedCopyStart)
|
|
|
|
ldy #<(BankedCopyStart - BankedCopyEnd)
|
|
|
|
lda #<(BankedCopyEnd - BankedCopyStart)
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC1L
|
2016-11-15 07:23:57 +00:00
|
|
|
jmp ExchangeSwapSet
|
|
|
|
|
|
|
|
_WelcomeMessage
|
2016-11-16 19:37:26 +00:00
|
|
|
!text $8D, "4LIVE ready. Press Ctrl+", HOTKEY + $40, " to activate.", $8D, 0
|
2016-11-10 23:35:25 +00:00
|
|
|
}
|
2016-11-15 07:23:57 +00:00
|
|
|
InstallEnd
|
|
|
|
!if >(InstallEnd - InstallStart) {
|
2016-11-17 06:53:50 +00:00
|
|
|
!error "swap code too large, ends at ", (InstallEnd - InstallStart) - $100, " bytes too many"
|
2016-11-10 23:35:25 +00:00
|
|
|
}
|
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
;editor code is an overlay that is loaded by install routine above
|
|
|
|
|
2016-11-10 23:35:25 +00:00
|
|
|
BankedCopyStart
|
|
|
|
!pseudopc $D000 {
|
|
|
|
RunFromBankedRAM
|
2016-11-01 05:14:14 +00:00
|
|
|
;preserve X across calls
|
|
|
|
;it's important for DOS
|
|
|
|
|
2016-11-10 23:35:25 +00:00
|
|
|
txa
|
2016-10-31 13:51:00 +00:00
|
|
|
pha
|
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
;first, scroll the edit buffer onto the screen
|
|
|
|
;(this also swaps the current screen contents out so we can restore it later)
|
2016-11-16 18:57:20 +00:00
|
|
|
jsr ScrollEditBufferIn ;returns Y=FF
|
2016-11-01 05:14:14 +00:00
|
|
|
|
|
|
|
;do the thing
|
2016-11-16 18:57:20 +00:00
|
|
|
iny
|
|
|
|
sty IsDirty + 1 ;0=false, non-0=true
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;do the thing
|
2016-10-26 21:02:52 +00:00
|
|
|
jsr EditorMode
|
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
;scroll the edit buffer out and the original screen back in
|
|
|
|
jsr ScrollEditBufferOut
|
|
|
|
|
2016-10-31 13:51:00 +00:00
|
|
|
;save to disk (if necessary)
|
2016-11-01 05:14:14 +00:00
|
|
|
IsDirty
|
2016-11-15 07:23:57 +00:00
|
|
|
lda #"Q" ;self-modified
|
2016-10-31 13:51:00 +00:00
|
|
|
beq +
|
2016-11-01 05:14:14 +00:00
|
|
|
|
|
|
|
;save to disk
|
2016-10-30 19:17:45 +00:00
|
|
|
jsr SaveFile
|
2016-11-01 05:14:14 +00:00
|
|
|
|
|
|
|
+ pla
|
2016-10-31 13:51:00 +00:00
|
|
|
tax
|
2016-11-10 23:35:25 +00:00
|
|
|
rts
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
ScrollEditBufferIn
|
2016-11-17 05:32:28 +00:00
|
|
|
ldy #(<(ScrollParms2 - ScrollParms1) - 1)
|
|
|
|
jsr SetScrollLines
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;copy last line on screen to temporary buffer
|
2016-10-30 01:17:18 +00:00
|
|
|
-- ldy #(WIDTH - 1)
|
2016-10-30 19:17:45 +00:00
|
|
|
- lda $07D0, y
|
2016-11-16 06:56:26 +00:00
|
|
|
sta (OPSRC1L), y
|
2016-10-30 01:17:18 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;copy each line on screen down to next line (leaves top line untouched)
|
2016-10-30 01:17:18 +00:00
|
|
|
jsr ScrollTextScreenDown
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;copy last line of edit buffer to top line on screen
|
2016-10-30 01:17:18 +00:00
|
|
|
ldy #(WIDTH - 1)
|
2016-11-16 06:56:26 +00:00
|
|
|
- lda (OPDST1L), y
|
2016-11-11 02:50:30 +00:00
|
|
|
CharMap2
|
2016-11-10 23:35:25 +00:00
|
|
|
cmp #0 ;self-modified
|
|
|
|
bcs +
|
2016-11-11 02:50:30 +00:00
|
|
|
cmp #"a"
|
2016-11-08 04:53:07 +00:00
|
|
|
bcc +
|
2016-11-10 23:35:25 +00:00
|
|
|
and #$DF
|
|
|
|
+ sta $0400, y
|
2016-10-30 01:17:18 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;animation delay
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr Delay
|
2016-10-30 19:17:45 +00:00
|
|
|
|
2016-11-03 06:32:10 +00:00
|
|
|
lda #-WIDTH
|
2016-11-16 06:56:26 +00:00
|
|
|
ldy #$FF
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr UpdateVirtualOff ;returns zr/nz state of SCROLLLINE
|
2016-10-30 01:17:18 +00:00
|
|
|
bne --
|
|
|
|
rts
|
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
ScrollEditBufferOut
|
2016-11-17 05:32:28 +00:00
|
|
|
ldy #((<(ScrollParms2 - ScrollParms1) * 2) - 1)
|
|
|
|
jsr SetScrollLines
|
2016-10-30 19:17:45 +00:00
|
|
|
|
|
|
|
;copy first line on screen to temporary buffer
|
2016-10-27 19:16:02 +00:00
|
|
|
-- ldy #(WIDTH - 1)
|
2016-11-17 05:32:28 +00:00
|
|
|
- lda $0400, y
|
2016-11-16 06:56:26 +00:00
|
|
|
sta (OPSRC1L), y
|
2016-10-26 21:02:52 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
;copy each line on screen up to next line (leaves bottom line untouched)
|
|
|
|
jsr ScrollTextScreenUp
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
;copy first line of edit buffer to last line on screen
|
2016-10-30 19:17:45 +00:00
|
|
|
ldy #(WIDTH - 1)
|
2016-11-16 06:56:26 +00:00
|
|
|
- lda (OPDST1L), y
|
2016-11-01 05:14:14 +00:00
|
|
|
sta $07D0, y
|
2016-10-26 21:02:52 +00:00
|
|
|
dey
|
|
|
|
bpl -
|
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
;animation delay
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr Delay ;returns A=0
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
tay
|
2016-11-03 06:32:10 +00:00
|
|
|
lda #WIDTH
|
2016-11-17 05:32:28 +00:00
|
|
|
jsr UpdateVirtualOff ;returns zr/nz state of SCROLLLINE
|
2016-10-26 21:02:52 +00:00
|
|
|
bne --
|
2016-10-30 01:17:18 +00:00
|
|
|
rts
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
SetScrollLines
|
|
|
|
ldx #3
|
|
|
|
- lda ScrollParms1, y
|
|
|
|
sta OPSRC1L, x
|
|
|
|
dey
|
|
|
|
dex
|
|
|
|
bpl -
|
|
|
|
lda #HEIGHT
|
|
|
|
sta SCROLLLINE
|
|
|
|
rts
|
|
|
|
|
|
|
|
ScrollParms1
|
|
|
|
!word LastLine, LastLine - WIDTH
|
|
|
|
|
|
|
|
ScrollParms2
|
|
|
|
!word FirstLine, FirstLine + WIDTH
|
|
|
|
|
2016-11-03 06:32:10 +00:00
|
|
|
UpdateVirtualOff
|
|
|
|
;set up copy addresses for next line
|
2016-11-16 06:56:26 +00:00
|
|
|
|
|
|
|
ldx #2
|
|
|
|
- pha
|
2016-11-03 06:32:10 +00:00
|
|
|
clc
|
2016-11-16 06:56:26 +00:00
|
|
|
adc OPSRC1L, x
|
|
|
|
sta OPSRC1L, x
|
|
|
|
tya
|
|
|
|
adc OPSRC1H, x
|
|
|
|
sta OPSRC1H, x
|
2016-11-03 06:32:10 +00:00
|
|
|
pla
|
2016-11-16 06:56:26 +00:00
|
|
|
dex
|
|
|
|
dex
|
|
|
|
bpl -
|
2016-11-17 05:32:28 +00:00
|
|
|
dec SCROLLLINE
|
2016-11-03 06:32:10 +00:00
|
|
|
rts
|
|
|
|
|
2016-10-30 01:17:18 +00:00
|
|
|
ScrollTextScreenDown
|
2016-11-01 05:14:14 +00:00
|
|
|
ldx #(HEIGHT - 2)
|
2016-11-16 06:56:26 +00:00
|
|
|
- jsr SetTextCalc
|
2016-10-30 01:17:18 +00:00
|
|
|
lda TextCalcLo+1, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST2L
|
2016-10-30 01:17:18 +00:00
|
|
|
lda TextCalcHi+1, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST2H
|
|
|
|
jsr CopyLine
|
2016-10-30 01:17:18 +00:00
|
|
|
dex
|
|
|
|
bpl -
|
2016-10-26 21:02:52 +00:00
|
|
|
rts
|
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
SetTextCalc
|
|
|
|
lda TextCalcLo, x
|
|
|
|
sta OPSRC2L
|
|
|
|
lda TextCalcHi, x
|
|
|
|
sta OPSRC2H
|
|
|
|
rts
|
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
ScrollTextScreenUp
|
2016-11-17 05:32:28 +00:00
|
|
|
ldx #(1 - HEIGHT)
|
2016-11-01 05:14:14 +00:00
|
|
|
- lda (TextCalcLo + HEIGHT - $101) +1, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC2L
|
2016-11-01 05:14:14 +00:00
|
|
|
lda TextCalcLo + HEIGHT - $101, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST2L
|
2016-11-01 05:14:14 +00:00
|
|
|
lda (TextCalcHi + HEIGHT - $101) +1, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC2H
|
2016-11-01 05:14:14 +00:00
|
|
|
lda TextCalcHi + HEIGHT - $101, x
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPDST2H
|
|
|
|
jsr CopyLine
|
2016-11-01 05:14:14 +00:00
|
|
|
inx
|
|
|
|
bne -
|
|
|
|
rts
|
|
|
|
|
2016-11-16 06:56:26 +00:00
|
|
|
CopyLine
|
|
|
|
ldy #(WIDTH - 1)
|
|
|
|
- lda (OPSRC2L), y
|
|
|
|
sta (OPDST2L), y
|
|
|
|
dey
|
|
|
|
bpl -
|
|
|
|
rts
|
|
|
|
|
2016-10-26 21:02:52 +00:00
|
|
|
Delay
|
2016-10-28 20:07:13 +00:00
|
|
|
lda #1
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
MyWAIT
|
|
|
|
sec
|
|
|
|
-- pha
|
|
|
|
- sbc #1
|
|
|
|
bne -
|
|
|
|
pla
|
|
|
|
sbc #1
|
|
|
|
bne --
|
|
|
|
rts
|
|
|
|
|
2016-11-16 18:57:20 +00:00
|
|
|
ClearScreen ; does not clear status line
|
|
|
|
pha
|
|
|
|
clc
|
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
HandleKeyImportScreen ;called with carry set
|
2016-11-01 05:14:14 +00:00
|
|
|
lda #<(LastLine - WIDTH)
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC1L
|
2016-11-01 05:14:14 +00:00
|
|
|
lda #>(LastLine - WIDTH)
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC1H
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-11-17 05:32:28 +00:00
|
|
|
ldx #(HEIGHT - 2)
|
2016-11-16 06:56:26 +00:00
|
|
|
-- jsr SetTextCalc
|
2016-11-01 05:14:14 +00:00
|
|
|
ldy #(WIDTH - 1)
|
2016-11-16 18:57:20 +00:00
|
|
|
lda #$A0
|
2016-11-17 05:32:28 +00:00
|
|
|
- bcc + ;ClearScreen path
|
2016-11-16 18:57:20 +00:00
|
|
|
lda (OPSRC1L), y
|
|
|
|
+ sta (OPSRC2L), y
|
2016-11-01 05:14:14 +00:00
|
|
|
dey
|
2016-10-27 19:16:02 +00:00
|
|
|
bpl -
|
2016-11-17 05:32:28 +00:00
|
|
|
bcc + ;ClearScreen path
|
2016-11-01 05:14:14 +00:00
|
|
|
sec
|
2016-11-16 06:56:26 +00:00
|
|
|
lda OPSRC1L
|
2016-11-01 05:14:14 +00:00
|
|
|
sbc #WIDTH
|
2016-11-16 06:56:26 +00:00
|
|
|
sta OPSRC1L
|
2016-11-01 05:14:14 +00:00
|
|
|
bcs +
|
2016-11-16 06:56:26 +00:00
|
|
|
dec OPSRC1H
|
2016-11-16 18:57:20 +00:00
|
|
|
sec
|
2016-11-01 05:14:14 +00:00
|
|
|
+ dex
|
|
|
|
bpl --
|
2016-11-17 05:32:28 +00:00
|
|
|
bcc ClearScreenRet ;ClearScreen path
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
;print anything that isn't a special key
|
|
|
|
;wrap around screen position when we hit edges
|
2016-11-16 06:56:26 +00:00
|
|
|
|
2016-10-26 21:02:52 +00:00
|
|
|
EditorMode
|
2016-11-01 05:14:14 +00:00
|
|
|
jsr MyKEYIN
|
2016-10-26 21:02:52 +00:00
|
|
|
cmp #HOTKEY
|
2016-11-01 05:14:14 +00:00
|
|
|
beq _doneEditorMode
|
2016-10-28 16:09:53 +00:00
|
|
|
cmp #ESC
|
2016-11-01 05:14:14 +00:00
|
|
|
beq _doneEditorMode
|
|
|
|
|
|
|
|
ClearOnFirstKeypress
|
2016-11-03 06:32:10 +00:00
|
|
|
ldx #0 ;self-modified
|
2016-11-01 05:14:14 +00:00
|
|
|
beq +
|
|
|
|
dec ClearOnFirstKeypress + 1
|
|
|
|
jsr ClearScreen
|
|
|
|
+
|
2016-10-28 16:09:53 +00:00
|
|
|
cmp #LTARROW
|
2016-10-31 15:11:32 +00:00
|
|
|
beq HandleKeyLineLeft
|
2016-11-01 05:14:14 +00:00
|
|
|
cmp #DNARROW
|
|
|
|
beq HandleKeyLineDown
|
2016-10-28 16:09:53 +00:00
|
|
|
cmp #UPARROW
|
2016-10-31 15:11:32 +00:00
|
|
|
beq HandleKeyLineUp
|
2016-10-28 16:09:53 +00:00
|
|
|
cmp #RTARROW
|
2016-10-31 15:11:32 +00:00
|
|
|
beq HandleKeyLineRight
|
2016-11-01 05:14:14 +00:00
|
|
|
cmp #RETURN
|
|
|
|
beq HandleKeyReturn
|
|
|
|
ldx #1
|
|
|
|
stx IsDirty + 1
|
|
|
|
cmp #IMPORTKEY
|
|
|
|
beq HandleKeyImportScreen
|
|
|
|
cmp #CLEARKEY
|
|
|
|
beq HandleKeyClearScreen
|
|
|
|
jsr MyCOUT
|
|
|
|
jmp EditorMode ;always
|
2016-10-28 16:09:53 +00:00
|
|
|
|
2016-11-16 18:57:20 +00:00
|
|
|
ClearScreenRet
|
|
|
|
pla
|
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
_doneEditorMode
|
2016-10-31 15:11:32 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
HandleKeyLineLeft
|
2016-11-01 05:14:14 +00:00
|
|
|
dec MyCH + 1
|
|
|
|
bpl EditorMode
|
2016-10-28 16:09:53 +00:00
|
|
|
lda #(WIDTH - 1)
|
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
SetColumn
|
|
|
|
sta MyCH + 1
|
|
|
|
bpl EditorMode ;always
|
2016-10-28 16:09:53 +00:00
|
|
|
|
2016-10-31 15:11:32 +00:00
|
|
|
HandleKeyLineRight
|
2016-11-01 05:14:14 +00:00
|
|
|
inc MyCH + 1
|
|
|
|
lda MyCH + 1
|
2016-10-28 16:09:53 +00:00
|
|
|
eor #WIDTH ;zero on match
|
2016-11-01 05:14:14 +00:00
|
|
|
bne EditorMode
|
2016-10-28 16:09:53 +00:00
|
|
|
beq SetColumn ;always
|
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
HandleKeyLineUp
|
2016-11-01 17:08:48 +00:00
|
|
|
ldy MyCV + 1
|
|
|
|
dey
|
2016-11-01 05:14:14 +00:00
|
|
|
bpl SetRow
|
|
|
|
ldy #(HEIGHT - 2)
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
SetRow
|
|
|
|
sty MyCV + 1
|
|
|
|
ldx MyCH + 1
|
|
|
|
jsr MyBASCALC ;returns flag=plus
|
|
|
|
bpl EditorMode ;always
|
2016-10-31 15:11:32 +00:00
|
|
|
|
|
|
|
HandleKeyClearScreen
|
2016-11-16 18:57:20 +00:00
|
|
|
jsr ClearScreen
|
2016-11-01 05:14:14 +00:00
|
|
|
dey ;-2
|
|
|
|
sty MyCV + 1 ;use big store to trigger wraparound
|
|
|
|
;fall through
|
|
|
|
|
|
|
|
HandleKeyReturn
|
|
|
|
lda #0
|
|
|
|
sta MyCH + 1
|
|
|
|
;fall through
|
|
|
|
|
|
|
|
HandleKeyLineDown
|
|
|
|
ldy MyCV + 1
|
|
|
|
iny
|
|
|
|
cpy #(HEIGHT - 1) ;zero on match
|
|
|
|
bcc SetRow ;not BNE to allow big store use
|
|
|
|
ldy #0
|
|
|
|
beq SetRow ;always
|
2016-10-31 15:11:32 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
MyKEYIN
|
|
|
|
ldx MyCH + 1
|
|
|
|
|
|
|
|
ScreenBuff2
|
2016-11-03 06:32:10 +00:00
|
|
|
lda $34f3, x ;self-modified
|
2016-11-01 05:14:14 +00:00
|
|
|
sta ToggleChar + 1
|
|
|
|
|
|
|
|
CharDel
|
|
|
|
lda #DELETE
|
|
|
|
sec
|
|
|
|
!byte $24 ;mask CLC
|
|
|
|
ToggleCarry
|
|
|
|
clc
|
|
|
|
bcs +
|
|
|
|
|
|
|
|
ToggleChar
|
|
|
|
lda #"Q" ;self-modified
|
|
|
|
|
|
|
|
+ ldx MyCH + 1
|
|
|
|
|
|
|
|
ScreenBuff3
|
2016-11-03 06:32:10 +00:00
|
|
|
sta $34f3, x ;self-modified
|
2016-11-01 05:14:14 +00:00
|
|
|
|
|
|
|
;timing is taken from extended ROM
|
|
|
|
;code is optimised for size
|
|
|
|
|
|
|
|
ldx #$31
|
|
|
|
ldy #0
|
|
|
|
- lda KBD
|
|
|
|
bmi +
|
|
|
|
dey
|
|
|
|
bne -
|
|
|
|
dex
|
|
|
|
bne -
|
|
|
|
bcc CharDel
|
|
|
|
+ bcs ToggleCarry ;restore original character, also on exit
|
|
|
|
bit STROBE
|
|
|
|
rts
|
|
|
|
|
|
|
|
MyCOUT
|
|
|
|
MyCH
|
|
|
|
ldx #"Q" ;self-modified
|
|
|
|
|
|
|
|
ScreenBuff4
|
2016-11-03 06:32:10 +00:00
|
|
|
sta $34f3, x ;self-modified
|
2016-11-01 05:14:14 +00:00
|
|
|
inx
|
|
|
|
cpx #WIDTH
|
|
|
|
bne ++
|
|
|
|
ldx #0
|
|
|
|
MyCV
|
|
|
|
ldy #"Q" ;self-modified
|
|
|
|
iny
|
|
|
|
cpy #(HEIGHT - 1)
|
|
|
|
bne MyBASCALC
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
MyBASCALC
|
|
|
|
sty MyCV + 1
|
|
|
|
lda TextCalcLo, y
|
|
|
|
sta ScreenBuff2 + 1
|
|
|
|
sta ScreenBuff3 + 1
|
|
|
|
sta ScreenBuff4 + 1
|
|
|
|
lda TextCalcHi, y
|
|
|
|
sta ScreenBuff2 + 2
|
|
|
|
sta ScreenBuff3 + 2
|
|
|
|
sta ScreenBuff4 + 2
|
|
|
|
++ stx MyCH + 1
|
2016-10-31 15:11:32 +00:00
|
|
|
rts
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
SaveFile
|
2016-11-01 05:14:14 +00:00
|
|
|
lda MyCH + 1
|
2016-10-30 19:17:45 +00:00
|
|
|
sta SaveCH
|
2016-11-01 05:14:14 +00:00
|
|
|
lda MyCV + 1
|
2016-10-30 19:17:45 +00:00
|
|
|
sta SaveCV
|
2016-11-01 05:14:14 +00:00
|
|
|
|
2016-10-27 19:16:02 +00:00
|
|
|
CreateWriteFile
|
2016-11-15 07:23:57 +00:00
|
|
|
jsr OpenDataFile
|
2016-10-27 19:16:02 +00:00
|
|
|
bcs OpenRet
|
2016-11-01 05:14:14 +00:00
|
|
|
jsr WriteFile
|
|
|
|
jsr DOSMLI
|
|
|
|
!byte CloseMLI_e - CloseMLI_b
|
|
|
|
CloseMLI_b
|
|
|
|
!byte CMDCLOSE
|
|
|
|
CloseMLI_e
|
2016-11-10 23:35:25 +00:00
|
|
|
|
2016-11-15 07:23:57 +00:00
|
|
|
OpenRet
|
|
|
|
rts
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-10-30 01:17:18 +00:00
|
|
|
TextCalcHi
|
|
|
|
!byte $04, $04, $05, $05, $06, $06, $07, $07
|
|
|
|
!byte $04, $04, $05, $05, $06, $06, $07, $07
|
|
|
|
!byte $04, $04, $05, $05, $06, $06, $07, $07
|
|
|
|
TextCalcLo
|
|
|
|
!byte $00, $80, $00, $80, $00, $80, $00, $80
|
|
|
|
!byte $28, $A8, $28, $A8, $28, $A8, $28, $A8
|
|
|
|
!byte $50, $D0, $50, $D0, $50, $D0, $50, $D0
|
|
|
|
|
2016-10-30 19:17:45 +00:00
|
|
|
LoadSaveStart
|
|
|
|
SaveCH
|
|
|
|
!byte 0 ;loaded from file if exists
|
|
|
|
SaveCV
|
|
|
|
!byte 0 ;loaded from file if exists
|
2016-10-27 19:16:02 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
FirstLine ;lines are stored sequentially, not like text page in memory
|
2016-10-31 15:11:32 +00:00
|
|
|
!fill WIDTH * 8, $A0
|
2016-11-08 04:53:07 +00:00
|
|
|
!text " 4LIVE by 4am && qkumba "
|
2016-10-31 15:11:32 +00:00
|
|
|
!fill WIDTH, $A0
|
2016-11-17 16:59:42 +00:00
|
|
|
!text " Revision 03 / Serial number 161117 "
|
2016-10-31 15:11:32 +00:00
|
|
|
!fill WIDTH * 2, $A0
|
2016-11-08 04:53:07 +00:00
|
|
|
!text " https://github.com/a2-4am/4live "
|
2016-10-31 15:11:32 +00:00
|
|
|
!fill WIDTH * 9, $A0
|
2016-10-26 21:02:52 +00:00
|
|
|
|
2016-10-27 19:16:02 +00:00
|
|
|
LoadSaveEnd
|
2016-11-01 05:14:14 +00:00
|
|
|
;in the current version, the status line is not saved
|
|
|
|
;however, when we move to multi-screen support,
|
|
|
|
;both the status line and the spill line must be saved
|
|
|
|
;for scrolling to work properly
|
2016-10-31 15:11:32 +00:00
|
|
|
!fill (WIDTH - 5), $20
|
2016-11-11 02:50:30 +00:00
|
|
|
!text "4LIVE"
|
2016-10-30 19:17:45 +00:00
|
|
|
|
2016-11-01 05:14:14 +00:00
|
|
|
LastLine
|
|
|
|
!fill WIDTH, $A0
|
2016-11-10 23:35:25 +00:00
|
|
|
}
|
|
|
|
BankedCopyEnd
|