Misc additions, font, and cleanup
Added A2560K keyboard LED, font memory definitions. Some cleanup of initialization code.
This commit is contained in:
parent
863bbd9472
commit
b5e6b8bb6b
|
@ -5,6 +5,7 @@
|
|||
#include "constants.h"
|
||||
#include "vicky_general.h"
|
||||
#include "text_screen_iii.h"
|
||||
#include "rsrc/font/foenix_st_8_8.h"
|
||||
|
||||
#define MAX_TEXT_CHANNELS 2
|
||||
|
||||
|
@ -105,6 +106,13 @@ int text_init() {
|
|||
chan_a->border_control[0] = 0x00102001; // Enable
|
||||
chan_a->border_control[1] = 0x00000040; //Dark Blue
|
||||
|
||||
/* Set the font for channel A */
|
||||
|
||||
for (i = 0; i < 0x800; i++) {
|
||||
unsigned char b = foenix_st_8x8[i];
|
||||
VICKY_TXT_FONT_A[i] = b;
|
||||
}
|
||||
|
||||
text_setsizes(0);
|
||||
text_set_color(0, 15, 3);
|
||||
text_clear(0);
|
||||
|
@ -129,6 +137,13 @@ int text_init() {
|
|||
text_set_cursor(1, 0xF3, 0xB1, 1, 1);
|
||||
text_set_xy(1, 0, 0);
|
||||
|
||||
/* Set the font for channel B */
|
||||
|
||||
for (i = 0; i < 0x800; i++) {
|
||||
unsigned char b = foenix_st_8x8[i];
|
||||
VICKY_TXT_FONT_B[i] = b;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
100
src/foenixmcp.c
100
src/foenixmcp.c
|
@ -95,8 +95,6 @@ void initialize() {
|
|||
short res;
|
||||
|
||||
text_init(); // Initialize the text channels
|
||||
DEBUG("Foenix/MCP starting up...");
|
||||
|
||||
log_setlevel(LOG_ERROR);
|
||||
|
||||
/* Initialize the interrupt system */
|
||||
|
@ -122,30 +120,30 @@ void initialize() {
|
|||
sid_test_internal();
|
||||
|
||||
cdev_init_system(); // Initialize the channel device system
|
||||
DEBUG("Channel device system ready.");
|
||||
log(LOG_INFO, "Channel device system ready.");
|
||||
|
||||
bdev_init_system(); // Initialize the channel device system
|
||||
DEBUG("Block device system ready.");
|
||||
log(LOG_INFO, "Block device system ready.");
|
||||
|
||||
if (res = con_install()) {
|
||||
print_error(0, "FAILED: Console installation", res);
|
||||
log_num(LOG_ERROR, "FAILED: Console installation", res)
|
||||
} else {
|
||||
DEBUG("Console installed.");
|
||||
log(LOG_INFO, "Console installed.");
|
||||
}
|
||||
|
||||
/* Initialize the real time clock */
|
||||
rtc_init();
|
||||
|
||||
if (res = pata_install()) {
|
||||
print_error(0, "FAILED: PATA driver installation", res);
|
||||
log_num(LOG_ERROR, "FAILED: PATA driver installation", res);
|
||||
} else {
|
||||
DEBUG("PATA driver installed.");
|
||||
log(LOG_INFO, "PATA driver installed.");
|
||||
}
|
||||
|
||||
if (res = sdc_install()) {
|
||||
print_error(0, "FAILED: SDC driver installation", res);
|
||||
log_num(LOG_ERROR, "FAILED: SDC driver installation", res);
|
||||
} else {
|
||||
DEBUG("SDC driver installed.");
|
||||
log(LOG_INFO, "SDC driver installed.");
|
||||
}
|
||||
|
||||
// At this point, we should be able to call into to console to print to the screens
|
||||
|
@ -157,21 +155,21 @@ void initialize() {
|
|||
// }
|
||||
|
||||
if (res = kbdmo_init()) {
|
||||
print_error(0, "FAILED: A2560K built-in keyboard initialization", res);
|
||||
log_num(LOG_ERROR, "FAILED: A2560K built-in keyboard initialization", res);
|
||||
} else {
|
||||
DEBUG("A2560K built-in keyboard initialized.");
|
||||
log(LOG_INFO, "A2560K built-in keyboard initialized.");
|
||||
}
|
||||
|
||||
if (res = cli_init()) {
|
||||
print_error(0, "FAILED: CLI initialization", res);
|
||||
log_num(LOG_ERROR, "FAILED: CLI initialization", res);
|
||||
} else {
|
||||
DEBUG("CLI initialized.");
|
||||
log(LOG_INFO, "CLI initialized.");
|
||||
}
|
||||
|
||||
if (res = fsys_init()) {
|
||||
print_error(0, "FAILED: file system initialization", res);
|
||||
log_num(LOG_ERROR, "FAILED: file system initialization", res);
|
||||
} else {
|
||||
DEBUG("File system initialized.");
|
||||
log(LOG_INFO, "File system initialized.");
|
||||
}
|
||||
|
||||
/* Enable all interrupts */
|
||||
|
@ -183,7 +181,6 @@ void uart_send(short uart, char * message) {
|
|||
|
||||
for (i = 0; i < strlen(message); i++) {
|
||||
uart_put(uart, message[i]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,42 +192,6 @@ void uart_test_send(short uart) {
|
|||
}
|
||||
}
|
||||
|
||||
static long g_sof_counter = 0;
|
||||
|
||||
/*
|
||||
* Interrupt handler for Channel A's Start of Frame
|
||||
*/
|
||||
void int_sof_a() {
|
||||
g_sof_counter++;
|
||||
|
||||
long counter_mod = g_sof_counter % 60;
|
||||
|
||||
if (counter_mod == 0) {
|
||||
/* Set the power LED to red */
|
||||
*RGB_LED_L = 0x00FF;
|
||||
*RGB_LED_H = 0x0000;
|
||||
} else if (counter_mod == 30) {
|
||||
/* Set the power LED to blue */
|
||||
*RGB_LED_L = 0x0000;
|
||||
*RGB_LED_H = 0x00FF;
|
||||
}
|
||||
|
||||
/* Acknowledge the interrupt before leaving */
|
||||
int_clear(SOF_A_INT00);
|
||||
}
|
||||
|
||||
/*
|
||||
* Interrupt handler for Channel A's Start of Frame
|
||||
*/
|
||||
void change_led() {
|
||||
g_sof_counter++;
|
||||
|
||||
long counter_mod = g_sof_counter % 2;
|
||||
|
||||
*RGB_LED_L = 0x0000;
|
||||
*RGB_LED_H = 0xFF00;
|
||||
}
|
||||
|
||||
void try_format(short screen, char * path) {
|
||||
FATFS fs; /* Filesystem object */
|
||||
FIL fil; /* File object */
|
||||
|
@ -337,40 +298,11 @@ int main(int argc, char * argv[]) {
|
|||
|
||||
initialize();
|
||||
|
||||
print(CDEV_CONSOLE, "Text Channel A\n");
|
||||
print(CDEV_EVID, "Text Channel B\n");
|
||||
|
||||
// uart_test_send(0);
|
||||
|
||||
/* Register a handler for the SOF interrupt and enable it */
|
||||
int_register(0x00, int_sof_a);
|
||||
int_enable(0x00);
|
||||
|
||||
// uart_init(0);
|
||||
// uart_test_send(0);
|
||||
|
||||
// test_get_mbr(0, BDEV_SDC);
|
||||
// try_write(0, "0:");
|
||||
// dos_cmd_dir(0, "0:");
|
||||
// try_mo(0);
|
||||
// try_mo_scancodes(0);
|
||||
// try_bdev_getput(0, BDEV_SDC);
|
||||
|
||||
// print(0, "Watching for MIDI signals:\n");
|
||||
// while (1) {
|
||||
// midi_byte = midi_get_poll();
|
||||
// if (midi_byte && (midi_byte != 0xFE) && (midi_byte != 0xF8)) {
|
||||
// print_hex(0, midi_byte);
|
||||
// print(0, "\n");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
const char * welcome = "\n\nFoenix/MCP Command Line Utility... online.\nType \"HELP\" or \"?\" for help.\n\n";
|
||||
const char * welcome = "Foenix/MCP Command Line Utility... online.\nType \"HELP\" or \"?\" for help.\n";
|
||||
sys_chan_write(0, welcome, strlen(welcome));
|
||||
cli_repl(0);
|
||||
|
||||
DEBUG("Stopping.");
|
||||
log(LOG_INFO, "Stopping.");
|
||||
|
||||
/* Infinite loop... */
|
||||
while (1) {};
|
||||
|
|
4140
src/foenixmcp.s68
4140
src/foenixmcp.s68
File diff suppressed because it is too large
Load diff
|
@ -77,7 +77,7 @@
|
|||
#define ScreenText_B ((volatile char *)0x00CA0000) /* Text matrix */
|
||||
#define ColorText_B ((volatile uint8_t *)0x00CA8000) /* Color matrix */
|
||||
#define FG_CLUT_B ((volatile uint16_t *)0x00CAC400) /* Foreground LUT */
|
||||
#define BG_CLUT_B ((volatile uint16_t *)0x00CAC440) /* Background LUT */
|
||||
#define BG_CLUT_B ((volatile uint16_t *)0x00CAC440) /* Background LUT */
|
||||
|
||||
#define BM0_Control_Reg ((volatile uint16_t *)0x00C80100)
|
||||
#define BM0_Addy_Pointer_Reg ((volatile uint16_t *)0x00C80104)
|
||||
|
@ -100,6 +100,13 @@
|
|||
#define LUT_6 ((volatile uint8_t *)0x00C83800)
|
||||
#define LUT_7 ((volatile uint8_t *)0x00C83C00)
|
||||
|
||||
/*
|
||||
* Text mode font memory
|
||||
*/
|
||||
|
||||
#define VICKY_TXT_FONT_A ((volatile unsigned char *)0x00C48000) /* $00C48000..$00C48FFF - FONT MEMORY Channel A */
|
||||
#define VICKY_TXT_FONT_B ((volatile unsigned char *)0x00C88000) /* $00C88000..$00C88FFF - FONT MEMORY Channel B */
|
||||
|
||||
/*
|
||||
* Location of VRAM
|
||||
*/
|
||||
|
@ -107,4 +114,4 @@
|
|||
#define VRAM_Bank0 ((volatile uint8_t *)0x00800000)
|
||||
#define VRAM_Bank1 ((volatile uint8_t *)0x00A00000)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -26,4 +26,22 @@
|
|||
#define GABE_CHIP_VERSION ((volatile unsigned short *)0x00C00010)
|
||||
#define GABE_CHIP_NUMBER ((volatile unsigned short *)0x00C00012)
|
||||
|
||||
/*
|
||||
* 16-bit register controlling the key of the A2560K built-in keyboard
|
||||
*/
|
||||
|
||||
#define GABE_MO_LEDS ((volatile unsigned short *)0x00C00006)
|
||||
#define GABE_MO_LED_0_B 0x0001 /* LED 0 (Close to DEL key) -- Blue ON */
|
||||
#define GABE_MO_LED_0_G 0x0002 /* LED 0 (Close to DEL key) -- Green ON */
|
||||
#define GABE_MO_LED_0_R 0x0004 /* LED 0 (Close to DEL key) -- Red ON */
|
||||
#define GABE_MO_LED_1_B 0x0008 /* LED 1 (Below #0) -- Blue ON */
|
||||
#define GABE_MO_LED_1_G 0x0010 /* LED 1 (Below #0) -- Green ON */
|
||||
#define GABE_MO_LED_1_R 0x0020 /* LED 1 (Below #0) -- Red ON */
|
||||
#define GABE_MO_LED_2_B 0x0040 /* LED 2 (above arrow) -- Blue ON */
|
||||
#define GABE_MO_LED_2_G 0x0080 /* LED 2 (above arrow) -- Green ON */
|
||||
#define GABE_MO_LED_2_R 0x0100 /* LED 2 (above arrow) -- Red ON */
|
||||
#define GABE_MO_LED_3_B 0x0200 /* LED 2 (caps lock, Rev C) -- Blue ON */
|
||||
#define GABE_MO_LED_3_G 0x0400 /* LED 2 (caps lock, Rev C) -- Green ON */
|
||||
#define GABE_MO_LED_3_R 0x0800 /* LED 2 (caps lock, Rev C) -- Red ON */
|
||||
|
||||
#endif
|
||||
|
|
9402
src/mapfile
9402
src/mapfile
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
unsigned char MSX_8x8[] = {
|
||||
const unsigned char MSX_8x8[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
unsigned char foenix_st_8x8[] = {
|
||||
const unsigned char foenix_st_8x8[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81,
|
||||
0xbd, 0x99, 0x81, 0x7e, 0x3c, 0x7e, 0xdb, 0xff, 0xc3, 0x7e, 0x3c, 0x00,
|
||||
0x00, 0xee, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10, 0x38, 0x7c, 0xfe,
|
||||
|
|
Loading…
Reference in a new issue