
[- This text is now obsolete, since you don't need to know how the SRAM
   works to use the new Visual SRAM Manager, but i've included it
   anyway since you can still learn something... -]

SRAM Tutorial
-------------

Since most people obviously doesn't know how the SRAM on the
Doctor GB cards work, I decided to write this brief tutorial.

A Doctor GB card 16M/64M has 1 Megabit SRAM (128 Kilobyte or 131072
bytes) space. But how is this space utilized?

Lets say you want to fill a 64M card with some gbc games. Your
card layout in GBX-Tool v1.0 looks like this:

Cartname        Filesize  Color Jap  SRAM  MBC
----------------------------------------------
BEAT MANIA GB    1048576   Yes  Yes        MBC5
CGBWARIOLAND     2097152   Yes  No   256k  MBC5
HOLLYWOOD PBALL  1048576   Yes  No         MBC5
LOGICAL           131072   Yes  No         MBC5
MARIO DELUXAHYE  1048576  Only  No    64k  MBC5
POKEBOM USA       524288   Yes  No         MBC5
ROADSTERS 98      131072   Yes  No         MBC1
ROX                65536   Yes  Yes   64k  MBC5
TETRIS DX         524288   Yes  Yes   64k  MBC1
VRALLY            524288   Yes  No         MBC5
ZELDA            1048576   Yes  No   256k  MBC5

The order of the games on the cart will be the same as the order in the
layout (which is always A-Z sorted).

If you see the 1M SRAM as 16 64K banks (numbered 0-15), the SRAM usage
for the above layout will look like:
       _______________________________________________
Bank: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|13|14|15|
      |-----------------------------------------------|
Game: |WarioLand2 |  |  |  | Zelda DX  |    Unused    |
       256k (4x64) /\ /\ /\ 256k (4x64)
                   || || ||=Tetris DX, 64k
                   || ||=ROX, 64k
                   ||=MARIO DELUXE, 64k

As you can see, the SRAM usage is in the same order as the games are
listed on the layout and card menu. 

Some examples: If you want to save your Tetris DX scores, select bank
6 as the sram bank (bank offset), and set the bank size to 64K.
To get the savedata from Zelda DX, set the sram bank to 7 (first bank
used by the game), and set the bank size to 256K.

On the GB menu the sram size is shown with an indicator after the
game number:

02 ~ CGBWARIOLAND2

Where ~ means 256Kbit, - means 64kbit and . means no sram.

Note: 16K SRAM is treated exactly the same way as 64K.

-mfm/eur
