Colour Genie EACA EG2000 emulation
pullmoll
Posts: 817
Here's a first version of my try to emulate the Colour Genie EG2000 computer, a system on which I used to code game programs for .. hmm.. not for cash, but for hardware! (colour monitor, floppy drive, joysticks...). They certainly knew how to rip off poor students Crazy Paint was one of the better games and is still fun to play. It was sold on 15min cassette tapes for abt. 40 Deutsch-Marks back then.
The emulation is missing the code to play the sounds of the AY-3-8910 sound chip. Also the graphics mode isn't working right yet, so the games using it display nothing. I included just the one game for now, while there are some more that would already be working. I may post some more later. Now I want to hear if Crazy Paint is fun even without sound
The game's goal is to paint all the rectangles by driving around them. Once you have completely framed a rectangle, it is filled up with some wiggling graphics. While you cruise around, there are 3 nasty little chewers trying to bite you. Avoid them by cleverly using alternate ways to reach every corner of each stage. Good luck!
What will be difficult to emulate is the configurable video RAM base address of the 6845. Whenever this is changed, I need to swap the XMM with the hub RAM screen buffer, because I don't have enough hub RAM for a 16KB frame buffer, but merely enough to hold the ~4KB of graphics mode data.
Specs:
CPU: Z80 @ 2.2MHz with wait states for the video RAM access.
Memory:
* 16KB (Colour-)BASIC ROM, based (ripped) off of the known 12KB MS-BASIC of the TRS80.
* 32KB RAM
* 8KB Disk-ROM (optional, not included)
* 1KB x 4bit colour map
* 1KB x 8bit user defined character generator (for characters $80..$bf and $c0..$ff).
Video:
* 40x25 text display with 256 8x8 characters.
* 16 foreground colours.
* One (later 3) selectable background colours.
* 128 predefined graphics characters that could be switched to user defined characters in two banks.
* 160x102 graphics display with 2 bits per pixel, i.e. a 4 colour mode.
Sound:
* AY-3-8910 chip with 3 sound generators, 1 noise generator and 16 selectable envelopes for the amplitude.
Runs on the DracBlade and (perhaps) on the TriBladeProp #2(?). Needs 8 VGA output pins, an SD card to load the ROM and the game from, a PS/2 keyboard for input.
v0.1.1: Cleaning up the DracBlade_spi_warp and adding code for other platforms (so far for the TriBladeProp)
v0.1.2: Got the graphics mode working (sort of). The copying of XMM RAM to the video frame buffer seems to be buggy. See glitches in ELIMIN.CMD. qz80 should be compatible with the Spectrum driver now(?)
v0.1.3: Bugfixes for the CRTC emulation (read back of registers). This fixes some graphics games, but not all.
v0.1.4: Add Ahle2's AY-3-891x emulation. Sound isn't right, though.
v0.1.5: Now sound plays right! I had to fix Ahle2's code to use a REGISTER_OFFSET value of 1 instead of 3 for the AY, just as it is defined for the YM chip.
v0.1.6: Fixed the screen base address changing by declaring the entire first 16K as wr_scr and comparing the address against the current base address of the frame buffer.
v0.1.7: Increased the VGA pixel rate to 35MHz / vsync to 75Hz. Adjustment of the CRTC vertical displayed register is evaluated, so Eliminator, Colour Kong and other games changing the setting look better now. Moved various data structures to io.spin. Ctrl+Alt+Del on the PS/2 keyboard resets the Propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 6/5/2010 5:57:16 AM GMT
The emulation is missing the code to play the sounds of the AY-3-8910 sound chip. Also the graphics mode isn't working right yet, so the games using it display nothing. I included just the one game for now, while there are some more that would already be working. I may post some more later. Now I want to hear if Crazy Paint is fun even without sound
The game's goal is to paint all the rectangles by driving around them. Once you have completely framed a rectangle, it is filled up with some wiggling graphics. While you cruise around, there are 3 nasty little chewers trying to bite you. Avoid them by cleverly using alternate ways to reach every corner of each stage. Good luck!
What will be difficult to emulate is the configurable video RAM base address of the 6845. Whenever this is changed, I need to swap the XMM with the hub RAM screen buffer, because I don't have enough hub RAM for a 16KB frame buffer, but merely enough to hold the ~4KB of graphics mode data.
Specs:
CPU: Z80 @ 2.2MHz with wait states for the video RAM access.
Memory:
* 16KB (Colour-)BASIC ROM, based (ripped) off of the known 12KB MS-BASIC of the TRS80.
* 32KB RAM
* 8KB Disk-ROM (optional, not included)
* 1KB x 4bit colour map
* 1KB x 8bit user defined character generator (for characters $80..$bf and $c0..$ff).
Video:
* 40x25 text display with 256 8x8 characters.
* 16 foreground colours.
* One (later 3) selectable background colours.
* 128 predefined graphics characters that could be switched to user defined characters in two banks.
* 160x102 graphics display with 2 bits per pixel, i.e. a 4 colour mode.
Sound:
* AY-3-8910 chip with 3 sound generators, 1 noise generator and 16 selectable envelopes for the amplitude.
Runs on the DracBlade and (perhaps) on the TriBladeProp #2(?). Needs 8 VGA output pins, an SD card to load the ROM and the game from, a PS/2 keyboard for input.
v0.1.1: Cleaning up the DracBlade_spi_warp and adding code for other platforms (so far for the TriBladeProp)
v0.1.2: Got the graphics mode working (sort of). The copying of XMM RAM to the video frame buffer seems to be buggy. See glitches in ELIMIN.CMD. qz80 should be compatible with the Spectrum driver now(?)
v0.1.3: Bugfixes for the CRTC emulation (read back of registers). This fixes some graphics games, but not all.
v0.1.4: Add Ahle2's AY-3-891x emulation. Sound isn't right, though.
v0.1.5: Now sound plays right! I had to fix Ahle2's code to use a REGISTER_OFFSET value of 1 instead of 3 for the AY, just as it is defined for the YM chip.
v0.1.6: Fixed the screen base address changing by declaring the entire first 16K as wr_scr and comparing the address against the current base address of the frame buffer.
v0.1.7: Increased the VGA pixel rate to 35MHz / vsync to 75Hz. Adjustment of the CRTC vertical displayed register is evaluated, so Eliminator, Colour Kong and other games changing the setting look better now. Moved various data structures to io.spin. Ctrl+Alt+Del on the PS/2 keyboard resets the Propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 6/5/2010 5:57:16 AM GMT
Comments
You can put the binary on an SD card (either FAT16 or FAT32, depending on loader) and use one of the loader programs (Catalyst, Sphinx etc.) or you load it directly to RAM or EEPROM using BST. On the SD card you need to put the CGENIE.ROM file from the ROM subdirectory and the PAINT.CMD file from the CMD subdirectory. The latter can also be put into a subdirectory on the SD.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Looks as though I'm going to need one of the blade type boards...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
@mikediv, yes all dracblade boards will work. It is up to version 9 but all that has really changed is the layout of parts eg shorter paths to the vga so less interference, more pads for different regulators, leds on the serial ports etc. So only minor changes. One version had a real time clock but I took it off again as there didn't seem a need for it, but I can put it back again if required.
I've got lots of boards left. $10 for one, $15 for 2 and $20 for 3, including shipping.
I think we are definitely going to have to think about a single sd card image and a bootloader. Cluso pointed me in the direction of his software and there are other options out there. (I haven't had a chance to look at it yet, as I have been *making* myself sit down and finish the boring coding for MP/M networking. No time for games when that project sits there unfinished!)
There are threads for various computers and I'm a little worried they might all get lost on the forum. So...
The simple idea is a small program that boots up in Spin, simpleVGA display, keyboard, fat32 sd card access and a menu with the computer you want to emulate. Select one and then it loads the 32k binary off the sd card, and that program loads whatever rom image/disk image it needs. The sd card can have all those images as they won't interfere with each other.
Thoughts?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
This is, of course, the emulation. I haven't had a Colour Genie for more than 20 years. They were all broken and unusable.
For the game selection menu: you could certainly do that in either Spin or in Catalina C and then use Cluso99's Sphinx or Catalyst to run it. I'll leave that to someone else, as I'm unconventionally using "make" to load up what I'm working on
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
MEM SIZE?
and whatever number I enter, it keeps asking. If I just hit Enter, it drops into
COLOUR BASIC
(which does seem to work fine except for a few characters like " and ' and eg to get = you need to do Shift = which is + on my keyboard.
How do I get the game working?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Post Edited (Dr_Acula) : 5/12/2010 7:51:51 AM GMT
Enter no number, but just hit ENTER. I should have mentioned that. The ROM is patched with the start address of the loaded program and it should execute right after you hit enter. Attached is another game that's working: MampfMan II, a Pacman clone.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/12/2010 11:02:17 AM GMT
It would not be unconventional if people opened themselves to the efficiency that is "make world".
A full 4 architecture release of bst is created with the following short tome.
~>make release compress zip upload
Try doing that with a GUI.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Are you suggesting coconuts migrate?"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
Strange. It works fine for me, all the time. Do you have a clean environment, i.e. the latest ./lib contents from the archive?
What you describe looks as if there is some serious addressing error going on. I updated the archive on the first page just to be sure you have the same files.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/12/2010 1:01:27 PM GMT
The I put BST in the folder and point it to the local folder. It compiles fine, and on this screen shot I see colour too, so a lot is working. It looks like Basic is crashing, but there is enough there on that screen to see a list of Basic error messages eg Prg ld err, Queue full etc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
These messages are not Colour Genie, but MP/M! It looks like there is a non-zero bank active and probably surviving resets as well. Did you try to power off your board?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Do you mind if I rip off your VGA display driver and develop a generic 8x8 text driver from it?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Are you Propeller Powered? PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
pullmoll has a thread "VGA color and VT100 objects" that may be a little more "generic" already.
http://forums.parallax.com/showthread.php?p=905162
--trodoss
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit the Propeller Powered SIG·fourm kindly hosted at Savage Circuits
Game(s) Mythic Flight
Utilities Font Editors (AIGeneric, Potato_Text, etc.)
That's what I would have suggested. You can of course use the driver without the VT100 code as well.
The license is MIT, so do with it whatever you like
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Are you Propeller Powered? PropellerPowered.com
Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
looks just great!
Did you say that the original game took 15 minutes to load from an audio tape?!?
That's pretty hard core.
No. The type of cassette tapes was 15min, especially made for data storage, and the programs were usually stored twice. IIRC the data rate was 1200 bps = 150 bytes/s, so it took abt. 85 seconds to load.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
I will have to alter the display dimensions in the graphics mode, too. It is 160x102 meaning 640x408 after pixel doubling + quadrupling, while the text mode is 640x400. The extra 8 scanlines are missing at the bottom in Eliminator.
@hairymnstr: Nathan, please note that I improved the XMM read/write functions a little by a) replacing the NOPs with instructions that followed in the loop and b) defining the latch write longs without the GateHigh bit in the first place. That way I don't have to pull the Gate pin low first, it is low the moment the OUTA is written and just has to be taken high again. I also added (untested) code for the TriBladeProp inside ifdefs.
I think the code could be improved by testing for long alignment of the I/O buffer and in case it is given, resorting to collect 32 bits from the XMM before writing the hub RAM. That could go along with just incrementing the lower latch value, if both, source and dest, are long aligned. That should be the case quite often.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/13/2010 6:17:29 PM GMT
A lot of programs did, or seemed to, take 15 mins to load off of cassettes. To get a good solid copy that would last hundreds of loads the Baud rate would be left low at 300. Faster 1200(+) rates were put on or added by the user as a "see if it works" basis. Coffee was the thing to make whilst the prog loaded, if it loaded. Often the computer would just say NG and the whole thing had to be tried again ....
The Nascom allowed for individual 256 byte blocks to go in and be error checked so that the errant ones could be corrected with a rewind and play that bit again.
Then the program would crash and the whole experiment would start again. Happy days.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
I don't have blade to test it out tough
How do I get one?
Dr_Acula sells the PCBs, 3 for 10$ including shipping IIRC. I haven't had reports if it works on the TriBlade, too. I'm not even sure the TriBlade has a VGA out on the same Propeller where the external RAM is connected to. I guess if someone came up with the Morpheus memory handling functions (read a byte + write a byte) for the qZ80 and other CPU cores, then Morpheus could also be supported. The RamBlade doesn't have enough free pins to attach a VGA display.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/24/2010 7:49:02 AM GMT
@pullmoll, I haven't quite got this working, but I think there are issues with it conflicting with other versions like CP/M, old bits of code etc, so I might start with a clean install on a new sd card. Having sound really does create a complete retro computer. I am very impressed!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
How many cycles does it take for a read/write to the external ram?
Is it possible to hook up a bigger external sram? like an adressing space of 2^24 = 16 megabyte?
Then it would be possible to do some really sweet things.
As for bigger ram, sure, that is quite possible. Which ram chip do you want to use?
So far, the biggest memory emulation is MP/M which is think is using 3x64k, so still less than half a 512k ram chip. Sooner or later someone will want more ram. Then we can design a new board! Then you can think about serial vs parallel ram, fast caches in parallel and slower caches in serial etc. Of course, there is a gigabyte of memory on the sd card and you can access that in pasm, spin or C or Basic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
There are 24 bits available, if you use all 8 bits of the third address latch to connect them to some RAM. You would have to build an adapter, though, since I think bigger SRAM will come in a different package!?
Depending on how you address the RAM, you may be able to optimize access. If you read or write it linear only, you can save setting the middle and high address parts and get away with ~12 instructions = 48 cycles to read and isolate a byte. Writing the middle latch takes at least +5 instructions and the high latch another +5, so random access read/write costs ~22 instructions = 88 cycles.
I think using the external RAM as frame buffer for video is thus at least not easy, if not impossible. 12 instructions for a byte is a little too much for any decent resolution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 5/24/2010 10:58:32 AM GMT
Okay, so there is no VGA on the same Propeller where the SRAM is connected. If the qZ80's I/O cog was able to communicate with another propeller, it could perhaps proxy video RAM, keyboard and sound chip status to a cog on the I/O prop. As it is now, the code won't work on a TriBlade.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects