Update Makefile and main with new stuff.

This commit is contained in:
giomba 2023-10-16 22:14:25 +02:00
parent 6920bd9bd4
commit a09d89ae90
2 changed files with 51 additions and 11 deletions

View File

@ -5,6 +5,7 @@ SERIALPORT = /dev/ttyUSB0
SRC = \
src/ceda_print_a.asm \
src/ceda_print_c.c \
src/crt.c \
src/cursor.c \
src/delay.asm \
src/main.c \

View File

@ -1,30 +1,69 @@
#include "ceda_print.h"
#include "crt.h"
#include "cursor.h"
#include "delay.h"
#include "io.h"
static void wait(void) {
(void)io_in(0xA0);
for (;;) {
const uint8_t port_c = io_in(0x82);
if (port_c & 0x2)
break;
}
}
int main(void) {
ceda_print("Hello world!");
// ceda_cls();
ceda_cls();
#if 0
for (int i = 0; i < 80; ++i) {
cursor_setXY(i, 0);
// TODO(giomba): add vsync?
delay_loop(US_TO_LOOPS(10000ULL));
}
#endif
int counter = 0;
__asm__("di");
#if 0
for (;;) {
for (int i = 0; i < 80; ++i) {
cursor_setXY(i, 0);
for (int i = 0; i < 50; ++i)
crt_waitNextFrame();
// TODO(giomba): add vsync?
delay_loop(US_TO_LOOPS(200000ULL));
// wait();
counter++;
int scratch = counter;
uint8_t digits[4];
digits[3] = scratch % 10;
scratch /= 10;
digits[2] = scratch % 10;
scratch /= 10;
digits[1] = scratch % 10;
scratch /= 10;
digits[0] = scratch % 10;
for (int i = 0; i < 4; ++i) {
digits[i] += '0';
*((char *)(0xd000 + i)) = digits[i];
}
}
#endif
cursor_setStartRaster(5);
cursor_setEndRaster(10);
cursor_setXY(39, 10);
for (;;) {
for (int i = 0; i < (16 - 1); ++i) {
cursor_setStartRaster(i);
cursor_setEndRaster(i + 1);
delay_loop(US_TO_LOOPS(200000UL));
for (int i = 0; i < 16; ++i) {
cursor_setStartRaster(0);
cursor_setEndRaster(i);
for (int j = 0; j < 8; ++j)
crt_waitNextFrame();
}
}