diff options
author | Paul Gilbert | 2018-11-11 22:28:07 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | 53612fa6f72cc2167f9b5a65bc09eb351248b718 (patch) | |
tree | 0bb8d64aa148831338a1c0524b7ab5c6234c2579 /engines/gargoyle/frotz/processor_input.cpp | |
parent | fbe7fb7e1a6223070bd0d0c9929b372391756c8c (diff) | |
download | scummvm-rg350-53612fa6f72cc2167f9b5a65bc09eb351248b718.tar.gz scummvm-rg350-53612fa6f72cc2167f9b5a65bc09eb351248b718.tar.bz2 scummvm-rg350-53612fa6f72cc2167f9b5a65bc09eb351248b718.zip |
GLK: FROTZ: Added storeb and storew methods
Diffstat (limited to 'engines/gargoyle/frotz/processor_input.cpp')
-rw-r--r-- | engines/gargoyle/frotz/processor_input.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/engines/gargoyle/frotz/processor_input.cpp b/engines/gargoyle/frotz/processor_input.cpp index 86a8abc13a..43f0aaf455 100644 --- a/engines/gargoyle/frotz/processor_input.cpp +++ b/engines/gargoyle/frotz/processor_input.cpp @@ -26,8 +26,6 @@ namespace Gargoyle { namespace Frotz { // TODO: Implement method stubs -static void storeb(zword, zchar) {} -static void storew(zword, zword) {} static void save_undo() {} static zword os_read_mouse() { return 0; } @@ -80,7 +78,35 @@ int Processor::read_number() { value = 10 * value + buffer[i] - '0'; return value; +} + +void Processor::storeb(zword addr, zbyte value) { + if (addr >= h_dynamic_size) + runtimeError(ERR_STORE_RANGE); + + if (addr == H_FLAGS + 1) { /* flags register is modified */ + + h_flags &= ~(SCRIPTING_FLAG | FIXED_FONT_FLAG); + h_flags |= value & (SCRIPTING_FLAG | FIXED_FONT_FLAG); + + if (value & SCRIPTING_FLAG) { + if (!ostream_script) + script_open(); + } else { + if (ostream_script) + script_close(); + } + + // TOR - glkified / refresh_text_style (); + } + + SET_BYTE(addr, value); + +} +void Processor::storew(zword addr, zword value) { + storeb((zword)(addr + 0), hi(value)); + storeb((zword)(addr + 1), lo(value)); } void Processor::z_read() { |