Emulating a rare Videopac Basic module
With the mbed I made a C7420 Basic Module emulator for and old Videopac G7400 game console.
First experiments were to try and use the Videopac videosystem as output for the mbed but I got a little carried away.. Now the mbed is emulating the complete module including the Z80, ROM and RAM. Connection to the Videopac console is through a one-on-one copy of the cartridge, both hardware and software. Storage for programs is on microSD now instead of cassette tape. The 'not so optimized' Z80 emulation is about 150% of the original Z80 speed so all in all not bad.
![/media/uploads/gertk/_scaled_small_basic_runs.jpg /media/uploads/gertk/_scaled_small_basic_runs.jpg](/media/uploads/gertk/_scaled_small_basic_runs.jpg)
and why stop at one Basic emulation:
http://www.youtube.com/watch?v=jLy48ESrzco
18 comments on Emulating a rare Videopac Basic module:
Looks nice. Are you planning to share the code?
Looks nice. Are you planning to share the code?
Do you have a G7400 console ?
Otherwise the Videopac Basic is not of much use although the BBC basic version is quite modular, all in and out functions(vectors) are controlled by an 'illegal' Z80 opcode and then diverted to mbed routines. It also echoes text in and output to the PC console (USB serial).
The whole concept of BBC Basic is that all Machine In/Out functions are handled by standard 'vectors'. I used the CP/M version as base. The Z80 emulator is mostly from the ZX81 emulator for Linux/Unix but without the 'cycle perfect' part. It just executes all instructions as fast as possible since I have no timing restrictions in both BBC basic or Videopac Basic.
I don't think I can share the code with the BBC (or Videopac) Basic roms included. But I could make a stripped down version without the roms.
I'd be very interested in this as well - we probably need to check the license agreement but I'm hoping that anyone with a BBC Micro would be able to use their own BBC Basic image(?).
Alternatively, as the mbed team are very near to ARM (which evolved out of Acorn IIRC) is there soemthing they might be able to ask/clarify?
Cheers,
Jez
I'd be very interested in this as well - we probably need to check the license agreement but I'm hoping that anyone with a BBC Micro would be able to use their own BBC Basic image(?).
Alternatively, as the mbed team are very near to ARM (which evolved out of Acorn IIRC) is there soemthing they might be able to ask/clarify?
The original BBC micro was 6502 based not Z80 so that rom is of no use but since I started with the C7420 which was Z80 based I reused the Z80 emulator. The CP/M version is free to download (for non commercial use I guess) There is still BBC Basic for Windows in production.
Would be nice to have a native ARM version of BBC Basic since that would be much, much faster.
I'd be very interested in this as well - we probably need to check the license agreement but I'm hoping that anyone with a BBC Micro would be able to use their own BBC Basic image(?).
Alternatively, as the mbed team are very near to ARM (which evolved out of Acorn IIRC) is there soemthing they might be able to ask/clarify?
The original BBC micro was 6502 based not Z80 so that rom is of no use but since I started with the C7420 which was Z80 based I reused the Z80 emulator. The CP/M version is free to download (for non commercial use I guess) There is still BBC Basic for Windows in production.
Would be nice to have a native ARM version of BBC Basic since that would be much, much faster.
Hi Gert,
Sorry, I should have been more specific - I also have the Acorn Z80 second processor & there's BBC Basic for that as well (though it may be on disc rather than on ROM - it's too long ago for me to remember that clearly). Just searched for the latest versions & it seems to be surprisingly well supported on a range of processors/computers!
Maybe the versions of BBC Basic for the Archimedes would provide a basis for converting the ARM version (though some of the THUMB2 instructions on the Cortex are a bit different from the earlier ARM ones). It looks like the source for BBC Basic V is available as 'shared source'...
Cheers,
Jez
Hi Jez,
Just downloaded some of the source packs for RiscOS but it is so terribly complex (it is more than 96 MB of source!)
That will take a lot of time to find out how that Basic could be implemented on the mbed.
I think porting 'brandy basic' http://sourceforge.net/projects/brandy/ is much easier since that is already written in C
Gert
Hi Gert,
Ah, just seen that on Wikipedia...sounds pretty good (BBC Basic V in ANSI C and under GPL license too) nice :-)
I'll have to dig out my old BBC to give myself a fix at this rate! Sad or what?
Cheers,
Jez
Hi Jez,
If you want to try out my Z80 emulated version I just published a stripped down version:
http://mbed.org/users/gertk/programs/BBC_Basic/ltk7a0
This runs on the terminal and uses the local filesystem for storage.
LOAD and SAVE work, OPEN/CLOSE not, but feel free to dig in :-)
Gert
And just for the fun of it:
![/media/uploads/gertk/_scaled_2011-06-30_18.07.56.jpg /media/uploads/gertk/_scaled_2011-06-30_18.07.56.jpg](/media/uploads/gertk/_scaled_2011-06-30_18.07.56.jpg)
This is BBC Basic running on my QVGA LCD screen scavenged from a defunct Canon printer.
The controllerless LCD is connected directly to the mbed and eats up quite some CPU power to keep the refreshrate at little over 50 Hz. Still the Z80 emulated basic runs at a good speed.
Hi Gert,
That's still a pretty good start - I'll try and make time to look at the code over the weekend and see if I can do anything to help out.
The only display I've got to connect to the mbed is the one included on the Embedded Artists base board (unless I scavenge another display off one of my other ARM dev kits...) - I think many of those have on-board graphic controllers though, which may help in some ways & hinder in others.
Cheers,
Jez
The version I published does only do text in/out through the USB serial. If you are interested in the graphic version as running on my QVGA display mail me at gertk(at)xs4all.nl
That version should be quite simple to adapt to the Embedded Artists display.
Gert
You will be surprised how much more powerful the mbed is than a ZX Spectrum :-)
You will be surprised how much more powerful the mbed is than a ZX Spectrum :-)
ghostbusters sprectrum.. but when emulating it is different.
You should write in assembly language.
The mbed programmed in C runs rings around a Z80 in assembler. Believe me, I have written a in assembler on 8048, Z80, 6502, 6809, 68000, even Alpha 64 bit
For small high speed routines it is sometimes better to write in assembler but it takes much more time to get it right.
No assembly language is the most powerfullest language ever. you can program the lpc1768 which is what mbed is in assembly language.. and your programs will be the most powerfullest:)
Nice work!
I'm trying to make a hardware clon of the BASIC Module, but I cant't find the ROM & EPROM contents.
Do you known where can I find it?
Thanks
Please log in to post comments.
Looks nice. Are you planning to share the code?