1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-29 14:51:17 +00:00
8bitworkshop/presets/coleco/text32.c

48 lines
1.2 KiB
C
Raw Normal View History

2019-12-03 04:16:11 +00:00
/*
Demonstration of "standard" mode, which is 32 x 24
characters. Each cell can have its own background and
foreground color, determined by the character in its
place. The color table contains 32 bytes, each byte
controlling the colors of a range of 8 characters.
For example, the first byte determines colors for
characters 0-7, the second byte for 8-15, etc.
*/
#include <cv.h>
#include <cvu.h>
2017-05-02 13:09:53 +00:00
2019-08-19 14:24:22 +00:00
#include "common.h"
//#link "common.c"
2020-07-01 02:14:33 +00:00
//#link "fonts.s"
2017-05-02 13:09:53 +00:00
void setup_32_column_font() {
cv_set_screen_mode(CV_SCREENMODE_STANDARD);
cv_set_character_pattern_t(PATTERN);
2017-05-02 13:09:53 +00:00
cv_set_image_table(IMAGE);
cv_set_color_table(COLOR);
2018-11-21 17:54:59 +00:00
cv_set_sprite_pattern_table(SPRITE_PATTERNS);
cv_set_sprite_attribute_table(SPRITES);
cvu_vmemset(0, 0, 0x4000);
2019-08-19 14:24:22 +00:00
copy_default_character_set();
2017-05-02 13:09:53 +00:00
cvu_vmemset(COLOR, 0x36, 8); // set color for chars 0-63
cvu_vmemset(COLOR+8, 0x06, 32-8); // set chars 63-255
}
2018-11-21 17:54:59 +00:00
void show_text() {
cvu_vmemset(IMAGE, '.', 32*24);
2019-12-03 04:16:11 +00:00
cvu_memtovmemcpy(IMAGE + 1, "Greetings Professor Falken", 26);
2018-11-21 17:54:59 +00:00
cv_set_screen_active(true);
2017-05-02 13:09:53 +00:00
}
void main() {
char i=0;
2017-05-02 13:09:53 +00:00
setup_32_column_font();
2018-11-21 17:54:59 +00:00
show_text();
while (1) {
2019-12-03 04:16:11 +00:00
/*
cvu_vmemset(COLOR+8, i++, 4); // animate color for chars 64-95
*/
}
2017-05-02 13:09:53 +00:00
}