fruit-bat / pico-zxspectrum

ZX Spectrum for Raspberry Pico Pi RP2040
459 stars 49 forks source link

PICOMPUTER / RetroVGA support #9

Open bobricius opened 2 years ago

bobricius commented 2 years ago

Hi If you are able to add support my boards I can send you this hardware https://hackaday.io/project/184965-picomputer-zx-pocket-zx-spectrum (ST7789 IPS LCD) https://hackaday.io/project/183398-retrovga-raspbery-pico-multi-retro-computer (VGA output) Currently this board use MCUME https://github.com/Jean-MarcHarvengt/MCUME But there is only Spectrum48K

shaeon commented 2 years ago

Why not add ps2 support too?

Some examples of use it: https://github.com/tvlad1234/pico-ps2Driv https://github.com/lurk101/pico-ps2kbd/blob/master/example.c

fruit-bat commented 2 years ago

If you can get some hardware to me I could have a go. As long as you don't mind if if takes a while. Circuit diagrams and any accompanying docs would be helpful.

fruit-bat commented 2 years ago

There has been a little progress on support for the VGA variant. It's all still subject to change and needs some tidying up but at least you can see something is happening!

As a little background, to have enough memory for the 128k emulation I cannot afford to have VGA frame buffers. The VGA encoder races the raster down the screen encoding lines as it goes; the consequence being the encoders have to be quick.

I have an RGB332 driver created from bits of other projects along with the encoders for the menu system and Spectrum: https://github.com/fruit-bat/pico-vga-332

This is the spectrum encoder, which I think is pretty efficient: https://github.com/fruit-bat/pico-vga-332/blob/main/pzx_prepare_vga332_scanline.cpp

...and here is the encoder for the menu: https://github.com/fruit-bat/pico-dvi-menu/blob/main/src/PicoCharRendererVga.cpp The encoder will support 80x60 characters but the emulator will only need 80x30.

I've just started messing about with keyboard scan routines: https://github.com/fruit-bat/pico-vga-332/blob/main/pzx_keyscan.cpp

That's all for now :-)

fruit-bat commented 2 years ago

Still work to be done on key mappings and documentation and other board types.

fruit-bat commented 2 years ago

Why not add ps2 support too?

Some examples of use it: https://github.com/tvlad1234/pico-ps2Driv https://github.com/lurk101/pico-ps2kbd/blob/master/example.c

Shaeon,

I've opened this as a new issue https://github.com/fruit-bat/pico-zxspectrum/issues/12 in case it gets lost in this conversation. Looks like a nice idea :-)

Thanks,

fruit-bat