Magic Desk and Ocean compatible cartridge for the Commodore 64

This project is free to use and you can use any PCB manufacturer by downloading the Gerber files from the GitHub repository, but if you would like to support my work and help with further C64 hardware development you can order these PCBs on PCBWay trough this link:

PCB from PCBWay

You will get cheap and professionally made PCBs, I will get credits that will help with this and other projects. Also, if you have to register to that site, you can use this link to get bonus initial credit.

Hardware Description

Magic Desk cartridges, in their original form, could hold up to 128Kb of code, or up to 16 banks of 8Kb each. Bank selection is done by writing a byte to $DE00. If bit 8 is set, then EXROM is disabled and RAM in the range of $8000 – $9FFF is usable.

This cartridge expands on the idea by having 128 banks of 8Kb available, thus the maximum size is 1 Mb.

Inputs of an 8-bit latch (74LS273) are connected to the data lines. Correct decoding for the I/O1 signal is done by combining PHI2 and I/O1 trough the NOR gates of 74LS02. The only feature that is deviant from the original Magic Desk specification, is that when you disable the cartridge by writing a value of $80 or larger to $DE00, the banking mechanism gets locked and no more write attempts to $DE00 will change the register’s state until a hardware reset is performed. This had to be done because some programs would unintentionally write to $DE00 (or any other location in the I/O1 range) and sometimes, if $01 is wrongly set by the program, it could result in a crash. Since the use of this particular cartrige is primarily to enable making onefile program compilations trough the Magic Desk Cartridge Generator, we have decided to do it this way. If you want (or need) full compatibility with the original Magic Desk cartridge hardware, we have left a jumper to disable this behaviour. Cut the track exposed on the LOCK jumper (“YES” position) on the bottom side of the cartridge PCB, and connect it to the “NO” position. This way the locking mechanism is disabled, but still you can remove the cartridge from the memory map by setting the bit 7 of the latch high.

The PCB was designed to accomodate various types of EPROMs and their FLASH variants. The smallest EPROM you can use is 27C512 (64Kb), and the largest is 27C040 (512 Kb). There is an option to expand the board to a full 1Mb, which will be explained below.

Jumper configuration

Do not be intimidated with the amount of jumpers on the board. They are preconfigured for Magic Desk cartridges. I you need Ocean (and other types of cartridges) compatibility, please continue reading, it is described further below. First, you need to configure the memory selection jumpers.

In order to support most common types of EPROMs and FLASH EPROMs, a bank of solder jumpers had to be placed on the bottom side of the PCB. They look like this:

EPROM selection jumpers

These jumpers HAVE to be configured before plugging the cartridge to your C64! Different types of EPROMs and their FLASH variants have some pins swapped, and if you are using a chip smaller than the maximum size, the unused address lines have to be pulled high on the EPROM side to ensure proper functioning. Also, 27C512 is “shorter” by 4 pins, so it’s power supply pin must be connected to +5V instead of being allocated as A17 on the larger ones. The leftmost pins of all 3 jumpers are +5V, and the rightmost pins are the address lines. The middle pins of the jumpers are connected according to the table:

Jumper Pin Description
PIN1 1 routes either A18 or VCC to pin 1 of EPROM
PIN31 31 routes either A18 or VCC to pin 31 of EPROM
28PIN/32PIN 30 routes either A17 or VCC to pin 30 of EPROM

Here is the table for configuring the jumpers on most common variants of EPROMS and their FLASH counterparts.

Jumper 27C512 27C010 29F010 27C020 29F020 27C040 29F040
PIN1 [X X X] [X=X X] [X=X X] [X=X X] [X=X X] [X=X X] [X X=X]
PIN31 [X X X] [X=X X] [X=X X] [X=X X] [X=X X] [X X=X] [X=X X]
28PIN/32PIN [X=X X] [X X=X] [X X=X] [X X=X] [X X=X] [X X=X] [X X=X]

Precautions have been taken to ensure the corectness of the table above. Please, check the datasheet of your particular (FLASH) EPROM and configure the jumpers accordingly.

Beyond 512Kb

