Ticket #8772: createKyraDatV2.patch
File createKyraDatV2.patch, 30.6 KB (added by , 17 years ago) |
---|
-
create_kyradat.cpp
31 31 #include "md5.h" 32 32 33 33 enum { 34 kKyraDatVersion = 1 7,34 kKyraDatVersion = 18, 35 35 kIndexSize = 12 36 36 }; 37 37 … … 45 45 #include "towns.h" 46 46 #include "amiga.h" 47 47 48 #include "hof_floppy.h" 49 #include "hof_towns.h" 50 #include "hof_cd.h" 51 #include "hof_demo.h" 52 48 53 const Game kyra1FanTranslations[] = { 49 54 { kKyra1, IT_ITA, kTalkieVersion, "d0f1752098236083d81b9497bd2b6989", kyra1FreCD }, 50 55 GAME_DUMMY_ENTRY … … 54 59 bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0); 55 60 bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0); 56 61 bool extractShapes(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0); 62 bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0); 63 int extractHofSeqData_checkString(void * ptr, uint8 checkSize); 64 int extractHofSeqData_isSequence(void * ptr, const Game *g, uint32 maxCheckSize); 65 int extractHofSeqData_isControl(void * ptr, uint32 size); 57 66 58 void createFilename(char *dstFilename, const int lang, const int special, const char *filename);59 void createLangFilename(char *dstFilename, const int lang, const int special, const char *filename);67 void createFilename(char *dstFilename, const int gid, const int lang, const int special, const char *filename); 68 void createLangFilename(char *dstFilename, const int gid, const int lang, const int special, const char *filename); 60 69 61 70 const ExtractType extractTypeTable[] = { 62 71 { kTypeLanguageList, extractStrings, createLangFilename }, … … 64 73 { kTypeRoomList, extractRooms, createFilename }, 65 74 { kTypeShapeList, extractShapes, createFilename }, 66 75 { kTypeRawData, extractRaw, createFilename }, 76 77 { k2TypeSeqData, extractHofSeqData, createFilename }, 78 67 79 { -1, 0, 0} 68 80 }; 69 81 … … 133 145 // IMAGE filename table 134 146 { kCharacterImageFilenames, kTypeStringList, "CHAR-IMAGE.TXT" }, 135 147 148 // AUDIO filename table 149 { kAudioTracks, kTypeStringList, "TRACKS.TXT" }, 150 { kAudioTracksIntro, kTypeStringList, "TRACKSINT.TXT" }, 151 136 152 // AMULET anim 137 153 { kAmuleteAnimSeq, kTypeRawData, "AMULETEANIM.SEQ" }, 138 154 … … 172 188 { kPaletteList33, kTypeRawData, "PALTABLE33.PAL" }, 173 189 174 190 // FM-TOWNS specific 175 { kKyra1TownsSFXTable, kTypeRawData, "SFXTABLE" }, 191 { kKyra1TownsSFXwdTable, kTypeRawData, "SFXWDTABLE" }, 192 { kKyra1TownsSFXbtTable, kTypeRawData, "SFXBTTABLE" }, 193 { kKyra1TownsCDATable, kTypeRawData, "CDATABLE" }, 176 194 { kCreditsStrings, kTypeRawData, "CREDITS" }, 177 { kMenuSKB, kTypeStringList, "MENUSKB" },178 { kSjisVTable, kTypeRawData, "SJISTABLE" },179 195 196 197 // HAND OF FATE 198 199 // Sequence Player 200 { k2SeqplayPakFiles, kTypeStringList, "S_PAKFILES.TXT" }, 201 { k2SeqplayCredits, kTypeRawData, "S_CREDITS.TXT" }, 202 { k2SeqplayStrings, kTypeLanguageList, "S_STRINGS" }, 203 { k2SeqplaySfxFiles, kTypeStringList, "S_SFXFILES.TXT" }, 204 { k2SeqplayTlkFiles, kTypeLanguageList, "S_TLKFILES" }, 205 { k2SeqplaySeqData, k2TypeSeqData, "S_DATA.SEQ" }, 206 { k2SeqplayIntroTracks, kTypeStringList, "S_INTRO.TRA" }, 207 { k2SeqplayFinaleTracks, kTypeStringList, "S_FINALE.TRA" }, 208 { k2SeqplayIntroCDA, kTypeRawData, "S_INTRO.CDA" }, 209 { k2SeqplayFinaleCDA, kTypeRawData, "S_FINALE.CDA" }, 210 211 // Ingame 212 { k2IngamePakFiles, kTypeStringList, "I_PAKFILES.TXT" }, 213 { k2IngameTracks, kTypeStringList, "I_TRACKS.TRA" }, 214 { k2IngameCDA, kTypeRawData, "I_TRACKS.CDA" }, 215 180 216 { -1, 0, 0 } 181 217 }; 182 218 … … 207 243 return false; 208 244 209 245 const ExtractType *type = findExtractType(i->type); 210 type->createFilename(dstFilename, g-> lang, g->special, i->filename);246 type->createFilename(dstFilename, g->game, g->lang, g->special, i->filename); 211 247 return true; 212 248 } 213 249 214 void createFilename(char *dstFilename, const int lang, const int special, const char *filename) {250 void createFilename(char *dstFilename, const int gid, const int lang, const int special, const char *filename) { 215 251 strcpy(dstFilename, filename); 252 253 static const char *gidExtensions[] = { "", ".K2", ".K3" }; 254 strcat(dstFilename, gidExtensions[gid]); 216 255 217 256 for (const SpecialExtension *specialE = specialTable; specialE->special != -1; ++specialE) { 218 257 if (specialE->special == special) { … … 223 262 } 224 263 } 225 264 226 void createLangFilename(char *dstFilename, const int lang, const int special, const char *filename) {265 void createLangFilename(char *dstFilename, const int gid, const int lang, const int special, const char *filename) { 227 266 strcpy(dstFilename, filename); 228 267 229 268 for (const Language *langE = languageTable; langE->lang != -1; ++langE) { 230 269 if (langE->lang == lang) { 231 270 strcat(dstFilename, "."); … … 233 272 break; 234 273 } 235 274 } 275 276 static const char *gidExtensions[] = { "", ".K2", ".K3" }; 277 strcat(dstFilename, gidExtensions[gid]); 236 278 237 279 for (const SpecialExtension *specialE = specialTable; specialE->special != -1; ++specialE) { 238 280 if (specialE->special == special) { … … 328 370 ++entries; 329 371 } 330 372 331 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) { 373 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || 374 g->special == k2TownsFile1E || g->special == k2TownsFile1J || 375 g->special == k2TownsFile2E || g->special == k2TownsFile2J) { 332 376 // prevents creation of empty entries (which we have mostly between all strings in the fm-towns version) 333 377 while (!data[++i]) { 334 378 if (i == size) … … 364 408 if (g->special == kFMTownsVersionE) 365 409 targetsize--; 366 410 if (g->special == kFMTownsVersionJ) 367 targetsize += 2; 411 targetsize += 2; 368 412 entries += (g->special - 1); 369 413 } 414 415 if (fmtPatch == 3) { 416 entries++; 417 targetsize++; 418 } 419 420 if (fmtPatch == 4) { 421 targetsize -= 9; 422 } 370 423 371 424 uint8 *buffer = new uint8[targetsize]; 372 425 assert(buffer); … … 374 427 const uint8 *input = (const uint8*) data; 375 428 376 429 WRITE_BE_UINT32(output, entries); output += 4; 377 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) { 430 if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || 431 g->special == k2TownsFile1E || g->special == k2TownsFile1J || 432 g->special == k2TownsFile2E || g->special == k2TownsFile2J) { 378 433 const byte * c = data + size; 379 434 do { 380 435 if (fmtPatch == 2 && input - data == 0x3C0 && input[0x10] == 0x32) { 381 436 memcpy(output, input, 0x0F); 382 437 input += 0x11; output += 0x0F; 383 438 } 439 384 440 strcpy((char*) output, (const char*) input); 385 441 uint32 stringsize = strlen((const char*)output) + 1; 386 442 input += stringsize; output += stringsize; … … 394 450 *output++ = *input; 395 451 } 396 452 453 // insert one dummy string at hof sequence strings position 59 454 if (fmtPatch == 3) { 455 if ((g->special == k2TownsFile1E && input - data == 0x695) || 456 (g->special == k2TownsFile1J && input - data == 0x598)) 457 *output++ = *input; 458 } 459 397 460 if (++input == c) 398 461 break; 399 462 } … … 424 487 } 425 488 targetsize = dstPos + 4; 426 489 } else { 427 memcpy(output, data, size); 490 uint32 copySize = size; 491 if (fmtPatch == 4) { 492 memcpy(output, data, 44); 493 output += 44; 494 data += 44; 495 for (int t = 1; t != 10; t++) { 496 sprintf((char*) output, "COST%d_SH.PAK", t); 497 output += 13; 498 } 499 data += 126; 500 copySize -= 170; 501 } 502 memcpy(output, data, copySize); 428 503 } 429 504 430 505 return out.addFile(filename, buffer, targetsize); … … 474 549 return out.addFile(filename, buffer, size + 1 * 4); 475 550 } 476 551 552 bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) { 553 int numSequences = 0; 554 int numNestedSequences = 0; 555 556 uint16 headerSize = 50 * sizeof(uint16); 557 uint16 bufferSize = size + headerSize; 558 byte *buffer = new byte[bufferSize]; 559 assert(buffer); 560 memset(buffer, 0, bufferSize ); 561 uint16 *header = (uint16*) buffer; 562 byte *output = buffer + headerSize; 563 uint16 *hdout = header; 564 565 //debug(1, "\nProcessing Hand of Fate sequence data:\n--------------------------------------\n"); 566 for (int cycle = 0; cycle < 2; cycle++) { 567 byte * ptr = (byte*) data; 568 hdout++; 569 570 const byte * endOffs = (const byte *) (data + size); 571 572 // detect sequence structs 573 while (ptr < endOffs) { 574 if (ptr[1]) { 575 error("invalid sequence data encountered"); 576 delete [] buffer; 577 return false; 578 } 579 580 int v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr); 581 582 if (cycle == 0 && v == 1) { 583 if (g->special == k2FloppyFile1 && *ptr == 5) { 584 // patch for floppy version 585 // skips invalid ferb sequence 586 ptr += 54; 587 continue; 588 } 589 590 numSequences++; 591 uint16 relOffs = (uint16) (output - buffer); 592 WRITE_LE_UINT16(hdout, relOffs); 593 hdout++; 594 595 /*char cc[15]; 596 cc[14] = 0; 597 if (ptr[2]) { 598 memcpy(cc, ptr + 2, 14); 599 debug(1, "adding sequence with file: %s, output file offset: 0x%x", cc, relOffs); 600 } else if (ptr[16]) { 601 memcpy(cc, ptr + 16, 14); 602 debug(1, "adding sequence with file: %s, output file offset: 0x%x", cc, relOffs); 603 } else if (ptr[0] == 4) { 604 debug(1, "adding sequence (text only), output file offset: 0x%x", relOffs); 605 //}*/ 606 607 memcpy(output , ptr, 30); 608 ptr += 30; 609 output += 30; 610 611 if (g->special == k2TownsFile1E) { 612 memcpy(output , ptr, 2); 613 ptr += 2; 614 output += 2; 615 } else { 616 *output++ = READ_LE_UINT16(ptr) & 0xff; 617 ptr += 2; 618 *output++ = READ_LE_UINT16(ptr) & 0xff; 619 ptr += 2; 620 } 621 622 memcpy(output, ptr, 14); 623 ptr += 18; 624 output += 14; 625 memcpy(output, ptr, 2); 626 ptr += 2; 627 output+= 2; 628 629 } else if (cycle == 1 && v != 1 && v != -2) { 630 uint16 controlOffs = 0; 631 if (v) { 632 byte * ctrStart = ptr; 633 while (v && v != -2) { 634 ptr++; 635 v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr); 636 } 637 638 if (v == -2) 639 break; 640 641 uint16 ctrSize = (uint16) (ptr - ctrStart); 642 643 if (g->special != k2DemoVersion && 644 extractHofSeqData_isControl(ctrStart, ctrSize)) { 645 646 controlOffs = (uint16) (output - buffer); 647 //debug(1, "frame control encountered, size: %d, output file offset: 0x%x", ctrSize, controlOffs); 648 memcpy(output, ctrStart, ctrSize); 649 output += ctrSize; 650 } 651 } 652 653 numNestedSequences++; 654 uint16 relOffs = (uint16) (output - buffer); 655 WRITE_LE_UINT16(hdout, relOffs); 656 hdout++; 657 658 /*char cc[15]; 659 cc[14] = 0; 660 memcpy(cc, ptr + 2, 14); 661 debug(1, "adding nested sequence with file: %s, output file offset: 0x%x", cc, relOffs);*/ 662 663 memcpy(output , ptr, 22); 664 ptr += 26; 665 output += 22; 666 memcpy(output, ptr, 4); 667 ptr += 4; 668 output += 4; 669 670 if (!READ_LE_UINT32(ptr)) 671 controlOffs = 0; 672 //else if (controlOffs) 673 // debug(1, "assigning frame control with output file offset 0x%x to item %s (output file offset: 0x%x)", controlOffs, cc, relOffs); 674 675 WRITE_LE_UINT16(output, controlOffs); 676 if (g->special != k2DemoVersion) 677 ptr += 4; 678 output += 2; 679 680 if (g->special != k2DemoVersion) { 681 memcpy(output, ptr, 4); 682 ptr += 4; 683 } else { 684 WRITE_LE_UINT32(output, 0); 685 } 686 687 output+= 4; 688 if (g->special == k2TownsFile1E) 689 ptr += 2; 690 691 } else if (cycle == 0) { 692 while (v != 1 && v != -2) { 693 ptr++; 694 v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr); 695 } 696 697 if (v == -2) 698 break; 699 700 /*char cc[15]; 701 cc[14] = 0; 702 if (ptr[2]) 703 memcpy(cc, ptr + 2, 14); 704 else 705 memcpy(cc, ptr + 16, 14); 706 debug(1, "next item: sequence with file %s", cc);*/ 707 708 } else if (cycle == 1) { 709 while (v == 1 && v != -2) { 710 ptr++; 711 v = extractHofSeqData_isSequence(ptr, g, endOffs - ptr); 712 } 713 714 if (v == -2) 715 break; 716 } 717 } 718 } 719 720 uint16 finHeaderSize = (2 + numSequences + numNestedSequences) * sizeof(uint16); 721 uint16 finBufferSize = ((output - buffer) - headerSize) + finHeaderSize; 722 byte *finBuffer = new byte[finBufferSize]; 723 assert(finBuffer); 724 uint16 diff = headerSize - finHeaderSize; 725 uint16 *finHeader = (uint16*) finBuffer; 726 727 for (int i = 1; i < finHeaderSize; i++) 728 WRITE_LE_UINT16(&finHeader[i], (READ_LE_UINT16(&header[i]) - diff)); 729 WRITE_LE_UINT16(finHeader, numSequences); 730 WRITE_LE_UINT16(&finHeader[numSequences + 1], numNestedSequences); 731 memcpy (finBuffer + finHeaderSize, buffer + headerSize, finBufferSize - finHeaderSize); 732 delete [] buffer; 733 734 finHeader = (uint16*) (finBuffer + ((numSequences + 2) * sizeof(uint16))); 735 for (int i = 0; i < numNestedSequences; i++) { 736 uint8 * offs = finBuffer + READ_LE_UINT16(finHeader++) + 26; 737 uint16 ctrl = READ_LE_UINT16(offs); 738 if (ctrl) 739 ctrl -= diff; 740 WRITE_LE_UINT16(offs, ctrl); 741 } 742 743 744 //debug(1, "\n\nFinished.\n"); 745 746 return out.addFile(filename, finBuffer, finBufferSize); 747 } 748 749 int extractHofSeqData_checkString(void * ptr, uint8 checkSize) { 750 // return values: 1 = text; 0 = zero string; -1 = other 751 752 int t = 0; 753 int c = checkSize; 754 uint8 * s = (uint8*) ptr; 755 756 // check for character string 757 while (c--) { 758 if (*s > 31 && *s < 123) 759 t++; 760 s++; 761 } 762 763 if (t == checkSize) 764 return 1; 765 766 // check for zero string 767 c = checkSize; 768 uint32 sum = 0; 769 s = (uint8*) ptr; 770 while (c--) 771 sum += *s++; 772 773 return (sum) ? -1 : 0; 774 } 775 776 int extractHofSeqData_isSequence(void * ptr, const Game *g, uint32 maxCheckSize) { 777 // return values: 1 = Sequence; 0 = Nested Sequence; -1 = other; -2 = overflow 778 779 if (maxCheckSize < 30) 780 return -2; 781 782 uint8 * s = (uint8*) ptr; 783 int c1 = extractHofSeqData_checkString(s + 2, 6); 784 int c2 = extractHofSeqData_checkString(s + 16, 6); 785 int c3 = extractHofSeqData_checkString(s + 2, 14); 786 int c4 = extractHofSeqData_checkString(s + 16, 14); 787 int c0 = s[1]; 788 int c5 = s[0]; 789 790 if (c0 == 0 && c5 && ((c1 + c2) >= 1) && (!(c3 == 0 && c2 != 1)) && (!(c4 == 0 && c1 != 1))) { 791 if (maxCheckSize < 41) 792 return -2; 793 794 if (g->special == k2TownsFile1E) { 795 if (!(s[37] | s[39]) && s[38] > s[36]) 796 return 1; 797 } else { 798 if (!(s[39] | s[41]) && s[40] > s[38]) 799 return 1; 800 } 801 } 802 803 if (c0 == 0 && c5 == 4 && c3 == 0 && c4 == 0) { 804 if (maxCheckSize >= 41 && READ_LE_UINT32(s + 34) && !(s[39] | s[41]) && s[40] > s[38]) 805 return 1; 806 } 807 808 if (c0 == 0 && c5 && c1 == 1 && c4 == -1 && s[20]) 809 return 0; 810 811 return -1; 812 } 813 814 int extractHofSeqData_isControl(void * ptr, uint32 size) { 815 // return values: 1 = possible frame control data; 0 = definitely not frame control data 816 817 uint8 * s = (uint8*) ptr; 818 for (int i = 2; i < size; i += 4) { 819 if (!s[i]) 820 return 0; 821 } 822 for (int i = 1; i < size; i += 2) { 823 if (s[i]) 824 return 0; 825 } 826 return 1; 827 } 828 477 829 // index generation 478 830 479 831 enum { … … 495 847 uint32 getFeatures(const Game *g) { 496 848 uint32 features = 0; 497 849 498 if (g->special == kTalkieVersion )850 if (g->special == kTalkieVersion || g->special == k2CDFile1E || g->special == k2CDFile1F || g->special == k2CDFile1G || g->special == k2CDFile2E || g->special == k2CDFile2F || g->special == k2CDFile2G) 499 851 features |= GF_TALKIE; 500 else if (g->special == kDemoVersion )852 else if (g->special == kDemoVersion || g->special == k2DemoVersion) 501 853 features |= GF_DEMO; 502 else if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) 854 else if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ || 855 g->special == k2TownsFile1E || g->special == k2TownsFile1J || 856 g->special == k2TownsFile2E || g->special == k2TownsFile2J) 503 857 features |= GF_FMTOWNS; 504 858 else if (g->special == kAmigaVersion) 505 859 features |= GF_AMIGA; … … 544 898 545 899 bool updateIndex(PAKFile &out, const Game *g) { 546 900 char filename[32]; 547 createFilename(filename, -1, g->special, "INDEX");901 createFilename(filename, g->game, -1, g->special, "INDEX"); 548 902 549 903 byte *index = new byte[kIndexSize]; 550 904 assert(index); … … 572 926 573 927 bool checkIndex(PAKFile &out, const Game *g) { 574 928 char filename[32]; 575 createFilename(filename, -1, g->special, "INDEX");929 createFilename(filename, g->game, -1, g->special, "INDEX"); 576 930 577 931 uint32 size = 0; 578 932 const uint8 *data = out.getFileData(filename, &size); … … 639 993 if (!process(out, g, buffer, size)) 640 994 fprintf(stderr, "ERROR: couldn't process file '%s'", argv[i]); 641 995 642 if (g->special == kFMTownsVersionE) { 643 // The English and non language specific data has now been extracted 644 // so we switch to Japanese and extract the rest 996 if (g->special == kFMTownsVersionE || g->special == k2TownsFile1E || g->special == k2TownsFile2E || 997 g->special == k2CDFile1E || g->special == k2CDFile2E) { 998 // This is for executables which contain support for at least 2 languages 999 // The English and non language specific data has now been extracted. 1000 // We switch to the second language and continue extraction. 645 1001 if (!hasNeededEntries(++g, &out)) { 646 1002 warning("file '%s' is missing offset entries and thus can't be processed", argv[i]); 647 1003 delete [] buffer; … … 650 1006 if (!process(out, g, buffer, size)) 651 1007 fprintf(stderr, "ERROR: couldn't process file '%s'", argv[i]); 652 1008 } 1009 1010 if (g->special == k2CDFile1F || g->special == k2CDFile2F) { 1011 // This is for executables which contain support for 3 languages. 1012 // We switch to the third language and continue extraction. 1013 if (!hasNeededEntries(++g, &out)) { 1014 warning("file '%s' is missing offset entries and thus can't be processed", argv[i]); 1015 delete [] buffer; 1016 continue; 1017 } 1018 if (!process(out, g, buffer, size)) 1019 fprintf(stderr, "ERROR: couldn't process file '%s'", argv[i]); 1020 } 653 1021 654 1022 delete [] buffer; 655 1023 } … … 708 1076 if (i->id == kTakenStrings || i->id == kNoDropStrings || i->id == kPoisonGoneString || 709 1077 i->id == kThePoisonStrings || i->id == kFluteStrings || i->id == kWispJewelStrings) 710 1078 patch = 1; 711 else if (i->id == kIntroStrings || i->id == kKyra1TownsSFX Table)1079 else if (i->id == kIntroStrings || i->id == kKyra1TownsSFXwdTable) 712 1080 patch = 2; 713 1081 } 1082 1083 if (g->special == k2TownsFile1E || g->special == k2TownsFile1J) { 1084 if (i->id == k2SeqplayStrings) 1085 patch = 3; 1086 } 714 1087 1088 if (g->special == k2FloppyFile2) { 1089 if (i->id == k2IngamePakFiles) 1090 patch = 4; 1091 } 1092 715 1093 if (!tDesc->extract(out, g, data + i->startOff, i->endOff - i->startOff, filename, patch)) { 716 1094 fprintf(stderr, "ERROR: couldn't extract id %d\n", i->id); 717 1095 return false; … … 736 1114 kyra1TownsGames, 737 1115 kyra1AmigaGames, 738 1116 kyra1FanTranslations, 1117 1118 kyra2FloppyGames, 1119 kyra2TalkieGames, 1120 kyra2TownsGames, 1121 kyra2Demos, 1122 739 1123 0 740 1124 }; 741 1125 -
create_kyradat.h
59 59 kRoomList, 60 60 61 61 kCharacterImageFilenames, 62 63 kAudioTracks, 64 kAudioTracksIntro, 62 65 63 66 kItemNames, 64 67 kTakenStrings, … … 133 136 kGUIStrings, 134 137 kConfigStrings, 135 138 136 kKyra1TownsSFXTable, 139 kKyra1TownsSFXwdTable, 140 kKyra1TownsSFXbtTable, 141 kKyra1TownsCDATable, 137 142 kCreditsStrings, 138 kSjisVTable, 139 kMenuSKB, 143 144 k2SeqplayPakFiles, 145 k2SeqplayStrings, 146 k2SeqplaySfxFiles, 147 k2SeqplayTlkFiles, 148 k2SeqplaySeqData, 149 k2SeqplayCredits, 150 k2SeqplayIntroTracks, 151 k2SeqplayFinaleTracks, 152 k2SeqplayIntroCDA, 153 k2SeqplayFinaleCDA, 154 155 k2IngamePakFiles, 156 k2IngameTracks, 157 k2IngameCDA, 140 158 141 159 kMaxResIDs 142 160 }; … … 158 176 kDemoVersion = 1, 159 177 kFMTownsVersionE = 2, 160 178 kFMTownsVersionJ = 3, 161 kAmigaVersion = 4 179 kAmigaVersion = 4, 180 181 k2CDFile1E = 5, 182 k2CDFile1F = 6, 183 k2CDFile1G = 7, 184 k2CDFile2E = 8, 185 k2CDFile2F = 9, 186 k2CDFile2G = 10, 187 188 k2TownsFile1E = 11, 189 k2TownsFile1J = 12, 190 k2TownsFile2E = 13, 191 k2TownsFile2J = 14, 192 193 k2FloppyFile1 = 15, 194 k2FloppyFile2 = 16, 195 196 k2DemoVersion = 17, 162 197 }; 163 198 164 199 struct SpecialExtension { … … 195 230 kTypeStringList, 196 231 kTypeRoomList, 197 232 kTypeShapeList, 198 kTypeRawData 233 kTypeRawData, 234 235 k2TypeSeqData 199 236 }; 200 237 201 238 struct ExtractType { 202 239 int type; 203 240 bool (*extract)(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch); 204 void (*createFilename)(char *dstFilename, const int lang, const int special, const char *filename);241 void (*createFilename)(char *dstFilename, const int gid, const int lang, const int special, const char *filename); 205 242 }; 206 243 207 244 #endif -
eng.h
80 80 { kGUIStrings, 0x0002EE7A, 0x0002F02A }, 81 81 { kNewGameString, 0x00032466, 0x0003247B }, 82 82 { kConfigStrings, 0x0002f870, 0x0002f8af }, 83 { kAudioTracks, 0x00032771, 0x000327B2 }, 84 { kAudioTracksIntro, 0x0002FC88, 0x0002FC8E }, 85 83 86 { -1, 0, 0 } 84 87 }; 85 88 … … 165 168 { kGUIStrings, 0x0002F1EE, 0x0002F3F7 }, 166 169 { kNewGameString, 0x00032CFB, 0x00032D10 }, 167 170 { kConfigStrings, 0x0002fc3d, 0x0002fc9e }, 171 { kAudioTracks, 0x00033006, 0x00033047 }, 172 { kAudioTracksIntro, 0x0002FE9A, 0x0002FEA6 }, 168 173 { -1, 0, 0 } 169 174 }; 170 175 -
hof_cd.h
1 const ExtractEntry kyra2File1CDE[] = { 2 { k2SeqplayPakFiles, 0x00029FA4, 0x00029FEA }, 3 { k2SeqplayCredits, 0x00027920, 0x00028408 }, 4 { k2SeqplayStrings, 0x0002C566, 0x0002CE7C }, 5 { k2SeqplaySfxFiles, 0x0002E284, 0x0002E4B8 }, 6 { k2SeqplayTlkFiles, 0x0002A2AC, 0x0002A349 }, 7 { k2SeqplayIntroTracks, 0x0002E4C5, 0x0002E4CD }, 8 { k2SeqplayFinaleTracks, 0x0002E4DA, 0x0002E4E3 }, 9 { k2SeqplaySeqData, 0x0002BB4C, 0x0002C20A }, 10 { -1, 0, 0 } 11 }; 12 13 const ExtractEntry kyra2File1CDF[] = { 14 { k2SeqplayStrings, 0x0002CE7C, 0x0002D845 }, 15 { k2SeqplayTlkFiles, 0x0002A349, 0x0002A3E6 }, 16 { -1, 0, 0 } 17 }; 18 19 const ExtractEntry kyra2File1CDG[] = { 20 { k2SeqplayStrings, 0x0002D845, 0x0002E284 }, 21 { k2SeqplayTlkFiles, 0x0002A3E6, 0x0002A483 }, 22 { -1, 0, 0 } 23 }; 24 25 const ExtractEntry kyra2File2CDE[] = { 26 { k2IngameTracks, 0x0002F2FE, 0x0002F37E }, 27 { -1, 0, 0 } 28 }; 29 30 const ExtractEntry kyra2File2CDF[] = { 31 { -1, 0, 0 } 32 }; 33 34 const ExtractEntry kyra2File2CDG[] = { 35 { -1, 0, 0 } 36 }; 37 38 const Game kyra2TalkieGames[] = { 39 { kKyra2, EN_ANY, k2CDFile1E, "85bbc1cc6c4cef6ad31fc6ee79518efb", kyra2File1CDE}, 40 { kKyra2, FR_FRA, k2CDFile1F, "85bbc1cc6c4cef6ad31fc6ee79518efb", kyra2File1CDF}, 41 { kKyra2, DE_DEU, k2CDFile1G, "85bbc1cc6c4cef6ad31fc6ee79518efb", kyra2File1CDG}, 42 { kKyra2, EN_ANY, k2CDFile2E, "e20d0d2e500f01e399ec588247a7e213", kyra2File2CDE}, 43 { kKyra2, FR_FRA, k2CDFile2F, "e20d0d2e500f01e399ec588247a7e213", kyra2File2CDF}, 44 { kKyra2, DE_DEU, k2CDFile2G, "e20d0d2e500f01e399ec588247a7e213", kyra2File2CDG}, 45 GAME_DUMMY_ENTRY 46 }; -
hof_demo.h
1 const ExtractEntry kyra2Demo[] = { 2 { k2SeqplayPakFiles, 0x0001C130, 0x0001C144 }, 3 { k2SeqplaySfxFiles, 0x0001CDDE, 0x0001CEBC }, 4 { k2SeqplaySeqData, 0x0001C920, 0x0001CB9C }, 5 { k2SeqplayIntroTracks, 0x0001CEBC, 0x0001CECC }, 6 { -1, 0, 0 } 7 }; 8 9 const Game kyra2Demos[] = { 10 { kKyra2, EN_ANY, k2DemoVersion, "a620a37579dd44ab0403482285e3897f", kyra2Demo}, 11 GAME_DUMMY_ENTRY 12 }; -
hof_floppy.h
1 const ExtractEntry kyra2File1E[] = { 2 { k2SeqplayPakFiles, 0x0002132A, 0x0002134C }, 3 { k2SeqplayStrings, 0x00022DF2, 0x000236BA }, 4 { k2SeqplaySfxFiles, 0x000236BA, 0x0002382D }, 5 { k2SeqplayIntroTracks, 0x0002383A, 0x0002384A }, 6 { k2SeqplayFinaleTracks, 0x00023857, 0x00023869 }, 7 { k2SeqplaySeqData, 0x000223E0, 0x00022AD4 }, 8 { -1, 0, 0 } 9 }; 10 11 const ExtractEntry kyra2File1F[] = { 12 { k2SeqplayPakFiles, 0x00020F9D, 0x00020FBF }, 13 { k2SeqplayStrings, 0x00022A9C, 0x00023431 }, 14 { k2SeqplaySfxFiles, 0x00023431, 0x000235A4 }, 15 { k2SeqplayIntroTracks, 0x000235B1, 0x000235C1 }, 16 { k2SeqplayFinaleTracks, 0x000235CE, 0x000235E0 }, 17 { k2SeqplaySeqData, 0x000223E0, 0x0002277E }, 18 { -1, 0, 0 } 19 }; 20 21 const ExtractEntry kyra2File1G[] = { 22 { k2SeqplayPakFiles, 0x000211F9, 0x0002121B }, 23 { k2SeqplayStrings, 0x00022D30, 0x0002371C }, 24 { k2SeqplaySfxFiles, 0x0002371C, 0x0002388F }, 25 { k2SeqplayIntroTracks, 0x0002389C, 0x000238AC }, 26 { k2SeqplayFinaleTracks, 0x000238B9, 0x000238CB }, 27 { k2SeqplaySeqData, 0x0002231E, 0x00022A12 }, 28 29 { -1, 0, 0 } 30 }; 31 32 const ExtractEntry kyra2File2E[] = { 33 { k2IngamePakFiles, 0x0035E4E, 0x00362ED }, 34 { k2IngameTracks, 0x0003B2F2, 0x0003B370 }, 35 { -1, 0, 0 } 36 }; 37 38 const ExtractEntry kyra2File2F[] = { 39 { k2IngamePakFiles, 0x0003AA9C, 0x0003AB1A }, 40 { k2IngameTracks, 0x0003B2F2, 0x0003B370 }, 41 { -1, 0, 0 } 42 }; 43 44 const ExtractEntry kyra2File2G[] = { 45 { k2IngamePakFiles, 0x0035626, 0x0035AC5 }, 46 { k2IngameTracks, 0x0003AA8C, 0x0003AB0A }, 47 { -1, 0, 0 } 48 }; 49 50 const Game kyra2FloppyGames[] = { 51 { kKyra2, EN_ANY, k2FloppyFile1, "9b0f5e57b5a2ed88b5b989cbb402b6c7", kyra2File1E}, 52 { kKyra2, FR_FRA, k2FloppyFile1, "df31cc9e37e1cf68df2fdc75ddf2d87b", kyra2File1F}, 53 { kKyra2, DE_DEU, k2FloppyFile1, "0ca4f9a1438264a4c63c3218e064ed3b", kyra2File1G}, 54 { kKyra2, EN_ANY, k2FloppyFile2, "7c3eadbe5122722cf2e5e1611e19dfb9", kyra2File2E}, 55 { kKyra2, FR_FRA, k2FloppyFile2, "fc2c6782778e6c6d5a553d1cb73c98ad", kyra2File2F}, 56 { kKyra2, DE_DEU, k2FloppyFile2, "0d9b0eb7b0ad889ec942d74d80dde1bf", kyra2File2G}, 57 GAME_DUMMY_ENTRY 58 }; -
hof_towns.h
1 const ExtractEntry kyra2File1FMTownsE[] = { 2 { k2SeqplayPakFiles, 0x00000540, 0x00000573 }, 3 { k2SeqplayStrings, 0x00001614, 0x00001FA4 }, 4 { k2SeqplaySfxFiles, 0x0000284C, 0x000029EF }, 5 { k2SeqplaySeqData, 0x000050D8, 0x00005794 }, 6 { k2SeqplayIntroCDA, 0x00007FF8, 0x00008010 }, 7 { k2SeqplayFinaleCDA, 0x00008010, 0x00008018 }, 8 { -1, 0, 0 } 9 }; 10 11 const ExtractEntry kyra2File1FMTownsJ[] = { 12 { k2SeqplayStrings, 0x00001FA4, 0x0000284C }, 13 { -1, 0, 0 } 14 }; 15 16 const ExtractEntry kyra2File2FMTownsE[] = { 17 { k2IngamePakFiles, 0x00000540, 0x0000065C }, 18 { k2IngameCDA, 0x0001808C, 0x000181BC }, 19 { -1, 0, 0 } 20 }; 21 22 const ExtractEntry kyra2File2FMTownsJ[] = { 23 { -1, 0, 0 } 24 }; 25 26 const Game kyra2TownsGames[] = { 27 { kKyra2, EN_ANY, k2TownsFile1E, "74f50d79c919cc8e7196c24942ce43d7", kyra2File1FMTownsE}, 28 { kKyra2, JA_JPN, k2TownsFile1J, "74f50d79c919cc8e7196c24942ce43d7", kyra2File1FMTownsJ}, 29 { kKyra2, EN_ANY, k2TownsFile2E, "a9a7fd4f05d00090e9e8bda073e6d431", kyra2File2FMTownsE}, 30 { kKyra2, JA_JPN, k2TownsFile2J, "a9a7fd4f05d00090e9e8bda073e6d431", kyra2File2FMTownsJ}, 31 GAME_DUMMY_ENTRY 32 }; -
misc.h
80 80 kGUIStrings, 81 81 kNewGameString, 82 82 kConfigStrings, 83 kAudioTracks, 84 kAudioTracksIntro, 83 85 -1 84 86 }; 85 87 … … 165 167 kGUIStrings, 166 168 kNewGameString, 167 169 kConfigStrings, 170 kAudioTracks, 171 kAudioTracksIntro, 168 172 -1 169 173 }; 170 174 … … 265 269 kNewGameString, 266 270 kConfigStrings, 267 271 268 kKyra1TownsSFXTable, 272 kKyra1TownsSFXwdTable, 273 kKyra1TownsSFXbtTable, 274 kKyra1TownsCDATable, 275 kAudioTracks, 269 276 kCreditsStrings, 270 kMenuSKB,271 kSjisVTable,272 277 -1 273 278 }; 274 279 … … 351 356 -1 352 357 }; 353 358 359 const int kyra2CDFile1EngNeed[] = { 360 k2SeqplayPakFiles, 361 k2SeqplayCredits, 362 k2SeqplayStrings, 363 k2SeqplaySfxFiles, 364 k2SeqplaySeqData, 365 k2SeqplayIntroTracks, 366 k2SeqplayFinaleTracks, 367 -1 368 }; 369 370 const int kyra2CDFile1FreNeed[] = { 371 k2SeqplayStrings, 372 -1 373 }; 374 375 const int kyra2CDFile1GerNeed[] = { 376 k2SeqplayStrings, 377 -1 378 }; 379 380 const int kyra2CDFile2EngNeed[] = { 381 k2IngameTracks, 382 -1 383 }; 384 385 const int kyra2CDFile2FreNeed[] = { 386 -1 387 }; 388 389 const int kyra2CDFile2GerNeed[] = { 390 -1 391 }; 392 393 const int kyra2FloppyFile1Need[] = { 394 k2SeqplayPakFiles, 395 k2SeqplayStrings, 396 k2SeqplaySfxFiles, 397 k2SeqplayIntroTracks, 398 k2SeqplayFinaleTracks, 399 k2SeqplaySeqData, 400 -1 401 }; 402 403 const int kyra2FloppyFile2Need[] = { 404 k2IngamePakFiles, 405 k2IngameTracks, 406 -1 407 }; 408 409 const int kyra2TownsFile1EngNeed[] = { 410 k2SeqplayPakFiles, 411 k2SeqplayStrings, 412 k2SeqplaySfxFiles, 413 k2SeqplaySeqData, 414 k2SeqplayIntroCDA, 415 k2SeqplayFinaleCDA, 416 -1 417 }; 418 419 const int kyra2TownsFile1JapNeed[] = { 420 k2SeqplayStrings, 421 -1 422 }; 423 424 const int kyra2TownsFile2EngNeed[] = { 425 k2IngamePakFiles, 426 k2IngameCDA, 427 -1 428 }; 429 430 const int kyra2TownsFile2JapNeed[] = { 431 -1 432 }; 433 434 const int kyra2DemoNeed[] = { 435 k2SeqplayPakFiles, 436 k2SeqplaySeqData, 437 k2SeqplaySfxFiles, 438 k2SeqplayIntroTracks, 439 -1 440 }; 441 354 442 const GameNeed gameNeedTable[] = { 355 443 { kKyra1, -1, kyra1FloppyNeed }, 356 444 { kKyra1, kTalkieVersion, kyra1CDNeed }, … … 358 446 { kKyra1, kFMTownsVersionJ, kyra1TownsJapNeed }, 359 447 { kKyra1, kAmigaVersion, kyra1AmigaNeed }, 360 448 { kKyra1, kDemoVersion, kyra1DemoNeed }, 449 450 { kKyra2, k2FloppyFile1, kyra2FloppyFile1Need }, 451 { kKyra2, k2FloppyFile2, kyra2FloppyFile2Need }, 452 { kKyra2, k2CDFile1E, kyra2CDFile1EngNeed }, 453 { kKyra2, k2CDFile1F, kyra2CDFile1FreNeed }, 454 { kKyra2, k2CDFile1G, kyra2CDFile1GerNeed }, 455 { kKyra2, k2CDFile2E, kyra2CDFile2EngNeed }, 456 { kKyra2, k2CDFile2F, kyra2CDFile2FreNeed }, 457 { kKyra2, k2CDFile2G, kyra2CDFile2GerNeed }, 458 { kKyra2, k2TownsFile1E , kyra2TownsFile1EngNeed }, 459 { kKyra2, k2TownsFile1J, kyra2TownsFile1JapNeed }, 460 { kKyra2, k2TownsFile2E , kyra2TownsFile2EngNeed }, 461 { kKyra2, k2TownsFile2J, kyra2TownsFile2JapNeed }, 462 { kKyra2, k2DemoVersion, kyra2DemoNeed}, 463 361 464 { -1, -1, 0 } 362 465 }; 363 466 … … 367 470 { kFMTownsVersionE , "TNS" }, 368 471 { kFMTownsVersionJ, "TNS" }, 369 472 { kAmigaVersion, "AMG" }, 473 474 { k2CDFile1E, "CD" }, 475 { k2CDFile1F, "CD" }, 476 { k2CDFile1G, "CD" }, 477 { k2CDFile2E, "CD" }, 478 { k2CDFile2F, "CD" }, 479 { k2CDFile2G, "CD" }, 480 { k2TownsFile1E, "TNS" }, 481 { k2TownsFile1J, "TNS" }, 482 { k2TownsFile2E, "TNS" }, 483 { k2TownsFile2J, "TNS" }, 484 { k2DemoVersion, "DEM" }, 485 370 486 { -1, 0 } 371 487 }; 372 488 … … 379 495 { JA_JPN, "JPN" }, 380 496 { -1, 0 } 381 497 }; 382 -
towns.h
80 80 { kGUIStrings, 0x000291E0, 0x000293DC }, 81 81 { kNewGameString, 0x0002919C, 0x000291B1 }, 82 82 { kConfigStrings, 0x00029360, 0x000293AA}, 83 { kKyra1TownsSFXTable, 0x0003A978, 0x0004CF80 }, 83 { kKyra1TownsSFXwdTable, 0x0003A978, 0x0004CF80 }, 84 { kKyra1TownsSFXbtTable, 0x0003A878, 0x0003A978 }, 85 { kKyra1TownsCDATable, 0x0004D021, 0x0004D2E5 }, 86 { kAudioTracks, 0x00027B8E, 0x00027BEB }, 84 87 { kCreditsStrings, 0x0002AED8, 0x0002B464 }, 85 { kMenuSKB, 0x000293DE, 0x000294A7 },86 { kSjisVTable, 0x0003A421, 0x0003A749 },87 88 { -1, 0, 0 } 88 89 }; 89 90