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 - lskovlun

Pages: 1 2 3 [4] 5 6 ... 34
46
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: July 13, 2019, 10:41:04 AM »
Just for fun, here's what Companion decompiles its own broken Bset to:
Code: [Select]
(procedure (localproc_003a param1 &tmp temp0)
(= [gameFlags (==
(/ param1 16)
(|
[gameFlags (/ param1 16)]
(>> $8000 (mod param1 16))
)
)]
(= temp0 (localproc_0028 param1))
)
(return temp0)
)
I'm surprised it doesn't resort to assembly to explain this mess...

47
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: July 13, 2019, 08:33:16 AM »
No, that's not quite it. SCI Companion generates this weird code for Bset:
Code: [Select]
procedure proc_003a
; (= oldState (Btst flagEnum))
  003a:3f 01             link 1 // (var $1)
  003c:78               push1
  003d:8f 01              lsp param1
  003f:41 e6 02          call proc_0028 2
  0042:a5 00              sat temp0

; Take flagEnum and divide it by 16
  0044:8f 01              lsp param1
  0046:35 10              ldi 10
  0048:08                 div
  0049:36                push
  004a:9b 06             lsli local6

; Similarly, get the remainder
  004c:38 8000          pushi 8000 // $8000 sel_32768
  004f:8f 01              lsp param1
  0051:35 10              ldi 10
  0053:0a                 mod
; Compute $8000 >> that remainder
  0054:0c                 shr
; OR the bit in
  0055:14                  or
; but wait, wtf is this?
  0056:1a                 eq?
  0057:3a                toss
  0058:60               pprev
; Store the corrupted result back
  0059:bb 06             ssli local6
; (return oldState)
  005b:85 00              lat temp0
  005d:48                 ret
Yay stack corruption: Companion seems confused about when (/ flagEnum 16) is on the stack, and when it's not, and starts throwing away random stack values (at code offset 0057). So you are right that the code ends up storing into the wrong variable, but it is due to improper stack handling. The eq?/pprev idiom could be quite clever under the right circumstances, but I don't see how it helps here.

48
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: July 12, 2019, 09:38:27 PM »
Phil, there seems to be a problem with compiling the |= operator.
If I replace this:
Code: [Select]
(|= [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16)))
with this
Code: [Select]
(= [gameFlags (/ flagEnum 16)] (| [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16))))
then it works. For good measure, let's change Bclr as well:
Code: [Select]
(&= [gameFlags (/ flagEnum 16)] (~ (>> $8000 (mod flagEnum 16))))
becomes
Code: [Select]
(= [gameFlags (/ flagEnum 16)] (& [gameFlags (/ flagEnum 16)] (~ (>> $8000 (mod flagEnum 16)))))

49
Everything-Else / Re: Deluxe Paint Amiga Source Released on GitHub
« on: July 12, 2019, 05:14:22 AM »
Source code to stuff is always of interest to me.
Seconded.

50
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: July 09, 2019, 10:47:47 PM »
Also make sure that your enum declarations don't have duplicate numbers. It's easy to do this by accident.

51
Forum Support and Suggestions / Re: Trouble with SCI Companion
« on: July 06, 2019, 04:51:51 PM »
Palette insertion vs. replacement... somewhere in your workflow you have a palette that contains the old palette entries (most likely the ego view?), and since it is loaded later than the pic, its old entries replace the altered ones in the pic.

52
Forum Support and Suggestions / Re: Trouble with SCI Companion
« on: June 29, 2019, 12:34:27 AM »
This looks like a weird mix of SCI Studio and Sierra syntax. In particular, the expression that's throwing an error is in SCI Studio syntax. You can change it as follows:
Code: [Select]
      (painting
          setOnMeCheck: omcPOLYGON (CreateNewPolygon @P_Painting)
          init:)
(oh, I see it comes from the page you linked to...)
I haven't tested this btw, I just rewrote it mechanically in the new syntax.

53
SCI Development Tools / Re: Robot Transcoding with Alpha Channel
« on: June 22, 2019, 06:14:42 PM »
Eh? Both KQ7 and Phant1 use Robot version 5. PQ SWAT DEMO uses version 4 (the full version uses version 5).

re AVIROBOT: Strange how it's packaged with runtime files from BC++ 4.0, but compiled with those from 4.5. I may try to find the files from 4.5 to run it, but it only generates Robot version 4, so its use would be quite limited.

54
SCI Development Tools / Re: Robot Transcoding with Alpha Channel
« on: June 20, 2019, 05:18:52 PM »
A quick peek indicates those RBT tools will only generate version 3 files (a few even work with version 2). There were six versions in total, and we only have interpreters that will read version 4 (just one: the SWAT DEMO interpreter), 5 and 6 (I believe most other interpreters will read both of these). I haven't checked your source archive to see which versions we have in there.

55
SCI Syntax Help / Re: Compiling Sierra Games
« on: June 18, 2019, 05:11:32 PM »
Most of that code looks reasonable, the faulty bit is that huge block of asm at the top. It seems to start in the middle of a method, which is guaranteed to create all sorts of havoc (that's also why it is not decompiled in the first place).
I have a similar version of KQ6 (@troflip, not KQ4) with a similarly buggy script. The floppy version seems to work.

56
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 13, 2019, 03:49:22 PM »
Code: [Select]
(if z ...) ; will execute if z is 1 or higher
You mean non-zero. Whether an integer is treated as signed or unsigned depends on the opcode. That is why we have > versus >u (or was that u>).

57
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 12, 2019, 06:03:24 AM »
Is $8000 hex?  I know how to convert hex, but I'm a little fuzzy on how it applies here, if so?  I've got no real experience with bitwise operation; I feel like I get the most basic of concepts, but I'm definitely lacking in the applicability department, so I'm kind of slow at translating when it comes up.
Yup, 215, that is to say, the value you AND something with to isolate the 15th bit (OR to set it).
By shifting it right as here, you get decreasing powers of two which can be used similarly to isolate/set the 14th, 13th, etc. bit.

58
Hard to say what that is without seeing any code... it seems clear that you must have modified something to get that effect? otherwise, copy the SYSWINDOW.SC file over from the template game (contains the Save class and friends..) and delete whatever file contains the converted class.

59
You need a few extra parentheses:
Code: [Select]
(squirrel setMotion: MoveTo (squirrel x?) (squirrel y?))
but why would you want to do this? It's just a null mover, that may or may not cue the script (haven't checked)...

60
SCI Syntax Help / Re: Dialog Box Edges Hiding Objects Behind
« on: June 09, 2019, 07:56:45 PM »
They did eventually do so. It's called "use bitmaps for backgrounds".
But I like vector backgrounds! (of course, I liked the undithering algorithm too) ;)

Pages: 1 2 3 [4] 5 6 ... 34

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.141 seconds with 21 queries.