apple1-videocard-lib/demos/demo/demo_screen2.h

52 lines
1.3 KiB
C
Raw Normal View History

2021-12-23 12:48:58 +00:00
#include <font8x8.h>
2021-12-16 17:33:56 +00:00
void demo_screen2() {
tms_init_regs(SCREEN2_TABLE);
2021-12-15 15:52:42 +00:00
byte text_color = FG_BG(COLOR_BLACK,COLOR_WHITE);
2021-12-15 15:52:42 +00:00
screen2_init_bitmap(text_color);
2021-12-17 08:12:39 +00:00
screen2_puts("*** P-LAB VIDEO CARD SYSTEM ***", 0, 0, text_color);
screen2_puts("16K VRAM BYTES FREE" , 0, 2, text_color);
screen2_puts("READY." , 0, 4, text_color);
2021-12-15 15:52:42 +00:00
// display all colors in the palette
for(byte i=0;i<16;i++) {
2021-12-17 08:12:39 +00:00
screen2_puts(" SCREEN 2 ",5,(byte)(6+i),(byte)(((15-i)<<4)+i));
}
2021-12-16 17:33:56 +00:00
screen2_line(18, 45,232,187);
screen2_line(18,187,232, 45);
2021-12-16 17:33:56 +00:00
screen2_plot_mode = PLOT_MODE_RESET;
2021-12-16 17:33:56 +00:00
screen2_line(18+5, 45,232+5,187);
screen2_line(18+5,187,232+5, 45);
2021-12-16 17:33:56 +00:00
screen2_plot_mode = PLOT_MODE_INVERT;
2021-12-16 17:33:56 +00:00
screen2_line(18+5+5, 45,232+5+5,187);
screen2_line(18+5+5,187,232+5+5, 45);
2021-12-16 17:33:56 +00:00
screen2_plot_mode = PLOT_MODE_SET;
2021-12-23 12:48:58 +00:00
// 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;
2021-12-23 14:37:01 +00:00
for(byte t=0;t<4;t++) {
spr.x = 200;
2021-12-23 12:48:58 +00:00
spr.y = 5 + t*32;
2021-12-23 14:37:01 +00:00
spr.name = t*4;
2021-12-23 12:48:58 +00:00
spr.color = t+1;
tms_set_sprite(t, &spr);
}
}
2021-12-23 14:37:01 +00:00