From 724137d696f36a0630c4ec0ddeaea6312a041a8b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 May 2019 16:35:26 +1000 Subject: GLK: MAGNETIC: General initialization --- engines/glk/magnetic/magnetic.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'engines/glk/magnetic/magnetic.cpp') diff --git a/engines/glk/magnetic/magnetic.cpp b/engines/glk/magnetic/magnetic.cpp index 9bfdc4825c..c658b8c5fd 100644 --- a/engines/glk/magnetic/magnetic.cpp +++ b/engines/glk/magnetic/magnetic.cpp @@ -28,7 +28,27 @@ namespace Glk { namespace Magnetic { Magnetic::Magnetic(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, gameDesc), - vm_exited_cleanly(false) { + + vm_exited_cleanly(false), dlimit(0xffffffff), slimit(0xffffffff), log_on(0), + i_count(0), string_size(0), rseed(0), pc(0), arg1i(0), mem_size(0), properties(0), fl_sub(0), + fl_tab(0), fl_size(0), fp_tab(0), fp_size(0), zflag(0), nflag(0), cflag(0), vflag(0), byte1(0), + byte2(0), regnr(0), admode(0), opsize(0), arg1(nullptr), arg2(nullptr), is_reversible(0), + lastchar(0), version(0), sd(0), decode_table(nullptr), restart(nullptr), code(nullptr), + string(nullptr), string2(nullptr), string3(nullptr), dict(nullptr), quick_flag(0), gfx_ver(0), + gfx_buf(nullptr), gfx_data(nullptr), gfx2_hdr(0), gfx2_buf(nullptr), gfx2_hsize(0), + snd_buf(nullptr), snd_hdr(nullptr), snd_hsize(0), undo_pc(0), undo_size(0), + gfxtable(0), table_dist(0), v4_id(0), next_table(1), pos_table_size(0), + command_table(nullptr), command_index(-1), pos_table_index(-1), pos_table_max(-1), + anim_repeat(0) { + + // Emu fields + undo[0] = undo[1] = nullptr; + undo_stat[0] = undo_stat[1] = 0; + Common::fill(&dreg[0], &dreg[8], 0); + Common::fill(&areg[0], &areg[8], 0); + Common::fill(&tmparg[0], &tmparg[4], 0); + Common::fill(&undo_regs[0][0], &undo_regs[2][18], 0), + Common::fill(&pos_table_count[0], &pos_table_count[MAX_POSITIONS], 0); } void Magnetic::runGame() { @@ -60,7 +80,7 @@ bool Magnetic::is_gamefile_valid() { } // We support version 2.0 through 3.1.* - uint version = _gameFile.readUint32BE(); + version = _gameFile.readUint32BE(); if (version < 0x20000) { GUIErrorMessage(_("This Glulx file is too old a version to execute.")); return false; -- cgit v1.2.3