Skip to content

Commit fc6c82d

Browse files
authored
Refactor graphics test routines and data
Updated various graphics test routines and data.
1 parent aa21fb5 commit fc6c82d

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

CMakePasm/samples/Commodore/graphics/experimental.txt

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ zpTmp = $FE
7676
lda #16
7777
jsr ClearScreenRAM
7878

79-
jsr Test
80-
rts
79+
jmp Test
80+
8181

8282
;=========================================================
8383
; Test
@@ -86,8 +86,9 @@ Test:
8686
jsr TestPlotPixel
8787
jsr TestDrawLine
8888
jsr TestHLine
89-
jmp TestVLine
89+
jsr TestVLine
9090

91+
rts
9192
;=========================================================
9293
; TestPlotPixel
9394
;=========================================================
@@ -132,7 +133,7 @@ TestPlotPixel:
132133
; TestDrawLine
133134
;=========================================================
134135
TDrawLineTests:
135-
.byte 4
136+
.byte 10
136137
TDrawLineCnt:
137138
.byte 0
138139
TDrawLineOff:
@@ -142,6 +143,16 @@ TDRAWDATA:
142143
.byte <275,>275,185,<12,>12,15
143144
.byte <5,>5,175, <300,>300,3
144145
.byte <305,>305,7,<9,>9,165
146+
147+
; HLINE
148+
.byte <25,>25,35,<300,>300,35
149+
.byte <25,>25,187,<305,>305,187
150+
.byte <295,>295,27,<17,>17,27
151+
.byte <310,>310,198,<5,>5,198
152+
153+
; VLINE
154+
.byte <40,>40,30,<40,>40,188
155+
.byte <265,>265,30,<265,>265,188
145156

146157
TestDrawLine:
147158
lda #0
@@ -188,8 +199,8 @@ THLineCnt:
188199
THLineOff:
189200
.byte 0
190201
THLINEDATA:
191-
.byte <25,>25,<300,>300,35
192-
.byte <25,>25,<305,>305,187
202+
.byte <5,>5,<300,>300,30
203+
.byte <20,>20,<305,>305,177
193204

194205
TestHLine:
195206
lda #0
@@ -438,8 +449,6 @@ CheckHorizontal:
438449
bne BresenhamStart
439450

440451
; Setup HLine (Expects Y in zpY and X1 <= X2)
441-
lda zpY1
442-
sta zpY
443452
lda zpX1Hi
444453
cmp zpX2Hi
445454
bcc DoHLine
@@ -454,12 +463,15 @@ SwapH:
454463
ldx zpX2Lo
455464
sta zpX2Lo
456465
stx zpX1Lo
466+
457467
lda zpX1Hi
458468
ldx zpX2Hi
459469
sta zpX2Hi
460470
stx zpX1Hi
461471

462472
DoHLine:
473+
lda zpY1
474+
sta zpY
463475
jmp HLine
464476

465477
;---------------------------------------------------------
@@ -621,7 +633,7 @@ LineDone:
621633
; FAST HORIZONTAL LINE (FIXED & ROBUST)
622634
; X1: zpX1Lo/Hi, X2: zpX2Lo/Hi, Y: zpY
623635
;=========================================================
624-
HLine:
636+
HLine:
625637
;--- 1. Calculate Base Address (Row + Y-offset within cell) ---
626638
lda zpY
627639
lsr

0 commit comments

Comments
 (0)