diff --git a/src/dev/Makefile b/src/dev/Makefile index 8be95bc..5df2e25 100644 --- a/src/dev/Makefile +++ b/src/dev/Makefile @@ -37,7 +37,7 @@ else ifeq ($(UNIT),F256) AS=as65816 AR=nlib - SRCS_FOR_UNIT=txt_f256.c # indicators_c256.c interrupts_c256.c timers_c256.c + SRCS_FOR_UNIT=txt_f256.c indicators_c256.c # interrupts_c256.c timers_c256.c CFLAGS_FOR_UNIT=-DMODEL=2 -DCPU=255 --code-model large --data-model large # --target Foenix endif diff --git a/src/dev/txt_f256.c b/src/dev/txt_f256.c index ffd30d5..353a44c 100644 --- a/src/dev/txt_f256.c +++ b/src/dev/txt_f256.c @@ -623,11 +623,9 @@ static void txt_f256_init() { txt_f256_set_cursor(1, 0, 0xB1); /* Set the border */ - txt_f256_set_border(8, 8); /* Set up the border */ + txt_f256_set_border(0, 0); /* Set up the border */ txt_f256_set_border_color(0xf0, 0, 0); - INFO("Border set"); - /* * Enable set_sizes, now that everything is set up initially * And calculate the size of the screen diff --git a/src/dev/uart.c b/src/dev/uart.c index 64e1133..1cb356c 100644 --- a/src/dev/uart.c +++ b/src/dev/uart.c @@ -170,7 +170,9 @@ unsigned char uart_get(short uart) { /* Return the byte */ return uart_base[UART_TRHB]; - } + } else { + return 0; + } } /* @@ -227,12 +229,12 @@ short uart_status(p_channel chan) { * @param mode an unused parameter * @return 0 on success, any other number is an error */ -short uart_open(p_channel chan, const char * spec, short mode) { +short uart_open(p_channel chan, const unsigned char * spec, short mode) { unsigned short bps = 0, lcr = 0; char * saveptr; char spec_copy[80]; char *token = 0; - short i = 0; + long i = 0; short bps_code = 0; short lcr_code = 0; @@ -240,14 +242,14 @@ short uart_open(p_channel chan, const char * spec, short mode) { uart_init(cdev_to_uart(chan->dev)); // Make a local copy of the specification so we can tokenize it - strncpy(spec_copy, spec, 80); + strncpy(spec_copy, (char *)spec, 80); // Get the first token saveptr = spec_copy; token = strtok_r(spec_copy, ",", &saveptr); if (token) { // Parse the bit rate token - i = atoi(token); + i = atol(token); switch (i) { case 300: bps_code = UART_300; @@ -392,7 +394,7 @@ short uart_read_b(p_channel chan) { * @param size the size of the buffer. * @return number of bytes read, any negative number is an error code */ -short uart_read(p_channel chan, char * buffer, short size) { +short uart_read(p_channel chan, unsigned char * buffer, short size) { short i = 0, count = 0; for (i = 0; i < size; i++) { buffer[i] = uart_get(cdev_to_uart(chan->dev)); @@ -410,7 +412,7 @@ short uart_read(p_channel chan, char * buffer, short size) { * @param size the size of the buffer. * @returns number of bytes read, any negative number is an error code */ -short uart_readline(p_channel chan, char * buffer, short size) { +short uart_readline(p_channel chan, unsigned char * buffer, short size) { short i = 0, count = 0; for (i = 0; i < size; i++) { char c = uart_get(cdev_to_uart(chan->dev)); @@ -444,7 +446,7 @@ short uart_write_b(p_channel chan, unsigned char c) { * @param size the size of the buffer. * @return number of bytes written, any negative number is an error code */ -short uart_write(p_channel chan, const char * buffer, short size) { +short uart_write(p_channel chan, const unsigned char * buffer, short size) { int i; for (i = 0; i < size; i++) { uart_put(cdev_to_uart(chan->dev), buffer[i]); @@ -484,8 +486,5 @@ short uart_install() { dev.number = CDEV_COM2; result = cdev_register(&dev); - - if (result) { - return result; - } + return result; } diff --git a/src/snd/Makefile b/src/snd/Makefile index 1460aad..d8eb1c5 100644 --- a/src/snd/Makefile +++ b/src/snd/Makefile @@ -1,5 +1,5 @@ -UNIT := C256U_PLUS +UNIT := F256 # Define OS-dependent variables @@ -32,6 +32,13 @@ else ifeq ($(UNIT),C256_FMX) SRCS_FOR_UNIT=psg.c sid.c codec_c256.c CFLAGS_FOR_UNIT=-DMODEL=0 -DCPU=255 --target Foenix --code-model large --data-model large +else ifeq ($(UNIT),F256) + CC=cc65816 + AS=as65816 + AR=nlib + + SRCS_FOR_UNIT=psg.c codec_c256.c # sid.c + CFLAGS_FOR_UNIT=-DMODEL=2 -DCPU=255 --code-model large --data-model large endif INCLUDES=-I.. -I../include diff --git a/src/toolbox.c b/src/toolbox.c index 6f514a5..9eaec50 100644 --- a/src/toolbox.c +++ b/src/toolbox.c @@ -133,27 +133,24 @@ void initialize() { #error Cannot identify screen setup #endif - txt_set_border_color(0, 0x80, 0x80, 0x80); - txt_print(0, "Foenix Toolbox starting up...\n"); - + printf("Foenix Toolbox v%d.%02d.%04d starting up...\n", VER_MAJOR, VER_MINOR, VER_BUILD); INFO("Text system initialized."); - while (1) ; - // // Initialize the bitmap system // bm_init(); // INFO("Bitmap system initialized..."); -// /* Initialize the indicators */ -// ind_init(); -// INFO("Indicators initialized"); + /* Initialize the indicators */ + ind_init(); + INFO("Indicators initialized"); // /* Initialize the interrupt system */ // int_init(); // INFO("Interrupts initialized"); -// /* Mute the PSG */ -// psg_mute_all(); + /* Mute the PSG */ + psg_mute_all(); + INFO("PSG Muted."); // /* Initialize and mute the SID chips */ // sid_init_all(); @@ -161,8 +158,9 @@ void initialize() { // // /* Initialize the Yamaha sound chips (well, turn their volume down at least) */ // // ym_init(); -// /* Initialize the CODEC */ -// init_codec(); + /* Initialize the CODEC */ + init_codec(); + INFO("CODEC initialized."); // cdev_init_system(); // Initialize the channel device system // INFO("Channel device system ready.");