Ticket #7122: hoyle3_amiga.diff

File hoyle3_amiga.diff, 3.2 KB (added by bluegr, 7 years ago)

Add support for Hoyle 3 Amiga

  • engines/sci/detection_tables.h

    diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
    index 91ce678..b014899 100644
    a b static const struct ADGameDescription SciGameDescriptions[] = {  
    10691069                AD_LISTEND},
    10701070                Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
    10711071
    1072 #if 0 // TODO: unknown if these files are corrupt
    10731072        // Hoyle 3 - English Amiga (from www.back2roots.org)
    10741073        // Executable scanning reports "1.005.000"
    10751074        // SCI interpreter version 1.000.510
    static const struct ADGameDescription SciGameDescriptions[] = {  
    10791078                {"resource.001", 0, "143df8aef214a2db34c2d48190742012", 632273},
    10801079                AD_LISTEND},
    10811080                Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)      },
    1082 #endif
    10831081
    10841082        // Hoyle 3 - English DOS Non-Interactive Demo
    10851083        // Executable scanning reports "x.yyy.zzz"
  • engines/sci/engine/kernel.cpp

    diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
    index 72c074f..8943d49 100644
    a b Common::String Kernel::lookupText(reg_t address, int index) {  
    876876        if (address.getSegment())
    877877                return _segMan->getString(address);
    878878
    879         Resource *textres = _resMan->findResource(ResourceId(kResourceTypeText, address.getOffset()), false);
     879        ResourceId resourceId = ResourceId(kResourceTypeText, address.getOffset());
     880        if (g_sci->getGameId() == GID_HOYLE3 && g_sci->getPlatform() == Common::kPlatformAmiga) {
     881                // In the Amiga version of Hoyle 3, texts are stored as either text, font or palette
     882                // types. Seems like the resource type bits are used as part of the resource numbers.
     883                // I haven't found a reliable way of loading these correctly as text in the
     884                // resource manager, so this is the least invasive way of loading them properly
     885                resourceId = ResourceId(kResourceTypeText, address.getOffset() & 0x7FF);
     886                if (!_resMan->testResource(resourceId))
     887                        resourceId = ResourceId(kResourceTypeFont, address.getOffset() & 0x7FF);
     888                if (!_resMan->testResource(resourceId))
     889                        resourceId = ResourceId(kResourceTypePalette, address.getOffset() & 0x7FF);
     890        }
     891
     892        Resource *textres = _resMan->findResource(resourceId, false);
    880893
    881894        if (!textres) {
    882895                error("text.%03d not found", address.getOffset());
  • engines/sci/engine/kscripts.cpp

    diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
    index 5a33023..41f7a61 100644
    a b reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {  
    269269
    270270        Script *scr = s->_segMan->getScript(scriptSeg);
    271271
     272        // Avoid referencing invalid export 0 in script 601 in Hoyle 3 Amiga
     273        if (g_sci->getGameId() == GID_HOYLE3 && g_sci->getPlatform() == Common::kPlatformAmiga && script == 601 && argc == 1)
     274                return NULL_REG;
     275
    272276        if (!scr->getExportsNr()) {
    273277                // This is normal. Some scripts don't have a dispatch (exports) table,
    274278                // and this call is probably used to load them in memory, ignoring