mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-17 10:30:43 +00:00
Optimized - and added cycle timing
This commit is contained in:
parent
1064518cf9
commit
9bd2a1d51d
@ -34,10 +34,10 @@ void init_angle_screen(byte* screen) {
|
||||
signed word yw = (signed word)(word){ y*2, 0 };
|
||||
word angle_w = atan2_16(xw, yw);
|
||||
byte ang_w = >(angle_w+0x0080);
|
||||
screen_bottomline[xb] = ang_w;
|
||||
screen_topline[xb] = -ang_w;
|
||||
screen_topline[x] = 0x80+ang_w;
|
||||
screen_bottomline[x] = 0x80-ang_w;
|
||||
screen_topline[xb] = -ang_w;
|
||||
screen_bottomline[xb] = ang_w;
|
||||
}
|
||||
screen_topline -= 40;
|
||||
screen_bottomline += 40;
|
||||
|
@ -4,6 +4,8 @@ import "stdlib"
|
||||
import "sqr"
|
||||
import "c64"
|
||||
import "font-hex"
|
||||
import "time"
|
||||
import "print"
|
||||
|
||||
#reserve(08)
|
||||
|
||||
@ -13,7 +15,13 @@ const byte* SCREEN = 0x2800;
|
||||
void main() {
|
||||
init_font_hex(CHARSET);
|
||||
*D018 = toD018(SCREEN, CHARSET);
|
||||
clock_start();
|
||||
init_dist_screen(SCREEN);
|
||||
clock_t cyclecount = clock()-CLOCKS_PER_INIT;
|
||||
byte* BASE_SCREEN = 0x0400;
|
||||
byte* BASE_CHARSET = 0x1000;
|
||||
print_dword_at(cyclecount, BASE_SCREEN);
|
||||
*D018 = toD018(BASE_SCREEN, BASE_CHARSET);
|
||||
}
|
||||
|
||||
// Populates 1000 bytes (a screen) with values representing the distance to the center.
|
||||
|
Loading…
x
Reference in New Issue
Block a user