fixed incorrect byte comparing

This commit is contained in:
FeralChild64 committed 2019-07-23 20:56:28 +02:00
1 parent f4db0f31c6
commit 44db729d5c
2 files changed
+12 -11

No files matched your search

+7 -4
View File
@@ -1,15 +1,18 @@
select_device:
;; Take last device number, make sure it's a drive
;; If not, set to 8 (first drive number)
;; Take last device number, make sure it's a drive - 8 or above. Above 30,
;; although illegal for IEC we also consider a drive, as they exists
;; drivers assigning these numbers to CBM-DOS capable devices - like some
;; IEEE-488 carts.
;;
;; If current device is not a drive, set device to 8 (first drive number)
;; Device number is left in X, for SETFLS Kernal routine
;; Note: if tape support is introduced here, make sure DOS wedge won't get broken
ldx current_device_number
cpx #$07
bpl +
cpx #$08
bcs +
ldx #$08
*
+5 -7
View File
@@ -7,18 +7,16 @@
iec_devnum_check:
;; 0, 1, 2, or 3 are illegal - reserved for non-IEC devices on Commodore
cmp #$03
bpl +
cmp #$04
bcs +
;; FALLTROUGH
iec_devnum_check_failed:
sec
sec ; indicate non-IEC device
rts
*
;; 30 and above are illegal too, due to IEC command encoding scheme,
;; 31 and above are illegal too, due to IEC command encoding scheme,
;; see https://www.pagetable.com/?p=1031
cmp #$1E
bpl iec_devnum_check_failed
cmp #$1F
bcs iec_devnum_check_failed
clc
;; Carry is clear here - indicates IEC device
rts