Posted on 16 Comments

ROMulator 6502 is ready!

Hi there,

For the past couple of months I’ve been working on a small, low-cost successor to the PETvet, which was a 6502 RAM/ROM replacement board with debug capabilities over a serial port. At the same time, I wanted to learn a bit about FPGA development, so the ROMulator was born.

The ROMulator uses a Lattice UltraPlus FPGA to implement both a full 64k memory map plus memory decode logic to enable/disable different sections of memory. It also allows halting a running 6502 CPU and sending out the memory contents over SPI to a connected Raspberry Pi. You can also update the memory contents and resume CPU execution.

The ROMulator has two separate small boards – a 6502 socket board which takes, surprise, a 6502 CPU, and a few 74LVC245 level-shifting buffers to convert 5v logic from the CPU to 3.3v which the FPGA can handle. Connected to this board is a DIP breakout with the FPGA, which also has regulators for the appropriate voltages to power the FPGA and an SPI flash. The flash stores both the FPGA bitstream which defines its hardware implementation and up to 16 full 64k memory maps, which are selectable by a DIP switch on the ROMulator. This allows you to pick any of these for your boot ROM image.

16 thoughts on “ROMulator 6502 is ready!

  1. I’m so glad you’ve been able to complete this 🙂 I’ve been trying to get my hands on a PETVet for over a year now in order to diagnose an issue I’m having with a PET I bought on eBay. Just ordered a ROMulator (love the name) and look forward to using it in my PET.

  2. I plan on buying a Commodore SuperPet (8xxx series w apl, Fortran, Pascal and Basic 4.0 ROMs).

    Will this work with this one?

    1. Hi John,
      Yes, the ROMulator should work fine with the SuperPet. I don’t have one to test on so I haven’t checked directly but should work fine in most any 6502 machine. We would need the contents of the ROMs used in the SuperPet so this can be added as one of the switch settings on the ROMulator, but that should not be difficult.

      1. Hi Mike,
        For SuperPet usage, you will have to look closely at a signal called /NoROM which is just a pull up in the 8032, but is asserted low in the SuperPet to float the ROMs in the main board so the 6809 uP (on another board) can take over the bus and use the I/O, video RAM and main RAM. This signal will have to partially disable the ROMulator and float key 6502 signals but allow usage of the main RAM I believe. It may be tricky. And there may be a mechanical clearance issues with your board fitting on the additional SuperPet board. At least the 6502 itself has to be on that board. There is a ribbon cable that connects to the 6502 socket on the mainboard to the SuperPet board. The Zimmer page has all the details on the SuperPet. Your Romulator does work perfectly on my 8032.

  3. Hi, wow – the ROMulator sounds like an amazing project! does it work with the original PET 2001 ? would i use setting 0 and 1? if so, what does “NON-CRTC” and “Business Kbd” mean? I don’t have a Pi – does it offer any other debug out options, uart maybe ?
    Thanks

    1. Hi Jules,
      Thanks! Yes, it does work with the original 2001. The 2001 lacks the CRT control chip (CRTC) found in the later models, hence the NON-CRTC.
      These settings just correspond to specific sets of ROMs in the machine, if you let me know the ids of the ROMs in your PET I can confirm which setting it would be.
      Using a uart as a debug console is definitely possible, but requires a firmware update. Since the fpga on board can essentially become whatever hardware you want it to be (within reason) it can be updated to use the debug pins as a serial port rather than an SPI interface. I’ll send you an email with more information, thanks.

  4. Saw the ROMulator on Adrian’s Digital Basement YouTube channel. What a cool idea and product!

    I have some questions about how this might work on an Apple //e. Can the ROMulator be configured to “intercept” only certain banks of memory and otherwise pass access through to the original RAM? The reason I ask is because certain banks of memory on the Apple are used for things like I/O soft switches and video memory, and I wouldn’t want the ROMulator intercepting those addresses.

    Thanks!

    1. Yes, definitely. The ROMulator can be configured to pass through sections of memory space, which will just cause reads and writes from the CPU to go to the motherboard rather than the ROMulator’s onboard memory. This is needed for I/O space, as you mentioned.

      1. Hi Mike/bitfixer,
        I’ve ordered this to use on an Apple IIe as well. Watching Adrian’s channel and looking through the github site, I see how you can map memory as needed. Is there any way you could also implement the ability for the apple IIe/IIc to access 128k through bank switching in/out a second set of 64k of ram through soft switches?
        Thanks!

        1. For reference on the soft switches and memory mapping on the 128k IIe/IIc:
          http://www.applelogic.org/files/AIIETECHREF2.pdf

        2. Banking through soft switches should be possible by adding a new Verilog module. The FPGA used in the ROMulator (ice40up5k-sg48i) has 128k of ram total onboard, so it may not be possible with this FPGA to get up to a full 128k memory in addition to replacing ROM, maybe just 96k, but will have to see how that goes.

  5. Just ordered a ROMulator. I’m so excited and can’t wait to try it on my Apple II.

  6. This is a brilliant piece of kit! I’ve built a few of Nicholas Welte’s RAM/ROM replacement boards for the PET but can see many more uses for the ROMulator. Have put my name on the backlog list for 2 units. 🙂

    Have you considered a Z80 version? Will be epic for the vintages computers using the Z80.

    1. Yes, a Z80 version is in development! You will be able to use the same FPGA board with the Z80 version, possibly without reprogramming, and just replace the interface board with the socket. Nice because the FPGA board is where most of the cost lies, so will be fairly cheap to have the capability of running on both 6502 and Z80. Other 8-bit CPUs should be possible as well, with a similar interface board replacement.

  7. Does it work with a 6510? IE C64 or C128?

    1. The current version of the ROMulator does not work with a 6510, due to the different pinout than a 6502. But with a small redesign of the interface board on the ROMulator which changes the socket pinout, it could. You could still use the same FPGA board, which is the more expensive part, so a replacement interface for different CPUs would be quite cheap. A Z80 version, for example, is under development now.

Leave a Reply to bitfixer Cancel reply

Your email address will not be published. Required fields are marked *