MEMU (not only) on Pico

Everything about Andy Key's great Emulator MEMU
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

MEMU (not only) on Pico

Post by Bill B »

My chronic inability to finish one project before geting distracted by another :roll:

Having destroyed my only PS/2 keyboard, I had to purchase another. In order to make the P&P worthwhile I also purchased a few Raspberry Pi Picos. And having got them I had to try one out.

The obvious thing to do was to try and port a certain emulator. It was clearly going to have to be a cut down version, as the Pico only has 264K of RAM, which is less than a fully loaded MTX. So a number of things got left out:
  • A maximum of 64K of emulated RAM.
  • No sound - I will probably try and fix this, although I may run against performance limits of the Pico
  • No loadable ROMs (but SDX and CP/M ROMs are built in).
  • Disks using disk floppy images only
  • No silicon disks
  • No CFX-II emulation
  • No DART
  • No Joystick
  • Probably other things I have forgotten
As a result the code has been heavily hacked, and it is a bit of a mess. But it does work, with a few bugs remaining. At the bottom of each of the photos you can see a Pico, sitting in a Pimoroni VGA demo board. This board has:
  • A resistor DAC giving RGB555 VGA video
  • A micro SD card - For MEMU this is VFAT formatted, and contains both the tape *.mxt files and disk *.mfloppy images
  • Sound via either I2S or PWM - Which is why I should have a go at implementing sound
20210425_153431.jpg
20210425_153431.jpg (1016.48 KiB) Viewed 10779 times
20210425_153248.jpg
20210425_153248.jpg (1.01 MiB) Viewed 10779 times
20210425_153459.jpg
20210425_153459.jpg (904.46 KiB) Viewed 10779 times
Last edited by Bill B on 16 May 2021 22:06, edited 2 times in total.
User avatar
gunrock
Posts: 244
Joined: 28 Oct 2020 21:17

Re: MEMU on Pico

Post by gunrock »

That is bloody amazing, Bill. Does it reach fullspeed? It's much less powerful than a Pi 1 or 2, but quite a bit more powerful than a Teensy or PIC, is it not?
Steve G
Danish Memotech MTX 512, MFX and loving it
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: MEMU on Pico

Post by Bill B »

I haven't done much testing yet, but in theory it is running about 20% fast (4.8Mhz instead of 4MHz). I have aimed for that so that for games it does as much work in one 60 Hz VGA frame as an original Memotech would to in one 50Hz TV frame.

It does mean that the Clock in Memotech Basic will be fast by that amount. I will have to see whether I can fudge that in some way.

It also means that the games are 20% harder :)
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: MEMU on Pico

Post by Bill B »

Sound now works.

Rather than keep bothering Dave, I have posted the code on GitHub here.

At the moment the GitHub code is only for the Pico version, but I intend that it should eventually be able to build all my versions of MEMU. There is a fair amount of work involved in that as I had to hack the code quite heavily to support the Pico.
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: MEMU on Pico

Post by Dave »

Hi Bill,

it's never a bother !

Have you used Andy's most recent MEMU build?
(It probably won't affect many people, but Andy added some extra VDP inspection capabilities for me.)
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: MEMU on Pico

Post by Bill B »

No. I have seen that Andy has a new version, but I haven't used it.

For the Pico version, so much has been cut-out, including almost all the diagnostic tools, it probably will not make a difference. I will have to see what as changed as I try and re-integrate the other versions.
Martin A
Posts: 797
Joined: 09 Nov 2013 21:03

Re: MEMU on Pico

Post by Martin A »

It's amazing what can be squeezed into such a tiny board!
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: MEMU not only on Pico

Post by Bill B »

My GitHub Repository now contains the latest source code for all my versions of MEMU:

* Linux X-Window
* Linux Framebuffer - No GUI required
* Raspberry Pi Linux - Use GPIOs to connect an MTX keyboard, Joystick or Printer
* Bare-Metal Raspberry Pi - Now includes Raspberry Pi 4 and 400 support
* Raspberry Pi Pico - Not full featured
* Microsoft Windows

Work is still needed on code tidy-up, and definitely on documentation.
Last edited by Bill B on 18 May 2021 10:13, edited 1 time in total.
User avatar
gunrock
Posts: 244
Joined: 28 Oct 2020 21:17

Re: MEMU (not only) on Pico

Post by gunrock »

Link is incorrect, Bill. It links back to this topic.

Steve
Steve G
Danish Memotech MTX 512, MFX and loving it
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: MEMU (not only) on Pico

Post by Bill B »

Thanks, fixed the link.
Post Reply