Jump to content

Magicard - PAL conversion + enhanced version


Recommended Posts

For those who don't know, Commavid's Magicard is a cartridge (initially only sold as a bare board without a case) that allowed to write programs in machine code on the 2600. It has 1Kb of RAM, a 2Kb Monitor program in rom which allows to enter programs using two keyboard controllers and, by building an interface described in the manual, to save and load them using a tape recorder. There are subroutines in the rom to easily generate a 40x42 pixel graphic display, or 7 lines of text with 10 characters each. A reduced ascii charset was also stored in rom. The monitor includes a simple disassembler, an hex dump of memory and a function to calculate relative addresses for branch instructions on the fly.

I learned a bit of assembly after joining AtariAge and discovering the homebrew scene. From that I also became interested in the early microcomputers like the KIM-1 or the Cosmac ELF, and got fascinated by Commavid's Magicard which shares a lot of similarities with them. At the time I first discover it, the repros were already out of productions and the original was (and still is) rare and way too expensive for me, so the only way I could try it out was through emulation. I remapped the keyboard controllers in Stella so that they are layed out next to each other and attached little labels on a spare keyboard to make it easy to use. I downloaded and printed the scans of the Manual available here on AtariAge, tried programming it and I LOVED it!

Later I disassembled the code (that wasn't too hard, because the monitor is described in detail in the manual, including ram usage and address and function of every subroutine) and I hacked it to work on a supercharger. The hack was a little buggy but it worked and I could run all of the example programs on the manual (with some screen roll due to the slow access to supercharger RAM).

With the advent of the Harmony cart, I could finally run the original bankswitch scheme on real hardware and I started again working on it. I made a Pal version and a slighty enanched version with a few bugfixes.
Here they are if anyone is interested (Although I'm probably the only one... :-D )
PAL conversion:



Like the original but with color correction and 50Hz display (without black bars on top and bottom of the image: the display is actually stretched to fill the screen, so the aspect ratio is the same as on the NTSC version).



Here is a pdf version of the manual and overlays for the keyboard controllers you can print








- Fixed "JSR" addressing mode in disassembler (The original lists it as "absolute Y", instead of "Absolute". There's a note on chapter 4.3 of the manual)
- Different font
- RIOT RAM $A2 to $A9 isn't zeroed anymore upon reset.
- Debounced RESET switch
- The left four digits are now blanked while typing hex codes (The original shows garbage data instead)
- "Unshifted" and "Shifted" mode (see Chapter 4) are now indicated by a different background color
- Using of "Fetch", "Hex dump" and "Disassembly" functions in write area doesn't cause unwanted writes anymore.



I couldn't make the cassette interface to work with any tape recorder, computer soundcard, mp3 player or anything else. I think old tape recorders used stronger audio levels and I'm not able to design a new interface that can work with modern devices. That's the main reason I left it in WIP state. If someone will come up with a functioning interface maybe I'll start working on it again and add some other features I had in mind.


Edited by alex_79
  • Like 7
Link to comment
Share on other sites

  • 7 years later...
On 1/18/2015 at 9:59 AM, alex_79 said:

Later I disassembled the code (that wasn't too hard, because the monitor is described in detail in the manual, including ram usage and address and function of every subroutine) and I hacked it to work on a supercharger. The hack was a little buggy but it worked and I could run all of the example programs on the manual (with some screen roll due to the slow access to supercharger RAM).


Hello, I have a supercharger in my possession and couldn't not see this, does anybody have a .bin I could try on my supercharger ? That would be really great as I don't have an harmony cart and I'd really like to play around with this "game".


It would be greatly appreciated if anyone could help, thank you.

Link to comment
Share on other sites

I had to search a bit in some old backups, but I found a few different wip versions of it.


In later versions I made more changes, making use of the other 2k bank in the Supercharger, adding the ability to load data using the supercharger audio input, dump of processor status and register on a "brk" instruction, etc. I never finished it, though, and I don't remember at what stage of completion it was when I stopped. Moreover I have no documentation for it. so I'd need to go through the source and understand what it does...


This one is an early version and doesn't differ too much from the original, so you should be able to try the examples in the manual with minimal changes.

The zip includes PAL and NTSC versions, both in binary form or audio, and the ".pro" files that, if kept in the same directory of the binary (or if you launch the rom from within the zip file) will tell Stella to enable the keyboard controllers. Stella autodetection in fact seems to fail for these particular roms.



I haven't documentation for this version either, but this is what I can guess after a brief test and look at the source:


Apart for some cosmetic changes (there's no blinking cursor, the "shifted" and "unshifted" modes are distinguished by the text color, reset switch doesn't clear the screen buffer), the main difference is that you have an extra 1k of ram available at $1400-$17ff. The only way to write to cartridge ram is to call the STPM monitor subroutine (which is quite a bit slower than the original one, because of the way the Supercharger RAM works). Since there aren't separate read and write addresses like in the original, you must not add the "$400" offset when using the STPM routine.

Also the addresses of the various monitor routines differ from those in the original, so you have to change them whenever they're used in a program, using the ones below instead:


Magicard SC Monitor Subroutines
 DSPL:  $fa6f
 STPM:  $ffc1
 STSC:  $ffc2
 CALP:  $ff7c
 ONEC:  $fb67
 DOLN:  $fcb3
 BFIL:  $fd9b
 SCRL:  $fd72
 NUMC:  $fc9c
 ENCL:  $fca5
 PSHD:  $fd62
 INCB:  $fc88
 BMPB:  $fc8a
 INSN:  $fc6e
 ADTY:  $fc3a
 INLN:  $fc28
Other Monitor Addresses
 RSET:  $feea
 MAIN:  $fefe
 DISA:  $fda5
 CWRT:  $fce3
 CRED:  $fd38
 HEXD:  $fe29
 GO:    $ffd4
 RELC:  $fe7f


As said in the first post, I haven't tested the cassette write and read routines, as the interface I built using the schematics in the manual never worked. (I have found a schematic of a different circuit that might work, but I haven't found time and motivation to give it a try yet)

Keep in mind that this is an unfinished wip and I haven't looked at it in more than a decade! There might be bugs.


BTW, I also have newer versions of the ones in the first post, with bugfixes and enanchements, and I will eventually post them sometime in the future when I finally get a chanche to test the cassette loading/recording function with a working interface.




Edited by alex_79
Link to comment
Share on other sites

1 hour ago, SvOlli said:

Magicard is not SuperCharger. The way RAM is accessed is totally different. So the Magicard sortware will not work on a SuperCharger.

In the Supercharger hack above, the "STPM" routine in the Monitor, used to write to the Magicard cartridge RAM, has been changed to handle SC RAM instead. Of course it is much slower, so there will be timing issues in complex programs, but as far as I remember all the examples in the manual worked with that SC hack, simply by changing the routine address and by not using the $400 offset for the address to be written to.

At the time I did that hack, the Harmony didn't exist and my goal was simply to be able to try the monitor program of the Magicard on real hardware, because I was fascinated by the idea of being able to enter and execute code using the 2600 console itself. Full software compatibility wasn't my goal and you're of course right that isn't possible by using a Supercharger.🙂


Edited by alex_79
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...