shave some bytes

This commit is contained in:
4am 2021-06-17 20:52:42 -04:00
parent 9a10d3c006
commit 7bd584ec34
12 changed files with 53 additions and 51 deletions

View File

@ -60,7 +60,7 @@ WAIT = $FCA8
PRBYTE = $FDDA
COUT = $FDED
; Zero-page addresses we use for variables
; Zero-page addresses we use for temporary variables
nibsrcindex = $EC ; byte
nibdestindex = $ED ; byte
prbuf = $EE ; word
@ -79,7 +79,47 @@ tmpx = $FD ; byte
tmpy = $FE ; byte
flag = $FF ; byte
; Other application-specific addresses
; Other addresses we use for global variables
gTrack = $0210
gSector = gTrack+1
mliparam = gSector+1
access = mliparam+3 ; access privileges (set by MLI get_file_info)
filetype = access+1 ; file type (set by MLI get_file_info)
auxtype = filetype+1 ; auxiliary file type (2 bytes, set by MLI get_file_info)
refnum = auxtype ; file refnum (set by MLI open)
mlilen = refnum+1 ; file length (set by MLI read)
blocks = mlilen+2 ; blocks used (set by getvolumeinfo)
; member is also used by createfile
; !fill 8 ; used by get_file_info
OnlineReturn = blocks + 10
VolumeName = OnlineReturn + 1
; !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF
; !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DiskIIArray = $038E
; !fill 7
HardDiskArray = DiskIIArray+7
; !fill 15
RAMDiskImagePath = HardDiskArray+15
; !byte 0 ; length byte (0 means no suitable RAM disk is available)
; !fill 1 ; / character
; !fill 4 ; longest possible volume name for supported RAM disks
; ; (code only matches 'RAM' or 'RAMn' where n is usually a slot number)
; !fill 1 ; / character
; !fill 15 ; filename without leading slash (constant, see initscan.a)
HardDiskImagePath = RAMDiskImagePath+21
; !byte 0 ; length byte
; !fill 1 ; / character
; !fill 15 ; longest possible volume name
; !fill 1 ; / character
; !fill 8 ; directory name (constant)
; !fill 12 ; filename with leading slash
; ; (modified at runtime but always the same length)
kForceLower = HardDiskImagePath+37 ; AND mask for lowercase letters (set at program startup)
; Other application-specific constants and assembler magic
!ifdef RELBASE {
!set VERBOSE = $00 ; override for make script
} else {

View File

@ -504,7 +504,7 @@ progress_STA:
; this 156 (204) byte table area may be relocated. It may also be
; clobbered by other data between decrunches.
; -------------------------------------------------------------------
decrunch_table=$200;;:
decrunch_table=$800;;:
;; .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;; .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;; .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

View File

@ -4,15 +4,6 @@ HardDirName_e
HardDiskName !raw "/IMG0000.DSK"
HardDiskName_e
HardDiskImagePath
!byte 0 ; length byte
!fill 1 ; / character
!fill 15 ; longest possible volume name
!fill 1 ; / character
!fill HardDirName_e-HardDirName ; directory name (constant, see above)
!fill HardDiskName_e-HardDiskName ; filename with leading slash
; (modified at runtime but always the same length)
;-------------------------------
; CreateFileOnHardDisk
; create a new autonumbered image file on the user's selected target,

View File

@ -58,6 +58,7 @@ ScanForRAMAndHardDisks
- sta HardDiskArray, y
dey
bpl -
sta RAMDiskImagePath
sta iunit
@nextunit
lda iunit

View File

@ -1,10 +1,11 @@
;-------------------------------
; YE OLDE GRAND UNIFIED MEMORY MAP
;
; 0210..02D7 - globals (see apidefs.a)
; 02D8..038D - clobbered by Optimum reader
; 038E..0394 - DiskIIArray
; 0395..03A3 - HardDiskArray
; 038E..03EF - globals (see apidefs.a)
; 0800..08FF - clobbered by all boot tracers and RAM disk
; 0800..08CB - clobbered by exodecrunch
; 0900..09FF - clobbered by Special Delivery tracer and RAM disk
; 0A00..0AFF - backup of zero page during Special Delivery tracer, used by RAM disk
; 0B00..0BFF - used by RAM disk

View File

@ -508,12 +508,7 @@ GetVolumeName
sta mliparam+2
lda #>OnlineReturn
sta mliparam+3
bne Online
OnlineReturn
!byte $FF
VolumeName
!byte $FF,$FF,$FF,$FF,$FF,$FF,$FF
!byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
; /!\ execution falls through here
;-------------------------------
; check if volume is online
@ -580,13 +575,3 @@ mli sta mlicmd ; store command code
mlicmd !byte 00 ; command number
!word mliparam ; address of parameter table
rts
mliparam !byte $FE,$FE,$FE
access !byte $FE ; access privileges (set by MLI get_file_info)
filetype !byte $FE ; file type (set by MLI get_file_info)
auxtype ; auxiliary file type (2 bytes, set by MLI get_file_info)
refnum !byte $FE ; file refnum (set by MLI open)
mlilen !byte $FE,$FE ; file length (set by MLI read)
blocks !byte $FE,$FE ; blocks used (set by getvolumeinfo)
; member is also used by createfile
!byte $FE,$FE,$FE,$FE,$FE,$FE,$FE,$FE
; used by get_file_info

View File

@ -447,8 +447,8 @@ _byte_skip_hi:
!source "id/davidson.a"
!source "id/holle.a"
!source "id/phoenix.a"
!source "id/555.a"
!source "id/bootfailure.a"
!source "id/555.a"
!source "print.a"
!source "compare.a"
!source "modify.a"
@ -462,9 +462,9 @@ _byte_skip_hi:
!source "keys.a"
!source "cffa.a"
!source "progress.a"
!source "wholetrack.a"
!source "rwts.a"
!source "standarddelivery.a"
!source "wholetrack.a"
!source "adstyle.a"
!source "universalstyle.a"
!source "crackme.a"

View File

@ -1,6 +1,3 @@
kForceLower !byte $FF ; AND mask for lowercase letters
; (set at program startup)
;-------------------------------
; PrintByID
; Print a string from the string table

View File

@ -1,11 +1,3 @@
RAMDiskImagePath
!byte 0 ; length byte (0 means no suitable RAM disk is available)
!fill 1 ; / character
!fill 4 ; longest possible volume name for supported RAM disks
; (code only matches 'RAM' or 'RAMn' where n is usually a slot number)
!fill 1 ; / character
!fill 15 ; filename without leading slash (constant, see initscan.a)
;-------------------------------
; CreateFileOnRAMDisk
; create 140KB file on RAM disk (filename is hardcoded)

View File

@ -1,6 +1,3 @@
gTrack !byte $00
gSector !byte $00
gRWTSParams
!byte $01,$60,$01,$00
_track !byte $00

View File

@ -1,6 +1,3 @@
DiskIIArray = $038E
HardDiskArray = $0395
;-------------------------------
; NextSlot
; in: DiskIIArray populated by calling ScanForDiskII

View File

@ -32,12 +32,13 @@ OneTimeSetup
sta $0F00, y
iny
bne -
ldx #$FF
lda $FBB3 ; ROM MachineID
cmp #$EA ; ][+?
bne +
lda #$DF ; AND mask to force characters to uppercase on ][+
sta kForceLower
ldx #$DF ; AND mask to force characters to uppercase on ][+
+
stx kForceLower
jsr ScanForDiskII ; scan slots for Disk II drives
lda DiskIIArray+5
bne +