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. ; Set up the IRQ vector in the banked RAM; and, switch off the ROM.
ldx #<IRQ lda #<IRQ
ldy #>IRQ ldx #>IRQ
sei ; No ints, handler not yet in place sei ; No ints, handler not yet in place
sta ENABLE_RAM sta ENABLE_RAM
stx $FFFE ; Install interrupt handler sta $FFFE ; Install interrupt handler
sty $FFFF stx $FFFF
ldx IRQVec lda IRQVec
ldy IRQVec+1 ldx IRQVec+1
stx IRQInd+1 sta IRQInd+1
sty IRQInd+2 stx IRQInd+2
ldx #<IRQStub lda #<IRQStub
ldy #>IRQStub ldx #>IRQStub
stx IRQVec sta IRQVec
sty IRQVec+1 stx IRQVec+1
cli ; Allow interrupts cli ; Allow interrupts
@@ -194,7 +194,9 @@ nohandler:
jmp (BRKVec) ; Jump indirect to the break vector 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 ; 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. ; __INTERRUPTOR_COUNT__ directly, since the condes function is not reentrant.
; The irqcount flag will be set/reset from the main code, to avoid races. ; 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 ; 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 $FF ; SER_BAUD_45_5
.byte $01 ; SER_BAUD_50 .byte $01 ; SER_BAUD_50
.byte $02 ; SER_BAUD_75 .byte $02 ; SER_BAUD_75
@@ -353,25 +353,25 @@ SER_IOCTL:
; ;
SER_IRQ: SER_IRQ:
lda ACIA_STATUS ;(4) ;status ;check for byte received lda ACIA_STATUS ; (4) Check for byte received
and #$08 ; (2) and #$08 ; (2)
beq @L9 ; (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) ldy RecvTail ; (4)
ldx RecvFreeCnt ; (4) ldx RecvFreeCnt ; (4)
beq @L3 ; (2*) Jump if no space in receive buffer beq @L3 ; (2*) Jump if no space in receive buffer
sta RecvBuf,y ; (5) sta RecvBuf,y ; (5)
inc RecvTail ; (6) inc RecvTail ; (6)
dec RecvFreeCnt ; (6) dec RecvFreeCnt ; (6)
cpx #33 ;(2) check for buffer space low cpx #33 ; (2) Check for buffer space low
bcc @L2 ; (2*) bcc @L2 ; (2*)
rts ; Return with carry set (interrupt handled) rts ; Return with carry set (interrupt handled)
; Assert flow control if buffer space too low ; Assert flow control if buffer space too low
@L2: lda RtsOff ;(3) assert flow control if buffer space too low @L2: lda RtsOff ; (3)
sta ACIA_CMD ;(4) command sta ACIA_CMD ; (4)
sta Stopped ; (3) sta Stopped ; (3)
@L3: sec ; Interrupt handled @L3: sec ; Interrupt handled
@L9: rts @L9: rts
@@ -396,7 +396,7 @@ SER_IRQ:
@L2: lda ACIA_STATUS @L2: lda ACIA_STATUS
and #$10 and #$10
bne @L4 bne @L4
bit tmp1 ;keep trying if must try hard bit tmp1 ; Keep trying if must try hard
bmi @L0 bmi @L0
@L3: rts @L3: rts

View File

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