mirror of
https://github.com/cc65/cc65.git
synced 2025-02-02 15:37:58 +00:00
Don't check firmware at $C200, as we don't use it
Just check that we're on a IIgs instead.
This commit is contained in:
parent
9e87e558d2
commit
65ce3a6792
@ -67,7 +67,7 @@ SendBuf: .res 256 ; Send buffers: 256 bytes
|
|||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
Slot: .byte $00 ; 2 when opened
|
Opened: .byte $00 ; 1 when opened
|
||||||
Channel: .byte $00 ; Channel B by default
|
Channel: .byte $00 ; Channel B by default
|
||||||
CurChanIrqFlags:.byte INTR_PENDING_RX_EXT_B
|
CurChanIrqFlags:.byte INTR_PENDING_RX_EXT_B
|
||||||
|
|
||||||
@ -138,25 +138,9 @@ ParityTable: .byte %00000000 ; SER_PAR_NONE, in WR_TX_RX_CTRL (WR4)
|
|||||||
.byte $FF ; SER_PAR_MARK
|
.byte $FF ; SER_PAR_MARK
|
||||||
.byte $FF ; SER_PAR_SPACE
|
.byte $FF ; SER_PAR_SPACE
|
||||||
|
|
||||||
IdOfsTable: .byte $00 ; First firmware instruction
|
|
||||||
.byte $05 ; Pascal 1.0 ID byte
|
|
||||||
.byte $07 ; Pascal 1.0 ID byte
|
|
||||||
.byte $0B ; Pascal 1.1 generic signature byte
|
|
||||||
.byte $0C ; Device signature byte
|
|
||||||
|
|
||||||
IdValTable: .byte $E2 ; SEP instruction
|
|
||||||
.byte $38 ; Fixed
|
|
||||||
.byte $18 ; Fixed
|
|
||||||
.byte $01 ; Fixed
|
|
||||||
.byte $31 ; Serial or parallel I/O card type 1
|
|
||||||
|
|
||||||
IdTableLen = * - IdValTable
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Addresses
|
; Addresses
|
||||||
|
|
||||||
ZILOG_BASE := $C200
|
|
||||||
|
|
||||||
SCCAREG := $C039
|
SCCAREG := $C039
|
||||||
SCCBREG := $C038
|
SCCBREG := $C038
|
||||||
SCCADATA := $C03B
|
SCCADATA := $C03B
|
||||||
@ -286,7 +270,7 @@ WriteAreg:
|
|||||||
SER_INSTALL:
|
SER_INSTALL:
|
||||||
SER_UNINSTALL:
|
SER_UNINSTALL:
|
||||||
SER_CLOSE:
|
SER_CLOSE:
|
||||||
ldx Slot ; Check for open port
|
ldx Opened ; Check for open port
|
||||||
beq :+
|
beq :+
|
||||||
ldx Channel
|
ldx Channel
|
||||||
|
|
||||||
@ -318,7 +302,7 @@ SER_CLOSE:
|
|||||||
jsr writeSCCReg
|
jsr writeSCCReg
|
||||||
|
|
||||||
ldx #$00
|
ldx #$00
|
||||||
stx Slot ; Mark port as closed
|
stx Opened ; Mark port as closed
|
||||||
|
|
||||||
cli
|
cli
|
||||||
: txa
|
: txa
|
||||||
@ -329,28 +313,22 @@ SER_CLOSE:
|
|||||||
; Must return an SER_ERR_xx code in a/x.
|
; Must return an SER_ERR_xx code in a/x.
|
||||||
|
|
||||||
SER_OPEN:
|
SER_OPEN:
|
||||||
; Check Pascal 1.1 Firmware Protocol ID bytes
|
bit $C082 ; Check if this is a IIgs
|
||||||
ldx #$00
|
lda $FE1F ; https://prodos8.com/docs/technote/misc/07/
|
||||||
Check: ldy IdOfsTable,x
|
cmp #$60 ; Everything but the IIgs has an RTS there
|
||||||
lda IdValTable,x
|
bne HardwareFound
|
||||||
cmp ZILOG_BASE,y
|
|
||||||
bne NoDevice
|
|
||||||
inx
|
|
||||||
cpx #IdTableLen
|
|
||||||
bcc Check
|
|
||||||
|
|
||||||
beq HardwareFound
|
|
||||||
|
|
||||||
; Device (hardware) not found
|
; Device (hardware) not found
|
||||||
NoDevice:
|
bit $C080
|
||||||
lda #SER_ERR_NO_DEVICE
|
lda #SER_ERR_NO_DEVICE
|
||||||
SetupErrOut:
|
SetupErrOut:
|
||||||
cli
|
cli
|
||||||
ldx #$00 ; Promote char return value
|
ldx #$00 ; Promote char return value
|
||||||
stx Slot ; Mark port closed
|
stx Opened ; Mark port closed
|
||||||
rts
|
rts
|
||||||
|
|
||||||
HardwareFound:
|
HardwareFound:
|
||||||
|
bit $C080
|
||||||
sei ; Disable interrupts
|
sei ; Disable interrupts
|
||||||
|
|
||||||
; Check if the handshake setting is valid
|
; Check if the handshake setting is valid
|
||||||
@ -499,8 +477,8 @@ IntA:
|
|||||||
StoreFlag:
|
StoreFlag:
|
||||||
sta SER_FLAG
|
sta SER_FLAG
|
||||||
|
|
||||||
ldy #$02 ; Mark port opened
|
ldy #$01 ; Mark port opened
|
||||||
sty Slot
|
sty Opened
|
||||||
cli
|
cli
|
||||||
lda #SER_ERR_OK
|
lda #SER_ERR_OK
|
||||||
.assert SER_ERR_OK = 0, error
|
.assert SER_ERR_OK = 0, error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user