Egghead.page Logo

How the Commodore VIC-20 Handles Cartridge Memory Mapping

The Commodore VIC-20 utilized a specific memory mapping strategy to allow cartridge software to override internal memory, enabling expanded functionality without modifying the motherboard. This article explores the technical architecture behind the VIC-20 cartridge port, detailing how memory blocks are selected and how the 6502 processor accesses external ROM through specific address lines.

The VIC-20 is built around the MOS 6502 microprocessor, which addresses memory in a 16-bit space. To manage cartridges, the system divides the available address space into specific blocks known as BLK1, BLK2, BLK3, and BLK5. These blocks correspond to specific ranges in the memory map where cartridge ROM can reside. When a cartridge is inserted, hardware signals on the cartridge port dictate which blocks are active.

Memory mapping is controlled by logic gates that monitor the address lines. If a cartridge asserts a signal for a specific block, the VIC-20 disables the internal ROM or RAM in that corresponding address range. This allows the cartridge code to run directly from the external medium. For example, BLK5 is often used for basic extension ROM, while BLK1, BLK2, and BLK3 are typically used for program code and data.

The cartridge port exposes address lines, data lines, and control signals such as IO1 and IO2. These control signals allow cartridges to map small amounts of memory for input/output operations without taking up large address spaces. This flexibility allowed developers to create games, utilities, and expansion modules that seamlessly integrated with the system’s existing architecture.

By using a block-based memory mapping system, the VIC-20 provided a robust method for software expansion. This design ensured that cartridges could efficiently utilize the limited address space of the 6502 processor while maintaining compatibility with the internal operating system and BASIC interpreter.