Hi,
I've spent several hours chasing a rather strange bug- without a lot of
success.
The problem occurs when entering the Adventurer's Guild in QfG1. The game
clears several old View clones, and then proceeds to constitute a set of
new ones. Some of them get their DELETE_ME (0x8000) flag set after they
are drawn; FreeSCI (kAnimate(), to be more precise) then calls the
dispose() method of each of them. Here's what happens:
[dozens of pushs deleted]
acc=0020 44F5: [B] class 25
acc=43e8 44F7: [W] send 04
PV::new[FUNCT]()
acc=43e8 3BA6: [W] push1
acc=43e8 3BA7: [W] pushSelf
acc=43e8 3BA8: [B] callk Clone[4] 02
Kernel params: (43e8)
acc=b628 3BAB: [W] ret
; Here it returns a clone of PV and proceeds to
; initialize it.
acc=b628 44F9: [W] send 34
PV::view[VAR](0137)
PV::loop[VAR](0002)
PV::cel[VAR](0009)
PV::x[VAR](012e)
PV::y[VAR](0053)
PV::z[VAR](0000)
PV::priority[VAR](0004)
PV::signal[VAR](8120)
PV::yourself[FUNCT]()
acc=b628 3C2C: [W] selfID
acc=b628 3C2D: [W] ret
; The send has returned.
acc=b628 44FB: [W] push
acc=b628 44FC: [B] lag 0a
acc=74c6 44FE: [W] send 06
addToPics::yourself[FUNCT]()
addToPics::<invalid>[INVALID]()
Send to invalid selector 0xb628 of object at 0x74c6
A stack trace ends with
e:[d] kAnimate(8a5a, 0000)
f:[e] View::delete()
obj@b578 pc=4500 sp=0fae fp=0f7a
10:[f] addToPics::yourself()
obj@74c6 pc=44fe sp=0fb4 fp=0fb4
(b578 is the address of a View clone with its signal property set to
0x8120)
The stack is set as follows:
[sp-0006] = 005f
[sp-0004] = 0000
[sp-0002] = b628
So the error message is justified. Without the push at 44fb, the code
would make sense.
This does not happen in the Sierra SCI interpreted code. This code is
called much earlier in FreeSCI, because our PicNotValid() kernel function
returns 1 where Sierra's function returns 0. I'm not sure why Sierra SCI
returns 0 there, though; a DrawPic() was done earlier, and the
pic_not_valid flag should therefore be set. This might have been caused
by the Sierra debugger implicitly updating the screen.
Does anybody have an idea? Is this some kind of new and rarely-used send
behaviour? Does SelfID implicitly set &rest? This is just weird.
Thanks for any help,
llap,
Christoph