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

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: Custom-building your own SSCI
« Reply #30 on: August 14, 2018, 12:14:10 AM »
Really cool to watch this develop.
Brass Lantern Prop Competition

Offline Kawa

Re: Custom-building your own SSCI
« Reply #31 on: August 14, 2018, 06:23:49 AM »
Y'think? Here's the ENDOOM thing:

START.C
Code: [Select]
void exit(char code)
{
int i;
Handle hB800;
volatile char far* vidya = (volatile char far*)0xB8000000;
char far* b800;

for (i = exitIndex - 1; i >= 0; i--)
exitProcs[i]();

if (panicStr)
WriteString(panicStr);
else
{
if (ResCheck(RES_VOCAB, 0xB8))
{
hB800 = ResLoad(RES_VOCAB, 0xB8);
b800 = (char far*)*hB800;
for (i = 0; i < 80*25*2; i++)
*vidya++ = *b800++;
gotoxy(23, 0);
//Consideration: add four bytes to the end of the picture
//data with the quitStr and prompt coordinates.
}
else if (quitStr)
WriteString(quitStr);
}

ExitFromC(code);
}

STARTASM.S
Code: [Select]
gotoxy proc row: byte, col: byte
mov ah, 2
xor bh, bh
mov dh, row
xor dl, col
int 10h
ret
gotoxy endp

START.H
Code: [Select]
void gotoxy(char, char);
And then you just drop your standard textmode screen dump, 4000 bytes plus an 86 00 resource cookie in the front, in your game as 184.VOC and quit the game. And then you realize DOSBox is set up to quit afterwards and you slap yourself on the forehead.

Offline lskovlun

Re: Custom-building your own SSCI
« Reply #32 on: August 23, 2018, 03:15:09 PM »
You are pulling our collective legs, right?
STARTASM.S
Code: [Select]
gotoxy proc row: byte, col: byte
mov ah, 2
xor bh, bh
mov dh, row
*** xor dl, col ***
int 10h
ret
gotoxy endp
This makes DL undefined unless it happened to be zero to begin with (which may well be true but unreliable) in which case DL = 0 ^ col = col.

Offline Kawa

Re: Custom-building your own SSCI
« Reply #33 on: August 23, 2018, 05:13:36 PM »
I never said I was any good at x86 ASM. But you did just solve an odd problem.

Edit: yeah, I now have quitString appearing wherever the vocab specifies it should.
Code: [Select]
if (ResCheck(RES_VOCAB, 0xB8))
{
hB800 = ResLoad(RES_VOCAB, 0xB8);
b800 = (char far*)*hB800;
for (i = 0; i < 80*25*2; i++)
*vidya++ = *b800++;
x = *b800++; y = *b800++;
if (quitStr)
{
gotoxy(x, y);
WriteString(quitStr);
}
x = *b800++; y = *b800++;
gotoxy(x, y); //note: prompt appears at the *next* line.
}
else if (quitStr)
WriteString(quitStr);
« Last Edit: August 23, 2018, 05:31:57 PM by Kawa »

Offline Kawa

Re: Custom-building your own SSCI
« Reply #34 on: September 01, 2018, 04:26:19 PM »
In cels.s, invoked in the line builders after setting al to the current view pixel color:
Code: [Select]
DoColorKawaHax proc near
.if (al == ss:skip) || (al >= REMAPCOLORSTART)
ret
.elseif (ss:kawaHax == 1)
xor al, al
.elseif (ss:kawaHax == 2)
;naive shitty but fast
;dec al

;proper
push bx
xor bh, bh
mov bl, al
mov al, ss:remapTable[bx]
pop bx
.elseif (ss:kawaHax == 3)
mov al, 253
.endif
ret
DoColorKawaHax endp
with kawaHax defined up top as
Code: [Select]
public kawaHax
kawaHax byte 0

In animate.c, add an extern char kawaHax; and add this:
Code: [Select]
//this handle will be valid for a while */
theViewNum = IndexedProp(him, actView);
view = ResLoad(RES_VIEW, theViewNum);

kawaHax = GetProperty(him,s_vm_signal) >> 8;

