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

Files at this revision

API Documentation at this revision

Comitter:
davervw
Date:
Fri Apr 17 15:49:23 2020 +0000
Parent:
11:69ea8de91915
Child:
13:035c53a987a1
Commit message:
comments, copyrights, licenses updated

Changed in this revision

emuc64.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/emuc64.cpp	Thu Apr 16 06:56:48 2020 +0000
+++ b/emuc64.cpp	Fri Apr 17 15:49:23 2020 +0000
@@ -31,30 +31,35 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 //
-// This is a 6502 Emulator, designed for running Commodore 64 text mode, 
-//   with only a few hooks: CHRIN-$FFCF/CHROUT-$FFD2/COLOR-$D021/199/646
-// Useful as is in current state as a simple 6502 emulator
+// This is a C64 Emulator, designed for targeting STM32F29 w/ LCD and USB kbd
 //
 // LIMITATIONS:
-// Only keyboard/console I/O.  No text pokes, no graphics.  Just stdio.  
-//   No asynchronous input (GET K$), but INPUT S$ works
-// No keyboard color switching.  No border displayed.  No border color.
-// No screen editing (gasp!) Just short and sweet for running C64 BASIC in 
-//   terminal/console window via 6502 chip emulation in software
-// No PETSCII graphic characters, only supports printables CHR$(32) to CHR$(126), and CHR$(147) clear screen
-// No memory management.  Full 64K RAM not accessible via banking despite startup screen.
-//   Just 44K RAM, 16K ROM, 1K VIC-II color RAM nybbles
-// No timers.  No interrupts except BRK.  No NMI/RESTORE key.  No STOP key.
-// No loading of files implemented.
+// Loading of files at startup is optional depending on availability of
+//   a local file system store (e.g. Mbed MSD)
+// Device I/O not implemented.  No tape/serial/printer/disk/joystick.
+// Limited VIC II register support (see Memory Map).  No graphics.
+// No CIA1/CIA2 except for keyboard scan.
+// No sound.  Sorry no SID.
+// No cartridges.
 //
-//   $00/$01     (DDR and banking and I/O of 6510 missing), just RAM
-//   $0000-$9FFF RAM (199=reverse if non-zero, 646=foreground color)
-//   $A000-$BFFF BASIC ROM (write to RAM underneath, but haven't implemented read/banking)
+// MEMORY MAP
+//   $00         (data direction missing)
+//   $01         Banking implemented (tape sense/controls missing)
+//   $0000-$9FFF RAM
+//   $A000-$BFFF BASIC ROM
+//   $A000-$BFFF Banked LORAM
 //   $C000-$CFFF RAM
-//   $D000-$DFFF (missing I/O and character ROM and RAM banks), just zeros except...
-//   $D021       Background Screen Color
-//   $D800-$DFFF VIC-II color RAM nybbles (note: haven't implemented RAM banking)
-//   $E000-$FFFF KERNAL ROM (write to RAM underneath, but haven't implemented read/banking)
+//   $D000-$D7FF (I/O missing except for select few, reads as zeros)
+//    D018       Memory Control Register (bit 1 limited to selecting which ROM character set)
+//    D020       Border Color
+//    D021       Background Color
+//    DC00       CIA#1 limited to writing value to Port A (select keyboard column)
+//    DC01       CIA#1 limited to reading value from Port B (read keyboard row)
+//   $D800-$DFFF VIC-II color RAM nybbles in I/O space (1K x 4bits)
+//   $D000-$DFFF Banked RAM
+//   $D000-$DFFF Banked Character ROM
+//   $E000-$FFFF KERNAL ROM
+//   $E000-$FFFF Banked HIRAM
 //
 // Requires user provided Commodore 64 BASIC/KERNAL ROMs (e.g. from VICE)
 //   as they are not provided, others copyrights may still be in effect.
--- a/main.cpp	Thu Apr 16 06:56:48 2020 +0000
+++ b/main.cpp	Fri Apr 17 15:49:23 2020 +0000
@@ -49,16 +49,22 @@
 {
     printf("\n");
     printf("C64-stm429_discovery\n");
-	printf("C64 Emu6502 (for STM32F429 Discovery), version 1.32\n");
+	printf("C64 Emu6502 (for STM32F429 Discovery), version 1.33\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("Contains other copyrighted and licensed software\n");
+	printf("   ARM MBED OS - Apache License 2.0\n");
+	printf("   ARM MBED USBHOST - Apache License 2.0\n");
+	printf("   STM32F429 Discovery Board BSP\n");
+	printf("      COPYRIGHT(c) 2014 STMicroelectronics\n");
+    printf("      Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n");
+    printf("      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n");
 	printf("\n");
+	printf("Commodore ROMs not licensed\n");
+	printf("\n");
+	
 	//StartupPRG = "/local/guess2.prg";
 	C64_Init("/local/basic", "/local/chargen", "/local/kernal");