The memory model in this C64 emulator is designed to accurately represent the complex memory management of the original hardware, including memory-mapped devices, multiple memory configurations, and the unique behavior of reads and writes in different address ranges.
Click on a component to learn more about its role in the memory system.
Key Concepts
Memory-Mapped Devices: All accessible devices, including RAM and ROM, are mapped to specific address ranges.
Separate Read/Write Maps: The emulator uses distinct maps for read and write operations to accurately emulate C64's behavior.
Multiple Memory Configurations: The emulator supports different memory maps that can be selected programmatically.
RAM, ROM, and Color RAM: Each type of memory is implemented with its unique characteristics and behaviors.
Memory Access Visualization
Implementation Details
MemoryMappedDevice: Base class for all memory-mapped devices, implementing Read and Write methods.
MemoryMap: Handles device mappings and redirects read/write operations to appropriate devices.
RAM: Simple byte array with straightforward read/write operations.
ROM: Read-only memory loaded from predefined files, with a Patch method for modifications.
ColorRAM: Special RAM for VIC-II chip, using only lower 4 bits of each byte.
Special Considerations
Shadowing: The emulator doesn't support mapping a single device to multiple locations. Chips mapped to larger spaces than their register count handle this internally.
Unmapped Space: The current implementation throws an exception for access to unmapped addresses, which may cause issues with some software.