Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - troflip

Pages: [1] 2 3 ... 104
1
AGI Syntax Help / Re: Understanding how goto and else work
« on: May 05, 2022, 01:09:31 AM »

The closing curly brace for ending block A happens BEFORE the end of block B. If you tried to compile this, the compiler would think that the 'endif A' curly brace is 'endif B', and vice versa. Blocks have to be fully nested.

Ok, yep. Makes sense in that context!

2
AGI Syntax Help / Re: Understanding how goto and else work
« on: May 04, 2022, 07:02:37 PM »
I forgot I had written some pretty detailed blog posts on decompilation. I dunno if they might be useful? There are some links to white papers on control flow analysis in part 2.

https://mtnphil.wordpress.com/2016/04/09/decompiling-sci-byte-code-part-1/

3
AGI Syntax Help / Re: Understanding how goto and else work
« on: May 04, 2022, 05:48:15 PM »
You will notice that the 'goto' statement jumps past the end of the if-block that it is inside of. So it can't be an 'else'. To reduce it to a simpler set of lines that are easier to see, this is what is happening:

Code: [Select]
if (testA)
  {
  if (testB)
    {
    statement1;
    goto(Label1);
    }  [endif testB
  statement2;
  } [ endif testA

Label1:
statement3;



Hmm... isn't that just an if/else inside an if?

Code: [Select]

if (a)
{
if (b)
{
statement1;
}
else
{
statement2;
}
}

statement3;

Yes, it jumps past the testB if block, but that's just because there isn't any code to jump to inside the testA block.

4
AGI Syntax Help / Re: Understanding how goto and else work
« on: May 03, 2022, 08:12:24 PM »
Is WinAGI's decompiler authoritative? Maybe it just isn't advanced enough to recognize the higher level logic at play, so it resorted to a goto?

5
SCI Syntax Help / Re: SCI 1.1 - Game class, newRoom method
« on: February 13, 2022, 03:09:45 PM »
Where exactly is your handsOn/handsOff?

You mentioned something about a changeState method? How does that factor in?

6
SCI Syntax Help / Re: SCI 1.1 - Game class, newRoom method
« on: February 13, 2022, 12:13:37 PM »
Does it lock up in ScummVM too? If so, break into the debugger when it happens, and look at the stack trace and see if it's in an infinite loop somewhere.

(We still don't have a SCI 1.1. interpreter with debugger, right?)

7
The export table points to objects and code. For a script that is a room, the first entry in the export table should point to the room object.

8
Is there a checkbox for "Manage resources as patch files" in Game properties?

Not sure if that was a private thing I added or not... or how well tested it was.


9
Make sure you have the MFC components installed for your visual studio.

10
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 03:29:49 PM »
Awesome.

Musically Inspired, note that if you use those same pasted commands, the picture will still be corrupt. You'll need to delete any random pen commands that end with any hex number 77 and above (there's about 10 of them), then it should save correctly.

11
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 02:12:01 PM »
Ok, I checked in a fix to the main branch, but I'm not set up to build (or test it, but it should be fine).

12
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 02:06:51 PM »
Ahh... that fix never made it into the official branch, I see.

In CPicView::_MakeRandomNR() and CPicView::_OnPatternRClick(), the 128 should be changed to 119.

Hold on...

13
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 02:01:19 PM »
Musically Inspired, are you sure this image wasn't created with an old version of SCI Companion? Or some other program?

The third pen command contains an invalid random pattern:

Code: [Select]
Pen: 121x119 Pat-C (2-69)
Pen: 129x119 Pat-C (2-15)
Pen: 137x118 Pat-C (2-78)  // 78 is too big... max allowed is 76

14
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 01:52:51 PM »
Seems to have something to do with the the pattern index (the random part) being too large (>= 120) and being interpreted as a new command instead of a continuation of the pattern command. However, when you're drawing, the code clamps the value to 118, so that should never happen.

15
SCI Development Tools / Re: SCI Companion Pic Editor saving bug?
« on: April 28, 2021, 12:59:46 PM »
Ok... this shouldn't be too hard to figure out... it's failing on the third pen command...

Pages: [1] 2 3 ... 104

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.204 seconds with 20 queries.