On Fri, 16 May 2008 16:03:47 +0100
James Urquhart <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've been playing about with the haXe-based SCUMM interpreter
> recently, and i've pretty much come to the point where i have to
> check to see if i am actually processing everything correctly.
> Otherwise i'll probably bump into a nasty bug later down the road.
>
> Currently i am trying to fathom out how variables in SCUMM are
> stored at runtime. From what i have been able to gather, they should
> be word's, possibly 16 bits in length? However i have not been able
> to figure out if they should be signed or unsigned. Now i know there
> are quite a few other places in SCUMM where this is obvious, but i
> am quite simply stumped on this.
Good question, honestly I haven't yet investigated that. My gut guess
would be that the stack and variables both use signed 16 bit. However
that should be tested, I'll look at that.
> In addition i am similarly puzzled as to how array's should be
> stored. 16bit? 32bit? signed / unsigned?
It depend on the array type, there is bit, nibble, byte, char and
words. char is the same as byte AFAIK but it might be different on
Asian ports (that should be checked one day). I don't know about the
signedness, again that should be checked.
> I really need to figure this out as the only integer type i have
> available to me in haXe is an Int, which is 32 bits. So i have to do
> things such as perform an additional subtraction if i want to
> convert an unsigned number into a signed one (after &'ing with
> 0xFFFF). :(
>
> Any suggestions on how to properly handle this would be appreciated.
This need a bit more investigations, but basically it will only matter
when converting between types of different size. From a larger to a
smaller type truncating (ie. &'ing) is enough. But from a smaller type
to a larger one sign extension might be needed.
Albeu
_______________________________________________
ScummC-general mailing list
[email protected]
https://mail.gna.org/listinfo/scummc-general