mirror of
https://github.com/cc65/cc65.git
synced 2024-06-08 15:29:37 +00:00
Reformat comments to style guide rules
This commit is contained in:
parent
2bd798fa13
commit
0d21a2b5a4
|
@ -131,7 +131,7 @@ VBASE := $E000 ; Video memory base address
|
||||||
;
|
;
|
||||||
|
|
||||||
INSTALL:
|
INSTALL:
|
||||||
; rts ; fall through
|
; rts ; Fall through
|
||||||
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
@ -272,7 +272,7 @@ CLEAR: ldy #$00
|
||||||
sta VBASE+$1C00,y
|
sta VBASE+$1C00,y
|
||||||
sta VBASE+$1D00,y
|
sta VBASE+$1D00,y
|
||||||
sta VBASE+$1E00,y
|
sta VBASE+$1E00,y
|
||||||
sta VBASE+$1E40,y ; preserve vectors
|
sta VBASE+$1E40,y ; Preserve vectors
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
rts
|
rts
|
||||||
|
@ -285,7 +285,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).
|
||||||
|
@ -460,14 +460,14 @@ GETPIXEL:
|
||||||
|
|
||||||
LINE:
|
LINE:
|
||||||
|
|
||||||
@CHECK: lda X2 ;Make sure x1<x2
|
@CHECK: lda X2 ; Make sure x1<x2
|
||||||
sec
|
sec
|
||||||
sbc X1
|
sbc X1
|
||||||
tax
|
tax
|
||||||
lda X2+1
|
lda X2+1
|
||||||
sbc X1+1
|
sbc X1+1
|
||||||
bpl @CONT
|
bpl @CONT
|
||||||
lda Y2 ;If not, swap P1 and P2
|
lda Y2 ; If not, swap P1 and P2
|
||||||
ldy Y1
|
ldy Y1
|
||||||
sta Y1
|
sta Y1
|
||||||
sty Y2
|
sty Y2
|
||||||
|
@ -488,19 +488,19 @@ LINE:
|
||||||
@CONT: sta DX+1
|
@CONT: sta DX+1
|
||||||
stx DX
|
stx DX
|
||||||
|
|
||||||
ldx #$C8 ;INY
|
ldx #$C8 ; INY
|
||||||
lda Y2 ;Calculate dy
|
lda Y2 ; Calculate dy
|
||||||
sec
|
sec
|
||||||
sbc Y1
|
sbc Y1
|
||||||
tay
|
tay
|
||||||
lda Y2+1
|
lda Y2+1
|
||||||
sbc Y1+1
|
sbc Y1+1
|
||||||
bpl @DYPOS ;Is y2>=y1?
|
bpl @DYPOS ; Is y2>=y1?
|
||||||
lda Y1 ;Otherwise dy=y1-y2
|
lda Y1 ; Otherwise dy=y1-y2
|
||||||
sec
|
sec
|
||||||
sbc Y2
|
sbc Y2
|
||||||
tay
|
tay
|
||||||
ldx #$88 ;DEY
|
ldx #$88 ; DEY
|
||||||
|
|
||||||
@DYPOS: sty DY ; 8-bit DY -- FIX ME?
|
@DYPOS: sty DY ; 8-bit DY -- FIX ME?
|
||||||
stx YINCDEC
|
stx YINCDEC
|
||||||
|
@ -516,8 +516,8 @@ LINE:
|
||||||
sta $01
|
sta $01
|
||||||
|
|
||||||
ldx DY
|
ldx DY
|
||||||
cpx DX ;Who's bigger: dy or dx?
|
cpx DX ; Who's bigger: dy or dx?
|
||||||
bcc STEPINX ;If dx, then...
|
bcc STEPINX ; If dx, then...
|
||||||
lda DX+1
|
lda DX+1
|
||||||
bne STEPINX
|
bne STEPINX
|
||||||
|
|
||||||
|
@ -535,14 +535,14 @@ LINE:
|
||||||
; Y1 AND #$07
|
; Y1 AND #$07
|
||||||
STEPINY:
|
STEPINY:
|
||||||
lda #00
|
lda #00
|
||||||
sta OLDCHUNK ;So plotting routine will work right
|
sta OLDCHUNK ; So plotting routine will work right
|
||||||
lda CHUNK
|
lda CHUNK
|
||||||
lsr ;Strip the bit
|
lsr ; Strip the bit
|
||||||
eor CHUNK
|
eor CHUNK
|
||||||
sta CHUNK
|
sta CHUNK
|
||||||
txa
|
txa
|
||||||
beq YCONT2 ;If dy=0, it's just a point
|
beq YCONT2 ; If dy=0, it's just a point
|
||||||
@CONT: lsr ;Init counter to dy/2
|
@CONT: lsr ; Init counter to dy/2
|
||||||
;
|
;
|
||||||
; Main loop
|
; Main loop
|
||||||
;
|
;
|
||||||
|
@ -554,17 +554,17 @@ YLOOP: sta TEMP
|
||||||
eor (POINT),y
|
eor (POINT),y
|
||||||
sta (POINT),y
|
sta (POINT),y
|
||||||
YINCDEC:
|
YINCDEC:
|
||||||
iny ;Advance Y coordinate
|
iny ; Advance Y coordinate
|
||||||
cpy #8
|
cpy #8
|
||||||
bcc @CONT ;No prob if Y=0..7
|
bcc @CONT ; No prob if Y=0..7
|
||||||
jsr FIXY
|
jsr FIXY
|
||||||
@CONT: lda TEMP ;Restore A
|
@CONT: lda TEMP ; Restore A
|
||||||
sec
|
sec
|
||||||
sbc DX
|
sbc DX
|
||||||
bcc YFIXX
|
bcc YFIXX
|
||||||
YCONT: dex ;X is counter
|
YCONT: dex ; X is counter
|
||||||
bne YLOOP
|
bne YLOOP
|
||||||
YCONT2: lda (POINT),y ;Plot endpoint
|
YCONT2: lda (POINT),y ; Plot endpoint
|
||||||
eor BITMASK
|
eor BITMASK
|
||||||
and CHUNK
|
and CHUNK
|
||||||
eor (POINT),y
|
eor (POINT),y
|
||||||
|
@ -574,13 +574,13 @@ YCONT2: lda (POINT),y ;Plot endpoint
|
||||||
cli
|
cli
|
||||||
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
|
||||||
sta POINT
|
sta POINT
|
||||||
bcc @CONT
|
bcc @CONT
|
||||||
|
@ -598,34 +598,33 @@ 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
|
||||||
lda DX+1
|
lda DX+1
|
||||||
sta COUNTHI
|
sta COUNTHI
|
||||||
cmp #$80
|
cmp #$80
|
||||||
ror ;Need bit for initialization
|
ror ; Need bit for initialization
|
||||||
sta Y1 ;High byte of counter
|
sta Y1 ; High byte of counter
|
||||||
txa
|
txa
|
||||||
bne @CONT ;Could be $100
|
bne @CONT ; Could be $100
|
||||||
dec COUNTHI
|
dec COUNTHI
|
||||||
@CONT: ror
|
@CONT: ror
|
||||||
;
|
;
|
||||||
; Main loop
|
; Main loop
|
||||||
;
|
;
|
||||||
XLOOP: lsr CHUNK
|
XLOOP: lsr CHUNK
|
||||||
beq XFIXC ;If we pass a column boundary...
|
beq XFIXC ; If we pass a column boundary...
|
||||||
XCONT1: sbc DY
|
XCONT1: sbc DY
|
||||||
bcc XFIXY ;Time to step in Y?
|
bcc XFIXY ; Time to step in Y?
|
||||||
XCONT2: dex
|
XCONT2: dex
|
||||||
bne XLOOP
|
bne XLOOP
|
||||||
dec COUNTHI ;High bits set?
|
dec COUNTHI ; High bits set?
|
||||||
bpl XLOOP
|
bpl XLOOP
|
||||||
|
|
||||||
lsr CHUNK ;Advance to last point
|
lsr CHUNK ; Advance to last point
|
||||||
jsr LINEPLOT ;Plot the last chunk
|
jsr LINEPLOT ; Plot the last chunk
|
||||||
lda #$36
|
lda #$36
|
||||||
sta $01
|
sta $01
|
||||||
cli
|
cli
|
||||||
|
@ -651,22 +650,22 @@ XFIXC: sta TEMP
|
||||||
; Check to make sure there isn't a high bit, plot chunk,
|
; Check to make sure there isn't a high bit, plot chunk,
|
||||||
; and update Y-coordinate.
|
; and update Y-coordinate.
|
||||||
;
|
;
|
||||||
XFIXY: dec Y1 ;Maybe high bit set
|
XFIXY: dec Y1 ; Maybe high bit set
|
||||||
bpl XCONT2
|
bpl XCONT2
|
||||||
adc DX
|
adc DX
|
||||||
sta TEMP
|
sta TEMP
|
||||||
lda DX+1
|
lda DX+1
|
||||||
adc #$FF ;Hi byte
|
adc #$FF ; Hi byte
|
||||||
sta Y1
|
sta Y1
|
||||||
|
|
||||||
jsr LINEPLOT ;Plot chunk
|
jsr LINEPLOT ; Plot chunk
|
||||||
lda CHUNK
|
lda CHUNK
|
||||||
sta OLDCHUNK
|
sta OLDCHUNK
|
||||||
|
|
||||||
lda TEMP
|
lda TEMP
|
||||||
XINCDEC:
|
XINCDEC:
|
||||||
iny ;Y-coord
|
iny ; Y-coord
|
||||||
cpy #8 ;0..7 is ok
|
cpy #8 ; 0..7 is ok
|
||||||
bcc XCONT2
|
bcc XCONT2
|
||||||
sta TEMP
|
sta TEMP
|
||||||
jsr FIXY
|
jsr FIXY
|
||||||
|
@ -691,11 +690,11 @@ LINEPLOT: ; Plot the line chunk
|
||||||
; Subroutine to fix up pointer when Y decreases through
|
; Subroutine to fix up pointer when Y decreases through
|
||||||
; zero or increases through 7.
|
; zero or increases through 7.
|
||||||
;
|
;
|
||||||
FIXY: cpy #255 ;Y=255 or Y=8
|
FIXY: cpy #255 ; Y=255 or Y=8
|
||||||
beq @DECPTR
|
beq @DECPTR
|
||||||
|
|
||||||
@INCPTR: ;Add 320 to pointer
|
@INCPTR: ; Add 320 to pointer
|
||||||
ldy #0 ;Y increased through 7
|
ldy #0 ; Y increased through 7
|
||||||
lda POINT
|
lda POINT
|
||||||
adc #<320
|
adc #<320
|
||||||
sta POINT
|
sta POINT
|
||||||
|
@ -704,8 +703,8 @@ FIXY: cpy #255 ;Y=255 or Y=8
|
||||||
sta POINT+1
|
sta POINT+1
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@DECPTR: ;Okay, subtract 320 then
|
@DECPTR: ; Okay, subtract 320 then
|
||||||
ldy #7 ;Y decreased through 0
|
ldy #7 ; Y decreased through 0
|
||||||
lda POINT
|
lda POINT
|
||||||
sec
|
sec
|
||||||
sbc #<320
|
sbc #<320
|
||||||
|
@ -861,10 +860,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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user