It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I know that the Commodore 64 has a cartridge slot, and it's easy to find technical information on how it works, like how cartridge ROM is mapped into the address space and how autostart works. I have also read the warning about not inserting the cartridge while the computer is running.

My question is: What exactly happens when you insert or remove a cartridge while the Commodore 64 is powered on? Is there any way to ensure that the system keeps running in a well-behaved manner when you do this?

(I never actually owned a Commodore 64, but it is possible to emulate it, and there is a ton of technical information online about how things are handled at a decently low level, and I find that interesting.)
avatar
dtgreene: My question is: What exactly happens when you insert or remove a cartridge while the Commodore 64 is powered on?
Attachments:
result.jpg (44 Kb)
This is an interesting question, one I'm not sure I can answer fully.

First you need to understand the 6502, which is an 8bit chip. the chip has approx 80 official instructions, while there's more being mapped of what the other undocumented ones do.

The chip has no IO pins, only pins for memory. This means in order to make it work outside of it's memory space, you have to carve out memory to be IO to other chips.

Generally the first 32k is straight ram, while the upper 32k may not be. With the Atari800 there's tons of little addresses with special purposes, including a random number generator.

Now let's look at it more. The cartridge is likely a ROM set of chips, and the connection is likely to be under anything to actually harm it. So the explosion shown by TinyE, is unlikely, as you probably won't permanently damage your computer or cartridge.

As for what happens. Most likely the memory will switch over from a fixed in-place rom that's there (much like the Atari800 which includes a copy of Basic without having to insert a cartridge to use it). This likely means that there will be a sudden change over of ram, and the data will become corrupt, not because anything happened to memory, but the screen, settings, chips and other configurations to that point were not prepared for the new forcefully injected instructions that are more or less random depending on when it switches over.

Sure instructions would still run, but that doesn't mean they are useful instructions. Things are being updated with completely irrational inputs, or going in loops or halting, eventually getting stuck in some small infinite loop.


To really know what happens, we'd have to probably slow the CPU down and single-step through it, assuming there isn't some hardware trigger that switches things.
avatar
dtgreene: I know that the Commodore 64 has a cartridge slot, and it's easy to find technical information on how it works, like how cartridge ROM is mapped into the address space and how autostart works. I have also read the warning about not inserting the cartridge while the computer is running.

My question is: What exactly happens when you insert or remove a cartridge while the Commodore 64 is powered on? Is there any way to ensure that the system keeps running in a well-behaved manner when you do this?

(I never actually owned a Commodore 64, but it is possible to emulate it, and there is a ton of technical information online about how things are handled at a decently low level, and I find that interesting.)
It's mainly an issue of some of the "pins" having a charge. Can possibly create a spark, short, static charge etc and maybe fry something. Semi-conductor technology was still in a primitive state at the time. Depending which "pin" hits and connects first and you may have an ungrounded charge.
avatar
RWarehall: It's mainly an issue of some of the "pins" having a charge. Can possibly create a spark, short, static charge etc and maybe fry something. Semi-conductor technology was still in a primitive state at the time. Depending which "pin" hits and connects first and you may have an ungrounded charge.
If all the pins connected at once, this probably wouldn't be a big worry. Put it in slightly wrong and the ROM chips can't hold the charge? Yeah... spark or short circuit... Probably ruining the cartridge, less so the computer in that case, unless it shorted on a non-grounded line from what should be the ground.

At that point you might get the Myth-busters 'mysterious blue smoke'.
If I recall, this guy has a video where he basically tried to copy cartridges to tape or the reverse.

It didn't work because things I forgot.