Update Makefile and main.c to use new modules.

This commit is contained in:
giomba 2023-10-22 11:42:03 +02:00
parent 9668db9853
commit 98d7a5c00a
2 changed files with 47 additions and 25 deletions

View File

@ -3,13 +3,17 @@ PROJECT := demo
SERIALPORT = /dev/ttyUSB0 SERIALPORT = /dev/ttyUSB0
SRC = \ SRC = \
src/ceda_print_a.asm \ src/video_a.asm \
src/ceda_print_c.c \ src/video.c \
src/crt.c \ src/crt.c \
src/cursor.c \ src/cursor.c \
src/delay.asm \ src/delay.asm \
src/main.c \ src/main.c \
src/io_a.c \ src/io_a.c \
src/performance_test.asm \
src/printf.c \
src/lfsr.c \
src/matrix.c \
\ \
OBJ = $(patsubst %, %.o, $(basename $(SRC))) OBJ = $(patsubst %, %.o, $(basename $(SRC)))

View File

@ -1,8 +1,11 @@
#include "ceda_print.h"
#include "crt.h" #include "crt.h"
#include "cursor.h" #include "cursor.h"
#include "delay.h" #include "delay.h"
#include "io.h" #include "io.h"
#include "lfsr.h"
#include "matrix.h"
#include "printf.h"
#include "video.h"
static void wait(void) { static void wait(void) {
(void)io_in(0xA0); (void)io_in(0xA0);
@ -14,10 +17,19 @@ static void wait(void) {
} }
} }
int main(void) { void _putchar(char c) {
ceda_print("Hello world!"); video_putchar(c);
}
ceda_cls(); int main(void) {
cursor_enable(false);
video_cls();
matrix_init();
for (;;) {
matrix_poll();
crt_waitFrames(4);
}
#if 0 #if 0
for (int i = 0; i < 80; ++i) { for (int i = 0; i < 80; ++i) {
@ -56,32 +68,38 @@ int main(void) {
} }
#endif #endif
#if 0
char c = 'X';
for (;;) {
if (c == 'X')
c = ' ';
else
c = 'X';
*(((char *)0xd000) + 80 * 10 + 39) = c;
for (int i = 0; i < 10; ++i) {
delay_loop(US_TO_LOOPS(50000ULL));
}
}
#endif
#if 0
performance_test();
#endif
#if 0
cursor_setXY(39, 10); cursor_setXY(39, 10);
for (;;) { for (;;) {
for (int i = 0; i < 16; ++i) { for (int i = 0; i < 16; ++i) {
cursor_setStartRaster(0); cursor_setStartRaster(i);
cursor_setEndRaster(i); cursor_setEndRaster(i);
for (int j = 0; j < 8; ++j) crt_waitFrames(8);
crt_waitNextFrame();
} }
} }
#endif
crt_waitFrames(50);
return 0; return 0;
} }
uint8_t ret_u8(void) {
return 0x01;
}
uint16_t ret_u16(void) {
return 0x0123;
}
uint32_t ret_u32(void) {
return 0x01234567;
}
void *ret_ptr(void) {
return (void *)0x1234;
}