Author Topic: SCI Companion V3 - alpha build notes/bugs/feature requests  (Read 113702 times)

0 Members and 2 Guests are viewing this topic.

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #900 on: January 15, 2019, 07:09:10 PM »
It's the stupidest thing but I can't make it happen? If I copy-paste GetDirectory from SCI16's SAVE.SC to a test project, compile, and then decompile it works fine. It just puts the repeat block inside a return and such little things. Perhaps it's a difference between the system code at the time preserved in SCI16.zip and at the time of SQ6... and looking at these two files, I'm inclined to believe it. I'll take a look at death messages later.

...I just did my best to rewrite LSL3's DyingScript, which is also undecompileable, and decompiled it. I hate this issue.
« Last Edit: January 15, 2019, 07:34:47 PM by Kawa »

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #901 on: January 16, 2019, 03:27:46 AM »
If I copy-paste GetDirectory from SCI16's SAVE.SC to a test project, compile, and then decompile it works fine.

Have you tried SCI32's SAVE.SC?

Offline EricOakford

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #902 on: January 16, 2019, 10:34:31 AM »
I was going to say the same thing! SQ6 uses SCI32, so using the SCI32 SAVE.SC would have made more sense.

Also, here is the EgoDead procedure from the SCI01 template game. It doesn't decompile, so it falls back to assembly.

Decompile results:
Code: [Select]
Decompiling script 0
WARNING:  ::EgoDead: Analyzing control flow: Expected node with two successors (then/else): 1 at 0178
Falling back to disassembly for EgoDead
Generated c:\scicompanion\templategame\sci0.1\src\Main.sc
Decompiled 13 of 14 functions successfully (92%).
Overall bytecount success rate: 84%.
Fell back to assembly for the remaining functions.

For reference, here is the uncompiled code:
Code: [Select]
(procedure (EgoDead message &tmp printRet)
;This procedure handles when Ego dies. It closely matches that of QFG1EGA.
;To use it: "(EgoDead {death message})". You can add a title and icon in the same way as a normal Print message.
(HandsOff)
(Wait 100)
(= normalCursor ARROW_CURSOR)
(theGame setCursor: normalCursor TRUE)
(SFX stop:)
(music number: deathSound play:)
(repeat
(= printRet
(Print message
&rest
#width 250
#button {Restore} 1
#button {Restart} 2
#button {__Quit__} 3
)
)
(switch printRet
(1
(theGame restore:)
)
(2
(theGame restart:)
)
(3
(= quit TRUE) (break)
)
)
)
)

And here is the asm that the decompiler fell back to:
Code: [Select]
(procedure (EgoDead param1 param2 &tmp temp0)
(asm
pushi    0
call     HandsOff,  0
pushi    1
pushi    100
callk    Wait,  2
ldi      999
sal      normalCursor
pushi    #setCursor
pushi    2
lsl      normalCursor
pushi    1
lal      theGame
send     8
pushi    #stop
pushi    0
lal      SFX
send     4
pushi    #number
pushi    1
lsl      deathSound
pushi    42
pushi    0
lal      music
send     10
code_012d:
ldi      1
bnt      code_0187
pushi    12
lsp      param1
&rest    param2
pushi    70
pushi    250
pushi    81
lofss    {Restore}
pushi    1
pushi    81
lofss    {Restart}
pushi    2
pushi    81
lofss    {__Quit__}
pushi    3
calle    Print,  24
sat      temp0
lst      temp0
dup     
ldi      1
eq?     
bnt      code_0168
pushi    #restore
pushi    0
lal      theGame
send     4
jmp      code_0184
code_0168:
dup     
ldi      2
eq?     
bnt      code_0178
pushi    #restart
pushi    0
lal      theGame
send     4
jmp      code_0184
code_0178:
dup     
ldi      3
eq?     
bnt      code_0184
ldi      1
sal      quit
jmp      code_0187
code_0184:
toss   
jmp      code_012d
code_0187:
ret     
)
)

The part where the decompiler fails is at code_0178, the part that handles the Quit button. It must be the break statement that it can't handle.
« Last Edit: January 16, 2019, 10:59:54 AM by EricOakford »
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #903 on: January 16, 2019, 01:05:33 PM »
Oh crap, I meant SQ5, wow! And that break is exactly the part my attempt was missing, too. And that makes the little test routine as follows:

Code: [Select]
(procedure (TheTest)
(repeat
(switch (== 1 1)
(1 (break))
)
)
)
which decompiles to
Code: [Select]
(procedure (TheTest)
(asm
code_000a:
ldi      1
bnt      code_001a
pushi    1
dup     
ldi      1
eq?     
bnt      code_0017
jmp      code_001a
code_0017:
toss   
jmp      code_000a
code_001a:
ret     
)
)

Notably, breaking on an if works fine:
Code: [Select]
(procedure (TheTest)
(repeat
(if TRUE (break))
)
)
« Last Edit: January 16, 2019, 01:18:25 PM by Kawa »

Offline Collector

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #904 on: January 18, 2019, 04:59:07 PM »
While trying to decompile the '90 EGA Christmas card it crashes on script 996 (User). It handles all of the other scripts. If I pull the user.sc and user.sco from the VGA '90 card the compiler crashes on the same script.
KQII Remake Pic

Offline EricOakford

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #905 on: April 05, 2019, 08:42:30 PM »
While trying to decompile the '90 EGA Christmas card it crashes on script 996 (User). It handles all of the other scripts. If I pull the user.sc and user.sco from the VGA '90 card the compiler crashes on the same script.

I figured out the cause of that problem - The Seasoned Professional has no VOCAB.900 resource. Taking the VOCAB.900 from another game, like the QFG2 demo, allows the script to decompile.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1

