Ticket #8783: createKyradat_NEW.patch
File createKyradat_NEW.patch, 6.5 KB (added by , 16 years ago) |
---|
-
create_kyradat.cpp
199 199 // Sequence Player 200 200 { k2SeqplayPakFiles, kTypeStringList, "S_PAKFILES.TXT" }, 201 201 { k2SeqplayCredits, kTypeRawData, "S_CREDITS.TXT" }, 202 { k2SeqplayCreditsSpecial, kTypeStringList, "S_CREDITS2.TXT" }, 202 203 { k2SeqplayStrings, kTypeLanguageList, "S_STRINGS" }, 203 204 { k2SeqplaySfxFiles, kTypeStringList, "S_SFXFILES.TXT" }, 204 205 { k2SeqplayTlkFiles, kTypeLanguageList, "S_TLKFILES" }, … … 210 211 211 212 // Ingame 212 213 { k2IngamePakFiles, kTypeStringList, "I_PAKFILES.TXT" }, 214 { k2IngameSfxFiles, kTypeStringList, "I_SFXFILES.TXT" }, 215 { k2IngameSfxIndex, kTypeRawData, "I_SFXINDEX.TRA" }, 213 216 { k2IngameTracks, kTypeStringList, "I_TRACKS.TRA" }, 214 217 { k2IngameCDA, kTypeRawData, "I_TRACKS.CDA" }, 215 218 … … 372 375 373 376 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || 374 377 g->special == k2TownsFile1E || g->special == k2TownsFile1J || 375 g->special == k2TownsFile2E || g->special == k2TownsFile2J ) {378 g->special == k2TownsFile2E || g->special == k2TownsFile2J || fmtPatch == 5) { 376 379 // prevents creation of empty entries (which we have mostly between all strings in the fm-towns version) 377 380 while (!data[++i]) { 378 381 if (i == size) … … 429 432 WRITE_BE_UINT32(output, entries); output += 4; 430 433 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || 431 434 g->special == k2TownsFile1E || g->special == k2TownsFile1J || 432 g->special == k2TownsFile2E || g->special == k2TownsFile2J ) {435 g->special == k2TownsFile2E || g->special == k2TownsFile2J || fmtPatch == 5) { 433 436 const byte * c = data + size; 434 437 do { 435 438 if (fmtPatch == 2 && input - data == 0x3C0 && input[0x10] == 0x32) { … … 580 583 int v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr); 581 584 582 585 if (cycle == 0 && v == 1) { 583 if ( g->special == k2FloppyFile1 && *ptr == 5) {584 // patch for floppy version 585 // skips invalid ferbsequence586 if ((g->special == k2FloppyFile1 && *ptr == 5) || (g->special == k2DemoVersion && (ptr - data == 312))) { 587 // patch for floppy version: skips invalid ferb sequence 588 // patch for demo: skips invalid title sequence 586 589 ptr += 54; 587 590 continue; 588 591 } … … 815 818 // return values: 1 = possible frame control data; 0 = definitely not frame control data 816 819 817 820 const uint8 *s = (const uint8*)ptr; 818 for (uint i = 2; i < size; i += 4) {821 for (uint32 i = 2; i < size; i += 4) { 819 822 if (!s[i]) 820 823 return 0; 821 824 } 822 825 823 for (uint i = 1; i < size; i += 2) {826 for (uint32 i = 1; i < size; i += 2) { 824 827 if (s[i]) 825 828 return 0; 826 829 } … … 1090 1093 if (i->id == k2IngamePakFiles) 1091 1094 patch = 4; 1092 1095 } 1096 1097 if (g->special == k2FloppyFile2 || g->special == k2CDFile2E) { 1098 if (i->id == k2IngameSfxFiles) 1099 patch = 5; 1100 } 1093 1101 1094 1102 if (!tDesc->extract(out, g, data + i->startOff, i->endOff - i->startOff, filename, patch)) { 1095 1103 fprintf(stderr, "ERROR: couldn't extract id %d\n", i->id); -
create_kyradat.h
147 147 k2SeqplayTlkFiles, 148 148 k2SeqplaySeqData, 149 149 k2SeqplayCredits, 150 k2SeqplayCreditsSpecial, 150 151 k2SeqplayIntroTracks, 151 152 k2SeqplayFinaleTracks, 152 153 k2SeqplayIntroCDA, 153 154 k2SeqplayFinaleCDA, 154 155 155 156 k2IngamePakFiles, 157 k2IngameSfxFiles, 158 k2IngameSfxIndex, 156 159 k2IngameTracks, 157 160 k2IngameCDA, 158 161 … … 193 196 k2FloppyFile1 = 15, 194 197 k2FloppyFile2 = 16, 195 198 196 k2DemoVersion = 17 199 k2DemoVersion = 17, 197 200 }; 198 201 199 202 struct SpecialExtension { … … 203 206 204 207 enum kGame { 205 208 kKyra1 = 0, 206 kKyra2 = 1,207 kKyra3 = 2209 kKyra2, 210 kKyra3 208 211 }; 209 212 210 213 struct Game { -
hof_cd.h
1 1 const ExtractEntry kyra2File1CDE[] = { 2 2 { k2SeqplayPakFiles, 0x00029FA4, 0x00029FEA }, 3 3 { k2SeqplayCredits, 0x00027920, 0x00028408 }, 4 { k2SeqplayCreditsSpecial, 0x00029E01, 0x00029E1B }, 4 5 { k2SeqplayStrings, 0x0002C566, 0x0002CE7C }, 5 6 { k2SeqplaySfxFiles, 0x0002E284, 0x0002E4B8 }, 6 7 { k2SeqplayTlkFiles, 0x0002A2AC, 0x0002A349 }, … … 23 24 }; 24 25 25 26 const ExtractEntry kyra2File2CDE[] = { 27 { k2IngameSfxFiles, 0x0002CB30, 0x0002D221 }, 28 { k2IngameSfxIndex, 0x000294F0, 0x00029848 }, 26 29 { k2IngameTracks, 0x0002F2FE, 0x0002F37E }, 27 30 { -1, 0, 0 } 28 31 }; -
hof_floppy.h
31 31 32 32 const ExtractEntry kyra2File2E[] = { 33 33 { k2IngamePakFiles, 0x0035E4E, 0x00362ED }, 34 { k2IngameSfxFiles, 0x00034700, 0x00034DF1 }, 35 { k2IngameSfxIndex, 0x0002A710, 0x0002AA68 }, 34 36 { k2IngameTracks, 0x0003B2F2, 0x0003B370 }, 35 37 { -1, 0, 0 } 36 38 }; 37 39 38 40 const ExtractEntry kyra2File2F[] = { 39 41 { k2IngamePakFiles, 0x0003AA9C, 0x0003AB1A }, 42 { k2IngameSfxFiles, 0x00033E24, 0x00034515 }, 43 { k2IngameSfxIndex, 0x000288B0, 0x00028C08 }, 40 44 { k2IngameTracks, 0x0003B2F2, 0x0003B370 }, 41 45 { -1, 0, 0 } 42 46 }; 43 47 44 48 const ExtractEntry kyra2File2G[] = { 45 49 { k2IngamePakFiles, 0x0035626, 0x0035AC5 }, 50 { k2IngameSfxFiles, 0x00033ED8, 0x000345C9 }, 51 { k2IngameSfxIndex, 0x000288E0, 0x00028C38 }, 46 52 { k2IngameTracks, 0x0003AA8C, 0x0003AB0A }, 47 53 { -1, 0, 0 } 48 54 }; -
hof_towns.h
15 15 16 16 const ExtractEntry kyra2File2FMTownsE[] = { 17 17 { k2IngamePakFiles, 0x00000540, 0x0000065C }, 18 { k2IngameSfxFiles, 0x00003E3C, 0x000047A3 }, 19 { k2IngameSfxIndex, 0x00013980, 0x00013CD8 }, 18 20 { k2IngameCDA, 0x0001808C, 0x000181BC }, 19 21 { -1, 0, 0 } 20 22 }; -
misc.h
359 359 const int kyra2CDFile1EngNeed[] = { 360 360 k2SeqplayPakFiles, 361 361 k2SeqplayCredits, 362 k2SeqplayCreditsSpecial, 362 363 k2SeqplayStrings, 363 364 k2SeqplaySfxFiles, 364 365 k2SeqplaySeqData, … … 378 379 }; 379 380 380 381 const int kyra2CDFile2EngNeed[] = { 382 k2IngameSfxFiles, 383 k2IngameSfxIndex, 381 384 k2IngameTracks, 382 385 -1 383 386 }; … … 402 405 403 406 const int kyra2FloppyFile2Need[] = { 404 407 k2IngamePakFiles, 408 k2IngameSfxFiles, 409 k2IngameSfxIndex, 405 410 k2IngameTracks, 406 411 -1 407 412 }; … … 423 428 424 429 const int kyra2TownsFile2EngNeed[] = { 425 430 k2IngamePakFiles, 431 k2IngameSfxFiles, 432 k2IngameSfxIndex, 426 433 k2IngameCDA, 427 434 -1 428 435 };