mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 17:56:21 +00:00
Merge pull request #349 from groessler/something_to_pull
Atari: fix lookup of default device on XDOS.
This commit is contained in:
commit
8b7767b748
@ -1024,9 +1024,16 @@ XFILE = $087D ; XDOS filename buffer
|
|||||||
XLINE = $0880 ; XDOS DUP input line
|
XLINE = $0880 ; XDOS DUP input line
|
||||||
XGLIN = $0871 ; get line
|
XGLIN = $0871 ; get line
|
||||||
XSKIP = $0874 ; skip parameter
|
XSKIP = $0874 ; skip parameter
|
||||||
|
.ifdef __ATARIXL__
|
||||||
|
.ifndef SHRAM_HANDLERS
|
||||||
|
.import XMOVE_handler
|
||||||
|
.endif
|
||||||
|
.define XMOVE XMOVE_handler
|
||||||
|
XMOVE_org = $0877 ; move filename
|
||||||
|
.else
|
||||||
XMOVE = $0877 ; move filename
|
XMOVE = $0877 ; move filename
|
||||||
|
.endif
|
||||||
XGNUM = $087A ; get number
|
XGNUM = $087A ; get number
|
||||||
XDEFDEV = $0816 ; current drive * undocumented *
|
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
; End of atari.inc
|
; End of atari.inc
|
||||||
|
@ -77,16 +77,33 @@ finish: lda #<__defdev
|
|||||||
ldx #>__defdev
|
ldx #>__defdev
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; XDOS version
|
; XDOS default device retrieval
|
||||||
|
|
||||||
xdos: lda XDEFDEV
|
xdos:
|
||||||
|
|
||||||
|
; check XDOS version (we need >= 2.4)
|
||||||
|
|
||||||
|
lda XGLIN
|
||||||
|
cmp #$4C ; there needs to be a 'JMP' opcode here
|
||||||
|
bne finish ; older version, use DEFAULT_DEVICE or D1:
|
||||||
|
lda XVER ; get BCD encoded version ($24 for 2.4)
|
||||||
|
cmp #$24
|
||||||
|
bcc finish ; too old, below 2.4
|
||||||
|
|
||||||
|
; good XDOS version, get default drive
|
||||||
|
|
||||||
|
lda #ATEOL
|
||||||
|
sta XLINE ; simulate empty command line
|
||||||
|
ldy #0
|
||||||
|
jsr XMOVE ; create an FMS filename (which in this case only contains the drive)
|
||||||
|
lda XFILE+1
|
||||||
bne done
|
bne done
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
crvec: jmp $FFFF ; target address will be set to crunch vector
|
crvec: jmp $FFFF ; target address will be set to crunch vector
|
||||||
|
|
||||||
; Default device
|
; Default device string
|
||||||
|
|
||||||
__defdev:
|
__defdev:
|
||||||
.ifdef DEFAULT_DEVICE
|
.ifdef DEFAULT_DEVICE
|
||||||
@ -94,4 +111,3 @@ __defdev:
|
|||||||
.else
|
.else
|
||||||
.byte "D1:", 0
|
.byte "D1:", 0
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ SHRAM_HANDLERS = 1
|
|||||||
.export CIO_handler
|
.export CIO_handler
|
||||||
.export SIO_handler
|
.export SIO_handler
|
||||||
.export SETVBV_handler
|
.export SETVBV_handler
|
||||||
|
.export XMOVE_handler
|
||||||
|
|
||||||
BUFSZ = 128 ; bounce buffer size
|
BUFSZ = 128 ; bounce buffer size
|
||||||
BUFSZ_SIO = 256
|
BUFSZ_SIO = 256
|
||||||
@ -1085,6 +1086,24 @@ SETVBV_handler:
|
|||||||
plp
|
plp
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
;---------------------------------------------------------
|
||||||
|
|
||||||
|
XMOVE_handler:
|
||||||
|
|
||||||
|
pha
|
||||||
|
lda PORTB
|
||||||
|
sta cur_XMOVE_PORTB
|
||||||
|
enable_rom
|
||||||
|
pla
|
||||||
|
jsr XMOVE_org
|
||||||
|
php
|
||||||
|
pha
|
||||||
|
disable_rom_val cur_XMOVE_PORTB
|
||||||
|
pla
|
||||||
|
plp
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
CIO_a: .res 1
|
CIO_a: .res 1
|
||||||
CIO_x: .res 1
|
CIO_x: .res 1
|
||||||
CIO_y: .res 1
|
CIO_y: .res 1
|
||||||
@ -1093,6 +1112,7 @@ cur_CIOV_PORTB: .res 1
|
|||||||
cur_SIOV_PORTB: .res 1
|
cur_SIOV_PORTB: .res 1
|
||||||
cur_KEYBDV_PORTB: .res 1
|
cur_KEYBDV_PORTB: .res 1
|
||||||
cur_SETVBV_PORTB: .res 1
|
cur_SETVBV_PORTB: .res 1
|
||||||
|
cur_XMOVE_PORTB: .res 1
|
||||||
orig_ptr: .res 2
|
orig_ptr: .res 2
|
||||||
orig_len: .res 2
|
orig_len: .res 2
|
||||||
req_len: .res 2
|
req_len: .res 2
|
||||||
|
Loading…
Reference in New Issue
Block a user