From 3ca6a4bdbc2b798aa933142c42d963c802a3d519 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sat, 17 Nov 2018 09:16:55 -0800 Subject: [PATCH] support Jungle Hunt --- src/glue.prorwts2.a | 46 +++++++++++++++++++-------------------------- src/prorwts2.a | 27 ++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/glue.prorwts2.a b/src/glue.prorwts2.a index 9cc1fdcce..32c54417a 100644 --- a/src/glue.prorwts2.a +++ b/src/glue.prorwts2.a @@ -286,6 +286,7 @@ ProDOS_enter } else { ;PASS2 !set PASS2=1 } + jsr @swap_zp pla sta @fetchaddr+1 pla @@ -304,12 +305,6 @@ ProDOS_enter pha tya pha - ldx #(last_zp - first_zp) - 1 -@save_zp - lda first_zp,x - pha - dex - bpl @save_zp @request lda #$d1 cmp #$c4 @@ -399,11 +394,9 @@ ProDOS_enter sta sizehi sta sizelo jsr hddopendir - ldx encbufpatch1+1 - inx - stx @block_index2+2 lda #0 - beq @block_index2 ;always + sta blkidx + beq @jmp_zp ;always @imp_seek lda #cmdseek @@ -423,18 +416,8 @@ ProDOS_enter lda ldrlo sta sizelo @set_blocks - ldx encbufpatch1+1 - inx - stx @block_index1+2 - stx @block_index2+2 -@block_index1 - lda $d1ff - sta blkidx - clc ;not a subdirectory jsr hddrdwrpart - lda blkidx -@block_index2 - sta $d1ff +@jmp_zp jmp @restore_zp @imp_close @@ -496,13 +479,19 @@ ProDOS_enter sta $1,x rts -@restore_zp - ldx #(last_zp - first_zp) - 1 -@store_zp - pla - sta first_zp,x +@swap_zp + ldx #last_zp-first_zp +@save_zp + lda first_zp,x + ldy @saved_zp,x + sta @saved_zp,x + sty first_zp,x dex - bpl @store_zp + bpl @save_zp + rts + +@restore_zp + jsr @swap_zp pla ;saved inside ProDOS_enter tay pla @@ -513,3 +502,6 @@ ProDOS_enter @handle !byte 0, 0 ;only up to two handles at a time + +@saved_zp + !fill (last_zp - first_zp) + 1 diff --git a/src/prorwts2.a b/src/prorwts2.a index 448e1271c..30f2f8312 100644 --- a/src/prorwts2.a +++ b/src/prorwts2.a @@ -196,7 +196,7 @@ ver_02 = 1 SETAUXZP = $c009 first_zp = $40 ;lowest address to save if swap_zp enabled - last_zp = $60 ;highest address to save if swap_zp enabled (max 127 entries later) + last_zp = $5f ;highest address to save if swap_zp enabled (max 127 entries later) D1S1 = 1 ;disk 1 side 1 volume ID if rwts_mode enabled @@ -941,11 +941,16 @@ foundname iny rdwrfile unrdrvon2 = unrelocdsk + (* - reloc) - lda MOTORON + lda MOTORON + !if allow_subdir = 1 { + clc + } ;allow_subdir !if no_interrupts = 1 { !if detect_err = 1 { + !if allow_subdir = 0 { clc + } ;allow_subdir } ;detect_err php sei @@ -1069,6 +1074,9 @@ unrdrvon3 = unrelocdsk + (* - reloc) sbc sizehi sta sizehi ora sizelo + !if allow_subdir = 1 { + clc + } ;allow_subdir bne rdwrfilei !if allow_aux = 0 { unrdrvoff3 = unrelocdsk + (* - reloc) @@ -2259,15 +2267,21 @@ attribpatch !if allow_subdir = 1 { plp + !byte $24 ;mask the clc that follows } ;allow_subdir ++ } ;rwts_mode hddrdfile hddrdwrfile +!if allow_subdir = 1 { + clc +} ;allow_subdir !if no_interrupts = 1 { !if detect_err = 1 { + !if allow_subdir = 0 { clc + } ;allow_subdir } ;detect_err php sei @@ -2398,7 +2412,16 @@ encbufpatch1 sbc sizehi sta sizehi ora sizelo + !if allow_subdir = 1 { + !if no_interrupts = 1 { + clc bne hddrdwrfilei + } else { ;no_interrupts = 0 + bne hddrdwrfile + } ;no_interrupts + } else { ;allow_subdir = 0 + bne hddrdwrfilei + } ;allow_subdir !if allow_aux = 0 { rts } else { ;allow_aux