kernelcrash / msx-rom-and-floppy-emulator

Emulate ROMs and Floppy images in MSX
MIT License
39 stars 7 forks source link

RP2040 port of RP5C01 code using PIOs? #2

Open shinaka opened 1 year ago

shinaka commented 1 year ago

Hey, wasn't sure of the best way to reach you, so figured I'd toss this here. I came across your project looking for options to emulate the RP5C01 - they're becoming harder and harder to track down, and while I have one on order from China, my Omega MSX I just finished is sitting here not able to do too much without one.

I was thinking the RP2040's PIOs could probably pull this off, but I'll be the first to admit it's a bit out of my depth thus far (but I'm trying!). Was wondering if you had any insight or interest in collaborating?

Either way, cheers! And thanks for the great project!

kernelcrash commented 1 year ago

Hey, thanks for reaching out. It's been a while since I looked at the Omega. Very cool project though. I remember asking Sergey about the RP5C01 and he pointed out that the Omega will actually boot CBIOS without the RP5C01, but it won't boot a regular BIOS from a MSX2 machine of the era.

So I do have a RP2040, but it's been sitting on my desk for a very long time. I still find these stm32f407 boards pretty good. They're still not too expensive. They go fast enough, they have heaps of IO pins and they are mostly 5V tolerant which means you can just 'plug them directly in' to some old computer. For the RP2040 you 'should' have 3.3V/5V level shifters when connecting to something like the Omega, but I am guessing you could get away with some resistors for testing it out. I know some people have written ROM emulators for the RP2040, so they are obviously fast enough for something like the Omega. If it were me, I would be looking at the source for some of those ROM emulators as a starting point.

I'd encourage you to 'have a go' at trying to emulate the RPC501. It is a very simple chip. In terms of the code I wrote, it only emulates the two main 16 byte ram banks in the chip so that the various mode settings can be saved and retrieved. It doesn't even attempt to tell the time. The main logic is in interrupt.S in the bits related to 0x00b4 and 0x00b5. Thinking about it now you could almost implement that in some TTL logic; Some HCT670's, a latch?, some address decoding to pick out the 0x0d mode register etc.

I am head down into trying to get a Tandy Color Computer 2 to do stuff at the moment... If I get some moments in the next few weeks I will have a look at the RP2040 again. Otherwise ask away. You can usually contact me at kernel @ "the domain of my blog".

kernelcrash commented 1 year ago

Re that suggestion about the HCT670s. Obviously typing that too late at night as the 670's are only 4 x 4bit. You would need 16 x 4 bit register files like the 74LS219's or 74LS189's with some inverters ... and those chips are possibly harder to get than the RP5C01!

kernelcrash commented 1 year ago

This is probably not very helpful, but I kept thinking there must be some way to 'hack' the Omega into life with the RP5C01 missing .. but with just a few TTL chips. A sort of 'fuzzing' approach with the aim to at least get it to boot. And hey, you can (just a 74LS367 and a 74LS02) . The screen width is wrong, but if you have a keyboard you can probably type something to fix it. I only tested this to see if I could get it to boot.

omega-msx2-rp5c01-missing-hack.pdf