| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /* ScummVM Tools
- *
- * ScummVM Tools 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.
- */
- #ifndef SCUMM_V6_ENGINE_H
- #define SCUMM_V6_ENGINE_H
- #include "../decompiler_engine.h"
- #include "../instruction.h"
- #include "../value.h"
- namespace Scumm {
- namespace v6 {
- const int kArrayOpInst = kFirstCustomInst;
- const int kIncDecInst = kFirstCustomInst + 1;
- /**
- * SCUMMv6 engine.
- */
- class Scummv6Engine : public Engine {
- public:
- virtual std::unique_ptr<Disassembler> getDisassembler(InstVec &insts) override;
- virtual std::unique_ptr<CodeGenerator> getCodeGenerator(const InstVec& insts, std::ostream &output) override;
- };
- /**
- * SCUMM v6 string value.
- */
- class Scummv6StringValue : public StringValue {
- public:
- /**
- * Constructor for Scummv6StringValue.
- *
- * @param str The string value.
- */
- Scummv6StringValue(std::string str) : StringValue(str) { }
- virtual std::ostream &print(std::ostream &output) const;
- };
- /**
- * SCUMM v6 load instruction.
- */
- class Scummv6LoadInstruction : public LoadInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- };
- /**
- * SCUMM v6 store instruction.
- */
- class Scummv6StoreInstruction : public StoreInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- };
- /**
- * SCUMM v6 stack operation.
- */
- class Scummv6StackInstruction : public StackInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- };
- /**
- * SCUMM v6 conditional jump.
- */
- class Scummv6CondJumpInstruction : public CondJumpInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- virtual uint32 getDestAddress() const;
- };
- /**
- * SCUMM v6 unconditional jump.
- */
- class Scummv6JumpInstruction : public UncondJumpInstruction {
- public:
- virtual uint32 getDestAddress() const;
- };
- /**
- * SCUMM v6 variable increment/decrement.
- */
- class Scummv6IncDecInstruction : public UnaryOpPostfixStackInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- };
- /**
- * SCUMM v6 array operation.
- */
- class Scummv6ArrayOpInstruction : public StoreInstruction {
- public:
- virtual void processInst(Function& func, ValueStack &stack, Engine *engine, CodeGenerator *codeGen) override;
- };
- } // End of namespace v6
- } // End of namespace Scumm
- #endif
|