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: select_device:
;; Take last device number, make sure it's a drive ;; Take last device number, make sure it's a drive - 8 or above. Above 30,
;; If not, set to 8 (first drive number) ;; 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 ;; 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 ;; Note: if tape support is introduced here, make sure DOS wedge won't get broken
ldx current_device_number ldx current_device_number
cpx #$07 cpx #$08
bpl +
bcs + bcs +
ldx #$08 ldx #$08
* *
+5 -7
View File
@@ -7,18 +7,16 @@
iec_devnum_check: iec_devnum_check:
;; 0, 1, 2, or 3 are illegal - reserved for non-IEC devices on Commodore ;; 0, 1, 2, or 3 are illegal - reserved for non-IEC devices on Commodore
cmp #$03 cmp #$04
bpl +
bcs + bcs +
;; FALLTROUGH ;; FALLTROUGH
iec_devnum_check_failed: iec_devnum_check_failed:
sec sec ; indicate non-IEC device
rts 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 ;; see https://www.pagetable.com/?p=1031
cmp #$1E cmp #$1F
bpl iec_devnum_check_failed
bcs iec_devnum_check_failed bcs iec_devnum_check_failed
clc ;; Carry is clear here - indicates IEC device
rts rts