Ticket #8216: loom-learn-drafts.diff

File loom-learn-drafts.diff, 2.1 KB (added by eriktorbjorn, 22 years ago)

Patch against a May 5 CVS snapshot

  • scummvm/scumm/debugger.cpp

    diff -ur ScummVM-cvs20030504/scummvm/scumm/debugger.cpp ScummVM-cvs20030504+hack/scummvm/scumm/debugger.cpp
    old new  
    760760
    761761        base = (_s->_gameId == GID_LOOM) ? 50 : 100;
    762762
    763         // During the testing of EGA Loom we had some trouble with the drafts
    764         // data structure being overwritten. I don't expect this command is
    765         // particularly useful any more, but it will attempt to repair the
    766         // (probably) static part of it.
    767 
    768         if (argc == 2 && strcmp(argv[1], "fix") == 0) {
    769                 for (i = 0; i < 16; i++) {
    770                         _s->_vars[base + 2 * i + 1] = odds[i];
     763        if (argc == 2) {
     764                // We had to debug a problem at the end of the game that only
     765                // happened if you interrupted the intro at a specific point.
     766                // That made it useful with a command to learn all the drafts
     767                // and notes.
     768
     769                if (strcmp(argv[1], "learn") == 0) {
     770                        for (i = 0; i < 16; i++)
     771                                _s->_vars[base + 2 * i] |= 0x2000;
     772                        _s->_vars[base + 72] = 8;
     773
     774                        // In theory, we could run script 18 here to redraw
     775                        // the distaff, but I don't know if that's a safe
     776                        // thing to do.
     777
     778                        Debug_Printf("Learned all drafts and notes.\n");
     779                        return true;
     780                }
     781
     782                // During the testing of EGA Loom we had some trouble with the
     783                // drafts data structure being overwritten. I don't expect
     784                // this command is particularly useful any more, but it will
     785                // attempt to repair the (probably) static part of it.
     786
     787                if (strcmp(argv[1], "fix") == 0) {
     788                        for (i = 0; i < 16; i++)
     789                                _s->_vars[base + 2 * i + 1] = odds[i];
     790                        Debug_Printf(
     791                                "An attempt has been made to repair\n"
     792                                "the internal drafts data structure.\n"
     793                                "Continue on your own risk.\n");
     794                        return true;
    771795                }
    772                 Debug_Printf(
    773                         "An attempt has been made to repair\n"
    774                         "the internal drafts data structure.\n"
    775                         "Continue on your own risk.\n");
    776                 return true;
    777796        }
    778797
    779         // More useful, list the drafts.
     798        // Probably the most useful command for ordinary use: list the drafts.
    780799
    781800        for (i = 0; i < 16; i++) {
    782801                draft = _s->_vars[base + i * 2];