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());
````
This commit is contained in:
sanni 2022-10-05 08:46:35 +02:00 committed by GitHub
parent f52df29266
commit 132b2e7031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -455,7 +455,7 @@ Anticipation (USA).nes
99A9F57E,E1051960,4E45531A020410085000000000000001
Aoki Ookami to Shiroki Mejika - Genchou Hishi (Japan).nes
6F4E4312,B2AA7578,4E45531A202052080000900000000001
6F4E4312,4AB267F7,4E45531A202052080000900000000001
Aoki Ookami to Shiroki Mejika - Genghis Khan (Japan).nes
FB69743A,D590DC93,4E45531A100012080000770700000001
@ -719,7 +719,7 @@ Bandai Golf - Challenge Pebble Beach (USA).nes
6CD46979,4A371110,4E45531A020431082000000000000001
Bandit Kings of Ancient China (USA).nes
15FE6D0F,B2AA7578,4E45531A101052080000770000000001
15FE6D0F,A13FC775,4E45531A101052080000770000000001
Bao Xiao San Guo (Asia) (Unl) (Alt).nes
CE102393,E35B7365,4E45531A4000F2080000700703000001
@ -1376,10 +1376,10 @@ Castlevania II - Simon's Quest (USA).nes
C471E42D,A098D92E,4E45531A081010080000000000000001
Castlevania III - Dracula's Curse (Europe).nes
671F23A8,B2AA7578,4E45531A101050080000000001000001
671F23A8,0859305A,4E45531A101050080000000001000001
Castlevania III - Dracula's Curse (USA).nes
ED2465BE,B2AA7578,4E45531A101050080000000000000001
ED2465BE,C48ACF2C,4E45531A101050080000000000000001
Cat Ninden Teyandee (Japan).nes
45878D7F,2FA35461,4E45531A081040080000000000000001
@ -1760,7 +1760,7 @@ Daikaijuu Deburas (Japan).nes
956E3D90,7A565B41,4E45531A082042080000700000000001
Daikoukai Jidai (Japan).nes
FE3488D1,B2AA7578,4E45531A201052080000770000000001
FE3488D1,F29477E0,4E45531A201052080000770000000001
Daiku no Gen-san (Japan).nes
78211EBF,E9CBB26E,4E45531A081040080000000000000001
@ -2450,10 +2450,10 @@ Emoyan no 10 Bai Pro Yakyuu (Japan).nes
9D45D8EC,005638D5,4E45531A081012080000700000000001
Empereur, L' (Japan).nes
6396B988,B2AA7578,4E45531A101052080000770000000001
6396B988,779CF65C,4E45531A101052080000770000000001
Empereur, L' (USA).nes
9C18762B,B2AA7578,4E45531A101052080000770000000001
9C18762B,05B635D5,4E45531A101052080000770000000001
English, Pyramid (Korea) (Unl).nes
301D4AB8,81861B98,4E45531A020260980000000000000001
@ -3140,7 +3140,7 @@ Gekitou Stadium!! (Japan).nes
481519B1,17ACCD7F,4E45531A081010080000000000000001
Gemfire (USA).nes
0EC6C023,B2AA7578,4E45531A102052080000700000000001
0EC6C023,BB36D7BA,4E45531A102052080000700000000001
GemVenture (USA) (Aftermarket) (Homebrew).nes
9C124B0E,B32BB7AE,4E45531A020020080000000700000001
@ -3410,7 +3410,7 @@ Gun Nac (USA).nes
D19DCB2B,4DB5CE50,4E45531A081040080000000000000001
Gun Sight (Japan).nes
0AFB395E,B2AA7578,4E45531A081050080000000000000008
0AFB395E,E5E02A88,4E45531A081050080000000000000008
Gun-Dec (Japan).nes
619BEA12,91DA6EB3,4E45531A081040080000000000000001
@ -3953,7 +3953,7 @@ Isaki Shuugorou no Keiba Hisshou Gaku (Japan).nes
18D44BBA,533852CA,4E45531A100012080000700700000001
Ishin no Arashi (Japan).nes
1CED086F,B2AA7578,4E45531A101052080000770000000001
1CED086F,A56C4FF5,4E45531A101052080000770000000001
Isolated Warrior (Europe).nes
4BB9B840,A00D525F,4E45531A081040080000000001000001
@ -4145,7 +4145,7 @@ Jurassic Park (USA).nes
3B7F5B3B,7B05BD9C,4E45531A081040080000070000000001
Just Breed (Japan).nes
9CBADC25,B2AA7578,4E45531A202052080000700000000001
9CBADC25,40760EFD,4E45531A202052080000700000000001
Justice Duel (USA) (RetroGameCon 5 Edition) (Aftermarket) (Unl).nes
E3879A83,4C16FA70,4E45531A041042080000070002000002
@ -4571,7 +4571,7 @@ Lasalle Ishii no Child's Quest (Japan).nes
D97C31B0,3559FCB5,4E45531A0808E1C80000000000000001
Laser Invasion (USA).nes
B0480AE9,B2AA7578,4E45531A081050080000000000000008
B0480AE9,B1FDA28D,4E45531A081050080000000000000008
Last Action Hero (USA).nes
E7DA8A04,7CC3E67F,4E45531A081040080000000000000001
@ -5222,7 +5222,7 @@ Metal Max (Japan).nes
9509F703,1DDCCD8B,4E45531A102042080000700000000001
Metal Slader Glory (Japan).nes
B4735FAC,B2AA7578,4E45531A204050080000000000000001
B4735FAC,3A1B45EF,4E45531A204050080000000000000001
Metal Slug Advance (Europe, Asia) (En) (Aftermarket) (Pirate).nes
8761D5C8,3701C245,4E45531A081040082000000000000001
@ -5897,16 +5897,16 @@ Noah's Ark (Europe).nes
81B2A3CD,B1E99617,4E45531A081040080000070001000001
Nobunaga no Yabou - Bushou Fuuun Roku (Japan) (Rev 1).nes
A1617DFA,B2AA7578,4E45531A202052080000900000000001
A1617DFA,673ECA96,4E45531A202052080000900000000001
Nobunaga no Yabou - Bushou Fuuun Roku (Japan).nes
F540677B,B2AA7578,4E45531A202052080000900000000001
F540677B,673ECA96,4E45531A202052080000900000000001
Nobunaga no Yabou - Sengoku Gunyuuden (Japan) (Rev 1).nes
F9B4240F,B2AA7578,4E45531A101052080000770000000001
F9B4240F,01347137,4E45531A101052080000770000000001
Nobunaga no Yabou - Sengoku Gunyuuden (Japan).nes
EEE9A682,B2AA7578,4E45531A101052080000770000000001
EEE9A682,AFF59444,4E45531A101052080000770000000001
Nobunaga no Yabou - Zenkoku Ban (Japan) (Rev 1).nes
2B11E0B0,ABE71F62,4E45531A100012080000770700000001
@ -5918,7 +5918,7 @@ Nobunaga's Ambition (USA).nes
4642DDA6,3BA26686,4E45531A100012080000770700000001
Nobunaga's Ambition II (USA).nes
8CE478DB,B2AA7578,4E45531A101052080000770000000001
8CE478DB,ED289AAE,4E45531A101052080000770000000001
NOFX Cover Cart Vol. 1 (World) (Aftermarket) (Homebrew).nes
D5A4944F,BD7BC39F,4E45531A080420480000000000000001
@ -6839,7 +6839,7 @@ Romance of the Three Kingdoms (USA).nes
C6182024,86F44215,4E45531A100012080000770700000001
Romance of the Three Kingdoms II (USA).nes
F011E490,B2AA7578,4E45531A102052080000900000000001
F011E490,AA9B3803,4E45531A102052080000900000000001
Romancia (Japan).nes
CF9CF7A2,5B051863,4E45531A080010080000000700000001
@ -6857,7 +6857,7 @@ Route-16 Turbo (Japan).nes
728BFA8D,33E2E2E9,4E45531A020100080000000000000001
Royal Blood (Japan).nes
BC80FB52,B2AA7578,4E45531A102052080000700000000001
BC80FB52,485DFCF4,4E45531A102052080000700000000001
RPG Jinsei Game (Japan).nes
07D92C31,EDF4F5FD,4E45531A101062780000700000000001
@ -6935,10 +6935,10 @@ Sangokushi - Chuugen no Hasha (Japan).nes
E64B8975,136FF556,4E45531A081032185000700000000001
Sangokushi II (Japan) (Rev 1).nes
EE8E6553,B2AA7578,4E45531A102052080000900000000001
EE8E6553,1652DF2A,4E45531A102052080000900000000001
Sangokushi II (Japan).nes
184C2124,B2AA7578,4E45531A102052080000900000000001
184C2124,D805E3F2,4E45531A102052080000900000000001
Sangokushi II - Haou no Tairiku (Japan).nes
098C672A,2FD636B9,4E45531A102032183000700000000001
@ -7166,7 +7166,7 @@ Shikinjou (Japan).nes
9B53F848,C17D1CE6,4E45531A080010080000000700000001
Shin 4 Nin Uchi Mahjong - Yakuman Tengoku (Japan).nes
D532E98F,B2AA7578,4E45531A101052080000700000000001
D532E98F,F417743F,4E45531A101052080000700000000001
Shin Jinrui - The New Type (Japan).nes
43B0944B,17C00A10,4E45531A020431082000000000000001
@ -7277,7 +7277,7 @@ Silver Surfer (USA).nes
BEE1C0D9,A53C16FD,4E45531A082040080000070000000001
SimCity (USA) (Proto).nes
FDC7C50B,B2AA7578,4E45531A081052080000770000000001
FDC7C50B,32C81CB6,4E45531A081052080000770000000001
Simpsons, The - Bart vs. the Space Mutants (Europe).nes
DE7E4629,F328AA5B,4E45531A081010080000000001000001
@ -7736,7 +7736,7 @@ Sugoro Quest - Dice no Senshitachi (Japan).nes
1411005B,A279B87C,4E45531A081042080000700000000001
Suikoden - Tenmei no Chikai (Japan).nes
39F2CE4B,B2AA7578,4E45531A101052080000770000000001
39F2CE4B,64C55B10,4E45531A101052080000770000000001
Sukeban Deka III (Japan).nes
02863604,967E8DDF,4E45531A080021082000000700000001
@ -8675,7 +8675,7 @@ Uchusen - Ultimate PLOID Battle (USA, Europe) (Aftermarket) (Unl).nes
6C9BB61A,5305C186,4E45531A2000E3180000070800000001
Uchuu Keibitai SDF (Japan).nes
BB7F829A,B2AA7578,4E45531A081050080000000000000001
BB7F829A,B95C0767,4E45531A081050080000000000000001
Uchuusen Cosmo Carrier (Japan).nes
3D1C3137,B80D3952,4E45531A0810E0481000000000000001
@ -8747,7 +8747,7 @@ Uncanny X-Men, The (USA).nes
2D41EF92,D5B427C2,4E45531A080021082000000700000001
Uncharted Waters (USA).nes
ACA15643,B2AA7578,4E45531A201052080000770000000001
ACA15643,CCBEEE99,4E45531A201052080000770000000001
Uninvited (USA) (Beta) (1990-07-04).nes
56EBE5DE,44171E51,4E45531A102042080000700000000001
@ -9327,3 +9327,4 @@ Zunou Senkan Galg (Japan) (En) (Beta).nes
Zunou Senkan Galg (Japan) (En).nes
EC0517C4,DB4C26B2,4E45531A020100080000000000000001