Code-style fixes as per PR feedback

This commit is contained in:
Richard Halkyard
2019-10-31 11:01:00 -05:00
parent bf4c9c3c8c
commit 917e5d4f01
4 changed files with 88 additions and 109 deletions

View File

@@ -58,20 +58,20 @@ L1: lda sp,x
; Set up the IRQ vector in the banked RAM; and, switch off the ROM.
ldx #<IRQ
ldy #>IRQ
lda #<IRQ
ldx #>IRQ
sei ; No ints, handler not yet in place
sta ENABLE_RAM
stx $FFFE ; Install interrupt handler
sty $FFFF
ldx IRQVec
ldy IRQVec+1
stx IRQInd+1
sty IRQInd+2
ldx #<IRQStub
ldy #>IRQStub
stx IRQVec
sty IRQVec+1
sta $FFFE ; Install interrupt handler
stx $FFFF
lda IRQVec
ldx IRQVec+1
sta IRQInd+1
stx IRQInd+2
lda #<IRQStub
ldx #>IRQStub
sta IRQVec
stx IRQVec+1
cli ; Allow interrupts
@@ -194,7 +194,9 @@ nohandler:
jmp (BRKVec) ; Jump indirect to the break vector
; IRQ stub called by the Kernal IRQ handler, via $314.
; IRQ stub installed at $314, called by our handler above if RAM is banked in,
; or the Kernal IRQ handler if ROM is banked in.
; If we have handlers, call them. We will use a flag here instead of loading
; __INTERRUPTOR_COUNT__ directly, since the condes function is not reentrant.
; The irqcount flag will be set/reset from the main code, to avoid races.

View File

@@ -88,7 +88,7 @@ SendBuf: .res 256
; Tables used to translate RS232 params into register values
BaudTable: ; bit7 = 1 means setting is invalid
BaudTable: ; Bit7 = 1 means setting is invalid
.byte $FF ; SER_BAUD_45_5
.byte $01 ; SER_BAUD_50
.byte $02 ; SER_BAUD_75
@@ -353,25 +353,25 @@ SER_IOCTL:
;
SER_IRQ:
lda ACIA_STATUS ;(4) ;status ;check for byte received
lda ACIA_STATUS ; (4) Check for byte received
and #$08 ; (2)
beq @L9 ; (2*)
@L1: lda ACIA_DATA ;(4) data ;get byte and put into receive buffer
lda ACIA_DATA ; (4) Get byte and put into receive buffer
ldy RecvTail ; (4)
ldx RecvFreeCnt ; (4)
beq @L3 ; (2*) Jump if no space in receive buffer
sta RecvBuf,y ; (5)
inc RecvTail ; (6)
dec RecvFreeCnt ; (6)
cpx #33 ;(2) check for buffer space low
cpx #33 ; (2) Check for buffer space low
bcc @L2 ; (2*)
rts ; Return with carry set (interrupt handled)
; Assert flow control if buffer space too low
@L2: lda RtsOff ;(3) assert flow control if buffer space too low
sta ACIA_CMD ;(4) command
@L2: lda RtsOff ; (3)
sta ACIA_CMD ; (4)
sta Stopped ; (3)
@L3: sec ; Interrupt handled
@L9: rts
@@ -396,7 +396,7 @@ SER_IRQ:
@L2: lda ACIA_STATUS
and #$10
bne @L4
bit tmp1 ;keep trying if must try hard
bit tmp1 ; Keep trying if must try hard
bmi @L0
@L3: rts

View File

@@ -151,7 +151,7 @@ CHRBASE := $0800 ; Base address of text mode data
;
INSTALL:
; rts ; fall through
; rts ; Fall through
; ------------------------------------------------------------------------
@@ -216,7 +216,7 @@ INIT:
;
DONE: lda $FF12
ora #%00000100 ; fetch from ROM
ora #%00000100 ; Fetch from ROM
sta $FF12
.if LBASE <> CHRBASE
@@ -229,7 +229,7 @@ DONE: lda $FF12
.endif
lda $FF06
and #%11011111 ; exit bitmap mode
and #%11011111 ; Exit bitmap mode
sta $FF06
rts
@@ -306,7 +306,7 @@ CLEAR: ldy #$00
;
SETVIEWPAGE:
; rts ; fall through
; rts ; Fall through
; ------------------------------------------------------------------------
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
@@ -579,11 +579,11 @@ YCONT2: lda (POINT),y ;Plot endpoint
sta (POINT),y
rts
YFIXX: ;x=x+1
YFIXX: ; X=x+1
adc DY
lsr CHUNK
bne YCONT ; If we pass a column boundary...
ror CHUNK ;then reset CHUNK to $80
ror CHUNK ; Then reset CHUNK to $80
sta TEMP2
lda POINT ; And add 8 to POINT
adc #8
@@ -603,8 +603,7 @@ YFIXX: ;x=x+1
.bss
COUNTHI:
.byte $00 ;Temporary counter
;only used once
.byte $00 ; Temporary counter, only used once.
.code
STEPINX:
ldx DX
@@ -815,28 +814,6 @@ TEXTSTYLE:
;
OUTTEXT:
; Calculate a pointer to the representation of the character in the
; character ROM
; ldx #((>(CHARROM + $0800)) >> 3)
; ldy #0
; lda (TEXT),y
; bmi @L1
; ldx #((>(CHARROM + $0000)) >> 3)
; @L1: stx ptr4+1
; asl a
; rol ptr4+1
; asl a
; rol ptr4+1
; asl a
; rol ptr4+1
; sta ptr4
rts
; ------------------------------------------------------------------------
@@ -862,10 +839,10 @@ CALC: lda Y1
ror POINT
cmp #$80
ror
ror POINT ; row*64
adc TEMP2 ; +row*256
ror POINT ; Row * 64
adc TEMP2 ; + Row * 256
clc
adc #>VBASE ; +bitmap base
adc #>VBASE ; + Bitmap base
sta POINT+1
lda X1