move ProRWTS to LC2

This commit is contained in:
Peter Ferrie 2019-06-19 18:10:56 -07:00
parent 2cfcbe9a10
commit 04968b7c49
5 changed files with 29 additions and 15 deletions

View File

@ -79,6 +79,6 @@ LastMover
!ifdef PASS2 {
} else { ;PASS2
!set PASS2=1
!warn "RELBASE = ", $FE00 - (LastMover - FirstMover)
!warn "RELBASE = ", $FFFC - (LastMover - FirstMover)
}
}

View File

@ -72,6 +72,7 @@ OneTimeSetup
sta holepatch ; enable restoring of copy from now on
lda hddopendir+1 ; save current directory as 'root'
ldy hddopendir+3
+READ_RAM1_WRITE_RAM1
+STAY gRootDirectory
lda $43

View File

@ -54,6 +54,7 @@ gRootDirectory
LoadFile
+LDADDR gPathname
+STAY namlo ; set filename
+READ_RAM2_WRITE_RAM2
jsr traverse ; go to subdirectory, set up filename for read
lda #cmdread ; read (instead of write)
sta reqcmd
@ -67,7 +68,9 @@ LoadFile
lda ldrhi2
sta ldrhi
dec sizehi ; read entire file (ProRWTS2 will figure out exact size)
jmp hddopendir ; exit via ProRWTS2 (must re-open the file after query)
jsr hddopendir ; exit via ProRWTS2 (must re-open the file after query)
+READ_RAM1_WRITE_RAM1
rts
;------------------------------------------------------------------------------
; LoadFileAt
@ -90,6 +93,7 @@ LoadFileAt
+STAY ldrlo ; set load address
+LDADDR gPathname
+STAY namlo ; set filename
+READ_RAM2_WRITE_RAM2
jsr traverse ; go to subdirectory, set up filename for read
lda #cmdread ; read (instead of write)
sta reqcmd
@ -97,7 +101,9 @@ LoadFileAt
sta auxreq
lda #$FF ; read entire file (ProRWTS2 will figure out exact size)
sta sizehi
jmp hddopendir ; exit via ProRWTS2
jsr hddopendir ; exit via ProRWTS2
+READ_RAM1_WRITE_RAM1
rts
;------------------------------------------------------------------------------
; LoadDHRFile
@ -116,6 +122,7 @@ LoadFileAt
LoadDHRFile
+LDADDR gPathname
+STAY namlo ; set filename
+READ_RAM2_WRITE_RAM2
jsr traverse ; go to subdirectory, set up filename for read
lda #$00 ; read first $2000 bytes
sta sizelo
@ -135,7 +142,9 @@ LoadDHRFile
sta ldrhi
dec auxreq ; 0 = read into main memory
clc ; not a subdirectory
jmp hddrdwrpart ; call ProRWTS2
jsr hddrdwrpart ; call ProRWTS2
+READ_RAM1_WRITE_RAM1
rts
;------------------------------------------------------------------------------
; SaveSmallFile
@ -157,6 +166,7 @@ SaveSmallFile
+STAY ldrlo ; set data buffer address for ProRWTS2
+LDADDR gPathname
+STAY namlo ; set filename for ProRWTS2
+READ_RAM2_WRITE_RAM2
jsr traverse ; go to subdirectory, set up filename for read
;;if the write address is always a fixed value then we can discard the query
lda #cmdread ; read (instead of write)
@ -172,7 +182,9 @@ SaveSmallFile
lda #cmdwrite ; write (instead of read)
sta reqcmd
sta sizelo ; non-zero
jmp hddopendir ; exit via ProRWTS2 (must re-open the file after query)
jsr hddopendir ; exit via ProRWTS2 (must re-open the file after query)
+READ_RAM1_WRITE_RAM1
rts
;------------------------------------------------------------------------------
; traverse [private]
@ -288,7 +300,6 @@ traverse
pla
sta (namlo), y
lda $c08b
@go
rts
@ -311,8 +322,7 @@ promote
rts ;clock interface, must be RTS on real ProDOS if program uses $20x
lda $c011
bit $c08b
bit $c08b
+READ_RAM2_WRITE_RAM2
;$bf10
jmp ProDOS_enter
!byte $c1

View File

@ -73,6 +73,11 @@
bit $C08B
}
!macro READ_RAM2_WRITE_RAM2 {
bit $C083
bit $C083
}
!macro READ_ROM_WRITE_RAM1 {
bit $C089
bit $C089

View File

@ -54,10 +54,10 @@ ver_02 = 1
;use unique volume numbers to distinguish between images in the same file
;requires override_adr, enable_seek, allow_trees, always_trees
;not compatible with enable_floppy, aligned_read, allow_subdir, might_exist, bounds_check
load_high = 1 ;set to 1 to load to top of RAM (either main or banked, enables a himem check)
load_high = 0 ;set to 1 to load to top of RAM (either main or banked, enables a himem check)
load_aux = 0 ;load to aux memory
load_banked = 1 ;set to 1 to load into banked RAM instead of main RAM (can be combined with load_aux for aux banked)
lc_bank = 1 ;load into specified bank (1 or 2) if load_banked=1
lc_bank = 2 ;load into specified bank (1 or 2) if load_banked=1
one_page = 0 ;set to 1 if verbose mode says that you should (smaller code)
;user-defined driver load address
@ -68,7 +68,7 @@ ver_02 = 1
reloc = $fe00 ;page-aligned, as high as possible, the ideal value will be shown on mismatch
} ;PASS2
} else { ;load_high = 0
reloc = $d000 ;page-aligned, but otherwise wherever you want
reloc = $d400 ;page-aligned, but otherwise wherever you want
} ;load_high
} else { ;load_banked = 0
!if load_high = 1 {
@ -2684,7 +2684,6 @@ hddresparse
bne hddrdwrloop
} ;aligned_read
hddrdwrdone
bit $c08b ;restore banks
!if allow_aux = 1 {
ldx #0
hddsetaux sta CLRAUXWR, x
@ -2823,7 +2822,6 @@ hddseekrdwr
stx bloklo
sta blokhi
bit $c083 ;switch banks
unrunit1 = unrelochdd + (* - reloc)
lda #$d1
@ -2997,7 +2995,7 @@ hdddataend
!warn "initial reloc too low, adjust to ", (0 - (((hdddataend + $ff) & -256) - reloc)) & $ffff
} ;hdddataend
} ;enable_floppy
hdddirbuf = $d200
hdddirbuf = reloc - $200
!if aligned_read = 0 {
hddencbuf = hdddirbuf - $200
} ;aligned_read
@ -3010,7 +3008,7 @@ hdddataend
} ;allow_trees
} else { ;load_high = 0
!pseudopc ((hdddataend + $ff) & -256) {
hdddirbuf = *
hdddirbuf = $d000
}
!if aligned_read = 0 {
hddencbuf = hdddirbuf + $200