Author Topic: Custom-building your own SSCI  (Read 20729 times)

0 Members and 1 Guest are viewing this topic.

Offline troflip

Re: Custom-building your own SSCI
« Reply #15 on: April 22, 2017, 09:52:39 PM »
Idea for easy add: ability to vertically flip views.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #16 on: April 23, 2017, 07:11:50 AM »
Easy perhaps, but still ASM. Tch, we'll see.

Offline MusicallyInspired

Re: Custom-building your own SSCI
« Reply #17 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.
Brass Lantern Prop Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #18 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



This has of course been tested and confirmed. The scibuild.zip file in my stash has been updated accordingly.

Offline troflip

Re: Custom-building your own SSCI
« Reply #19 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)
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #20 on: October 07, 2017, 02:42:44 PM »
I'm gonna need another field for those flags.

Offline troflip

Re: Custom-building your own SSCI
« Reply #21 on: October 07, 2017, 02:50:09 PM »
Yes, you will.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #22 on: April 01, 2018, 10:16:17 AM »
Y'know, I haven't done anything with this for a bit now, but the fact you can build versions that have menu bar support like the terp that came with LSL6 did remind me of something. I did mention menu bars on page one about (Kawa 3).

SIERRA.EXE has no debugger and no menu bar, basically the one intended for public use. SIERRAM.EXE adds SCI0-style menu bar support to that, and is basically what LSL6 came with. SCI.EXE includes the debugger, and SCITESTR.EXE has both.

