Commit Graph

13 Commits

Author SHA1 Message Date
splash5
9d0ac8c27d Fix wrong first/last bank crc32 2023-02-26 15:58:56 +08:00
sanni
9bfa9c3418
Fix some duplicate first bank/last bank CRCs 2023-02-13 11:32:46 +01:00
sanni
b453bf85a8
Fix wrong first/last bank CRC32 for Zelda 1 2023-01-28 16:27:33 +01:00
splash5
b4021f5594 Fix wrong first/last bank crc32 2022-12-25 18:46:02 +08:00
splash5
1d3eecfc14 Fix wrong first bank crc32 2022-12-14 12:31:31 +08:00
sanni
132b2e7031
Only wanted to change MMC3, not the other MMCs (yet)
````
 // 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)); //*16
    }
    else {
      // exponent-multiplier notation
      prgsize = (((1 << (romFile[4] >> 2)) * ((romFile[4] & 0x3) * 2 + 1)) >> 14); //*16
    }
    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
    //else if(mapper == 9){}
    // MMC3
    if(mapper == 4){
      int startoffset = (prgsize/8 - 1) *8 *1024;  
      // Get crc32 of first 512 bytes
      for(int l = 0; l < 512; l++){
        first512[l] = romFile2[startoffset + l];
      }  
    }
    // MMC4
    //else if(mapper == 10){}
    // MMC5
    //else if(mapper == 5){}
    else {
      // Get crc32 of first 512 bytes
      for(int l = 0; l < 512; l++){
      first512[l] = romFile2[l];
      }
    }
    
    CRC32 crc2 = new CRC32();
    crc2.update(first512); 
    checksum512 = String.format("%08X", crc2.getValue());
````
2022-10-05 08:46:35 +02:00
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
nsx0r
e372bcc5e3
Update nes.txt
updated nes.txt to no-intro 2022-10-01
now includes ONLY physical releases, should speed up the process (from 3858 games to 3108)
2022-10-01 08:17:48 +02:00
nsx0r
e3978a86a5
typos... sorry!
fixed and double-checked
2022-07-19 16:54:14 +02:00
nsx0r
816428604e
fixed and update to no-intro 2022-07-18
previous version was all kinds of wrong
2022-07-19 16:34:05 +02:00
sanni
9d4336741e
Improve NES cart detection 2022-07-07 10:52:25 +02:00
sanni
f4eaca88c8
Add no-intro database to NES 2022-07-07 00:10:51 +02:00
sanni
8b96d250bd Add MD database 2022-06-16 17:17:16 +02:00