//all stopped actors have already been drawn
//a HIDE actor is not drawn
//a VIEWADDED is not drawn
if (!(signal & (VIEWADDED | NOUPDATE | HIDE)))
{
//......
}
kawaHax = 0;
}

//do we show the screen here
Now you can do stuff like this in an actor's doit:
Code: [Select]
(if (== (self onControl: TRUE) ctlGREY)
(self scaleSignal: (| (self scaleSignal?) $200))
else
(self scaleSignal: (& (self scaleSignal?) (~ $200)))
)
Try it on Ego. Given an earlier (RemapColors rcPERCENT 253 64), every dark gray control area now causes that actor to darken in shadow.



It's like Roger Wilco in SQ3, as seen in that video I made, but better.

Offline Collector

Re: Custom-building your own SSCI
« Reply #35 on: September 03, 2018, 01:55:51 PM »
Nice effect. Now if the shadow is being cast at an angle the shade would sweep up and down the character when walking through it.
KQII Remake Pic

Offline Kawa

Re: Custom-building your own SSCI
« Reply #36 on: September 03, 2018, 04:48:55 PM »


This is not something I added! It turns out that DrawCel has two more optional parameters that aren't listed in Phil's documentation: scaleX scaleY. I don't know if this also applies to SCI11, but that's easy enough to test.

I found that out while trying to simulate PQ4's translucent windows.

Offline Kawa

Re: Custom-building your own SSCI
« Reply #37 on: September 05, 2018, 04:14:33 AM »
Using SCI Companion's version detector as a guide because the ScummVM wiki page on the topic is too confusingly worded, I've added a thing where the interpreter'll try to ensure you're trying to run an SCI11 game, so instead of getting zero hunk allocation requests, errors on explode, or missing 0.fon, all in bigass font, you get a friendly and informative message.

Offline Collector

Re: Custom-building your own SSCI
« Reply #38 on: September 05, 2018, 08:55:28 AM »
So this is version detection of the resources, not the interpreter?
KQII Remake Pic

Offline Kawa

Re: Custom-building your own SSCI
« Reply #39 on: September 05, 2018, 09:31:37 AM »
The interpreter detects the format of resource.map so as to not try and fail to run non-SCI11 data.

Offline Collector

Re: Custom-building your own SSCI
« Reply #40 on: September 05, 2018, 08:14:20 PM »
Nice. This must be what the ScummVM does to guess the versions of the interpreters with the "x.yyy.yyy" version strings.
KQII Remake Pic

Offline Kawa

Re: Custom-building your own SSCI
« Reply #41 on: September 06, 2018, 07:02:24 AM »
Near I can tell it always does this. After all, you only need the resource files to run the games in ScummVM.

I've been working on a flip bit but I'm having trouble with the Y-offsets.

Offline Collector

Re: Custom-building your own SSCI
« Reply #42 on: September 06, 2018, 11:30:31 AM »
When ScummVM decided to take on SCI they started with the then available documentation like the FreeSCI specs, etc. Among those were the HWM documents. His SCI version list is based on the interpreter itself, I assume from the version string. The Wiki still has this list with the "x.yyy.yyy" strings.

It would make sense that SVM would have to go by resource versions to handle a game since the original interpreter is not used.

Near I can tell it always does this. After all, you only need the resource files to run the games in ScummVM.

I've been working on a flip bit but I'm having trouble with the Y-offsets.

For cast shadows and reflections of views?
KQII Remake Pic

Offline Kawa

Re: Custom-building your own SSCI
« Reply #43 on: September 06, 2018, 12:46:44 PM »
For cast shadows and reflections of views?
Exactly that.

Offline lskovlun

Re: Custom-building your own SSCI
« Reply #44 on: September 06, 2018, 03:35:26 PM »
Yes, ScummVM does other things (the full algorithm can't work without having loaded the selector table and instantiated some scripts). We used version numbers in the FreeSCI days, but it became untenable with both SCI1.1 and SCI32.. No version numbers, and lots of little annoying quirks in each interpreter. (Try issuing the 'version' command from a ScummVM console one day and see. Its output is... voluminous).



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

Page created in 0.123 seconds with 24 queries.