[Scummvm-tracker] [ScummVM] #10814: QFG4: Crash in cave when fighting Pit Horror below the tightrope

Vhati trac at scummvm.org
Thu Nov 22 17:40:35 CET 2018


#10814: QFG4: Crash in cave when fighting Pit Horror below the tightrope
--------------------------------+-------------------------
  Reporter:  Vhati              |      Owner:  (none)
      Type:  defect             |     Status:  new
  Priority:  normal             |  Component:  Engine: SCI
Resolution:                     |   Keywords:  SCI32
      Game:  Quest for Glory 4  |
--------------------------------+-------------------------

Comment (by Vhati):

 @m-kiewitz:
 > Reproduced it.
 > 002e:1694 is "horror"

 > maybe that code is really working as intended (checking for an object OR
 that kernel call returning 1)
 The object in question is horror.

 This
 {{{
 (| (SetNowSeen horror) $0001)
 }}}
 is this

 {{{
 002e:0404: 78             push1
 002e:0405: 72 10 00       lofsa horror[1694]
 002e:0408: 36             push
 002e:0409: 43 0a 02 00    callk SetNowSeen[a],  0002
 002e:040d: 36             push
 002e:040e: 35 01          ldi   01
 002e:0410: 14             or
 }}}

 "Invalid arithmetic operation (bitwise OR - params: 002e:1694 and
 0000:0001)"

 The things being OR'd are acc following a kernel call (pushed to the stack
 for this op) and a literal 1.
 The acc value after the kernel call is an object, 002e:1694, horror.
 \\
 \\
 Believe me, I am painfully aware of my Dunning-Kruger risk as I press
 this. I can't see how you're reading something different.
 \\
 [http://sciwiki.sierrahelp.com//index.php?title=SCI_Specifications:_Chapter_5_(cont.)_-_Kernel_functions#Kernel_functions
 Article]: SCI Spec, Kernel funcs
 > Return values are returned into the accumulator, unless stated
 otherwise. If return type is stated as (void), then the accumulator is not
 modified.
 \\
 > [SetNowSeen32] returns "found", which is defined as a boolean.
 > So it's 0 or 1.
 {{{
 reg_t kSetNowSeen32(EngineState *s, int argc, reg_t *argv) {
         const bool found = ...

         if (getSciVersion() <= SCI_VERSION_2_1_EARLY ... ) {
                 return s->r_acc;
         }

         return make_reg(0, found);

 }
 }}}

 It has two return statements.
 The SciVersion enum comments say QFG4 is <= SCI_VERSION_2_1_EARLY.
 It doesn't look to me like the found bool is being returned. At least not
 the found that is declared there.

--
Ticket URL: <https://bugs.scummvm.org/ticket/10814#comment:16>
ScummVM <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list