-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retain type of consts better to avoid precision loss
this also fixed a difference in const calculation where the result could differ if you were using optimzations or not.
- Loading branch information
Showing
11 changed files
with
129 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,16 @@ | ||
%import textio | ||
%import gfx_lores | ||
%import emudbg | ||
%zeropage basicsafe | ||
%option no_sysinit | ||
|
||
main { | ||
const uword WIDTH = 320 | ||
const ubyte HEIGHT = 240 | ||
|
||
sub start() { | ||
uword clo, chi | ||
|
||
void cx16.set_screen_mode(128) | ||
|
||
word x1, y1, x2, y2 | ||
ubyte i | ||
ubyte color = 2 | ||
|
||
sys.set_irqd() | ||
emudbg.reset_cpu_cycles() | ||
for i in 0 to 254 step 4 { | ||
x1 = ((WIDTH-256)/2 as word) + math.sin8u(i) as word | ||
y1 = (HEIGHT-128)/2 + math.cos8u(i)/2 | ||
x2 = ((WIDTH-64)/2 as word) + math.sin8u(i)/4 as word | ||
y2 = (HEIGHT-64)/2 + math.cos8u(i)/4 | ||
cx16.GRAPH_set_colors(color, 0, 1) | ||
cx16.GRAPH_draw_line(x1 as uword, y1 as uword, x2 as uword, y2 as uword) | ||
} | ||
clo, chi = emudbg.cpu_cycles() | ||
sys.clear_irqd() | ||
|
||
txt.print_uwhex(chi, true) | ||
txt.print_uwhex(clo, false) | ||
uword @shared large = (320*240/8/8) | ||
const uword WIDTH=320 | ||
uword x1 = ((WIDTH-256)/2 as uword) + 200 | ||
txt.print_uw(x1) | ||
txt.nl() | ||
|
||
sys.wait(50) | ||
cx16.GRAPH_clear() | ||
sys.wait(50) | ||
|
||
sys.set_irqd() | ||
emudbg.reset_cpu_cycles() | ||
color = 5 | ||
for i in 0 to 254 step 4 { | ||
x1 = ((WIDTH-256)/2 as word) + math.sin8u(i) as word | ||
y1 = (HEIGHT-128)/2 + math.cos8u(i)/2 | ||
x2 = ((WIDTH-64)/2 as word) + math.sin8u(i)/4 as word | ||
y2 = (HEIGHT-64)/2 + math.cos8u(i)/4 | ||
gfx_lores.line(x1 as uword, y1 as ubyte, x2 as uword, y2 as ubyte, color) | ||
} | ||
clo, chi = emudbg.cpu_cycles() | ||
sys.clear_irqd() | ||
|
||
txt.print_uwhex(chi, true) | ||
txt.print_uwhex(clo, false) | ||
txt.nl() | ||
|
||
|
||
x1 = ((WIDTH-256)/2) + 200 | ||
txt.print_uw(x1) | ||
} | ||
} | ||
|