Use structs/enums
git-svn-id: svn://svn.cc65.org/cc65/trunk@2709 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -63,7 +63,7 @@ ACIA_CLOCK = ACIA+7 ; Turbo232 external baud-rate generator
|
||||
; Global variables
|
||||
;
|
||||
|
||||
; We reuse the RS232 zero page variables for the driver, since the ROM
|
||||
; We reuse the RS232 zero page variables for the driver, since the ROM
|
||||
; routines cannot be used together with this driver.
|
||||
RecvHead = $B5 ; Head of receive buffer
|
||||
RecvTail = $BD ; Tail of receive buffer
|
||||
@@ -183,7 +183,7 @@ OPEN:
|
||||
|
||||
; Check if the handshake setting is valid
|
||||
|
||||
ldy #SER_PARAMS_HANDSHAKE ; Handshake
|
||||
ldy #SER_PARAMS::HANDSHAKE ; Handshake
|
||||
lda (ptr1),y
|
||||
cmp #SER_HS_HW ; This is all we support
|
||||
bne InvParam
|
||||
@@ -195,21 +195,21 @@ OPEN:
|
||||
; Set the value for the control register, which contains stop bits, word
|
||||
; length and the baud rate.
|
||||
|
||||
ldy #SER_PARAMS_BAUDRATE
|
||||
ldy #SER_PARAMS::BAUDRATE
|
||||
lda (ptr1),y ; Baudrate index
|
||||
tay
|
||||
lda BaudTable,y ; Get 6551 value
|
||||
bmi InvBaud ; Branch if rate not supported
|
||||
sta tmp1
|
||||
|
||||
ldy #SER_PARAMS_DATABITS ; Databits
|
||||
ldy #SER_PARAMS::DATABITS ; Databits
|
||||
lda (ptr1),y
|
||||
tay
|
||||
lda BitTable,y
|
||||
ora tmp1
|
||||
sta tmp1
|
||||
|
||||
ldy #SER_PARAMS_STOPBITS ; Stopbits
|
||||
ldy #SER_PARAMS::STOPBITS ; Stopbits
|
||||
lda (ptr1),y
|
||||
tay
|
||||
lda StopTable,y
|
||||
@@ -220,7 +220,7 @@ OPEN:
|
||||
; Set the value for the command register. We remember the base value in
|
||||
; RtsOff, since we will have to manipulate ACIA_CMD often.
|
||||
|
||||
ldy #SER_PARAMS_PARITY ; Parity
|
||||
ldy #SER_PARAMS::PARITY ; Parity
|
||||
lda (ptr1),y
|
||||
tay
|
||||
lda ParityTable,y
|
||||
|
||||
@@ -90,7 +90,7 @@ ExpectedHdrSize = * - ExpectedHdr
|
||||
|
||||
.code
|
||||
PushCallerData:
|
||||
ldy #MODCTRL_CALLERDATA+1
|
||||
ldy #MOD_CTRL::CALLERDATA+1
|
||||
lda (Ctrl),y
|
||||
tax
|
||||
dey
|
||||
@@ -336,7 +336,7 @@ _mod_load:
|
||||
; Get the read function pointer from the control structure and place it into
|
||||
; our call vector
|
||||
|
||||
ldy #MODCTRL_READ
|
||||
ldy #MOD_CTRL::READ
|
||||
lda (Ctrl),y
|
||||
sta Read+1
|
||||
iny
|
||||
@@ -397,10 +397,10 @@ Opt: jsr ReadByte ; Read the length byte
|
||||
bne OSError ; Wrong version
|
||||
|
||||
jsr ReadByte ; Get low byte of id
|
||||
ldy #MODCTRL_MODULE_ID
|
||||
ldy #MOD_CTRL::MODULE_ID
|
||||
sta (Ctrl),y
|
||||
jsr ReadByte
|
||||
ldy #MODCTRL_MODULE_ID+1
|
||||
ldy #MOD_CTRL::MODULE_ID+1
|
||||
sta (Ctrl),y
|
||||
|
||||
inc TPtr+1 ; Remember that we got the OS
|
||||
@@ -448,7 +448,7 @@ CalcSizes:
|
||||
lda TPtr
|
||||
add Header + O65_HDR_BLEN
|
||||
pha ; Save low byte of total size
|
||||
ldy #MODCTRL_MODULE_SIZE
|
||||
ldy #MOD_CTRL::MODULE_SIZE
|
||||
sta (Ctrl),y
|
||||
lda TPtr+1
|
||||
adc Header + O65_HDR_BLEN + 1
|
||||
@@ -465,7 +465,7 @@ CalcSizes:
|
||||
sta Module
|
||||
stx Module+1
|
||||
|
||||
ldy #MODCTRL_MODULE
|
||||
ldy #MOD_CTRL::MODULE
|
||||
sta (Ctrl),y
|
||||
txa
|
||||
iny
|
||||
|
||||
@@ -59,12 +59,12 @@ _ser_install:
|
||||
|
||||
; Copy the jump vectors
|
||||
|
||||
ldy #SER_HDR_JUMPTAB
|
||||
ldy #SER_HDR::JUMPTAB
|
||||
ldx #0
|
||||
@L1: inx ; Skip the JMP opcode
|
||||
jsr copy ; Copy one byte
|
||||
jsr copy ; Copy one byte
|
||||
cpx #(SER_HDR_JUMPCOUNT*3)
|
||||
cpx #(SER_HDR::JUMPTAB + .sizeof(SER_HDR::JUMPTAB))
|
||||
bne @L1
|
||||
|
||||
jmp ser_install ; Call driver install routine
|
||||
|
||||
Reference in New Issue
Block a user