diff --git a/src/bdos/filesystem.S b/src/bdos/filesystem.S index 758f438e..bd29e5c8 100644 --- a/src/bdos/filesystem.S +++ b/src/bdos/filesystem.S @@ -55,6 +55,8 @@ zproc internal_ENDSYS pha tya pha + txa + pha lda old_fcb_drive zif_pl @@ -62,6 +64,11 @@ zproc internal_ENDSYS sta (param), y ; restore user FCB zendif + lda current_drive ; reselect the current drive + jsr bios_SELDSK + + pla + tax pla tay pla @@ -1818,7 +1825,7 @@ NOINIT filesystem_state_start: find_first_count: .byte 0 active_drive: .byte 0 ; drive currently being worked on -old_drive: .byte 0 ; if the drive has been overridden by the FCB +old_active_drive: .byte 0 ; if the drive has been overridden by the FCB old_fcb_drive: .byte 0 ; drive in user FCB on entry write_protect_vector: .word 0 login_vector: .word 0