Could the Dragon use CoCo banked cartridges?

Hardware Hacking, Programming and Game Solutions/Cheats
jmk
Posts: 65
Joined: Fri Mar 20, 2009 1:12 am

Could the Dragon use CoCo banked cartridges?

Post by jmk »

I've been invited by John Linville to make cartridge versions of my CoCo/Dragon games, namely Deathchase and Glove.

Deathchase is a problem because I never managed to get permission from Mervyn J. Estcourt, but that fits into 16K so that's not the issue here.

Glove would need at least 32K of ROM, maybe 48K. The CoCo 3 has some banked cartridges, as explained here:
http://permalink.gmane.org/gmane.comp.h ... y.coco/595

The 16K pages are swapped by writing a bank number to $FF40.

Now, I am wondering whether the hardware in these types of cartridges would be compatible with the Dragon?

Also, can anyone think of a good development environment (Windows) for this? I have tried MESS (MAME) recently and I have to say it is a sad state of affairs. Tano Dragon detected as PAL, banked cartridges not working, wrong video modes on CoCo 3, etc...

It would be a good solution, but I really want to avoid the time I would have to spend downloading the source, fixing bugs and trying to get it to recompile. Only VCC seems to support banked cartridges at the moment and I can't find any debugger in it.

Thanks!
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: Could the Dragon use CoCo banked cartridges?

Post by pser1 »

