Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,261 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Secrets of the Pyramids (Win)
* Mindscape's Wonder Land (Win)
* Grackon's Curse (Win)
* Return to Jurassic (Win)
*
*************************************/
/*
* -- Ednox External Factory. 22Nov93 PTM
* ednox
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance
* S mName --Returns the XObject name (Widget)
* I mStatus --Returns an integer status code
* SI mError, code --Returns an error string
* S mLastError --Returns last error string
* SSI playSoundX --Play an external sound, return status string
* S clearSoundX --Stop an external sound, return status string
* S checkSoundX --check an external sound,see if it is still playing
* SS drawBkgndX,hBkgnd --draw background image, from resource bitmap
* SS SaveX, hStrIn --Save string into a file(file name will be prompted
* SSSI GetPathX,hSection,hStrIn,mMacMode, Retrieve the installed path name from the win.ini and return
* S RestoreX --Restore string from a file(file name will be prompted
* SS SetDriveX,hStrIn --Set the current path name
* SSS IsCDX,hDrive,hStrIn --Check for the correct CD
* S EnableTaskSwitch --enable task switch
* S DisableTaskSwitch --Disable task switch
* SSS getDocumentName,hdir,hext --Get strings of file in specific directory
* SSS getDocumentFile,hDir,hFile --Get string from a file
* SSSS saveDocumentFile,hDir,hFile,hStrIn --save string into a file
* SSS deleteDocumentFile,hDir,hFile -- delete a file from the directory
*/
#include "common/savefile.h"
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/e/ednox.h"
namespace Director {
const char *const Ednox::xlibName = "Ednox";
const XlibFileDesc Ednox::fileNames[] = {
{ "Ednox", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "mNew", Ednox::m_new, 0, 0, 300 }, // d3
{ "mDispose", Ednox::m_dispose, 0, 0, 300 }, // d3
{ "mName", Ednox::m_name, 0, 0, 300 }, // d3
{ "mStatus", Ednox::m_status, 0, 0, 300 }, // d3
{ "mError", Ednox::m_error, 1, 1, 300 }, // d3
{ "mLastError", Ednox::m_lasterror, 0, 0, 300 }, // d3
{ "playSoundX", Ednox::m_playsoundx, 2, 2, 300 }, // d3
{ "clearSoundX", Ednox::m_clearsoundx, 0, 0, 300 }, // d3
{ "checkSoundX", Ednox::m_checksoundx, 0, 0, 300 }, // d3
{ "drawBkgndX", Ednox::m_drawbkgndx, 1, 1, 300 }, // d3
{ "SaveX", Ednox::m_savex, 1, 1, 300 }, // d3
{ "GetPathX", Ednox::m_getpathx, 3, 3, 300 }, // d3
{ "RestoreX", Ednox::m_restorex, 0, 0, 300 }, // d3
{ "SetDriveX", Ednox::m_setdrivex, 1, 1, 300 }, // d3
{ "IsCDX", Ednox::m_iscdx, 2, 2, 300 }, // d3
{ "EnableTaskSwitch", Ednox::m_enabletaskswitch, 0, 0, 300 }, // d3
{ "DisableTaskSwitch", Ednox::m_disabletaskswitch, 0, 0, 300 }, // d3
{ "getDocumentName", Ednox::m_getdocumentname, 2, 2, 300 }, // d3
{ "getDocumentFile", Ednox::m_getdocumentfile, 2, 2, 300 }, // d3
{ "saveDocumentFile", Ednox::m_savedocumentfile, 3, 3, 300 }, // d3
{ "deleteDocumentFile", Ednox::m_deletedocumentfile, 2, 2, 300 }, // d3
{ nullptr, nullptr, 0, 0, 0 }
};
void Ednox::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
EdnoxObject::initMethods(xlibMethods);
EdnoxObject *xobj = new EdnoxObject(kXObj);
g_lingo->exposeXObject(xlibName, xobj);
}
}
void Ednox::close(ObjectType type) {
if (type == kXObj) {
EdnoxObject::cleanupMethods();
g_lingo->_globalvars[xlibName] = Datum();
}
}
EdnoxObject::EdnoxObject(ObjectType ObjectType) :Object<EdnoxObject>("Ednox") {
_objType = ObjectType;
}
void Ednox::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUBNR(Ednox::m_dispose)
void Ednox::m_getpathx(int nargs) {
/* int mMacMode = */ g_lingo->pop().asInt();
Common::U32String hStrIn = g_lingo->pop().asString();
/* Common::U32String hSection = */ g_lingo->pop().asString();
hStrIn.toLowercase();
if (hStrIn == "cdpath"){
g_lingo->push(Datum("d:\\"));
} else {
g_lingo->push(Datum(""));
}
}
void Ednox::m_iscdx(int nargs) {
/* Common::U32String hStrIn = */ g_lingo->pop().asString();
Common::U32String hDrive = g_lingo->pop().asString();
// g_lingo->printSTUBWithArglist("Ednox::m_iscdx", nargs);
if (hDrive == "d:\\"){
g_lingo->push(Datum("0"));
} else {
g_lingo->push(Datum("-1"));
}
}
void Ednox::m_setdrivex(int nargs) {
// Common::U32String hStrIn = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_setdrivex", nargs);
g_lingo->dropStack(nargs);
g_lingo->push(Datum("1"));
}
XOBJSTUB(Ednox::m_checksoundx, "")
XOBJSTUB(Ednox::m_clearsoundx, "")
void Ednox::m_deletedocumentfile(int nargs) {
// Common::U32String hFile = g_lingo->pop().asString();
// Common::U32String hDir = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_deletedocumentfile", nargs);
g_lingo->dropStack(nargs);
}
XOBJSTUB(Ednox::m_enabletaskswitch, "")
XOBJSTUB(Ednox::m_disabletaskswitch, "")
void Ednox::m_drawbkgndx(int nargs) {
// Common::U32String hBkgnd = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_drawbkgndx", nargs);
}
void Ednox::m_getdocumentname(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String prefix = savePrefix();
g_lingo->printSTUBWithArglist("Ednox::m_getdocumentname", nargs);
ARGNUMCHECK(2);
Common::String hExt = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String result;
Common::StringArray existing = saves->listSavefiles(Common::String::format("%s*", prefix.c_str()));
bool first = true;
for (auto &it : existing) {
if (first)
first = false;
else
result += ",";
result += it.substr(prefix.size());
}
g_lingo->push(result);
}
void Ednox::m_getdocumentfile(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
Common::String prefix = savePrefix();
g_lingo->printSTUBWithArglist("Ednox::m_getdocumentfile", nargs);
ARGNUMCHECK(2);
Common::String hFile = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String filename = prefix + hFile;
// ignore the directory, we just care about the filename
if (!saves->exists(filename)) {
warning("Ednox::m_getdocumentfile: No file exists for %s", filename.c_str());
g_lingo->push(Datum());
return;
}
Common::SeekableReadStream *stream = saves->openForLoading(filename);
if (!stream) {
warning("Ednox::m_getdocumentfile: Unable to open file %s", filename.c_str());
g_lingo->push(Datum());
return;
}
Common::String result = stream->readString();
delete stream;
g_lingo->push(Datum(result));
}
void Ednox::m_savedocumentfile(int nargs) {
Common::SaveFileManager *saves = g_system->getSavefileManager();
g_lingo->printSTUBWithArglist("Ednox::m_savedocumentfile", nargs);
ARGNUMCHECK(3);
Common::String hStrIn = g_lingo->pop().asString();
Common::String hFile = g_lingo->pop().asString();
Common::String hDir = g_lingo->pop().asString();
Common::String filename = savePrefix() + hFile;
Common::SeekableWriteStream *stream = saves->openForSaving(filename, false);
if (!stream) {
warning("Ednox::m_savedocumentfile: Unable to open file %s", filename.c_str());
g_lingo->push(Datum());
return;
}
stream->writeString(hStrIn);
delete stream;
g_lingo->push(Common::String(""));
}
void Ednox::m_error(int nargs) {
// int code = g_lingo->pop().asInt();
g_lingo->printSTUBWithArglist("Ednox::m_error", nargs);
g_lingo->dropStack(nargs);
}
XOBJSTUB(Ednox::m_lasterror, "")
void Ednox::m_name(int nargs) {
g_lingo->push(Datum("ednox"));
}
XOBJSTUB(Ednox::m_status, 0)
XOBJSTUB(Ednox::m_playsoundx, "")
XOBJSTUB(Ednox::m_restorex, "")
void Ednox::m_savex(int nargs) {
// Common::U32String hStrIn = g_lingo->pop().asString();
g_lingo->printSTUBWithArglist("Ednox::m_savex", nargs);
g_lingo->dropStack(nargs);
}
} // End of namespace Director

