int main(void) { // Initialize LED, sound and the program button pins. maximite_init(); // Initial setup of the I/O ports. AD1PCFG = 0xFFFF; // Default all pins to digital. mJTAGPortEnable(0); // Turn off JTAG. // Setup the CPU. // System config performance. SYSTEMConfigPerformance(CLOCKFREQ); // Fix the peripheral bus to the main clock speed. mOSCSetPBDIV(OSC_PB_DIV_1); INTEnableSystemMultiVectoredInt(); // Allow vectored interrupts. usb_init(); keyboard_init(); // Initialise and startup the keyboard routines. rk86_video_init(); // Start the video state machine. delay_us(1000); while (keyboard_inkey() != -1); i8080_pic32_run(); panic(PANIC_EMULATION_TERMINATED); return 0; }
int input_key(void) { int c; do { video_show_cursor(1); c = keyboard_inkey(); if (c == '\r') c = '\n'; } while (c == -1); video_show_cursor(0); return c; }
int main(void) { // Initial setup of the I/O ports. AD1PCFG = 0xFFFF; // Default all pins to digital. mJTAGPortEnable(0); // Turn off JTAG. // Setup the CPU. // System config performance. SYSTEMConfigPerformance(CLOCKFREQ); #if defined(MAXIMITE) || (defined(UBW32) && defined(__DEBUG)) || \ defined(DUINOMITE) // Fix the peripheral bus to the main clock speed. mOSCSetPBDIV(OSC_PB_DIV_1); #endif INTEnableSystemMultiVectoredInt(); // Allow vectored interrupts. keyboard_init(); // Initialise and startup the keyboard routines. video_init(); // Start the video state machine. video_clear_screen(); // Clear the video buffer. DelayUs(1*1000*1000); while (keyboard_inkey() != -1); video_display_string("MAXIMITE console\r\n"); while (1) { int ch = input_key(); video_put_char(ch); { static char buf[10]; sprintf(buf, "<%02X>", ch); video_display_string(buf); } if (ch == '\n') video_put_char('\r'); } }