* The 16-bit comparison code actually didn't compare the high byte.
* This implementation supports only the 1541, 1571, and 1581; but, it didn't exclude the other drive types that GEOS supports.
* Two error code numbers were swapped.
* A 1571 converter didn't catch sector numbers that are too high.
* A 1581 converter didn't catch sector numbers that are too high.
;
-; Maciej 'YTM/Elysium' Witkowiak
-; 2.7.2001
+; 2001-07-02, Maciej 'YTM/Elysium' Witkowiak
+; 2015-08-26, Greg King
;
;
; unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
lda (ptr3),y
tay
lda driveType,y
- and #%00000011 ; this is for RamDrive compatibility
+ and #%00001111 ; remove ramDisk flags
cmp #DRV_1541
beq dio_cts1541
cmp #DRV_1571
cmp #DRV_1581
beq dio_cts1581
- lda #DEV_NOT_FOUND ; unknown device
+ lda #INCOMPATIBLE ; unsupported device
ldx #0
beq ret
lda #INV_TRACK
.byte $2c
_inv_hand:
- lda #INCOMPATIBLE
+ lda #DEV_NOT_FOUND
ldx #0
beq ret
;
-; Maciej 'YTM/Elysium' Witkowiak
-; 2.7.2001
+; 2001-07-02, Maciej 'YTM/Elysium' Witkowiak
+; 2015-08-27, Greg King
;
; unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
; unsigned *sectnum, /* input */
lda (ptr3),y
tay
lda driveType,y
- and #%00000011 ; this is for RamDrive compatibility
+ and #%00001111 ; remove ramDisk flags
cmp #DRV_1541
beq dio_stc1541
cmp #DRV_1571
cmp #DRV_1581
beq dio_stc1581
- lda #DEV_NOT_FOUND ; unknown device
+ lda #INCOMPATIBLE ; unsupported device
ldx #0
beq _ret
lda #INV_TRACK
.byte $2c
_inv_hand:
- lda #INCOMPATIBLE
+ lda #DEV_NOT_FOUND
ldx #0
beq _ret
bne _nxt
lda tmp1
cmp sectab_1541_l+1,x
- bcc _found
-_nxt: inx
+_nxt: bcc _found
+ inx
cpx #35
bne _loop41
beq _inv_data
; - fall down to 1541
lda tmp2
cmp #>683
- bne _cnt71
+ bne _if71
lda tmp1
cmp #<683
- bcc dio_stc1541
+_if71: bcc dio_stc1541
-_cnt71:
lda tmp1
sec
sbc #<683
sbc #>683
sta tmp2
jsr dio_stc1541 ; will fall through here
+ tay
+ bne _ret ; result beyond track 70
ldy #diopp_track
lda (ptr1),y
sbc #0
sta tmp2
inx
- cpx #81
+ cpx #80
bne _loop81
beq _inv_data