Skip to content

Commit

Permalink
DIRECTOR: Lingo: Added stubs for 'closeDA', 'closeResFile' and 'close…
Browse files Browse the repository at this point in the history
…Xlib'
  • Loading branch information
sev- committed Aug 4, 2016
1 parent 7ec2e7b commit 415cefd
Show file tree
Hide file tree
Showing 8 changed files with 816 additions and 704 deletions.
11 changes: 8 additions & 3 deletions engines/director/lingo/lingo-builtins.cpp
Expand Up @@ -48,9 +48,10 @@ static struct BuiltinProto {
{ "length", Lingo::b_length, 1 },
{ "string", Lingo::b_string, 1 },
// Misc
{ "dontpassevent", Lingo::b_dontpassevent, -1 },
{ "updatestage", Lingo::b_updatestage, -1 },
{ "ilk", Lingo::b_ilk, 1 },
{ "closeDA", Lingo::b_closeDA, -1 },
{ "dontpassevent", Lingo::b_dontpassevent, -1 },
{ "updatestage", Lingo::b_updatestage, -1 },
{ "ilk", Lingo::b_ilk, 1 },
// point
{ "point", Lingo::b_point, 2 },
{ 0, 0, 0 }
Expand Down Expand Up @@ -239,6 +240,10 @@ void Lingo::b_ilk() {
g_lingo->push(d);
}

void Lingo::b_closeDA() {
warning("STUB: b_closeDA");
}

///////////////////
// Point
///////////////////
Expand Down
20 changes: 20 additions & 0 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -698,6 +698,26 @@ void Lingo::c_alert() {
delete d.u.s;
}

void Lingo::c_closeResFile() {
Datum d = g_lingo->pop();

d.toString();

warning("STUB: c_closeResFile(%s)", d.u.s->c_str());

delete d.u.s;
}

void Lingo::c_closeXlib() {
Datum d = g_lingo->pop();

d.toString();

warning("STUB: c_closeXlib(%s)", d.u.s->c_str());

delete d.u.s;
}

void Lingo::c_beep() {
Datum d = g_lingo->pop();
g_lingo->func_beep(d.u.i);
Expand Down
883 changes: 463 additions & 420 deletions engines/director/lingo/lingo-gr.cpp

Large diffs are not rendered by default.

66 changes: 35 additions & 31 deletions engines/director/lingo/lingo-gr.h
Expand Up @@ -87,21 +87,23 @@
tMETHOD = 303,
tALERT = 304,
tBEEP = 305,
tGE = 306,
tLE = 307,
tGT = 308,
tLT = 309,
tEQ = 310,
tNEQ = 311,
tAND = 312,
tOR = 313,
tNOT = 314,
tCONCAT = 315,
tCONTAINS = 316,
tSTARTS = 317,
tSPRITE = 318,
tINTERSECTS = 319,
tWITHIN = 320
tCLOSERESFILE = 306,
tCLOSEXLIB = 307,
tGE = 308,
tLE = 309,
tGT = 310,
tLT = 311,
tEQ = 312,
tNEQ = 313,
tAND = 314,
tOR = 315,
tNOT = 316,
tCONCAT = 317,
tCONTAINS = 318,
tSTARTS = 319,
tSPRITE = 320,
tINTERSECTS = 321,
tWITHIN = 322
};
#endif
/* Tokens. */
Expand Down Expand Up @@ -153,21 +155,23 @@
#define tMETHOD 303
#define tALERT 304
#define tBEEP 305
#define tGE 306
#define tLE 307
#define tGT 308
#define tLT 309
#define tEQ 310
#define tNEQ 311
#define tAND 312
#define tOR 313
#define tNOT 314
#define tCONCAT 315
#define tCONTAINS 316
#define tSTARTS 317
#define tSPRITE 318
#define tINTERSECTS 319
#define tWITHIN 320
#define tCLOSERESFILE 306
#define tCLOSEXLIB 307
#define tGE 308
#define tLE 309
#define tGT 310
#define tLT 311
#define tEQ 312
#define tNEQ 313
#define tAND 314
#define tOR 315
#define tNOT 316
#define tCONCAT 317
#define tCONTAINS 318
#define tSTARTS 319
#define tSPRITE 320
#define tINTERSECTS 321
#define tWITHIN 322



Expand All @@ -185,7 +189,7 @@ typedef union YYSTYPE
Common::Array<double> *arr;
}
/* Line 1529 of yacc.c. */
#line 189 "engines/director/lingo/lingo-gr.hpp"
#line 193 "engines/director/lingo/lingo-gr.hpp"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
Expand Down
16 changes: 15 additions & 1 deletion engines/director/lingo/lingo-gr.y
Expand Up @@ -85,7 +85,7 @@ void yyerror(char *s) {
%token<s> ID
%token tDOWN tELSE tNLELSIF tEND tEXIT tFRAME tGLOBAL tGO tIF tINTO tLOOP tMACRO
%token tMCI tMCIWAIT tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tALERT tBEEP
%token tWITH tWHILE tNLELSE tFACTORY tMETHOD tALERT tBEEP tCLOSERESFILE tCLOSEXLIB
%token tGE tLE tGT tLT tEQ tNEQ tAND tOR tNOT
%token tCONCAT tCONTAINS tSTARTS
%token tSPRITE tINTERSECTS tWITHIN
Expand Down Expand Up @@ -421,6 +421,20 @@ func: tMCI vSTRING { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString($2->c
WRITE_UINT32(&i, 0);
g_lingo->code1(i);
g_lingo->code1(g_lingo->c_beep); }
| tCLOSERESFILE expr { g_lingo->code1(g_lingo->c_closeResFile); }
| tCLOSERESFILE {
g_lingo->code1(g_lingo->c_constpush);
inst i = 0;
WRITE_UINT32(&i, 0);
g_lingo->code1(i);
g_lingo->code1(g_lingo->c_closeResFile); }
| tCLOSEXLIB expr { g_lingo->code1(g_lingo->c_closeXlib); }
| tCLOSEXLIB {
g_lingo->code1(g_lingo->c_constpush);
inst i = 0;
WRITE_UINT32(&i, 0);
g_lingo->code1(i);
g_lingo->code1(g_lingo->c_closeXlib); }
;

globallist: ID { g_lingo->code1(g_lingo->c_global); g_lingo->codeString($1->c_str()); delete $1; }
Expand Down

0 comments on commit 415cefd

Please sign in to comment.