Full 1Mb is achievable using a 27C080 or 27C801 EPROM. Other types of memory are not supported. On the right top side of the PCB there are two jumpers marked as “1MB Extend”. You should leave out connections on the jumper PIN1 on the bottom side and configure other jumpers as for 27C040, move the jumper in the “1MB Extend” block from CE to OE and connect the 1MB jumper, as seen in the pictures. Note that this breaks Ocean compatibility.

1MB jumpers

Advanced Jumper Configuration

The board has 5 jumpers that are associated with the change of functions from Magic Desk to Ocean (and others). Ocean cartridges are differently mapped in memory, depending on their size. 128k and 512k games use plain 8k /EXROM mapping, but 256k games need to see two different banks in the 16k window.

MODE – Completely disable or enable usage of the bit 7 of latch, so Ocean images can work.

  • When in position OCEAN – bit 7 is disabled, in MAGIC DESK – Enabled.
  • Default is MAGIC DESK

LOCK – Enable or disable latch locking when the latch bit 7 is set (for Ocean, EasyFlash conversions and C64GS).

  • Position YES – Enabled, NO – Disabled.
  • Default is YES.
  • This jumper has no effect if MODE is set to OCEAN position.
  • The effect of this jumper is that you can remove the cartridge temporarily from the memory map by setting bit 7 high, but if needed, it can be re-enabled.

GAME – Enable 16K mapping by pulling /GAME low together with /EXROM ($8000-$9FFF & $A000-$BFFF)

  • This is used for EasyFlash conversions and Ocean carts that require two 8k banks.
  • Depending on SIZE, this will either show the same 8K bank mirrored in both windows (if SIZE is in 8k position) or two different 8k banks (if SIZE is set to 16k)

SIZE – Map C64 A13 to A18 of the EPROM (for 16K configurations).

  • To be used in conjuction with GAME and MD jumper.
  • If GAME jumper is set, and SIZE is left at 8k position, both 8k windows show the same data.
  • If SIZE is in 16k position, two 8k windows show different data.

MD – If no 16k configuration is needed, leave closed and don’t install diodes and resistor on the bottom. If any 16K configuration is needed, cut and install 2x1N4148 diodes and 10k resistor.

  • This connects both /ROML and /ROMH to /OE of the EPROM.

Examples for configuring jumpers

Ocean 128k

(Batman The Movie, Double Dragon, Navy Seals, Pang etc.)

  • Use a 128k EPROM or FLASH, set the memory type selection jumpers accordingly.
  • Set MODE jumper to OCEAN.

Ocean 256K

(Shadow of the Beast, Robocop 2, Chase HQ 2)

  • Use a 512k EPROM or FLASH. You need to program the same image in both 256k halves of the EPROM. Set memory type selection jumpers accordingly.
  • Use the following jumper settings: MODE Ocean, LOCK No, SIZE 16k, GAME connected, MD disconnected, resistor and diodes installed.

Ocean 512k

(Terminator 2)

  • Use a 512k EPROM or FLASH, set the memory type selection jumpers accordingly.
  • Move MODE from MAGIC DESK to OCEAN.

C64GS / System 3

  • Myth and Last Ninja work with the following configuration:
  • MODE Magic, LOCK No, SIZE 8k, GAME disconnected, MD connected, resistor and diodes NOT installed.
  • Myth reqires you to type SYS 3 MYTH on the black screen to start the game.
  • C64GS cartridge doesn’t work – it writes wrong banks as it uses STA $DE00,X. This would need to be changed to STX $DE00, and one STA $DE00 needs to be changed to LDA #$00, STA $DE00. I’m investigating the possible patch.
  • Probably the former is also valid for the recently leaked Elite .crt files. I haven’t investigated them yet.

EasyFlash conversions

