shave some bytes

This commit is contained in:
4am 2021-06-11 20:55:18 -04:00
parent 003240e505
commit 24a67c61fc
2 changed files with 20 additions and 23 deletions

View File

@ -1,10 +1,3 @@
!cpu 6502
!ifdef RELBASE {
*=RELBASE
} else {
*=$2000
}
;------------------------------- ;-------------------------------
; Passport ; Passport
; a 4am hack ; a 4am hack
@ -33,6 +26,13 @@
; ;
;------------------------------- ;-------------------------------
!cpu 6502
!ifdef RELBASE {
*=RELBASE
} else {
*=$2000
}
!ifndef VERBOSE { !ifndef VERBOSE {
VERBOSE = $00 ; set to $01 to display API label addresses VERBOSE = $00 ; set to $01 to display API label addresses
} }
@ -42,13 +42,10 @@ VERBOSE = $00 ; set to $01 to display API label addresses
!source "apidefs.a" ; no code in here !source "apidefs.a" ; no code in here
FirstMover MainMenu
ldx #$FF ldx #$FF
txs txs
lda $C0E8 jsr Cleanup ; RAM/HD files might be left open after Ctrl-Reset
jsr CleanupFiles ; RAM/HD files might be left open after Ctrl-Reset
; /!\ execution falls through here
MainMenu
jsr ClearScreen jsr ClearScreen
lda #s_header lda #s_header
jsr PrintByID jsr PrintByID
@ -164,8 +161,7 @@ Reaction
; /!\ execution falls through here ; /!\ execution falls through here
TheEnd TheEnd
lda $C0E8 jsr Cleanup
jsr CleanupFiles
lda #s_done lda #s_done
jsr PrintByID jsr PrintByID
jsr WaitForKey jsr WaitForKey
@ -207,15 +203,17 @@ RestartScan
jmp ReadWithRWTS jmp ReadWithRWTS
;------------------------------- ;-------------------------------
; CleanupFiles ; Cleanup
; ;
; Cleans up open files (if any) ; Cleans up open files (if any)
; Also turns off slot 6 drive motor
; ;
; in: ProDOS is NOT in memory ; in: ProDOS is NOT in memory
; out: ProDOS is NOT in memory ; out: ProDOS is NOT in memory
; all registers and flags clobbered ; all registers and flags clobbered
;------------------------------- ;-------------------------------
CleanupFiles Cleanup
lda $C0E8
lda gHardDiskRef lda gHardDiskRef
ora gRAMDiskRef ora gRAMDiskRef
beq + beq +
@ -235,7 +233,7 @@ CleanupFiles
; out: does not return ; out: does not return
;------------------------------- ;-------------------------------
CleanExit CleanExit
jsr CleanupFiles jsr Cleanup
jsr SwapProDOS ; ProDOS out -> in jsr SwapProDOS ; ProDOS out -> in
lda gChangedPrefs lda gChangedPrefs
bne + bne +
@ -440,19 +438,18 @@ _byte_skip_hi:
AnalyzeT00 ; placeholder to identify stack of packed data AnalyzeT00 ; placeholder to identify stack of packed data
!bin "../build/t00only.pak" !bin "../build/t00only.pak"
!source "apicode.a" !source "apicode.a"
LastMover
!if RELBASE = $2000 { !if RELBASE = $2000 {
!ifdef PASS2 { !ifdef PASS2 {
} else { ;PASS2 } else { ;PASS2
!set PASS2=1 !set PASS2=1
!warn "RELBASE = ", HIGHPOINT - (LastMover - FirstMover) !warn "RELBASE = ", HIGHPOINT - (* - MainMenu)
} }
} else { } else {
!if (HIGHPOINT - (LastMover - FirstMover)) < LOWPOINT { !if (HIGHPOINT - (* - MainMenu)) < LOWPOINT {
!serious "My spoon is too big (", HIGHPOINT - (LastMover - FirstMover), ") is below minimum (", LOWPOINT, ")!" !serious "My spoon is too big (", HIGHPOINT - (* - MainMenu), ") is below minimum (", LOWPOINT, ")!"
} else { } else {
!warn "LowPoint=", HIGHPOINT - (LastMover - FirstMover) !warn "LowPoint=", HIGHPOINT - (* - MainMenu)
} }
!warn "CleanExit=",CleanExit !warn "CleanExit=",CleanExit

View File

@ -59,7 +59,7 @@ OneTimeSetup
sta $03F3 sta $03F3
eor #$A5 eor #$A5
sta $03F4 sta $03F4
jmp ($FE) ; jump to decompressed code (FirstMover) jmp ($FE) ; jump to decompressed code (MainMenu)
!source "apidefs.a" !source "apidefs.a"
!source "strings/enid.a" !source "strings/enid.a"