2018-11-27 15:14:24 +00:00
|
|
|
|
2018-08-12 23:59:08 +00:00
|
|
|
#include <cv.h>
|
|
|
|
#include <cvu.h>
|
2017-05-02 13:09:53 +00:00
|
|
|
|
2018-11-27 15:14:24 +00:00
|
|
|
#define PATTERN 0x0000 // 256*8 = 2048 bytes
|
|
|
|
#define IMAGE 0x0800 // 32*24 = 768 bytes
|
|
|
|
#define COLOR 0x0b00 // 32 bytes
|
|
|
|
#define SPRITE_PATTERNS 0x3800 // 32*32 = 1024 bytes
|
|
|
|
#define SPRITES 0x3c00 // 4*32 = 128 bytes
|
2017-05-02 13:09:53 +00:00
|
|
|
|
|
|
|
uintptr_t __at(0x6a) font_bitmap_a;
|
|
|
|
uintptr_t __at(0x6c) font_bitmap_0;
|
|
|
|
|
|
|
|
void setup_32_column_font() {
|
2018-11-27 15:14:24 +00:00
|
|
|
cv_set_screen_mode(CV_SCREENMODE_STANDARD);
|
2017-05-25 19:49:30 +00:00
|
|
|
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);
|
2017-05-25 19:49:30 +00:00
|
|
|
cvu_memtovmemcpy(PATTERN, (void *)(font_bitmap_0 - '0'*8), 2048);
|
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() {
|
2018-11-27 15:14:24 +00:00
|
|
|
cvu_vmemset(IMAGE, '.', 32*24);
|
2018-11-21 17:54:59 +00:00
|
|
|
cvu_memtovmemcpy(IMAGE + 1, "Hello Professor Falken", 22);
|
|
|
|
cv_set_screen_active(true);
|
2017-05-02 13:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void main() {
|
2018-11-27 15:14:24 +00:00
|
|
|
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();
|
2018-11-27 15:14:24 +00:00
|
|
|
while (1) {
|
|
|
|
cvu_vmemset(COLOR, i++, 8); // set color for chars 0-63
|
|
|
|
}
|
2017-05-02 13:09:53 +00:00
|
|
|
}
|