When I was a kid I had an MSX, a SVI-728 to be more precise, it's just a Z80 based computer with 64Kb of RAM. Mine used cassette tapes to load games and the loading times were eternal not to mentioned all the loading errors that required restarting the load from the beginning.
Other friends of mine had an MSX with a disk drive but I got still stuck with the tapes :-(
So... Revenge! I decided to build my own disk unit :-)
MSX's with a disk drive come with a disk BIOS that handles all the disk operations, from the lowest level (i.e.: read sector 23) to extending BASIC with new commands to list the available files in the disk, formating, deleting and creating files, and so on.
My first step was to get a disk BIOS from a MSX with a disk unit and patch the sector reading/writing routine so instead of talking to a disk unit, it would talk to another device, an Arduino.
Unfortunately I can't fit an 720Kb disk in an Arduino but since it has a USB connection it can ask my PC to get that sector form an certain disk image in my PC's hard's disk and send it thought the USB cable.
For that I need some gluing hardware between the MSX and the Arduino, here is the pic of the setup
Breadboard with arduino-msx gluing logic |
And here are the schematics of the interface:
Schematics |
The trick of the trade
It all works thanks to the Z80's /WAIT pin, when an IN or an OUT instruction happens for an port below 31 the logic gates put this pin to a low sate making the Z80 wait, the Arduino notices that and can fetch the data from the computer and put it onto the 74245 buffer, then the Arduino will raise the /WAIT pin to make the Z80 resume the execution so the OUT instruction gets the data from the buffer.
The software bit on the MSX side...
Simple flash memory reader on the top, game cartridge on the bottom |
The two white cables sticking out of the Atmega128 are the serial port, I wont tell what are the black and red ones :-)
..and on the PC side
I just used Python to read the commands coming from them MSX, the script will take the 512 bytes sector and will send it to the arduino and 1Mbit per second. The Arduino will send byte by byte to the Z80 at a similar speed.
Here is the video, sorry for the shaky hand :-) On the left you have the python script, on the right VLC media player.
Source code! :)
Ok here are the sources, sorry I didn't document the code so much, please let me know if you have any questions.
https://docs.google.com/file/d/0B4IJZPdCtzO0OGJvcnB3U0xnY1U/edit?usp=sharing
Hi, nice work. Still eagerly awaiting the "polished" docs you were gonna make on this :)
ReplyDeletebest regards!
This comment has been removed by a blog administrator.
ReplyDeleteHi,
ReplyDeletePlease send me an email with the text of the autoexec.bat or. Bas or zipped files. Loved the menu to select games. Also'm bloger. I'm from Brazil and I still have a msx with an emulator diskettes (100 disks in one pendrive 720k).
blog: virtualstaff.wordpress.com
e-mail: virtual.staff@inbox.com
Hi Raul,
ReplyDeleteI would like to get in touch with you, cause I'm interested on doing an article on this Arduino Project for the MSX.
Please check my weblog www.msxinfo.net
Regards,
Erik
Hi Raul,
ReplyDeleteI recently aqcuired a couple of msx machines and really would like to have some drive for it. I probably could adapt your sketch to use a Arduindo SD card shield I've lying around. But I need to make a cartridge with the bios. Are there any schemas of the cartridge you used ? I have a cnc router for milling boards.
What kind of eeprom is used ? Could I use a eeprom shield like this one https://www.tindie.com/products/UnaClocker/28cxxx-eeprom-programmer-shield-for-arduino/ ?
Regards and best wishes.
Luc De pauw
Blog: http://vintagegamer.wordpress.com http://fabolab.wordpress.com
Hi MegaMobile, I'm currently on holidays :) could you send me a reminder in a week so I can get back to you? As a quick response I used a game cartridge where I just replaced the eprom
ReplyDeleteAmazing!
ReplyDeleteIndeed the Wait signal was designed for being used like this.
What about integrating the SD card library with your project and turn it into a disk drive emulator?
Best regards!
I mean, a standalone drive emulator :)
ReplyDeleteAmazing job man!! it's excty what i was looking for.. pls when can I put the 11 and 10 Pins from arduino in order to get (iswriting/iswaiting function) ?
ReplyDeletetks in adv
Hi! Thanks! The IsWriting should be connected to the /WR (or the /RD not sure!) and the is waiting to the /WAIT
DeleteHi Raul, thak you very much for this nice project!
ReplyDeleteDo you have a cleaner documentation and a parlist used on the breadboard?
I'm sorry to bother but i've some difficulties understanding the circuit schematic...
Hey there!! amazing project here! actuallyI was looking for something similar to do using a rpi and yesterday I found you and YOU MAKE MY DAY! I'll learn how to use arduinos only for this. Thanks!!
ReplyDeleteI have a couple of questions (surely caused by my lack of electronics knowledge):
- as I understand, the mac files (z80 asm) you provided in your zip are the modified versions you wrote included on the DISK.ROM, isn't it?
- In the pictures showing the connectings (the one with the breadboard) I see that you connect the arduino inouts to the secondary expansion port, and the disk rom to the first one. Can this be done in just one slot?
Do you think that all this can be easily ported to a raspi? If its GPIO system there is enough? It would be nice to have all system in one single external board.
THANKS AGAIN FOR THIS!
I´ve been opening some of my cartridges looking for something similar to yours. I´ve only small ROM cartridges and Konami cartridges with a mapper.
ReplyDelete(like this http://www.msxvillage.fr/upload/koflco.png , before adding a flash) Is it possible to do the same whith these cartridges??
Thanks!
Hi Raul, nice project, I tried to implement it, but I fail. Then your project was the starting point for mine, Rookie drive. Take a look: (in spanish sorry) http://rookiedrive.com
ReplyDeleteThank you
your schemmatic is incomplete, there is no line going to the arduino from the computer, so the arduino knows about a request. its a fake.
ReplyDeleteto use roms<50k in msx , convert roms using Caslink3 to wav 320k
ReplyDeleteand play it using vlc in andorid phone :D
(using msx cas cable)
i reencode it to mp3 and work, :D
>.< need more info to your proyect :D