Konami Sound Cartridge - Using The Memory

Using The Memory

Everything is done using memory-mapped I/O and it is much like the SCC ROM cartridges.

As with SCC cartridges, the memory is divided into four memory banks of 8kB:

Bank 1
4000h - 5FFFh
Bank 2
6000h - 7FFFh
Bank 3
8000h - 9FFFh
Bank 4
A000h - BFFFh

To change the mapping, write to one of these addresses:

Bank 1
5000h - 57FFh
Bank 2
7000h - 77FFh
Bank 3
9000h - 97FFh
Bank 4
B000h - B7FFh

Bits 3 through 7 are ignored. Values 0 to 7 select 8kB pages of the lower 64kB (which is included with Snatcher) and values 8 to 15 the higher 64kB (which is included with SD Snatcher).

By default (after reset) bank 1 selected area 0, bank 2 area 1, bank 3 area 2 and bank 4 area 3. Again this is the same as SCC ROM cartridges. If the lower 64kB is empty (as it is with the Super Deform Snatcher cartridge) then the memory will be empty (reads FFh).

By default, the RAM cannot be changed. By setting a bit somewhere else the areas can no longer be changed (ROM mode) but can be written to (RAM mode). This is done by writing to the mode register, which is always accessible through address BFFEh and BFFFh. The SCC can be put in also be put in SCC+ mode through this register, where channel 4 and 5 do not share a waveform.

bit 7
no function
bit 6
no function
bit 5
if set, sound chip is in SCC+ mode otherwise SCC compatibility
bit 4
if set, banks 1 to 3 are in RAM mode otherwise area select
bit 3
no function
bit 2
if set and bit 5 reset, bank 3 is RAM mode irrespective of bit 4
bit 1
if set, bank 2 is RAM mode irrespective of bit 4
bit 0
if set, bank 1 is RAM mode irrespective of bit 4

Even in RAM mode the memory under BFFEh and BFFFh cannot be changed through those addresses as that will always end up in the mode register.

Konami uses 20h and 3Fh for the mode register as they always use SCC+ mode. 30h would also work for RAM mode.

Read more about this topic:  Konami Sound Cartridge

Famous quotes containing the word memory:

    We went to Mannheim and attended a shivaree—otherwise an opera—the one called “Lohengrin.” The banging and slamming and booming and crashing were something beyond belief. The racking and pitiless pain of it remains stored up in my memory alongside the memory of the time that I had my teeth fixed.
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)