View File

@@ -0,0 +1,66 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_EDNOX_H
#define DIRECTOR_LINGO_XLIBS_EDNOX_H
namespace Director {
class EdnoxObject : public Object<EdnoxObject> {
public:
EdnoxObject(ObjectType objType);
};
namespace Ednox {
extern const char *const xlibName;
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_name(int nargs);
void m_status(int nargs);
void m_error(int nargs);
void m_lasterror(int nargs);
void m_playsoundx(int nargs);
void m_clearsoundx(int nargs);
void m_checksoundx(int nargs);
void m_drawbkgndx(int nargs);
void m_savex(int nargs);
void m_getpathx(int nargs);
void m_restorex(int nargs);
void m_setdrivex(int nargs);
void m_iscdx(int nargs);
void m_enabletaskswitch(int nargs);
void m_disabletaskswitch(int nargs);
void m_getdocumentname(int nargs);
void m_getdocumentfile(int nargs);
void m_savedocumentfile(int nargs);
void m_deletedocumentfile(int nargs);
} // End of namespace Ednox
} // End of namespace Director
#endif

View File

@@ -0,0 +1,107 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*************************************
*
* USED IN:
* Meet Mediaband
*
*************************************/
/*
* -- EventQ XObject. 7/12/94 greg yachuk
* I mNew --Creates a new instance of the XObject
* X mDispose --Disposes of XObject instance.
* X mBufferEvents --Begins buffering messages.
* X mFlushEvents --Ends buffering. Flushes all queued messages.
* X mPostEvents --Ends buffering. Posts all queued messages.
* I mBufferStatus --1 => Buffering in effect. 0 => No buffering.
* SSI mGetNextEvent --Gets the next event of a certain type.
* -- -- param1: mouseDown or keyDown.
* -- -- param2: 1 => remove found message.
* -- -- 0 => leave found message in queue.
*/
#include "director/director.h"
#include "director/lingo/lingo.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/e/eventq.h"
namespace Director {
const char *const EventQXObj::xlibNames[] = {
"EventQ",
nullptr
};
const XlibFileDesc EventQXObj::fileNames[] = {
{ "EventQ", nullptr },
{ nullptr, nullptr },
};
static const MethodProto xlibMethods[] = {
{ "new", EventQXObj::m_new, 0, 0, 400 }, // D4
{ "Dispose", EventQXObj::m_dispose, 0, 0, 400 }, // D4
{ "BufferEvents", EventQXObj::m_bufferEvents, 0, 0, 400 }, // D4
{ "FlushEvents", EventQXObj::m_flushEvents, 0, 0, 400 }, // D4
{ "PostEvents", EventQXObj::m_postEvents, 0, 0, 400 }, // D4
{ "BufferStatus", EventQXObj::m_bufferStatus, 0, 0, 400 }, // D4
{ "GetNextEvent", EventQXObj::m_getNextEvent, 2, 2, 400 }, // D4
{ nullptr, nullptr, 0, 0, 0 }
};
void EventQXObj::open(ObjectType type, const Common::Path &path) {
if (type == kXObj) {
EventQXObject::initMethods(xlibMethods);
EventQXObject *xobj = new EventQXObject(kXObj);
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->exposeXObject(xlibNames[i], xobj);
}
}
}
void EventQXObj::close(ObjectType type) {
if (type == kXObj) {
EventQXObject::cleanupMethods();
for (uint i = 0; xlibNames[i]; i++) {
g_lingo->_globalvars[xlibNames[i]] = Datum();
}
}
}
EventQXObject::EventQXObject(ObjectType ObjectType) : Object<EventQXObject>("EventQ") {
_objType = ObjectType;
}
void EventQXObj::m_new(int nargs) {
g_lingo->push(g_lingo->_state->me);
}
XOBJSTUB(EventQXObj::m_dispose, 0)
XOBJSTUB(EventQXObj::m_bufferEvents, 0)
XOBJSTUB(EventQXObj::m_flushEvents, 0)
XOBJSTUB(EventQXObj::m_postEvents, 0)
XOBJSTUB(EventQXObj::m_bufferStatus, 0)
XOBJSTUB(EventQXObj::m_getNextEvent, 0)
} // End of namespace Director

View File

@@ -0,0 +1,51 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef DIRECTOR_LINGO_XLIBS_EVENTQ_H
#define DIRECTOR_LINGO_XLIBS_EVENTQ_H
namespace Director {
class EventQXObject : public Object<EventQXObject> {
public:
EventQXObject(ObjectType objType);
};
namespace EventQXObj {
extern const char *const xlibNames[];
extern const XlibFileDesc fileNames[];
void open(ObjectType type, const Common::Path &path);
void close(ObjectType type);
void m_new(int nargs);
void m_dispose(int nargs);
void m_bufferEvents(int nargs);
void m_flushEvents(int nargs);
void m_postEvents(int nargs);
void m_bufferStatus(int nargs);
void m_getNextEvent(int nargs);
} // End of namespace EventQXObj
} // End of namespace Director
#endif