Skip to content

rpsubc8/RP2040TinyGalaksija

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RP2040 Tiny Galaksija

Galaksija emulator Waveshare RP2040 pizero

Port I had made from TinyESP32 to RP2040 with VGA and HDMI. Based on the x86 emulator by Miodrag Jevremovic, Tomaž Šolc and Peter Bakota.

https://github.com/rpsubc8/ESP32TinyGalaksija

Using use_lib_hdmi in gbConfig.h (hdmi connector on waveshare board):

HDMI GPIO
sm_tmds 0, 1, 2
pins_tmds 26, 24, 22
pins_clk 28



Using use_lib_vga in gbConfig.h:

VGA GPIO Description
18 RED
19 GREEN
20 BLUE
16 HSync
17 VSync

In this connector we have:

VGA Description
1 RED
2 GREEN
3 BLUE
13 HSYNC
14 VSYNC
5,6,7,8,11 GROUND

Some modern monitors may need 5v (very low amperage) on pin 9, which in the current schematic is not connected (N/C).



PS/2 keyboard USB C

If we have a Waveshare PiZero board, we can use the PIO-USB connector, i.e. the central one, which is located between the HDMI and the power supply.
From this USB C connector, we can use a USB to USB C converter.
In the gbConfig.h we must choose the option use_lib_keyboard_ps2usb, which will use GPIO 6 and 7.
PS2 GPIO Description
6 CLK (D+)
7 Data (D-)

For some emulators, when using the native HID protocol via USB, the keyboard must be connected to the external connector, while the board is powered by the central connector (PIO-USB). But in this case, you are using the PS/2 protocol, so you must connect to the central PIO-USB and power it on the external USB.

Description

  • Arduino IDE 1.8.16
  • Board Waveshare RP2040 pizero
  • Tested with Earle F.Philhower,III 2.6.4 and Earle F.Philhower,III 3.9.3
  • HDMI picoDVI fork adafruit version 1.0.0
  • Adafruit GFX library
  • Adafruit BusIO library
  • VGA library (Hunter Adams and San Tarcisio mod)
  • PS2 library (ps2kbdlib michalhol mod)
  • A variety of PS/2 keyboards, as well as USB keyboards with PS/2 conversion allow 3.3v power supply. Be sure to work with 3.3v. Never power the keyboard at 5v. In case you are using the PIO-USB USB C connector, you can work with 5V. Make sure you know what you are doing, and if in doubt, just don't go ahead.
  • Although 3 GPIO's are used for VGA, since only 1 bit of colour (black and white) is used, one of the 3 colour GPIO outputs can be used at each input of the VGA monitor.
  • No overclock voltage HDMI (1.05v). By default RP2040 runs at 1.10v and 133 Mhz. For HDMI it is required to overclock to 1.25v and 250 Mhz. For HDMI, I have done an undervolt, to be more conservative, i.e. I have left it at 1.05v, being configurable in gbConfig.h. If it doesn't look good, you can go higher.
  • Activate the option: Optimize Even More (-02) or (-03) for HDMI



Tool data2h

I have created a very basic tool (win32) to convert .GTP and .GAL files into .h in ready mode to be processed by the emulator.
It is recommended to have short file names. Additionally, the tool cuts to 32 characters to display in the OSD.

We just have to leave the .GAL and .GTP files in the input/GAL folder and input/GTP run the data2h.exe file , so that an output will be generated in the output/dataFlash directory.Tool data2h

 input/
  gal/
  gtp/
 output/
  dataFlash/
   gal/
   gtp/ 
Later we must copy the dataFlash directory to the galaksija project, overwriting the previous dataFlash folder. It is recommended to clean the project and compile again.
This tool is very simple, and does not control errors, so it is recommended to leave the files with very simple names and as simple as possible.
Since the source code is available, it can be compiled for Linux or for Android under Termux. In Termux we have to install the gcc or clang package and compile:
 gcc -s data2h.cpp -odata2h.a
It must be done from the home data directory of the Android device, so if we do it in any other directory, the data2h.a created will never be able to be executed, unless the device is rooted.



Precompile version

Versions VGA, HDMI, with PS/2 to USB C converter (ps2usb) are available.
https://github.com/rpsubc8/RP2040TinyGalaksija/tree/main/precompile

About

Galaksija emu Waveshare RP2040 pizero

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published