C64 emulation on STM32F429 Discovery board with builtin LCD and USB keyboard support (OTG). More info at davevw.com and/or github.com/davervw

Dependencies:   LCD_DISCO_F429ZI BSP_DISCO_F429ZI USBHOST

Revision:
4:8476be802690
Parent:
1:256d8a124b55
Child:
6:65f96b9dd1d3
--- a/main.cpp	Fri Apr 10 04:32:54 2020 +0000
+++ b/main.cpp	Mon Apr 13 05:36:43 2020 +0000
@@ -1,9 +1,10 @@
-// c-simple-emu-cbm.cs - main()
+// main.cpp - main()
 //
 ////////////////////////////////////////////////////////////////////////////////
 //
-// c-simple-emu-cbm (C Portable Version)
-// C64/6502 Emulator for Microsoft Windows Console
+// C64-stm429_discovery
+// C64/6502 Emulator targeting STM32F429 LCD/USBHOST
+// [ported from c-simple-emu-cbm (C Portable Version - for console)]
 //
 // MIT License
 //
@@ -11,7 +12,6 @@
 // davevw.com
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
-//
 // of this software and associated documentation files (the "Software"), to deal
 // in the Software without restriction, including without limitation the rights
 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -30,24 +30,47 @@
 // SOFTWARE.
 //
 ////////////////////////////////////////////////////////////////////////////////
+// OTHER INCLUDED (NOT LIMITED TO) SOURCE/LIBRARIES MAY HAVE DIFFERENT LICENSES.
+//    ARM MBED OS
+//    ARM MBED USBHOST
+//    STM32F429 BSP
+////////////////////////////////////////////////////////////////////////////////
 
 #include <mbed.h>
-#include "cbmconsole.h"
+#include "USBHostKeyboard.h"
 #include "emuc64.h"
 #include "emu6502.h"
 
-Serial pc(USBTX, USBRX, 115200);
+static void execute_task(void const *) {
+	ResetRun(ExecutePatch);
+}
 
 int main(/*int argc, char* argv[]*/)
 {
-    pc.printf("\n");
-	pc.printf("c-simple-emu-cbm version 1.3\n");
-	pc.printf("Copyright (c) 2020 by David R. Van Wagner\n");
-	pc.printf("MIT License\n");
-	pc.printf("github.com/davervw\n");
-	pc.printf("\n");
+    printf("\n");
+    printf("C64-stm429_discovery\n");
+	printf("C64 Emu6502 (for STM32F429 Discovery), version 1.0\n");
+	printf("Copyright (c) 2020 by David R. Van Wagner\n");
+	printf("Open Source - MIT License\n");
+	printf("github.com/davervw\n");
+	printf("\n");
+	printf("Contains other licensed software\n");
+	printf("   ARM MBED OS\n");
+	printf("   ARM MBED USBHOST\n");
+	printf("   STM32F429 BSP\n");
+	printf("\n");
 	//StartupPRG = "/local/guess2.prg";
 	C64_Init("/local/basic", "/local/kernal");
-	ResetRun(ExecutePatch);
+
+    Thread keyboardTask(keyboard_task, NULL, osPriorityNormal, 1024 * 4);
+    Thread executeTask(execute_task, NULL, osPriorityNormal, 1024 * 4);
+
+	//DigitalOut led1(LED1);
+	//led1 = 1;
+    while(1) {
+        //led1=!led1;
+        Thread::wait(500);
+    }
+
 	return 0;
 }