Some of EasyFlash games can be converted to use this cartridge. Usually, if the game doesn’t use eAPI or is not converted with disk2easyflash, then it can be converted. The startup code (because Easyflash starts in ULTIMAX mode which cannot be emulated here) needs also to be moved, if needed. Here are some games that I successfully converted to use this cartridge:

  • Mayhem in Monsterland
    • Requres a 512Kb chip
    • Export the .crt file using crt2chip2
    • Using a hex editor, take the first 256Kb of both U4 and U3 files, and concatenate them to one file (First the data from U4, then from U3)
    • Find all banking routines and patch them to use $0x instead of $4x.
    • Patch out any $DE02 access by NOP
    • Use the following jumper settings: MODE Magic, LOCK No, SIZE 16k, GAME connected, MD disconnected, resistor and diodes installed.
    • Patch file for use with bspatch (Windows / Linux) available HERE
  • Creatures 2
    • Requres a 512Kb chip
    • Export the .crt file using crt2chip2
    • Only the U4 file is needed.
    • Minimal startup code and vector initialization needs to be added to the first bank of the cartridge file ($0000 – $2000), part of the code is in U3 file. There is some empty space at $1FE0, use it wisely…
    • CBM80 signature needs to be altered to point to the newly added startup code
    • Use the following jumper settings: MODE Magic, LOCK No, SIZE 8k, GAME disconnected, MD connected, resistor and diodes NOT installed.
    • Patch file for use with bspatch (Windows / Linux) available HERE

As I patch more games, I’ll describe the process here. Useful tools for patching are C64Debugger and Regenerator.

RESET button

The pads for the RESET button will accomodate a vertical miniature tact switch.

Capacitors

The capacitors are not needed, but you can populate them. They are 100nF 50V MLCC capacitors with 2.54mm raster.

Enclosure compatibility

The PCB is designed so it can be used in various types of cartridge cases. It has been mainly designed to fit the “Stumpy” cartridge from TFW8B, but it also fits the original Commodore cases and cases from the Polish companies KRADEX / MASZCZYK which are available at some retailers in Europe. It also fits in a 3D-printed case from the model available at Thingiverse. Unfortunately, I don’t have all of the cartridge cases available in the market, so the design is NOT tested to fit with: Individual Computers’ and Shareware Plus’ (and all other currently available but not mentioned here) cases.

Please note – the cartridge cases from KRADEX / MASZCZYK are “low profile”, and you cannot use a socket for the EPROM with this type of cases!

Cartridges in case

Also, recently TFW8B came out with their MARINA 64 cartridge. This was not made to compete with their design – actually, development was done concurrently, not knowing what the other party was doing.

But, where are the EAGLE schematic and PCB design?

Glad that you asked. The schematic is available as a .pdf file, and for the time being I’m making only the Gerbers available, because of people taking credit for my designs, removing texts and presenting the cartridges as their own product, thus breaching the license, and later refusing to take action upon notice. I hope that you can understand. You can see from the photos, this was not an easy task to route. If you have good intentions, I will provide you the files via e-mail or other communications channel. The EAGLE files will be made available 6 months from the date of the release (on 1st of October 2020.)

PCB Artwork

Revision history

  • Rev.1
    • Initial release, not public
  • Rev.2
    • Clearance issue with the diodes and GAME jumper addressed
    • Added 1MB Extension jumpers
    • Enlarged all jumpers
    • Cosmetic improvements

Thanks:

My thanks go to:

License

c64-uni-cart is Open Hardware licensed under the CERN OHL v. 1.2, released by Marko Šolajić in 2020. You may redistribute and modify this documentation under the terms of the CERN OHL v.1.2.

2 Comments

  1. Greetings from Hungary!
    First of all, congratulations, this is a really nice job! Sorry, but I don’t speak English well, therefore, I use Google Translate!
    I wanted to try the MagicDesk version of Creatures 2, Mayhem and Prince, converted from EasyFlash. But, unfortunately, the transformation is not going for me. I don’t understand ASM. Yet, there would be several game CRTs that could be converted. Eg. Turrican, Bugs Bunny starts the conversion maybe, but down freezes. About this, you can’t make a description of which titles need to be rewritten to be MagicDesk compatible?
    Thanks!
    DuckTales and FlimboQuest can be played after conversion! But, I didn’t try for a long time!

  2. Hello!
    I use to create PCBs starting from your projects. In the Creations section of my site you will find something i reviewed. I’m writing on the back “Based on Zarkov and Solajic design” or “based on Bakisha design” (in the case of my 1MB cart, i saw Bakisha credited you in his page) and i’d like to know if it’s enough to you or not. So to be compliant with your creation credits requirement. Thanks for all your effort, it has been very inspiring.

1 Trackback / Pingback

  1. CRX2020 Presentation – 8bitchip's Retrocomputing Blog

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.