fix getdevice
This commit is contained in:
@@ -34,22 +34,25 @@ next: inx
|
|||||||
; interpret a non-disk as a no-op while we need to interpret it
|
; interpret a non-disk as a no-op while we need to interpret it
|
||||||
; as an error here
|
; as an error here
|
||||||
|
|
||||||
jsr isdisk
|
jsr isdisk ; carry clear if the unit number in X is a disk
|
||||||
bcs next
|
bcs next
|
||||||
|
|
||||||
; [open|close]cmdchannel don't call into the Kernal at all if they
|
; [open|close]cmdchannel don't call into the Kernal at all if they
|
||||||
; only [in|de]crement the reference count of the shared cmdchannel
|
; only [in|de]crement the reference count of the shared cmdchannel
|
||||||
; so we need to explicitly initialize ST here
|
; so we need to explicitly initialize ST here
|
||||||
|
|
||||||
|
stx tmp2 ; further calls my use X
|
||||||
|
|
||||||
jsr initst
|
jsr initst
|
||||||
|
|
||||||
stx tmp2
|
ldx tmp2 ; get unit number back
|
||||||
jsr opencmdchannel
|
jsr opencmdchannel
|
||||||
ldx tmp2
|
ldx tmp2 ; get unit number back
|
||||||
jsr closecmdchannel
|
jsr closecmdchannel
|
||||||
ldx tmp2
|
|
||||||
|
|
||||||
jsr READST
|
ldx tmp2 ; get unit number back
|
||||||
|
|
||||||
|
jsr READST ; preserves X, returns A and Flags
|
||||||
|
|
||||||
; Either the Kernal calls above were successful or there was
|
; Either the Kernal calls above were successful or there was
|
||||||
; already a cmdchannel to the device open - which is a pretty
|
; already a cmdchannel to the device open - which is a pretty
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
.include "cbm610.inc"
|
.include "cbm610.inc"
|
||||||
|
|
||||||
|
; preserves X and Y, returns status in A and in status flags
|
||||||
.proc READST
|
.proc READST
|
||||||
|
|
||||||
jsr sys_bank
|
jsr sys_bank
|
||||||
|
|||||||
Reference in New Issue
Block a user