Given a SIERRAM terp (custom built or LSL6's), what's stopping you from being cheeky and removing the icon bar?

Edit: and yes, I did add that "& 2 to check if menus are available" thing:
Code: [Select]
case 3: //KAWA_ISDEBUG
  //(Kawa 3) ;Returns 1 if debug version, 2 if menu bars are enabled, 3 if both.
  acc = isDebugVersion;
#if TESTER
  acc |= 2;
#endif
  break;
« Last Edit: April 01, 2018, 10:18:00 AM by Kawa »

Offline Kawa

Re: Custom-building your own SSCI
« Reply #23 on: July 13, 2018, 04:39:13 AM »
Given no resource.cfg, the original interpreter will say it can't find the configuration file and to run the install program.
Given a config file with a missing video driver -- literally no videoDrv = ____ line at all -- it'll say it couldn't install the video driver but not how to fix it.

So I edited mine to detect the fact that there's no driver specified and simply say, "please run the install program." No script #, no IP #, just a simple request so next time you run it there will be a video driver to try and load.

Now I should update my install program to secretly reset to defaults if these things are missing too cos I just loaded a no-driver config and it was full of blanks :D (update: done and uploaded.)
« Last Edit: July 13, 2018, 04:49:49 AM by Kawa »

Offline Kawa

Re: Custom-building your own SSCI
« Reply #24 on: July 13, 2018, 05:37:30 AM »
Oh, and another thing that I did. Ending text screens. B800 screens, ENDOOM screens, whatever you wanna call 'em. If the data's not there, it reverts to the regular quit message.

Offline MusicallyInspired

Re: Custom-building your own SSCI
« Reply #25 on: July 18, 2018, 08:16:13 AM »
ASCII ending screens are the best.
Brass Lantern Prop Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #26 on: August 12, 2018, 10:20:26 AM »
It's about time I added a new feature.



(Display {This text is outlined automagically!} dsCOORD 8 8 dsALIGN 2 dsCOLOR 31)

Alignment can be 0 for left, 1 for center, or -1 for right. Seems a waste of a whole 16-bit word, why not make 2 left-outlined and 3 center-outlined?

In any case I can now draw outlined text in any font I damn well want.




In KERNEL.C:
Code: [Select]
RGrafPort savePort;
RPoint newPenLoc;
word penColor = 0, outline = 0; //add these two
width = colorIt = -1;
mode = TEJUSTLEFT;
Code: [Select]
case p_color:
penColor = *args++; //instead of calling PenColor directly
break;
Code: [Select]
//get size of text rectangle
RTextSize(&r, text, -1, width);

if (mode & 2) RInsetRect(&r, -1, -1); //not sure if needed but eeeeeh

//move the rectangle to current pen position
MoveRect(&r, rThePort->pnLoc.h, rThePort->pnLoc.v);
Code: [Select]
//opaque background
if (colorIt != -1) RFillRect(&r, VMAP, colorIt);

//add this whole thing.
if (mode & 2) {
mode &= ~2;
ROffsetRect(&r, 1, 0); RTextBox(text, FALSE, &r, mode, -1); //right...
ROffsetRect(&r, 0, 1); RTextBox(text, FALSE, &r, mode, -1); //bottom right...
ROffsetRect(&r,-1, 0); RTextBox(text, FALSE, &r, mode, -1); //bottom...
ROffsetRect(&r,-1, 0); RTextBox(text, FALSE, &r, mode, -1); //bottom left...
ROffsetRect(&r, 0,-1); RTextBox(text, FALSE, &r, mode, -1); //left...
ROffsetRect(&r, 0,-1); RTextBox(text, FALSE, &r, mode, -1); //top left...
ROffsetRect(&r, 1, 0); RTextBox(text, FALSE, &r, mode, -1); //top...
ROffsetRect(&r, 1, 0); RTextBox(text, FALSE, &r, mode, -1); //top right...
ROffsetRect(&r,-1, 1); //and back to the center.
}
PenColor(penColor); //NOW we set our pen color!

//now draw the text and show the rectangle it is in
RTextBox(text, FALSE, &r, mode, -1);
Outlines are always in black because it calls PenColor(0) before parsing the arguments.
« Last Edit: August 12, 2018, 10:26:38 AM by Kawa »

Offline troflip

Re: Custom-building your own SSCI
« Reply #27 on: August 12, 2018, 03:45:50 PM »
Add another bitmask/flag for controlling which of the 8 "outline texts" are drawn. Then you can do things like dropshadows, or fake a blur on the text if the outline color is partway between your text color and your screen (this is how I do the hover effect on the verbs in Snowspirit).
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #28 on: August 12, 2018, 04:43:31 PM »
I was thinking of having the 4 bit do dropshadows... by the way, I mentioned this on Twitter but there's an extra value in Display that's not in your header file, 121 "noshow".

Offline Kawa

Re: Custom-building your own SSCI
« Reply #29 on: August 13, 2018, 08:38:30 AM »
Okay, I moved the thing into its own pseud, dsSTROKE 122, and made it a bitfield. You'll notice there was an unused outline variable in that code I posted...

Code: [Select]
case p_noshow:
showIt = 0;
break;
case p_stroke:
stroke = *args++; //this was that variable.
break;
Code: [Select]
if (stroke)
{
ROffsetRect(&r, 1, 0); if (stroke &   1) RTextBox(text, FALSE, &r, mode, -1); //right...
ROffsetRect(&r, 0, 1); if (stroke &   2) RTextBox(text, FALSE, &r, mode, -1); //bottom right...
ROffsetRect(&r,-1, 0); if (stroke &   4) RTextBox(text, FALSE, &r, mode, -1); //bottom...
ROffsetRect(&r,-1, 0); if (stroke &   8) RTextBox(text, FALSE, &r, mode, -1); //bottom left...
ROffsetRect(&r, 0,-1); if (stroke &  16) RTextBox(text, FALSE, &r, mode, -1); //left...
ROffsetRect(&r, 0,-1); if (stroke &  32) RTextBox(text, FALSE, &r, mode, -1); //top left...
ROffsetRect(&r, 1, 0); if (stroke &  64) RTextBox(text, FALSE, &r, mode, -1); //top...
ROffsetRect(&r, 1, 0); if (stroke & 128) RTextBox(text, FALSE, &r, mode, -1); //top right...
ROffsetRect(&r,-1, 1); //and center.
}
Useless offset calls, but this does ensure you end up in the right spot.





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

Page created in 0.021 seconds with 23 queries.