2018-11-10 12:21:23 -08:00
|
|
|
/* 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 2
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-06-22 20:06:26 -07:00
|
|
|
#ifndef GLK_ZCODE_ZCODE
|
|
|
|
#define GLK_ZCODE_ZCODE
|
2018-11-10 12:21:23 -08:00
|
|
|
|
2020-06-22 20:06:26 -07:00
|
|
|
#include "glk/zcode/processor.h"
|
2018-11-10 12:21:23 -08:00
|
|
|
|
2018-11-13 20:05:59 -08:00
|
|
|
namespace Glk {
|
2020-06-22 20:06:26 -07:00
|
|
|
namespace ZCode {
|
2018-11-10 12:21:23 -08:00
|
|
|
|
2019-01-02 23:24:50 -08:00
|
|
|
class FrotzScreen;
|
|
|
|
|
2018-11-10 12:21:23 -08:00
|
|
|
/**
|
|
|
|
* Frotz interpreter for Z-code games
|
|
|
|
*/
|
2020-06-22 20:06:26 -07:00
|
|
|
class ZCode : public Processor {
|
2019-01-02 23:24:50 -08:00
|
|
|
friend class FrotzScreen;
|
2018-11-25 12:41:39 -08:00
|
|
|
protected:
|
2019-01-06 14:07:14 -08:00
|
|
|
/**
|
|
|
|
* Setup the video mode
|
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
void initGraphicsMode() override;
|
2019-01-06 14:07:14 -08:00
|
|
|
|
2018-11-25 12:41:39 -08:00
|
|
|
/**
|
|
|
|
* Create the screen class
|
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
Screen *createScreen() override;
|
2018-11-10 12:21:23 -08:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2020-06-22 20:06:26 -07:00
|
|
|
ZCode(OSystem *syst, const GlkGameDescription &gameDesc);
|
2018-11-10 12:21:23 -08:00
|
|
|
|
2018-11-12 18:42:45 -08:00
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
2020-06-22 20:06:26 -07:00
|
|
|
~ZCode() override;
|
2018-11-12 18:42:45 -08:00
|
|
|
|
2018-11-11 21:44:15 -08:00
|
|
|
/**
|
|
|
|
* Initialization
|
|
|
|
*/
|
|
|
|
void initialize();
|
|
|
|
|
2018-11-17 19:04:06 -08:00
|
|
|
/**
|
|
|
|
* Returns the running interpreter type
|
|
|
|
*/
|
2020-06-22 20:11:00 -07:00
|
|
|
InterpreterType getInterpreterType() const override { return INTERPRETER_ZCODE; }
|
2018-11-17 19:04:06 -08:00
|
|
|
|
2018-11-10 12:21:23 -08:00
|
|
|
/**
|
|
|
|
* Execute the game
|
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
void runGame() override;
|
2018-11-10 12:21:23 -08:00
|
|
|
|
|
|
|
/**
|
2019-06-16 13:29:15 -07:00
|
|
|
* Load a savegame from a given slot
|
2018-11-10 12:21:23 -08:00
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
Common::Error loadGameState(int slot) override;
|
2018-11-10 12:21:23 -08:00
|
|
|
|
|
|
|
/**
|
2019-06-16 13:29:15 -07:00
|
|
|
* Save the game to a given slot
|
2018-11-10 12:21:23 -08:00
|
|
|
*/
|
2020-02-04 22:13:33 -08:00
|
|
|
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
|
2019-06-16 13:29:15 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loading method not used for Frotz sub-engine
|
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
Common::Error readSaveData(Common::SeekableReadStream *rs) override { return Common::kReadingFailed; }
|
2019-06-16 13:29:15 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Saving method not used for Frotz sub-engine
|
|
|
|
*/
|
2020-02-09 12:05:28 +01:00
|
|
|
Common::Error writeGameData(Common::WriteStream *ws) override { return Common::kWritingFailed; }
|
2019-06-16 13:29:15 -07:00
|
|
|
|
2018-11-10 12:21:23 -08:00
|
|
|
};
|
|
|
|
|
2020-06-22 20:06:26 -07:00
|
|
|
extern ZCode *g_vm;
|
2018-11-10 17:54:35 -08:00
|
|
|
|
2020-06-22 20:06:26 -07:00
|
|
|
} // End of namespace ZCode
|
2018-11-13 20:05:59 -08:00
|
|
|
} // End of namespace Glk
|
2018-11-10 12:21:23 -08:00
|
|
|
|
|
|
|
#endif
|