1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-21 02:24:34 +00:00

Optimized - and added cycle timing

This commit is contained in:
jespergravgaard 2019-07-05 06:46:06 +02:00
parent 1064518cf9
commit 9bd2a1d51d
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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.