Skip to content

Commit

Permalink
[GRAPH/BASIC] implement GRAPH_draw_oval and BASIC "OVAL" and "RING" c…
Browse files Browse the repository at this point in the history
…ommands (#356)

* [GRAPH/BASIC] implement GRAPH_draw_oval and BASIC "OVAL" and "RING" commands

* handle extreme edge case of zero width or height oval, which should become a line

* convert spaces to tabs in new file
  • Loading branch information
mooinglemur authored Sep 5, 2024
1 parent 9a38de8 commit 2f5e9c6
Show file tree
Hide file tree
Showing 7 changed files with 760 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ GRAPH_SOURCES= \
graphics/fonts/fonts.s \
graphics/graph/console.s \
graphics/drivers/framebuffer.s \
graphics/drivers/fb_vectors.s
graphics/drivers/fb_vectors.s \
graphics/math.s

DEMO_SOURCES= \
demo/test.s
Expand Down
10 changes: 10 additions & 0 deletions basic/graph.s
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ rect jsr get_points_col
sec
jmp GRAPH_draw_rect

ring: jsr get_points_col
jsr convert_point_size
clc
jmp GRAPH_draw_oval

oval: jsr get_points_col
jsr convert_point_size
sec
jmp GRAPH_draw_oval

;***************
char jsr get_point

Expand Down
2 changes: 2 additions & 0 deletions basic/token2.s
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ reslst3
.byt "SPRME", 'M' + $80
.byt "MOVSP", 'R' + $80
.byt "BASLOA", 'D' + $80
.byt "OVA", 'L' + $80
.byt "RIN", 'G' + $80

; add new statements before this line

Expand Down
2 changes: 2 additions & 0 deletions basic/tokens.s
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ stmdsp2 ; statements
.word sprmem-1
.word movspr-1
.word basload-1
.word oval-1
.word ring-1
; functions
ptrfunc .word vpeek
.word mx
Expand Down
2 changes: 2 additions & 0 deletions cfg/graph.cfgtpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ MEMORY {
SEGMENTS {
GRAPHVAR: load = GRAPHVAR, type = bss;
GRAPH: load = GRAPH, type = ro;
MATH: load = GRAPH, type = ro;
MATHTABLES: load = GRAPH, type = ro, align = $100;
KVARSB0: load = GRVARSB0, type = bss, define=yes;
CONSOLE: load = GRAPH, type = ro;
VECTORS: load = VECTORS, type = ro;
Expand Down
Loading

0 comments on commit 2f5e9c6

Please sign in to comment.