I have ported my old project “pNesX” game console emulator to the nucleo.
Dependencies: SDFileSystem mbed
Intro
I have ported my old project “pNesX” to the STM32 Nucleo. The pNesX is a NES emulator for the PlayStation that I have created 16 years ago!
Emulation part was almost without change, the sound part was newly added.
Parts
STM32 Nucleo F446RE |
QVGA 2.2 TFT SPI (with the SD card slot) |
Audio jack(TS or TRS) |
USB Connector |
Register 100k, 10k, 4.7k, 100 |
Capacitor 0.01uF, 2.2uF |
Breadboard |
Wires |
Computer Speakers |
USB GamePad |
Wiring diagram
TFT J2 | Nucleo |
---|---|
VCC | 3V3 |
GND | GND |
CS | PB_5(D4) |
Reset | PA_10(D2) Pull Up(100k) |
D/C | PA_8(D7) |
MOSI | PA_7(D11) |
SCK | PA_5(D13) |
LED | LED-100ohm-3V3 |
MISO | PA_6(D12) |
TFT J4 | Nucleo |
---|---|
SD_CS | PA_9 |
SD_MOSI | PB_15 |
SD_MISO | PB_14 |
SD_SCK | PB_13 |
Audio | Nucleo |
---|---|
TIP | PA_4(A2) |
USB con. | Nucleo |
---|---|
GND | GND |
+ | PA_12 |
- | PA_11 |
5V | 5V |
Limitations
- Since the rest of the RAM is about 50kbyte, maximum capacity of the game ROM is about 50kbyte.
- The length of the file name up to 32 characters.
- The number of files in the folder is up to 100.
Used Library
- SDFileSystem by Neil Thiessen
- F401RE-USBHost by Norimasa Okamoto
- USBHostGamepad by Yuuichi Akagawa
Diff: Racoon_logo.cpp
- Revision:
- 0:3dac1f1bc9e0
diff -r 000000000000 -r 3dac1f1bc9e0 Racoon_logo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Racoon_logo.cpp Sun Apr 03 07:45:29 2016 +0000 @@ -0,0 +1,54 @@ +/*===================================================================*/ +/* */ +/* Racoon_logo.cpp : Racoon Logo image data(4bit bmp) */ +/* */ +/* 2016/1/20 Racoon */ +/* */ +/*===================================================================*/ + +extern const unsigned char Racoon_logo[]; + +const unsigned char Racoon_logo[]= +{ + 0x42,0x4D,0x6E,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0x28,0x00, + 0x00,0x00,0x3D,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0xF8,0x00,0xF5,0xF5,0xF5,0x00,0xEF,0xEF, + 0xEF,0x00,0xE3,0xE3,0xE3,0x00,0xD2,0xD2,0xD2,0x00,0xC2,0xC2,0xC2,0x00,0xAC,0xAC, + 0xAC,0x00,0x9E,0x9E,0x9E,0x00,0x80,0x80,0x80,0x00,0x68,0x68,0x68,0x00,0x4D,0x4D, + 0x4D,0x00,0x2E,0x2E,0x2E,0x00,0x17,0x17,0x17,0x00,0x09,0x09,0x09,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, + 0x01,0x01,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, + 0x27,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88, + 0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x73,0x00,0x00,0x00,0x00,0x00, + 0x5C,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD, + 0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,0xC6,0x10,0x00,0x00,0x00,0x00, + 0x26,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77, + 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x63,0x10,0x00,0x00,0x00,0x00, + 0x00,0x00,0x04,0x97,0x22,0x69,0x84,0x8A,0x97,0x94,0x14,0x8A,0xA7,0x33,0x8A,0xA7, + 0x31,0x26,0x9A,0x94,0x24,0x97,0x13,0x96,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCA,0x35,0xBC,0x68,0xCA,0x9C,0xD6,0x4A,0xCA,0xAA,0x59,0xCA,0xAD, + 0x93,0x7C,0xB9,0xCB,0x46,0xDA,0x15,0xCA,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCA,0x4A,0xD9,0x28,0xC8,0x39,0xD6,0x7C,0xA3,0x34,0x6B,0xA4,0x4B, + 0xC6,0xAC,0x52,0x9D,0x76,0xDB,0x05,0xCA,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCC,0xBD,0xB5,0x04,0xAB,0xBC,0xD6,0x8D,0x91,0x01,0x6C,0xA3,0x3A, + 0xD6,0xBC,0x30,0x8D,0x86,0xDA,0x25,0xC9,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCB,0x9B,0xC9,0x22,0x56,0x6B,0xD6,0x6C,0xB4,0x46,0x6B,0xB4,0x5B, + 0xB5,0xAC,0x63,0xAD,0x76,0xDB,0x57,0xC9,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCA,0x45,0xBC,0x43,0xAB,0xBC,0xA4,0x39,0xCB,0xBA,0x48,0xCB,0xBC, + 0x82,0x6B,0xBB,0xC9,0x36,0xCC,0xBB,0xC7,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCB,0x78,0xDC,0x32,0x68,0x88,0x41,0x02,0x68,0x85,0x21,0x57,0x85, + 0x20,0x04,0x78,0x62,0x13,0x66,0x58,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0xCD,0xDD,0xB8,0x20,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,0x02,0x33,0x33,0x32,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,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,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + +