Community

SCI Programming => SCI Development Tools => Topic started by: Kawa on April 12, 2017, 05:48:34 PM

Title: Custom-building your own SSCI
Post by: Kawa on April 12, 2017, 05:48:34 PM
I just managed to compile my own copy of sierra.exe. It doesn't actually run anything yet, but at least I got the right compiler! Lemme just rename it so it can coexist with the one that came with the archive...

(http://i.imgur.com/pTk7ux2.png)
Yeah okay, I'll accept that.

Edit: got a new development environment set up in a DOSbox. Two minor changes to startasm.s and info.c later, I have an SCI.EXE (debug) that manages to run the template game, albeit without the ability to initialize my sound hardware, and a SIERRA.EXE that actively refuses because it's not been stamped.
Title: Re: Custom-building your oe
Post by: Collector on April 12, 2017, 11:44:06 PM
What compiler?
Title: Re: Custom-building your oe
Post by: OmerMor on April 13, 2017, 05:59:32 AM
VC++ v1.52 I guess?  :)
Title: Re: Custom-building your oe
Post by: Kawa on April 13, 2017, 06:06:34 AM
Yeah. Who wantsHere's a ZIP with all you need to compile this?: http://helmet.kafuka.org/sci/scibuild.zip run it in DOSBox, with SCIBUILD as C:, invoke GO to set up the env. Run it at least INSTALL once for initial setup to remove stamping and such.

Things I feel like doing:
1. Fix the issues cl warns about
2. Add a novel subcommand, palette inversion most likely.

Changelog: EXISTS is shit, split up the setup batch files instead. Added -nologo and @ to clean up compiler invocations.
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 13, 2017, 07:59:15 PM
I've been going through the code, fixing warnings and mildly updating formatting style -- it's full of old-style function definitions with the types listed separately -- and I'm wondering what kind of features could feasibly be added.

So far I've got that palette inversion thing, (RemapColors rcZAWARUDO [range]), which needs more testing, and an optional fourth arg for DisplayPic to control transition speeds, confirmed to work on dsOPEN_CHECKBOARD and dsOPEN_FADEPALETTE (names from memory because lolphone).

Phil has suggested:
* Savegame thumbnails, though I've no idea where to even start, plus there's the whole palette thing.
* Masked sprites.
* Coroutines, so very likely.
Title: Re: Custom-building your own SSCI
Post by: Collector on April 13, 2017, 08:47:32 PM
Port to Win32 ;)
Title: Re: Custom-building your own SSCI
Post by: troflip on April 14, 2017, 12:07:56 AM
Masked sprites seem like the easiest (and biggest bang for the buck). In Cascade Quest, I use them for: having a waterfall "dry up", making the ego partially submerged in water (at different levels), making the ego partially transparent, and fading from one tv screen to another.

Savegame thumbnails and coroutines would be a ton of work.
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 14, 2017, 04:15:31 AM
If the cel drawing routine is ASM, I'm not going there.

Edit: phucking fone
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 14, 2017, 09:27:28 AM
New kernel call, so as to not foul up what's already there:

