add demo for sprites

This commit is contained in:
nino-porcino 2021-12-23 13:48:58 +01:00
parent 1d4c4ddf32
commit ec773f2ac2

View File

@ -1,3 +1,5 @@
#include <font8x8.h>
void demo_screen2() {
tms_init_regs(SCREEN2_TABLE);
@ -28,5 +30,21 @@ void demo_screen2() {
screen2_plot_mode = PLOT_MODE_SET;
//vti_ellipse_rect(7,9,202,167);
// define sprites using bitmap fonts
tms_copy_to_vram(&FONT[64*8], 32*8, TMS_SPRITE_PATTERNS);
// set 16x16 sprites
tms_set_sprite_double_size(1);
// set double pixel sprites
tms_set_sprite_magnification(1);
tms_sprite spr;
for(byte t=0;t<32;t++) {
spr.x = 10 + t*32;
spr.y = 5 + t*32;
spr.name = t;
spr.color = t+1;
tms_set_sprite(t, &spr);
}
}