-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preparing to optimize monogfx.fill()
- Loading branch information
Showing
2 changed files
with
61 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,39 @@ | ||
%import palette | ||
%import monogfx | ||
%import textio | ||
%import math | ||
|
||
%option no_sysinit | ||
%zeropage basicsafe | ||
|
||
|
||
main { | ||
|
||
sub start() { | ||
repeat 4 { | ||
for cx16.r0L in 0 to 15 { | ||
txt.color2(cx16.r0L, cx16.r0L) | ||
txt.spc() | ||
txt.spc() | ||
txt.spc() | ||
txt.spc() | ||
} | ||
txt.nl() | ||
} | ||
bool changed | ||
uword[] colors = [ | ||
$f00, $800, $200, $000, | ||
$f0f, $80f, $20f, $00f | ||
] | ||
do { | ||
sys.waitvsync() | ||
sys.waitvsync() | ||
changed = palette.fade_step_colors(0, 8, colors) | ||
} until not changed | ||
|
||
sys.wait(60) | ||
changed = false | ||
do { | ||
sys.waitvsync() | ||
sys.waitvsync() | ||
changed = palette.fade_step_multi(0, 8, $fff) | ||
} until not changed | ||
sys.wait(60) | ||
monogfx.lores() | ||
demofill() | ||
} | ||
|
||
sub demofill() { | ||
monogfx.circle(160, 120, 110, true) | ||
monogfx.rect(180, 5, 25, 190, true) | ||
monogfx.line(100, 150, 240, 10, true) | ||
monogfx.line(101, 150, 241, 10, true) | ||
monogfx.rect(150, 130, 10, 100, true) | ||
|
||
sys.wait(30) | ||
|
||
cbm.SETTIM(0,0,0) | ||
monogfx.fill(100,100,true) | ||
monogfx.fill(100,100,false) | ||
uword duration = cbm.RDTIM16() | ||
sys.wait(30) | ||
|
||
monogfx.textmode() | ||
txt.nl() | ||
txt.print_uw(duration) | ||
txt.print(" jiffies\n") | ||
|
||
; before optimizations: ~166 jiffies | ||
|
||
} | ||
} |