Hi James,
The problem with cartridges with more than 16k ROM is that you need to add inside the card the switching
circuits you'd like to use. And decode to an address where you would write to change the bank.
Dragon has just the SAM, no GIME unfortunately :-(
I think, but I might be wrong, that Dragon only maps to the cartridge addresses $C000-$FEFF, so aprox 16k
The first selected bank has to load into RAM a switcher that will be called everytime you need to change
of bank. This must be done from RAM or you would lose control ...

I don't know if attaching a cart with 32k mapped from $8000-$FEFF will work. Presumably it will but having
a strange memory configuration. I mean that the start point, probably, would need to be at $C000, I have
heard something like that on CoCo big cartridges too.
But I am not sure how you could disable the Basic ROM without entering MAP1 ...

Anyway it is a very interesting project
cheers
pere
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: Could the Dragon use CoCo banked cartridges?

Post by pser1 »

Hi James,
This info is only CoCo related but explains something onthat subject and points to an article
from Greg Zumwalt, the super cartridge creator ...

Code: Select all

Robert Gault | 1 Nov 22:57 2003
Re: Banking ROMS (was-6309 microprocessor project:11-01-2003)
There was another approach taken by Greg Zumwalt for the RoboCop and Predator
cartridges. These paks used a 64K ROM, a SN74LS10N, and a SN74LS175N to switch
the ROM as four 16K banks. This meant that if the programs did not use Coco3
specific programming (which they did), the 64K pak could be used with a Coco1 or 2.
The specifics of the technique were detailed in Rainbow, June 1990, p.58-64,
where Zumwalt mentioned in passing the Super Program Pak II using 1024K by 8 bit
ROMS or higher!
cheers
jmk
Posts: 65
Joined: Fri Mar 20, 2009 1:12 am

Re: Could the Dragon use CoCo banked cartridges?

Post by jmk »

pser1 wrote:The problem with cartridges with more than 16k ROM is that you need to add inside the card the switching
circuits you'd like to use. And decode to an address where you would write to change the bank.
Well, John is dealing with the hardware and he is planning to make a similar cartridge. It's interesting to see that snippet of information that says it works on a CoCo 1/2. That gives it a reasonable chance of working on a Dragon, unless there is some specific change to the Dragon that prevents access to $FF40.

There is another who is working on multibank carts, but I only know the details of John's plan to use $FF40.
I don't know if attaching a cart with 32k mapped from $8000-$FEFF will work. Presumably it will but having
a strange memory configuration. I mean that the start point, probably, would need to be at $C000, I have
heard something like that on CoCo big cartridges too.
But I am not sure how you could disable the Basic ROM without entering MAP1 ...
Fortunately, I don't need to have 32K mapped in at the same time, although it would make life easier.

The easiest thing to do would be to copy (or decompress) the game from cartridge into RAM, but I was hoping to make Glove compatible with 16K RAM machines (like my original CoCo 2, as well as it being my original plan when writing Glove). But that would force me to significantly restructure the code because Glove is 23K of code & data (plus >10K of extremely well-compressed level data). Complicated... :?
prime
Posts: 266
Joined: Fri Apr 10, 2009 1:40 am

Re: Could the Dragon use CoCo banked cartridges?

Post by prime »

Just my 2p.....

There is no reason why the Dragon cannot use Banked carts, I have implemented a pretty simple cart with a 29xx040 Flash rom and an XC9536 CPLD that gave me the ability to load 16K, or 8K images into it. Simon has one of these that he uses at the RCM events.

I also developed firmware that would allow you to load a cas file into the cart and then boot it from there into RAM.

I'll upload the project files if anyone is interested (schematics, CPLD source, Freepascal program for building the ROMS, and the 6809 menu source).

As for 32K banks, this is entirely possible on a Dragon or CoCo 1/2, by using the DSD line, which disables the internal device selection. Basically you decode the addresses $8000-$FEFF from the address bus, and then assert DSD, and enable your alternate ROM. DragonMMC does this with it's onboard 32K RAM, so that it can copy the system roms into the RAM then patch them for loading CAS files from the MMC card.

You also don't need to always switch banks from ram as long as the instruction following the one that actusally switches the banks is in the same place in each rom and the instruction following this is valid. Perhaps the easiest way of doing this is to have the bank switch in a routine near the start of the ROM, then pass it the bank you require and the address you want to jump to in destination bank, these can be passed in a register or on the stack.

Again DragonMMC does something similar to this, it detects on startup which machine it is running on (Dragon or CoCo), and selects the appropreate version of the ROM, because the code exists in both banks everything works without problems.

Cheers.

Phill.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: Could the Dragon use CoCo banked cartridges?

Post by pser1 »

Hi,
there are other projects that use banking on the Dragon, you can see Tormod Volden's here
viewtopic.php?f=6&t=5229
and here
viewtopic.php?f=5&t=5459&hilit=FUZIX

cheers
pere
linville
Posts: 129
Joined: Mon Feb 13, 2012 11:01 pm

Re: Could the Dragon use CoCo banked cartridges?

Post by linville »

The cartridge hardware in question is described in this Rainbow article by Greg Zumwalt:

https://archive.org/stream/rainbowmagaz ... 7/mode/2up

The hardware design is used in Robocop and Predator cartridges for the CoCo3, but there is nothing about the design the requires a CoCo3 to function. The 16K banks are mapped-in at $c000, just like any standard cartridge. Use of ~SLENB (aka ~DSD on the Dragon) is definitely not required. I don't see any reason why this design would not function on a Dragon, CoCo1, or CoCo2 just as well as it does on a CoCo3.
jmk
Posts: 65
Joined: Fri Mar 20, 2009 1:12 am

Re: Could the Dragon use CoCo banked cartridges?

Post by jmk »

Some interesting answers here.

I've got myself to within 512 bytes of being able to run Glove in a banked cartridge (two banks) on a 16K RAM machine. I had to make a little modification to the A09 assembler to export labels and I have to assemble everything twice (!) but it does the job. I've figured out that I can use RMB (in strict circumstances) instead of FCB/FCW to define space in the RAM area without it deciding to output a giant binary covering the whole of memory.

Another question... how much of a gap should I leave at the end of each 16K "page"? The usual $100 to keep $FF00+ clear or should I keep $FE00+ clear just in case (CoCo 3)?

Also... if I used the "ROM fast/RAM slow" version of the double-speed POKE for the Dragon/CoCo 1/2 (not the CoCo 3 double-speed POKE), would it run the cartridge code (safely) at double the speed? If it did, that would be quite a boon for Glove, which works really well with the extra speed.
linville
Posts: 129
Joined: Mon Feb 13, 2012 11:01 pm

Re: Could the Dragon use CoCo banked cartridges?

Post by linville »

FWIW I run Fahrfall in the ROM fast / RAM slow mode at all times. Highly recommended for cartridge games IMHO.
jmk
Posts: 65
Joined: Fri Mar 20, 2009 1:12 am

Re: Could the Dragon use CoCo banked cartridges?

Post by jmk »

Well, I have missed the CoCoFest deadline, but I do have a banked ROM that I can play (I had to cut the last few levels though, to save space). It only works in VCC and MESS 0.136b (if I add an entry to coco.hsi, including the CRC32 of the ROM) - it does not work in newer versions of MESS/MAME. I can't test it on any Dragon emulation, as no Dragon-specific emulator supports it and banking doesn't work in Dragon modes in MESS.

MESS 0.136b is pretty old and the emulation is a bit flaky. For example, when using a 4K or 16K CoCo, I page into all-RAM mode (to test the presence of upper RAM) and then page the ROMs back in, the cartridge has gone!

According to the behaviour of the two emulators, I can't put anything in $FE00+ in any bank and expect it to be compatible with a CoCo 3. This means that a 32K cartridge is actually a 31K cartridge, hence the difficulty I've had squashing the game in!

I am still interested in the use of the fast ROM POKE. I have about 6K of code copied into RAM, so I wouldn't get the full speed boost. When I use it, the emulators run the game as if it's as fast as a CoCo 3. I doubt it would be like that in real life, it seems too good to be true. I guess not many people have experience with cartridge development, so I might not be able to get any more answers on that one? Perhaps if someone with a multi-cart tried disabling autostart and did a POKE &HFFD7,0 before the EXEC &HC000 to see how various titles performed?

XRoar would probably be the only one that would time it right (the only emulator that supports the picture break-up when you do the fast RAM POKE), but I can't use that for my banked ROM.

All in all, I've had fun though. I hadn't touched 6809 for 6 years and had to remember a few things. It's amazing what you can see with fresh eyes. If I retrofit the new optimisations into the cassette version of Glove, I might have 1K free to add new things...
Post Reply