restore any active LC bank

This commit is contained in:
Peter Ferrie 2018-12-19 14:53:24 -08:00
parent 68085d257c
commit 28eff77da0
4 changed files with 50 additions and 12 deletions

View File

@ -108,6 +108,7 @@ md:
mkdir -p build/po mkdir -p build/po
mkdir -p build/X mkdir -p build/X
mkdir -p build/HGR mkdir -p build/HGR
mkdir -p build/ACTION
mkdir -p build/DHGR mkdir -p build/DHGR
mkdir -p build/SS mkdir -p build/SS
mkdir -p build/DEMO mkdir -p build/DEMO

View File

@ -253,19 +253,26 @@ traverse
promote promote
!pseudopc $bf00 { !pseudopc $bf00 {
lda $c08b lda $c012
clc asl
bcc @do_enter !byte $2c
nop
;$bf06 ;$bf06
rts ;clock interface, must be RTS on real ProDOS if program uses $20x rts ;clock interface, must be RTS on real ProDOS if program uses $20x
@do_enter
lda $c08b lda $c011
jmp ProDOS_enter jmp ProDOS_enable
!text "q4!" !text "q4!"
;$bf10 ;$bf10
!word $c1d1, $c2d1, $c3d1, $c4d1, $c5d1, $c6d1, $c7d1 !word $c1d1, $c2d1, $c3d1, $c4d1, $c5d1, $c6d1, $c7d1
ProDOS_enable
bit $c08b
bit $c08b
jmp ProDOS_enter
ProDOS_exit ProDOS_exit
bit $c081 sta $c082, x
ProDOS_savedX
ldx #$d1
rts rts
ProDOS_fatal ;only for debugging, will be removed ProDOS_fatal ;only for debugging, will be removed
pha pha
@ -274,7 +281,7 @@ ProDOS_fatal ;only for debugging, will be removed
jsr $fe93 jsr $fe93
pla pla
jsr $fdda jsr $fdda
jmp $ff59 jmp $ff65
ProDOS_prefix=$bfd0 ProDOS_prefix=$bfd0
; !fill $2e ; !fill $2e
} }
@ -343,8 +350,12 @@ ProDOS_enter
} else { ;PASS2 } else { ;PASS2
!set PASS2=1 !set PASS2=1
} }
stx ProDOS_savedX+1
pha
jsr @swap_zp jsr @swap_zp
pla pla
tax
pla
sta @fetchaddr+1 sta @fetchaddr+1
pla pla
sta @fetchaddr+2 sta @fetchaddr+2
@ -358,6 +369,7 @@ ProDOS_enter
pha pha
lda @fetchaddr+1 lda @fetchaddr+1
pha pha
php
txa txa
pha pha
tya tya
@ -378,6 +390,8 @@ ProDOS_enter
beq @do_close beq @do_close
cmp #$ce cmp #$ce
beq @do_seek beq @do_seek
cmp #$d1
beq @do_eof
;;any others?? ;;any others??
jmp ProDOS_fatal jmp ProDOS_fatal
@do_getattrib @do_getattrib
@ -395,6 +409,8 @@ ProDOS_enter
jmp @restore_zp jmp @restore_zp
@do_seek @do_seek
jmp @imp_seek jmp @imp_seek
@do_eof
jmp @imp_eof
@imp_getattrib @imp_getattrib
lda packet+1 lda packet+1
@ -486,6 +502,15 @@ ProDOS_enter
@jmp_zp @jmp_zp
jmp @restore_zp jmp @restore_zp
@imp_eof
ldy #2
lda bleftlo
sta (packet), y
iny
lda blefthi
sta (packet), y
jmp @restore_zp
@imp_close @imp_close
lda @handles+1 lda @handles+1
beq @close_ret beq @close_ret
@ -558,9 +583,16 @@ ProDOS_enter
@restore_zp @restore_zp
jsr @swap_zp jsr @swap_zp
pla ;saved inside ProDOS_enter pla
tay tay
pla pla
lsr
lsr
lsr
lsr
and #8
plp
adc #0
tax tax
lda #0 lda #0
clc clc

View File

@ -1997,9 +1997,6 @@ seek1 sta blkidx
lda #1 lda #1
sta sizehi sta sizehi
} else { ;rwts_mode } else { ;rwts_mode
!if (enable_readseq + allow_subdir) > 0 {
hddrdwrpart jmp hddrdwrfile
} ;enable_readseq or allow_subdir
hddopendir hddopendir
!if no_interrupts = 1 { !if no_interrupts = 1 {
!if detect_err = 1 { !if detect_err = 1 {
@ -2087,6 +2084,9 @@ hddnextent ldy #0
inx inx
- cmp (namlo), y - cmp (namlo), y
beq hddfoundname beq hddfoundname
ora #$80
cmp (namlo), y
beq hddfoundname
;match failed, check if any directory entries remain ;match failed, check if any directory entries remain
@ -2278,6 +2278,7 @@ attribpatch
++ ++
} ;rwts_mode } ;rwts_mode
hddrdwrpart
hddrdfile hddrdfile
hddrdwrfile hddrdwrfile
lda #$ff lda #$ff

View File

@ -22,6 +22,7 @@ if "%1" equ "asm" (
2>nul md build\po 2>nul md build\po
2>nul md build\X 2>nul md build\X
2>nul md build\HGR 2>nul md build\HGR
2>nul md build\ACTION
2>nul md build\DHGR 2>nul md build\DHGR
2>nul md build\SS 2>nul md build\SS
2>nul md build\DEMO 2>nul md build\DEMO
@ -96,6 +97,9 @@ call :asm
1>nul copy /y res\hgr\* build\HGR >>build\log 1>nul copy /y res\hgr\* build\HGR >>build\log
cscript /nologo bin/buildfileinfo.js build\HGR >>build\log cscript /nologo bin/buildfileinfo.js build\HGR >>build\log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/HGR" "build/HGR" >>build/log %CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/HGR" "build/HGR" >>build/log
1>nul copy /y res\action\* build\ACTION >>build/log
cscript /nologo bin/buildfileinfo.js build\ACTION >>build/log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/ACTION" "build/ACTION" >>build/log
1>nul copy /y res\dhgr\* build\DHGR >>build\log 1>nul copy /y res\dhgr\* build\DHGR >>build\log
cscript /nologo bin/buildfileinfo.js build\DHGR >>build\log cscript /nologo bin/buildfileinfo.js build\DHGR >>build\log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/DHGR" "build/DHGR" >>build\log %CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/DHGR" "build/DHGR" >>build\log