disassembler.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* ScummVM Tools
  2. *
  3. * ScummVM Tools is the legal property of its developers, whose
  4. * names are too numerous to list here. Please refer to the
  5. * COPYRIGHT file distributed with this source distribution.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef DEC_SCUMMV6_DISASM_H
  22. #define DEC_SCUMMV6_DISASM_H
  23. #include "decompiler/simple_disassembler.h"
  24. #include "engine.h"
  25. namespace Scumm {
  26. namespace v6 {
  27. /**
  28. * Disassembler for SCUMMv6.
  29. */
  30. class Scummv6Disassembler : public SimpleDisassembler {
  31. public:
  32. /**
  33. * Constructor for Scummv6Disassembler.
  34. *
  35. * @param insts Reference to the vector in which disassembled instructions should be placed.
  36. */
  37. Scummv6Disassembler(InstVec &insts);
  38. void doDisassemble();
  39. virtual ValuePtr readParameter(InstPtr inst, std::string type);
  40. /**
  41. * Determines the actual stack effect of an opcode with a variable stack effect.
  42. *
  43. * @param it Iterator pointing to the instruction to be fixed.
  44. * @param popBefore Number of pops prior to the variable-length list.
  45. * @param popAfter Number of pops after the variable-length list.
  46. * @param pushTotal Number of values pushed from the instruction.
  47. */
  48. void fixStackEffect(InstIterator &it, int popBefore, int popAfter, int pushTotal);
  49. };
  50. } // End of namespace v6
  51. } // End of namespace Scumm
  52. #endif