Shop OBEX P1 Docs P2 Docs Learn Events
Colour Genie EACA EG2000 emulation — Parallax Forums

Colour Genie EACA EG2000 emulation

pullmollpullmoll Posts: 817
edited 2010-11-27 05:23 in Propeller 1
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 wink.gif 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 smile.gif
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
1440 x 1080 - 341K
«13

Comments

  • mikedivmikediv Posts: 825
    edited 2010-05-11 17:17
    Thanks Pull, I am not home to try this but I only have an older Drac will this run on it and how do I go about running it? Do I load it onto the SD first and use BST?
  • pullmollpullmoll Posts: 817
    edited 2010-05-11 17:21
    mikediv said...
    Thanks Pull, I am not home to try this but I only have an older Drac will this run on it and how do I go about running it? Do I load it onto the SD first and use BST?

    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
  • BaggersBaggers Posts: 3,019
    edited 2010-05-11 19:14
    looks great pullmoll, not had time to play, only just got in, so will have a go tomorrow [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2010-05-11 20:35
    Very cool. What an interesting old computer!

    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!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-11 23:40
    This looks very clever. Dumb question I know, but is that screenshot from the original computer or from the propeller emulation? It looks so cool!

    @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
  • pullmollpullmoll Posts: 817
    edited 2010-05-12 05:36
    Dr_Acula said...
    This looks very clever. Dumb question I know, but is that screenshot from the original computer or from the propeller emulation? It looks so cool!

    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 smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-12 07:44
    This looks fun. Ok,. I got it booting up and running the program PAINT.CMD. Next it asks

    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
    672 x 480 - 41K
  • pullmollpullmoll Posts: 817
    edited 2010-05-12 10:52
    Dr_Acula said...
    This looks fun. Ok,. I got it booting up and running the program PAINT.CMD. Next it asks

    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?

    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
  • BradCBradC Posts: 2,601
    edited 2010-05-12 11:16
    pullmoll said...
    I'll leave that to someone else, as I'm unconventionally using "make" to load up what I'm working on smile.gif

    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?"
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-12 12:51
    Getting close. I get the menu to select which one of the three .cmd programs to run. Then the MEM SIZE? message. I hit return, and the screen fills with coloured ascii and other characters which move around a lot then there is an error, usually something that mentions BASIC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • pullmollpullmoll Posts: 817
    edited 2010-05-12 12:55
    Dr_Acula said...
    Getting close. I get the menu to select which one of the three .cmd programs to run. Then the MEM SIZE? message. I hit return, and the screen fills with coloured ascii and other characters which move around a lot then there is an error, usually something that mentions BASIC.

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-12 13:28
    I've not been able to copy your environment. What I have done is download the zip, put all the files in a new folder, then move everything that ends in .spin into a common folder, taking care to only overwrite old files with new files and not the other way round. So all the dates on the files are either 11th or 12th May.

    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
    546 x 574 - 64K
  • pullmollpullmoll Posts: 817
    edited 2010-05-12 13:36
    Dr_Acula said...
    I've not been able to copy your environment. What I have done is download the zip, put all the files in a new folder, then move everything that ends in .spin into a common folder, taking care to only overwrite old files with new files and not the other way round. So all the dates on the files are either 11th or 12th May.

    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.

    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
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-05-12 13:37
    @pullmoll

    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.
  • trodosstrodoss Posts: 577
    edited 2010-05-12 13:52
    @OBC,

    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.)
  • pullmollpullmoll Posts: 817
    edited 2010-05-12 13:55
    trodoss said...
    @OBC,

    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

    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 smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-05-12 14:21
    Thanks guys!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Are you Propeller Powered? PropellerPowered.com
    Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2010-05-13 05:06
    I don't have a setup that can run the code but the image you posted
    looks just great!

    Did you say that the original game took 15 minutes to load from an audio tape?!?
    That's pretty hard core.
  • pullmollpullmoll Posts: 817
    edited 2010-05-13 06:57
    HollyMinkowski said...
    I don't have a setup that can run the code but the image you posted
    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
  • pullmollpullmoll Posts: 817
    edited 2010-05-13 18:04
    I finally got the 4 colour graphics mode working - at least partially. The game Eliminator uses a double buffering technique and it seems that my copying of XMM RAM to the video frame buffer on a page flip isn't quite right. There are wrong pixels in the first third of the display. I have no idea yet what causes this.

    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
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-05-13 21:41
    @Holly

    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
  • pullmollpullmoll Posts: 817
    edited 2010-05-24 06:31
    Updated with the latest AY-3-891x emulation from Ahle2. It works great with those old games. Of course they can't compete with the AY tracker files, because we didn't know about how to get the maximum out of the chip wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • Ahle2Ahle2 Posts: 1,179
    edited 2010-05-24 07:38
    That's great pullmoll tongue.gif
    I don't have blade to test it out tough cry.gif

    How do I get one?
  • pullmollpullmoll Posts: 817
    edited 2010-05-24 07:43
    Ahle2 said...
    That's great pullmoll tongue.gif
    I don't have blade to test it out tough cry.gif

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-24 08:39
    Yes, send me a PM regarding the boards. Of course, you need the parts as well and it depends a bit on where you are as to which suppliers are best.

    @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
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-05-24 08:47
    pullmoll: The TriBlade is effectively a RamBlade plus a ProtoBoard (i.e. seperate prop with VGA, TV, KBD, Mouse, serial, etc plus a latched SRAM which has not been used by anyone) and another prop with undefined outputs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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
  • Ahle2Ahle2 Posts: 1,179
    edited 2010-05-24 09:18
    I think I'm going to order one from Dr_Acula. [noparse]:)[/noparse]
    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-24 09:35
    There is one NOP wait state for a read or write. On a dracblade you need to latch the address lines then the data lines and the whole thing is about 20 cycles. Cluso does it with far less as there are no latches, but needs two propellers. So slower with one prop or faster with two props - you can choose which.

    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
  • pullmollpullmoll Posts: 817
    edited 2010-05-24 10:53
    Ahle2 said...
    I think I'm going to order one from Dr_Acula. [noparse]:)[/noparse]
    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.

    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
  • pullmollpullmoll Posts: 817
    edited 2010-05-24 11:01
    Cluso99 said...
    pullmoll: The TriBlade is effectively a RamBlade plus a ProtoBoard (i.e. seperate prop with VGA, TV, KBD, Mouse, serial, etc plus a latched SRAM which has not been used by anyone) and another prop with undefined outputs.

    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
Sign In or Register to comment.