Offline Collector

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #906 on: May 14, 2019, 07:33:36 PM »
I know someone that is about to release a new replacement for the INN server.

https://www.facebook.com/groups/69704136680/permalink/10156005666256681/

I tried an early alpha of it and it could let you into areas that the Revival could not. James Leiterman was a developer in the old INN barn. "INN Barn" supports all of the original INN games and should work with new games. Not sure if they need to be developed with LSCI, but it does make make me curious as to how hard it would be to add LSCI support to SCI Companion.
KQII Remake Pic

Offline lskovlun

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #907 on: May 17, 2019, 12:42:59 AM »
I've been asked to help out with LSCI support for ScummVM, and I helped fix a bug in the INN Barn last month. So, a few things that come to mind:
  • The file extension for script patches is different (.SO instead of .SCR), and the format is likely to be different. Also, small differences in syntax.
  • LSCI scripts often don't contain the names of objects, so we are left to guess (this is technically possible in ordinary SCI as well, it was just never used), which would make decompilation less useful.
  • There's a bunch of new kernel calls that would have to be documented. This is not only for network access, but also for strings/arrays. The latter has a very SCI32-like flavor, I sure wish they'd ported that to ordinary SCI16. Oh well.
  • How to use the networking protocols and such to integrate one's code with INN
  • And of course a bunch of new classes.

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #908 on: May 17, 2019, 07:34:28 AM »
There's a bunch of new kernel calls that would have to be documented. This is not only for network access, but also for strings/arrays. The latter has a very SCI32-like flavor, I sure wish they'd ported that to ordinary SCI16. Oh well.
*coughs guiltily*

Offline Collector

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #909 on: May 17, 2019, 08:36:04 AM »
The scripts still have the .sc extension

Code: [Select]
;;;;
;;;; NETUSER.SC
;;;; (c) Sierra On-Line, Inc, 1988
;;;;
;;;; Author: Jeff Stephenson
;;;;
;;;; A network version of User.
;;;;
;;;; Classes:
;;;; NetUser



(module# NETUSER)


(define INPUTLEN 210)

(class NetUser of User
(properties
id    name: "NetUser"
int sid    0
int   numLines 2 ;; number of lines for getText.
int   disposeOfIncomingMessage TRUE
)


(method (init)
(super init: (String new: INPUTLEN))
(= prompt (super prompt?))
)


(method (getText nLines &tmp rect retVal saveFont)
(= saveFont (DEdit font?))
(DEdit font: smallFont)

(= rect (Rectangle new:))
(TextSize rect "M" smallFont)
(rect
height: (* (if argc nLines else numLines) (rect height:)),
width: 256,
)

(= retVal
(Print
prompt
#p_at: x y
#p_width: (rect width:)
#p_rEdit: inputLine (inputLine strMax:) rect
&rest
)
)

(rect dispose:)
(DEdit font: saveFont)

(return retVal)
)


(method (handleEvent event &tmp msg)
(switch (event type?)
(remoteEvt
(if haveConnection
(= msg (Msg with: (event message?) (event modifiers?)))
(if (== msg NULLID)
(return)
)
(if (& debugMsgs SHOW_MSG)
(Debug DInspect msg)
)
(cond
((IsObject (msg to?))
(if netMsgProcessor
;; if there are already any messages in the nmpSystemQueue
;; then do not allow any incoming messages to be
;; handled.
(if ((netMsgProcessor nmpSystemQueue?) size:)
(netMsgProcessor putMsg: msg)
(return)
else
((msg to?) handleMsg: msg)
)
else
((msg to?) handleMsg: msg)
)
)

;; big time kludge for OLS
;;
((== (msg to?) 0)
(if curRoom
(if (== (curRoom number?) 14) ;; ONLINESIGNUP
(curRoom handleMsg: msg)
)
)
)

((== (& debugMsgs RCV_NOT_OBJ) 0)
)

;RWL (
;RWL (Print
;RWL "Message receiver not an object."
;RWL #p_button " Debug " 1
;RWL #p_button " Ignore " 0
;RWL )
;RWL )
)

(if disposeOfIncomingMessage
(msg dispose:)
)
)
)
(else
(super handleEvent: event)
)
)
)


(method (said event)
(or
(cast handleEvent: event)
(features handleEvent: event)
(theGame handleEvent: event)
)
)


(method (parse line evt)
(evt message: line)
(return TRUE)
)
)

KQII Remake Pic

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #910 on: May 17, 2019, 02:19:34 PM »
small differences in syntax.
That'd be stuff like the optional type specifiers in Collector's example file, right? Cos besides define taking more than just a single value and kindof being a deprecated synonym to of that's about the only syntax differences I know of. Which kernel calls are available has no bearing on the syntax or format after all.

Which explains why the script source files still have the .sc extension.

Offline lskovlun

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #911 on: May 17, 2019, 07:55:34 PM »
Which explains why the script source files still have the .sc extension.
But the include files have an .si extension.

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #912 on: May 18, 2019, 02:32:35 AM »
But the include files have an .si extension.
You called them "include" files with an 'i' so why not?

Offline Collector

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #913 on: May 18, 2019, 09:16:12 AM »
A sample
KQII Remake Pic

Offline EricOakford

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #914 on: May 18, 2019, 09:13:25 PM »
All right! There's another version of GAME.SC in that archive! I've just now used it along with SCI16's GAME.SC to carefully document the ones in my templates.
« Last Edit: May 19, 2019, 12:57:23 PM by EricOakford »
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1


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

Page created in 0.148 seconds with 23 queries.