base:memory_management
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
base:memory_management [2015-04-17 04:32] – external edit 127.0.0.1 | base:memory_management [2022-03-06 10:20] – [With Cartridges] white_flame | ||
---|---|---|---|
Line 3: | Line 3: | ||
(Someone please integrate the texts on this page into one...) | (Someone please integrate the texts on this page into one...) | ||
- | Oswald/ | + | ====== Without Cartridges ====== |
- | the c64 has 64k ram overlapped with ROMs and IO register areas. | + | The low 3 bits of $01 control |
- | memory | + | ^Name ^Bit ^Region ^0 ^1 ^Notes^ |
+ | |LORAM|0|$A000-BFFF|RAM|BASIC|If KERNAL isn't mapped in, then BASIC won' | ||
+ | |HIRAM|1|$E000-FFFF|RAM|KERNAL| | | ||
+ | |CHAREN|2|$D000-DFFF|CHARROM|I/ | ||
- | < | + | * All other memory locations ($0002-9FFF, |
- | 0000-A000 RAM | + | |
- | A000-C000 RAM _OR_ BASIC ROM | + | * I/O includes the registers for the VIC-II, SID, and CIA chips; color RAM; and two external I/O pages that reach out the expansion port. |
- | C000-D000 RAM | + | * The VIC-II always sees the CHARROM at $1000-1FFF and $9000-9FFF, and RAM everywhere else, regardless of these bits. |
- | D000-E000 RAM | + | |
- | E000-FFFF RAM _OR_ KERNAL ROM | + | |
- | </ | + | |
- | Memory address | + | The mappings from combining these 3 bits are listed below. |
- | < | + | ^$01 value ^$A000-BFFF ^$D000-DFFF ^$E000-FFFF |
- | $01=$37 -> Basic Rom visible | + | |$30 +48 %000 |RAM |RAM |RAM| |
- | $01=$36 -> RAM visible A000-C000, IO visible at D000-E000, Kernal Rom Visible at E000-FFFF | + | |$31 +49 %001 |RAM |CHARROM |RAM| |
- | $01=$35 -> RAM visible A000-C000, IO visible at D000-E000, | + | |$32 +50 %010 |RAM |CHARROM |KERNAL| |
- | $01=$34 -> RAM visible A000-C000, | + | |$33 +51 %011 |BASIC |CHARROM |KERNAL| |
- | $01=$33 -> RAM visible A000-C000, CHAR ROM at D000-E000, | + | | |
- | </code> | + | |$34 +52 %100 |RAM |RAM |RAM| |
+ | |$35 +53 %101 |RAM |I/O |RAM| | ||
+ | |$36 +54 %110 |RAM |I/O |KERNAL| | ||
+ | |$37 +55 %111 |BASIC |I/O |KERNAL|Default| | ||
- | thats all. | + | ***WARNING***: |
- | Char Rom behaves weird, as from the processors point of view normally its invisible, and if you turn it on the CPU " | ||
- | ===== Related: from Graham' | + | ====== With Cartridges ====== |
+ | |||
+ | The expansion port has 2 configuration inputs (/EXROM and /GAME), and 4 chip select outputs (/IO1, /IO2, /ROML, /ROMH). | ||
+ | |||
+ | /IO1 and /IO2 lines are active on both reads & writes to their respective memory ranges, any time that I/O is banked in: | ||
+ | * /IO1 = $DE00 - $DEFF | ||
+ | * /IO2 = $DF00 - $DFFF | ||
+ | |||
+ | /ROML and /ROMH are active on reads depending on how the cartridge sets the configuration inputs. | ||
+ | |||
+ | |||
+ | ===== Cart pulls /EXROM low ===== | ||
+ | |||
+ | The simplest C64-mode cartridge configuration, | ||
+ | |||
+ | ^$01 value ^$8000-9FFF ^$A000-BFFF ^$D000-DFFF ^$E000-FFFF ^Notes^ | ||
+ | |$30 +48 %000 |RAM |RAM |RAM |RAM| | ||
+ | |$31 +49 %001 |RAM |RAM |CHARROM |RAM| | ||
+ | |$32 +50 %010 |RAM |RAM |CHARROM |KERNAL| | ||
+ | |$33 +51 %011 |**__ROML__** |BASIC |CHARROM |KERNAL| | ||
+ | | | ||
+ | |$34 +52 %100 |RAM |RAM |RAM |RAM| | ||
+ | |$35 +53 %101 |RAM |RAM |I/O |RAM| | ||
+ | |$36 +54 %110 |RAM |RAM |I/O |KERNAL| | ||
+ | |$37 +55 %111 |**__ROML__** |BASIC |I/O |KERNAL|Default| | ||
+ | |||
+ | ===== Cart pulls /EXROM + /GAME low ===== | ||
+ | |||
+ | ROML is before BASIC, and is swapped out with the LORAM bit in $01. ROMH replaces BASIC, and HIRAM swaps out both it and the KERNAL. | ||
+ | |||
+ | ^$01 value ^$8000-9FFF ^$A000-BFFF ^$D000-DFFF ^$E000-FFFF ^Notes^ | ||
+ | |$30 +48 %000 |RAM |RAM |RAM |RAM| | ||
+ | |$31 +49 %001 |RAM |RAM |CHARROM |RAM| | ||
+ | |$32 +50 %010 |RAM |**__ROMH__** |CHARROM |KERNAL| | ||
+ | |$33 +51 %011 |**__ROML__** |**__ROMH__** |CHARROM |KERNAL| | ||
+ | | | ||
+ | |$34 +52 %100 |RAM |RAM |RAM |RAM| | ||
+ | |$35 +53 %101 |RAM |RAM |I/O |RAM| | ||
+ | |$36 +54 %110 |RAM |**__ROMH__** |I/O |KERNAL| | ||
+ | |$37 +55 %111 |**__ROML__** |**__ROMH__** |I/O |KERNAL|Default| | ||
+ | |||
+ | ===== Cart pulls only /GAME low (Ultimax mode) ===== | ||
+ | |||
+ | ROMH replaces the KERNAL at $E000, ROML is still at $8000. | ||
+ | |||
+ | ^$0000-0FFF ^$1000-7FFF ^$8000-9FFF ^$A000-CFFF ^$D000-DFFF ^$E000-FFFF ^ | ||
+ | |RAM |unmapped |**__ROML__** |unmapped |I/O |**__ROMH__**| | ||
+ | |||
+ | The VIC-II will also see the first 4kB of ROMH at $3000-3FFF in all of its 16kB banks, with no access to CHARROM. | ||
+ | |||
+ | |||
+ | - White Flame | ||
+ | |||
+ | |||
+ | ====== Related: from Graham' | ||
In the C64/C128 series of computers, slightly modified versions of the 6502 were used. The modifications did not affect the functional part of the processor itself. Only a so-called processor port was added. This port, in combination with an external PLA, was used to map ROM and I/O areas into the 64KB RAM of the C64. Also, some bits of the port were used for the legendary Datasette. | In the C64/C128 series of computers, slightly modified versions of the 6502 were used. The modifications did not affect the functional part of the processor itself. Only a so-called processor port was added. This port, in combination with an external PLA, was used to map ROM and I/O areas into the 64KB RAM of the C64. Also, some bits of the port were used for the legendary Datasette. |
base/memory_management.txt · Last modified: 2022-04-17 05:36 by white_flame