Giter Club home page Giter Club logo

magic-desk-128's Introduction

Magic Desk 128 (1MB)

Render top
This is a Commodore 128 version of the popular Commodore 64 Magic Desk cartridge. The Magic Desk cartridge is a simple bank switching ROM cartridge that uses IO1 ($de00) to select ROM banks. The difference between this C128 Magic Desk format and the C64 version is that the C128 version has 16kB ROM per bank instead of 8kB and therefore supports twice as much ROM. Theoretically it would support up to 4MB (256x16kB).
This is the first version of the C128 Magic Desk cartridge and it has room for up to 1MB of ROM divided into 64 banks of 16kB.

The cartridge was designed with SST39 flash chips in mind but other 32-pin flash or EPROM/EEPROM chips can be used too as long as they are pin-compatible.

Startup

After power-up or reset, ROM bank 0 (the first 16kB of the LOW chip) is active and accessible at $8000-$bfff.
That first bank needs to contain the regular cartridge initiation bytes such as CBM magic word, autostart configuration and start vectors if you want your cartridge to autostart.

Switching banks

Write an address of a ROM bank such as #00-#63 (#$00-#$3f in hex) to $de00 to switch bank. Set the value to 63 to switch to the last bank of the second ROM and value 0 to switch back to the first bank in first ROM or any bank in between. The size and amount of ROM chips is flexible. It's even possible to mix and match chips of different sizes to match your needs but you need to be aware of the available bank numbers when doing so. The LOW chip contains banks 0-31 and the HIGH chip contains 32-63. It doesn't make sense to add a HIGH chip if there's anything less than a 4Mbit/512kB (SST39SF040) chip in the LOW position but it is possible. You just have to skip some of the banks from the LOW range and skip to bank 32 to read from the HIGH chip.

Precautions

ROM banks are switched whenever IO1 is asserted which is when any address between $de00 and $deff is accessed. Writing to any of these addresses will switch the bank the same way as $de00 does. Reading from any adress between $de00 and $deff corrupts the bank selection by switching bank to a somewhat random bank so if you for some reason would like to read from these addresses in your application you must make a proper bank selection afterwards. I don't know of any program that reads from that area but if a program does that it can't be used on a multicart created with the Magic Cartridge Generator if you don't modify the program.

ROM population examples

LOW chip HIGH chip Banks Total size
SST39SF010 0-7 128kB
SST39SF010 SST39SF010 0-7, 32-39 256kB
SST39SF020 0-15 256kB
SST39SF040 0 -31 512kB
SST39SF040 SST39SF020 0-47 768kB
SST39SF040 SST39SF040 0-63 1024kB

If you use a smaller chip such as the SST39SF010, the data in the eight available banks will be repated at bank address 8-15, 16-23, 24-31.

BOM

identifier Part Comments
U1 74LS273 or 74HCT273/74AHCT273
U1 74LS02 or 74HCT02/74AHCT02
U3 32-pin flash/EPROM First ROM. SST39SF or compatible
U4 32-pin flash/EPROM Second ROM (optional)
C1,C2,C3,C4 100nF ceramic 5mm pitch

Software

Volley for Two

The game Volley for Two is the reason that I developed this cartridge format in the first place. I started working on the cartrige when the programmer Jonas Hultén wanted a cartridge format to release the game on. He modified the game to load from a Magic Desk 128 cartridge.

You can download cartridge ROM file along with printable labels and more from https://kollektivet.nu/v42/
The game needs a 256kB (SST39SF020) or larger flash chip.

Magic Cartridge Generator

Zzarko has made a Python script and a menu program that can be used to generate menu-driven multi-cart images that can be put on this cartridge.
Create a cartridge with all your favorite C128 utils or games. The requirement is that they consist of a single prg-file (no multi-load programs). Zzarko's Magic Cartridge Generator along with documentation and examples can be found at https://bitbucket.org/zzarko/magic-cartridge-generator

Emulator Support

The Kernal64 emulator can emulate this cartridge. At the moment you will have to mount the ROM image from the internal function ROM configuration and set the type to MAGICDESK128.
The Kernal64 project can be found at https://github.com/abbruzze/kernal64

VICE supports emulation of the Magic Desk 128 from version 3.7.
Mounting a regular bin file can be done by starting Vice with the command line parameter -cartmd128 <romfile.bin>
Cartridge images in crt format can be opened using the attach cartridge function in the menu. The crt files can be generated from bin files using version 3.7 or newer of the command cartconv using the below syntax.
cartconv -t md128 -i romfile.bin -o cartfile.crt -n "Your display name"

magic-desk-128's People

Contributors

retronynjah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ozw1z5rd

magic-desk-128's Issues

Where is the ROM mapped really?

The Schematic says the ROM is only ever mapped to ROML ($8000-$BFFF) - however the readme says its mapped to both ROML and ROMH. What is correct? :)

What happens when reading IO1?

If i read the schematic correctly, the register (bank) latch is loaded on any IO1 access - regardless of read or write. that means any read in the $de00-$deff range would potentially corrupt that register (simelar problem as AR5 has). Is that correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.