Part 2: the first milestone.
Today I have successfully booted OneChipMSX on the Turbo Chameleon 64!
To do this I’ve had to make some changes to the OneChipMSX source tree, and while I’d hoped that I’d be able to keep the main core pretty much untouched, and do the Chameleon-specific stuff externally, it hasn’t quite worked out that way.
The first problem I encountered was that the Chameleon has no EPCS4 configuration device, so I would need to load the BIOS from somewhere else. My choices were the Chameleon’s own flash, or SD card. The former option might seem like the most sensible choice at a quick glance, but it’s actually quite complicated, since the Chameleon has flash space for a number of different cores, so the BIOS’s location within flash would depend upon which flash slot contained the core! I thus chose loading from SD card, added an extra control CPU and simplified the Initial Program Loader.
The next problem was that the OneChipMSX clocks the SD card a little too fast for the Chameleon. Unlike most other SD-equipped FPGA boards, some of the SD card signals are routed through a CPLD inside the Chameleon which multiplexes a number of signals. This CPLD is responsible for accessing the C64 when the chameleon is in cartridge mode, so there’s a limit to how promptly SPI signals are forwarded to the SD card. Halving the OCMSX’s SPI clock speed seems to have done the trick (which is good because I haven’t yet figured out how to stall the T80 on SPI writes, so making the SPI clock slower still is currently not an option!)
Finally, the PS/2 keyboard posed a problem. The OCMSX source tree forwards bidirectional PS/2 clock and data signals into the heart of the core. This is in contrast to most other projects, which generally have separate in and out signals for clock and data, and merge them into their respective bidirectional signals in the toplevel. The Chameleon64, again, routes these signals through the MUX in a way that requires in and out signals to be separate in the toplevel, so I had to adjust the innermost PS/2 component and main MSX core accordingly.
With these changes, however, the core boots and works on both DE1 and Chameleon64 (though the cartridge slot signals that Caro’s DE1 port forwards to the GPIO headers on the DE1 are temporarily disabled.)
The BIOS is loaded from SD card rather than EPCS, which means you can upload the core on the fly via JTAG and it will work. You need an SD card (not SDHC) which needs to be FAT16 formatted, and which needs to contain the MSX2 bios from this page.
If you’re content to just play around in BASIC that should be all you need – otherwise you’ll want to add MSXDOS to the card – I’m told that Nextor can be used for this purpose, but haven’t yet had a chance to try it.
Please note, this is still very much experimental, and there’s a long way to go yet before it can be considered usable. Feel free to tinker with it, but don’t expect a fully-working, polished product!