First I"d like to countinue discussion about usage of stack and heap in VM
First of all, why do we need to store bytecode in SCI heap?
And classes may be stored not in it too. For example, super and self is only an 
identifiers right?
Why they must be pointers in heap. We could store them elsewhere. As I understand we 
can access to local(global) variables only by indexing them (I mean that we cannot 
modify them directly by setting sp to some value and then call push()
Then, I've already try to store Doubly-linked lists, nodes not in heap, but in my own 
allocation pool and return it IDs in this pool instead of heap_ptr - All works fine (I 
test this on several screens from SQ3 LSL3)
Then about HQ2 again
I fear that in SCI01 games sound subsitem slightly different then in SCI0
For example, It is assumed that second parameter for DoSound function if passed, is a 
pointer to SoundObject
But function 0 from script 2 do something like this:(I don't remember which values 
does it exactly pass):
ldi 0x2a3
sag 907
ldi 3
sag 12
pushi 2
pushi 0xf
pish0
push0
push0
callk DoSound 4
If I don't miss something i.e. DoSound was called with parametrs (0, 0x0f) which means 
init sound object with pointer 0f!!! Absurd! But why do we need to chage some global 
variables before call to DoSound. May be if objptr<1000 then it should take 
information about sound object from global variables?
BTW, why do you know, that scripts in SCI01 are dynamically loaded?
Nikita

Reply via email to