(Kawa 0 {...}) wraps DoAlert(), basically.
(Kawa 1 [from] [to]) inverts the specified range in the palette. Here's (Kawa 1 0 63). (https://i.imgur.com/frilbIs.png)
(Kawa 2 [back] [text]) sets the title bar color of the uncustomized system window. To wit. (https://i.imgur.com/P3FZtKk.png)
(Kawa 3) returns 1 if we're running a debug terp. Might extend this to &2 if we have menu bar support, I dunno.

Title: Re: Custom-building your own SSCI
Post by: troflip on April 14, 2017, 11:06:22 AM
Haha...

When I still cared about running (or was able to run) on Sierra SCI, I was overloading DoAvoider for my kernel extensibility, since it does nothing (on SCI0 anyway).
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 14, 2017, 11:14:51 AM
Why overload when you can extend, right?
Title: Re: Custom-building your own SSCI
Post by: lskovlun on April 14, 2017, 01:41:21 PM
(Kawa 1 [from] [to]) inverts the specified range in the palette.
Ilira on shrooms?
Title: Re: Custom-building your own SSCI
Post by: troflip on April 15, 2017, 12:24:50 AM
From what I recall, you can only modify the intensity of a palette right? How about adding color channel multipliers, or saturation adjustment, or hue shifting? Should be pretty straightforward (although I guess there's already a function to transition gradually between 2 palettes, so maybe that's not needed).
Title: Re: Custom-building your own SSCI
Post by: MusicallyInspired on April 15, 2017, 01:37:12 AM
Well, having the ability to adjust a palette by hue, saturation, etc would negate the need to have extra palette resources....though that's not really a huge issue. Maybe just easier to deal with commands than remembering which palettes are which?
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 16, 2017, 04:02:13 AM
Palette adjustments like that, without using floats? Should be fun. And you could always use some defines in your PalVary call to identify the targets.

Anyway, here's a control renderer that listens to the back and color properties. Normally it only cares about text and font.
(http://i.imgur.com/Vymasda.png)
Shown here on a one-pixel bevel window. Where and how these colors are set is up to you.
Title: Re: Custom-building your own SSCI
Post by: troflip on April 22, 2017, 09:52:39 PM
Idea for easy add: ability to vertically flip views.
Title: Re: Custom-building your own SSCI
Post by: Kawa on April 23, 2017, 07:11:50 AM
Easy perhaps, but still ASM. Tch, we'll see.
Title: Re: Custom-building your own SSCI
Post by: MusicallyInspired on April 23, 2017, 06:13:56 PM
Easy perhaps, but still ASM. Tch, we'll see.

It's "tsk" not "tch", you barbarian you.
Title: Re: Custom-building your own SSCI
Post by: Kawa on June 13, 2017, 03:42:09 PM
So with a little help from IDA and a few liters of diet coke, I found out that startasm.s was being assembled wrong. This broke restore/restart, which works by longjmp, and saving if it were to fail. And woah boy how it broke.

Turns out that MASM was generating extra code around the setjmp and longjmp procedures, because they have parameters. The originally released code did not specify any, but MASM wouldn't take it because the proto definitions did have parameters. To quote the MASM 6.11 manual:
Quote
When you use the PROC directive with its extended syntax and argument list, the assembler automatically generates the prologue and epilogue code in your procedure.
Quote
If a procedure does not have any parameters or local variables, the prologue and epilogue code that sets up and restores a stack pointer is omitted, unless FORCEFRAME is included in the prologuearg list.
We want to do the opposite here, though...
Quote
If you want to revert to the standard prologue or epilogue code, use PROLOGUEDEF or EPILOGUEDEF as the macroname in the OPTION statement.
Code: [Select]
OPTION EPILOGUE:EPILOGUEDEFYou can completely suppress prologue or epilogue generation with
Code: [Select]
OPTION PROLOGUE:None
OPTION EPILOGUE:None

(http://i.imgur.com/2tJJpmk.gif)

This has of course been tested and confirmed. The scibuild.zip file in my stash has been updated accordingly.
Title: Re: Custom-building your own SSCI
Post by: troflip on October 07, 2017, 02:26:48 PM
If you're still working on this, other than the x/y axis flipping (which is useful for having mirror or floor reflections), you can:

- have a flag that says ignore the priority comparison when drawing a view (so it always draws)
- have a flag that tells a view not to write to the visual screen (combined with the above, useful for cutting out holes of lower priority in a scene... like for a window)
- have a flag that tells a view not to write to the priority screen (lets you apply a "decal" onto a surface of varying priority)
- have a flag that inverts the priority compare (why would you do this? I have a crazy reason to do this)
Title: Re: Custom-building your own SSCI
Post by: Kawa on October 07, 2017, 02:42:44 PM
I'm gonna need another field for those flags.
Title: Re: Custom-building your own SSCI
Post by: troflip on October 07, 2017, 02:50:09 PM
Yes, you will.