mirror of
https://github.com/a2-4am/4live.git
synced 2025-01-02 13:30:48 +00:00
cosmetic fixes, reduced banked size
This commit is contained in:
parent
1c1541a1a7
commit
7239f37a2c
38
src/4live.a
38
src/4live.a
@ -15,6 +15,7 @@
|
|||||||
NEXTPAGEKEY = $99 ; CTRL-Y
|
NEXTPAGEKEY = $99 ; CTRL-Y
|
||||||
IMPORTKEY = $9E ; CTRL-^
|
IMPORTKEY = $9E ; CTRL-^
|
||||||
|
|
||||||
|
VERBOSE = $0 ; set to 1 to show memory usage during build
|
||||||
;
|
;
|
||||||
!addr KSWL = $38
|
!addr KSWL = $38
|
||||||
!addr KSWH = $39
|
!addr KSWH = $39
|
||||||
@ -71,12 +72,11 @@
|
|||||||
POSRDWRRANGE = 4
|
POSRDWRRANGE = 4
|
||||||
WIDTH = 40
|
WIDTH = 40
|
||||||
HEIGHT = 24
|
HEIGHT = 24
|
||||||
LDRBASE = $2e0
|
LDRBASE = $2E0
|
||||||
INSTALLBUFFER = $237 ; yes, the overlay overwrites the loader...
|
INSTALLBUFFER = $237 ; yes, the overlay overwrites the loader...
|
||||||
SWAPBUFFER = $900 ; (LoadSaveEnd - LoadSaveStart) size
|
SWAPBUFFER = $900 ; (LoadSaveEnd - LoadSaveStart) size
|
||||||
; needed by DiversiDOS, must be page-aligned
|
; needed by DiversiDOS, must be page-aligned
|
||||||
; region is preserved across calls
|
; region is preserved across calls
|
||||||
TEMPBUFFER = $dc00 ; hard upper-limit for the code, must be page-aligned
|
|
||||||
|
|
||||||
*=LDRBASE-4
|
*=LDRBASE-4
|
||||||
LdrHeader
|
LdrHeader
|
||||||
@ -234,11 +234,12 @@ WriteFile
|
|||||||
lsr ;read has bit 0 set, write does not
|
lsr ;read has bit 0 set, write does not
|
||||||
bcs ReadFile
|
bcs ReadFile
|
||||||
|
|
||||||
;we are not now writing any page-aligned sizes
|
;;we are not now writing any page-aligned sizes
|
||||||
; lda WriteSize
|
;; lda WriteSize
|
||||||
; bne +
|
;; bne +
|
||||||
; dec WriteSize + 1
|
;; dec WriteSize + 1
|
||||||
+ dec WriteSize
|
;;+
|
||||||
|
dec WriteSize
|
||||||
|
|
||||||
ReadFile
|
ReadFile
|
||||||
jsr ExchangeBanked1
|
jsr ExchangeBanked1
|
||||||
@ -494,7 +495,6 @@ RunFromBankedRAM
|
|||||||
tax
|
tax
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;;candidate for merge with ScrollEditBufferOut
|
|
||||||
ScrollEditBufferIn
|
ScrollEditBufferIn
|
||||||
ldy #(<(ScrollParmsDown - ScrollParms) - 1)
|
ldy #(<(ScrollParmsDown - ScrollParms) - 1)
|
||||||
jsr SetScrollLine
|
jsr SetScrollLine
|
||||||
@ -757,7 +757,7 @@ ClearOnFirstKeypress
|
|||||||
ldy #0 ;self-modified
|
ldy #0 ;self-modified
|
||||||
beq +
|
beq +
|
||||||
dec ClearOnFirstKeypress + 1
|
dec ClearOnFirstKeypress + 1
|
||||||
php ;preserve carry (don't care about the rest)
|
php ;save carry (don't care about the rest)
|
||||||
pha
|
pha
|
||||||
jsr ClearScreen
|
jsr ClearScreen
|
||||||
pla
|
pla
|
||||||
@ -766,7 +766,7 @@ ClearOnFirstKeypress
|
|||||||
sta WriteIfDirty2 + 1
|
sta WriteIfDirty2 + 1
|
||||||
|
|
||||||
DispatchCommand
|
DispatchCommand
|
||||||
jsr EditorMode ;self-modified, currently both bytes
|
jsr $34f3 ;self-modified, currently both bytes
|
||||||
;but could be just one if all routines begin in the same page...
|
;but could be just one if all routines begin in the same page...
|
||||||
jmp EditorMode
|
jmp EditorMode
|
||||||
|
|
||||||
@ -967,7 +967,7 @@ HandleKeyPrevPage
|
|||||||
+++ jsr LoadSaveHeader
|
+++ jsr LoadSaveHeader
|
||||||
jsr CloseFile ;work around DiversiDOS bug
|
jsr CloseFile ;work around DiversiDOS bug
|
||||||
jsr OpenDataFile ;by close and reopen to flush the write
|
jsr OpenDataFile ;by close and reopen to flush the write
|
||||||
dec ReadWriteCmd ;lda CMDREAD / sta ReadWriteCmd
|
dec ReadWriteCmd ;lda #CMDREAD / sta ReadWriteCmd
|
||||||
lda ReadBuffer
|
lda ReadBuffer
|
||||||
pha
|
pha
|
||||||
adc #WIDTH
|
adc #WIDTH
|
||||||
@ -982,7 +982,7 @@ HandleKeyPrevPage
|
|||||||
sta ReadBuffer + 1
|
sta ReadBuffer + 1
|
||||||
pla
|
pla
|
||||||
sta ReadBuffer
|
sta ReadBuffer
|
||||||
inc ReadWriteCmd ;lda CMDWRITE / sta ReadWriteCmd
|
inc ReadWriteCmd ;lda #CMDWRITE / sta ReadWriteCmd
|
||||||
plp ;restore carry
|
plp ;restore carry
|
||||||
lda SaveCH + WIDTH
|
lda SaveCH + WIDTH
|
||||||
pha
|
pha
|
||||||
@ -1338,9 +1338,9 @@ FirstLine ;lines are stored sequentially, not like
|
|||||||
!fill WIDTH, $A0
|
!fill WIDTH, $A0
|
||||||
|
|
||||||
SecondLine
|
SecondLine
|
||||||
!if >SecondLine != >LoadSaveStart {
|
!if >SecondLine != >LoadSaveStart {
|
||||||
!error "first two lines of text buffer must not cross a page"
|
!error "first two lines of text buffer must not cross a page"
|
||||||
}
|
}
|
||||||
!fill WIDTH * 7, $A0
|
!fill WIDTH * 7, $A0
|
||||||
!text " 4LIVE by 4am && qkumba "
|
!text " 4LIVE by 4am && qkumba "
|
||||||
!fill WIDTH, $A0
|
!fill WIDTH, $A0
|
||||||
@ -1356,8 +1356,12 @@ LoadSaveEnd
|
|||||||
LastLine
|
LastLine
|
||||||
!fill WIDTH, $A0
|
!fill WIDTH, $A0
|
||||||
|
|
||||||
!if * > TEMPBUFFER {
|
TEMPBUFFER=(*+255) and not 255
|
||||||
!error "code is too large, ends at ", *, ", ", * - TEMPBUFFER, " bytes too many"
|
!if (TEMPBUFFER>$DC00) {
|
||||||
|
!error "banked code is too large, ends at ", *, ", ", *-$DC00, " bytes too many"
|
||||||
|
}
|
||||||
|
!if VERBOSE=1 {
|
||||||
|
!warn "banked code end=", *, ", data end=", TEMPBUFFER+$3FF, ", bytes free=", $DC00-*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BankedCopyEnd
|
BankedCopyEnd
|
||||||
|
Loading…
Reference in New Issue
Block a user