Conflux wip003 Hint Oracle error

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
Phoenix
Expert
Posts: 347
Joined: Tue Oct 11, 2011 7:32 am

Conflux wip003 Hint Oracle error

Post by Phoenix »

I have a Conflux wip003 save game at top of the Tower of Mampang. When I access the Hint Oracle for this save game and access the entry for the Archmaster of Mampang, I get:

Error
I did not translate all of the atari code. Some of it appeared to never be used. You have encountered code that I did not translate at address 0x8874. Let me know and I will fix it.
<email addess sensored for spambots>

System Error 0
SystemError

program exits.

All other entries for the Hint Oracle work.
Christoph
Craftsman
Posts: 102
Joined: Sun Nov 20, 2011 12:04 am

Re: Conflux wip003 Hint Oracle error

Post by Christoph »

When I encountered this error this was due to the static number of possible Oracle entries:
In Hint.cpp:
#define MAXHINTINDICES 9

Perhaps you see a tenth entry there?
Christoph
Phoenix
Expert
Posts: 347
Joined: Tue Oct 11, 2011 7:32 am

Re: Conflux wip003 Hint Oracle error

Post by Phoenix »

Nope, only 8 entries. The only difference is the the last entry isn't in all caps and only that entry crashes csbwin. The explicit error message was the only reason I posted this this forum and not the main Conflux thread.
Christoph
Craftsman
Posts: 102
Joined: Sun Nov 20, 2011 12:04 am

Re: Conflux wip003 Hint Oracle error

Post by Christoph »

This function in Hint.cpp is the place to look at:

Code: Select all

RESTARTABLE _StartHint(const CSB_UI_MESSAGE *)
{//(void)
  static dReg D0;
  static TEXT  *pText_10;
  static i16 w_4;
  static i16 w_2;
  //static int iii;
  RESTARTMAP
    RESTART(1)
    RESTART(6)
    RESTART(7)
    RESTART(9)
    RESTART(11)
    RESTART(12)
    RESTART(14)
    RESTART(23)
    RESTART(24)
    RESTART(25)
    RESTART(26)
    RESTART(27)
    RESTART(28)
  END_RESTARTMAP
  //iii = sizeof S4076;
  ASSERT(sizeof S4076 == ((4076 + 3)&0xfffffffc),"s4076");
  memset(&f, 0, sizeof (f));
//
//file = hint.ftl      offset =92be
//

//file = hint.ftl      offset =92e8

//  w_4 = TAG00794e
  f.Word10464 = 1;
  f.Word16910 = 1;
  f.Word16912 = 1;
  f.Word16914 = 1;
  f.Word194 = 0;
  TAG009a40();
  TAG0051c2_1(_1_, 10); //**01cdc2 //Window appears
                        // hcsb.dat is opened and read
  TAG00799a_1(10);
  TAG008a62();
  TAG00978a_1(10);
  TAG008c40_1(10);
  w_4 = 1;
  TAG008c40_3(w_4, 1, 0);
  TAG008c40_3(w_4, 2, 0);
  TAG008c40_3(w_4, 8, 0);
  D0W = sw(TAG0076a0_13(w_4));
  if (D0W > 1)
  {
    pText_10 = pText16272[1];
  }
  else
  {
    pText_10 = pText16272[0];
  };
  TAG004e4c_6(_25_, w_4, pText_10);
  do
  {
    TAG008c40_5(_23_, w_4, w_4);//construct and display screen
              //Wait for user to select LOAD, DUMP, or EXIT
    w_2 = sw(intResult); //1 = LOAD
    TAG008c40_8(_24_, w_4, w_2);//flash button??
    w_2 = sw(intResult);
    switch (w_2)
    {
    case 1:
    case 8: //DUMP
      switch (w_4)
      {
      case 1:
        if (w_2 == 8)
        {
          dumpFile = CREATE("HINTDUMP.TXT","w", true);
        };
        TAG007fdc_2(w_4);
        TAG006c7e_9(_6_, w_4, 501, NULL, NULL);
        D0L = intResult;
        if (D0L != 1)
        {
          NotImpMsg(0x85e0);
          /*
*/
          break;
        };
        TAG00799a_9(_7_, w_4);
        D0W = sw(TAG00799a_13(w_4));
        if (D0W > 0)
        {
          w_4 = 2;
          TAG008c40_3(w_4, 5, 0);
          TAG00799a_6(_9_, w_4);
        }
        else
        {
          w_4 = 2;
          TAG008c40_3(w_4, 5, 0);
          TAG004e4c_6(_26_, w_4, pText16272[4]);
        };
        break;
      default:
        NotImpMsg(0x86ca);
        /*
*/
        break;
      }; //switch (w_4)
      break;
    case 2:
      TAG005d2a(_28_, w_4, 31);
      break;
    case 10:
    case 11:
    case 12:
    case 13:
    case 14:
    case 15:
    case 16:
    case 17:
      //w_6 = TAG0064fc(TAG00684a, TAG006ba0);

          //****** Nonsense Deleted *******//      
      w_4 = 4;
      SetSelectedLine(w_4, w_2-10);
      TAG007fdc_36(_11_, w_4, w_2-10, 0);
      break;
    case 5:
      switch (w_4)
      {
      case 4:
        w_4 = 2;
        TAG008c40_3(w_4, 5, 0);
        TAG00799a_6(_12_, w_4);
        break;
      case 2:
        w_4 = 1;
        TAG008c40_3(w_4, 1, 0);
        TAG008c40_3(w_4, 2, 0);
        D0W = sw(TAG0076a0_13(w_4));
        if (D0W > 1)
        {
          pText_10 = pText16272[1];
        }
        else
        {
          pText_10 = pText16272[0];
        };
        TAG004e4c_6(_27_, w_4, pText_10);
        break;
      case 3:
      default:
        TAG0093a0_18(w_4, 75);
      };//switch (w_4)

      break;
    case 3:
    case 4:
      if (w_2 != 3)
      {
        D0L = 1;
      }
      else
      {
        D0L = -1;
      };
      TAG007fdc_36(_14_, w_4, 0, D0L);//Increment page number
      break;
    case 6:
    case 7:
    case 9:
    default:
      NotImpMsg(0x8874);
      /*
*/
      break;
    case 0:
      break;
    }; //switch (w_2)
  } while (w_2 != 2);
  TAG009a40();  
  RETURN;
}
Paul Stevens (in an E-Mail to me) wrote:The problem was that there were more selection
lines than the hint oracle had ever before
encountered.

