cartreader/sd
sanni f52df29266
Add auto mapper detecting for MMC3 carts
"E000-FFFF is always fixed to the last bank of ROM." Source: http://kevtris.org/mappers/mmc3/index.html
Therefore calculate CRC32 of the first 512 bytes of the last bank of the PRG ROM instead of the first bank.

Database creation code example:

````
// Convert iNES to useful info (thx to fceux)
    mapper = (romFile[6] >> 4);
    mapper |= (romFile[7] & 0xF0);
    mapper |= ((romFile[8] & 0x0F) << 8);

    // PRG size
    if ((romFile[9] & 0x0F) != 0x0F) {
      // simple notation
      prgsize = (romFile[4] | ((romFile[9] & 0x0F) << 8)); 
    }
    else {
      // exponent-multiplier notation
      prgsize = (((1 << (romFile[4] >> 2)) * ((romFile[4] & 0x3) * 2 + 1)) >> 14); 
    }
    if (prgsize != 0)
      prgsize = (int(log(prgsize) / log(2)));
              
    prgsize = (int_pow(2, prgsize)) * 16;
    
    byte[] first512 = new byte[512];
     
    // MMC1
    if(mapper == 1){
    }
     // MMC2
    if(mapper == 9){
    }
    // MMC3
    if(mapper == 4){
	// MMC3 has 8KB banks
      int startoffset = (prgsize/8 - 1) *8 *1024;  
      // Get crc32 of first 512 bytes of last PRG bank
      for(int l = 0; l < 512; l++){
        first512[l] = romFile[16 + startoffset + l];
      }  
    }
    // MMC4
    else if(mapper == 10){
    }
    // MMC5
    else if(mapper == 5){
    }
    else {
      // Get crc32 of first 512 bytes after iNES header
      for(int l = 0; l < 512; l++){
      first512[l] = romFile[16 + l];
      }
    }
````
2022-10-04 22:31:23 +02:00
..
32x.txt Add files via upload 2022-09-18 20:44:12 +02:00
colv.txt Add files via upload 2022-07-24 10:34:33 +02:00
gb.txt updated 2022-07-19 18:48:39 +02:00
gba.txt Update GBA database 2022-09-27 19:12:48 +02:00
gg.txt gg.txt encoding modified 2022-07-25 13:12:04 +02:00
intv.txt Add files via upload 2022-07-24 10:34:33 +02:00
md.txt Add files via upload 2022-08-26 13:09:40 +02:00
n64.txt Update n64.txt 2022-08-25 20:10:50 +02:00
nes20db.txt Add files via upload 2022-07-07 11:42:05 +02:00
nes.txt Add auto mapper detecting for MMC3 carts 2022-10-04 22:31:23 +02:00
pce.txt updated 2022-07-19 19:03:51 +02:00
pcw.txt Add support for Benesse Pocket Challenge W Module (thx to skaman) 2022-09-25 10:36:55 +02:00
README.md Update README.md 2022-08-22 18:14:41 +02:00
sms.txt updated 2022-07-19 18:58:03 +02:00
snes.txt Update SNES database to 20220812 2022-08-22 17:50:41 +02:00
vb.txt Add Virtual Boy and Watara Supervision databases 2022-08-21 12:22:48 +02:00
wsv.txt Add Virtual Boy and Watara Supervision databases 2022-08-21 12:22:48 +02:00

Copy these files to the root of your SD card. If you're on Linux or MAC make sure the Windows style line endings(CRLF) don't get removed.

Hint: You can select all the databases, right-click, properties, mark checkbox Hidden and now they won't show up in the Cart Reader's file browser.

gb.txt / gg.txt / md.txt / pce.txt / sms.txt / vb.txt

These files store the ROM names and the CRC32 checksums of the complete ROM and are used only for verification at the end of the dumping process.

Example:
007 - The World Is Not Enough (USA, Europe).gbc
E038E666

Name
CRC32

colv.txt / wsv.txt

Stores the ROM name, CRC32 of the complete ROM, CRC32 of the first 512 bytes and size in KB, since the size is not stored in the ROM it is needed for dumping.

Example:
Artillery Duel (USA).col
6F88FCF0,48474D52,16

Name
CRC32 (complete ROM), CRC32 (512 bytes), size in KB

gba.txt

This file stores the GBA database which is needed because the save type and rom size are not stored inside the rom.

Example:
007 - Everything or Nothing (USA, Europe) (En,Fr,De).gba
9D4F1E18,BJBE,08,1

Name
CRC32, game id, size in MByte, savetype

Savetypes:
0 = Unknown or no save
1 = 4k Eeprom
2 = 64K Eeprom
3 = 256K Sram
4 = 512K Flash
5 = 1024K Flash
6 = 512K Sram

intv.txt

This file stores the Intellivision database which is needed because the save type and rom size are not stored inside the rom.

Example:
Air Strike (USA) (Proto).int
2C668249,1BB8CBB9,0,08,0

Name
CRC32(whole ROM), CRC32(first 512bytes), mapper, size in KB, save

n64.txt

This file stores the N64 database which is needed because the save type and rom size are not stored inside the rom.
The CRC32 checksum is used to verify a good dump.

Example:
007 - The World Is Not Enough (Europe) (En,Fr,De).z64
002C3B2A,3B941695,32,0

Name
CRC32, ROM internal CRC1, size in MByte, savetype

Savetypes:
0 = no save chip
1 = SRAM
4 = Flashram
5 = 4K Eeprom
6 = 16K Eeprom

nes.txt

This file stores the CRC32 of the complete ROM minus the iNES header, the CRC32 of the first 512 bytes after the iNES header and the iNES Header. The iNES header holds all the mapping info.

Example:
89 Dennou Kyuusei Uranai (Japan).nes
BA58ED29,716956B4,4E45531A100010080000070700000001

Name
CRC32 (prg+chr combined), CRC32 (512 bytes), iNES Header

nes20db.txt

This file stores NES 2.0 data about NES ROMs, generated from NewRisingSun's nes20db XML file on NesDev. Converting updated versions of the XML file to this format requires compiling and running NES20Tool with the following options at runtime:

NES20Tool -operation transform -xml-file nes20db.xml -xml-format nes20db -format-transform-type sanni -format-transform-destination nes20db.txt

snes.txt

This file is needed for odd sized SNES games like Final Fantasy (JAP), Super Metroid(US/JAP) or Tales of Symphonia. Without this file you will get overdumps and the checksum calculation will fail.

Example:
2020 Super Baseball (Japan).sfc E95A3DD7,0C19,379A6FFB,12,024

Name
CRC32, internal checksum, CRC32 of header area(0xFFB0-0xFFFF), size in Mbit, number of banks (lorom needs twice as many banks as hirom for the same rom size, lorom: 32kb banks, hirom: 64kb banks)