mirror of
https://github.com/cc65/cc65.git
synced 2025-01-01 03:30:20 +00:00
Fixed bugs in geos-cbm's dio_open().
* Trying to open an unused drive would leave a byte on the hardware stack. * Too high device numbers weren't caught.
This commit is contained in:
parent
83890e56eb
commit
8476360e9f
@ -1,8 +1,8 @@
|
|||||||
;
|
;
|
||||||
; Maciej 'YTM/Elysium' Witkowiak
|
; 2001-07-02, Maciej 'YTM/Elysium' Witkowiak
|
||||||
|
; 2015-08-24, Greg King
|
||||||
;
|
;
|
||||||
; based on Atari version by Christian Groessler
|
; based on Atari version by Christian Groessler
|
||||||
; 2.7.2001
|
|
||||||
;
|
;
|
||||||
; dhandle_t __fastcall__ dio_open (unsigned char device);
|
; dhandle_t __fastcall__ dio_open (unsigned char device);
|
||||||
; unsigned char __fastcall__ dio_close (dhandle_t handle);
|
; unsigned char __fastcall__ dio_close (dhandle_t handle);
|
||||||
@ -27,11 +27,13 @@ sectsizetab:
|
|||||||
.code
|
.code
|
||||||
|
|
||||||
_dio_open:
|
_dio_open:
|
||||||
pha
|
cmp #4
|
||||||
|
bcs _inv_drive
|
||||||
tax
|
tax
|
||||||
lda driveType,x ; check if there's a device
|
lda driveType,x ; check if there's a device
|
||||||
beq _inv_drive
|
beq _inv_drive
|
||||||
txa
|
txa
|
||||||
|
pha
|
||||||
clc
|
clc
|
||||||
adc #8 ; normalize devnum
|
adc #8 ; normalize devnum
|
||||||
sta curDevice
|
sta curDevice
|
||||||
|
Loading…
Reference in New Issue
Block a user