Do you want me to package a new source release
for version 12.1? Or could you be happy adding
a patch line?

+6572 Hint.cpp
case 17:

This immediately follows 'case 16:' in function
'StartHint'.
Another line "case 18:" might fix that. I'm not sure how many entries have been present when I found the problem, I haven't got the correct version installed any more to use the oracle with that save file, and I'm not sure which one to use, probably 3.5B8.
Christoph
Christoph
Craftsman
Posts: 102
Joined: Sun Nov 20, 2011 12:04 am

Re: Conflux wip003 Hint Oracle error

Post by Christoph »

I didn't mention the reason why I think this "18" might be the solution; the code is unfortunately rather incomprehensible, but:

The possible "cases" leading to the message you got are "6", "7", "9", and "default", that is any positive integer greater than 17. I think that "6", "7", "9" are the ones Paul is referring to in the message displayed: numbers which have probably no function, things he therefore didn't port from ST.

Assuming that "10" is the one displaying the main hint page with all the hint topics (or might be even another functionless number not tied to an action, making it irrelevant in which "case" it is put), taking into account that normally there are 6 or less hint topics on most map squares, my former problem might have had 7 topics (I can't remember, can't easily look it up, but that was the order of magnitude), and yours definitely has 8, adding the "case 18:" would be the solution.

If it is not, you must have encountered one of the cases above which is highly unlikely, because hint topics obviously begin at either "10" or "11", or your action caused a negative number, also unlikely.

If you can test on Linux/x86, I can easily make a test version for you, if not, you must ask Paul Stevens. He also will be able to verify if my above assumptions are correct.

If this is the case, we should probably set "#define MAXHINTINDICES 10", and extend the cases count to 20 for the upcoming version, just in case there are actually map squares with more than 8 topics, since I think about 10 might actually fit on the screen.
Christoph
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”