ScummVM
Glk::Frotz::Frotz Class Reference

Frotz interpreter for Z-code games. More...

#include <frotz.h>

Inheritance diagram for Glk::Frotz::Frotz:
Collaboration diagram for Glk::Frotz::Frotz:

Public Member Functions

 Frotz (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
virtual ~Frotz ()
 Destructor. More...
 
void initialize ()
 Initialization. More...
 
virtual InterpreterType getInterpreterType () const override
 Returns the running interpreter type. More...
 
virtual void runGame () override
 Execute the game. More...
 
virtual Common::Error loadGameState (int slot) override
 Load a savegame from a given slot. More...
 
virtual Common::Error saveGameState (int slot, const Common::String &desc) override
 Save the game to a given slot. More...
 
virtual Common::Error readSaveData (Common::SeekableReadStream *rs) override
 Loading method not used for Frotz sub-engine. More...
 
virtual Common::Error writeGameData (Common::WriteStream *ws) override
 Saving method not used for Frotz sub-engine. More...
 
- Public Member Functions inherited from Glk::Frotz::Processor
 Processor (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
virtual ~Processor ()
 
void initialize ()
 Initialization. More...
 
void interpret ()
 Z-code interpreter main loop. More...
 
zbyteoperator[] (uint addr)
 Square brackets operator. More...
 
zbyte codeByte ()
 Read a code byte. More...
 
zword codeWord ()
 Read a code word. More...
 
zword codeWordIdx (uint addr) const
 Return a code word at a given address. More...
 
uint getPC () const
 Return the current program execution offset. More...
 
void setPC (uint addr)
 Set the program execution offset. More...
 
- Public Member Functions inherited from Glk::Frotz::GlkInterface
 GlkInterface (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
virtual ~GlkInterface ()
 Destructor. More...
 
void initialize ()
 Initialization. More...
 
- Public Member Functions inherited from Glk::GlkAPI
 GlkAPI (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
virtual ~GlkAPI ()
 
void glk_exit (void)
 
void glk_set_interrupt_handler (void(*func)(void))
 
void glk_tick (void)
 
uint glk_gestalt (uint id, uint val)
 
uint glk_gestalt_ext (uint id, uint val, uint *arr, uint arrlen)
 
unsigned char glk_char_to_lower (unsigned char ch)
 
unsigned char glk_char_to_upper (unsigned char ch)
 
winid_t glk_window_get_root (void) const
 Get the root window of the window hierarchy. More...
 
winid_t glk_window_open (winid_t split, uint method, uint size, uint wintype, uint rock=0) const
 Open a new window. More...
 
void glk_window_close (winid_t win, stream_result_t *result=nullptr)
 
void glk_window_get_size (winid_t win, uint *width, uint *height)
 
void glk_window_set_arrangement (winid_t win, uint method, uint size, winid_t keyWin)
 
void glk_window_get_arrangement (winid_t win, uint *method, uint *size, winid_t *keyWin)
 
winid_t glk_window_iterate (winid_t win, uint *rock=0)
 
uint glk_window_get_rock (winid_t win)
 
uint glk_window_get_type (winid_t win)
 
winid_t glk_window_get_parent (winid_t win)
 
winid_t glk_window_get_sibling (winid_t win)
 
void glk_window_clear (winid_t win)
 
void glk_window_move_cursor (winid_t win, uint xpos, uint ypos)
 
strid_t glk_window_get_stream (winid_t win)
 
void glk_window_set_echo_stream (winid_t win, strid_t str)
 
strid_t glk_window_get_echo_stream (winid_t win)
 
void glk_set_window (winid_t win)
 
strid_t glk_stream_open_file (frefid_t fileref, FileMode fmode, uint rock=0)
 
strid_t glk_stream_open_memory (char *buf, uint buflen, FileMode fmode, uint rock=0)
 
void glk_stream_close (strid_t str, stream_result_t *result=nullptr)
 
strid_t glk_stream_iterate (strid_t str, uint *rockptr) const
 
uint glk_stream_get_rock (strid_t str) const
 
void glk_stream_set_position (strid_t str, int pos, uint seekMode)
 
uint glk_stream_get_position (strid_t str) const
 
void glk_stream_set_current (strid_t str)
 
strid_t glk_stream_get_current (void)
 
void glk_put_char (unsigned char ch)
 
void glk_put_char_stream (strid_t str, unsigned char ch)
 
void glk_put_string (const char *s)
 
void glk_put_string_stream (strid_t str, const char *s)
 
void glk_put_buffer (const char *buf, uint len)
 
void glk_put_buffer_stream (strid_t str, const char *buf, uint len)
 
void glk_set_style (uint styl)
 
void glk_set_style_stream (strid_t str, uint styl)
 
int glk_get_char_stream (strid_t str)
 
uint glk_get_line_stream (strid_t str, char *buf, uint len)
 
uint glk_get_buffer_stream (strid_t str, char *buf, uint len)
 
void glk_stylehint_set (uint wintype, uint styl, uint hint, int val)
 
void glk_stylehint_clear (uint wintype, uint style, uint hint)
 
uint glk_style_distinguish (winid_t win, uint style1, uint style2)
 
bool glk_style_measure (winid_t win, uint style, uint hint, uint *result)
 
frefid_t glk_fileref_create_temp (uint usage, uint rock=0)
 
frefid_t glk_fileref_create_by_name (uint usage, const char *name, uint rock=0)
 
frefid_t glk_fileref_create_by_prompt (uint usage, FileMode fmode, uint rock=0)
 
frefid_t glk_fileref_create_from_fileref (uint usage, frefid_t fref, uint rock=0)
 
void glk_fileref_destroy (frefid_t fref)
 
frefid_t glk_fileref_iterate (frefid_t fref, uint *rockptr)
 
uint glk_fileref_get_rock (frefid_t fref)
 
void glk_fileref_delete_file (frefid_t fref)
 
uint glk_fileref_does_file_exist (frefid_t fref)
 
void glk_select (event_t *event)
 
void glk_select_poll (event_t *event)
 
void glk_request_timer_events (uint millisecs)
 
void glk_request_line_event (winid_t win, char *buf, uint maxlen, uint initlen)
 
void glk_request_char_event (winid_t win)
 
void glk_request_mouse_event (winid_t win)
 
void glk_cancel_line_event (winid_t win, event_t *event)
 
void glk_cancel_char_event (winid_t win)
 
void glk_cancel_mouse_event (winid_t win)
 
uint glk_buffer_to_lower_case_uni (uint32 *buf, uint len, uint numchars)
 
uint glk_buffer_to_upper_case_uni (uint32 *buf, uint len, uint numchars)
 
uint glk_buffer_to_title_case_uni (uint32 *buf, uint len, uint numchars, uint lowerrest)
 
void glk_put_char_uni (uint32 ch)
 
void glk_put_string_uni (const uint32 *s)
 
void glk_put_buffer_uni (const uint32 *buf, uint len)
 
void glk_put_char_stream_uni (strid_t str, uint32 ch)
 
void glk_put_string_stream_uni (strid_t str, const uint32 *s)
 
void glk_put_buffer_stream_uni (strid_t str, const uint32 *buf, uint len)
 
int glk_get_char_stream_uni (strid_t str)
 
uint glk_get_buffer_stream_uni (strid_t str, uint32 *buf, uint len)
 
uint glk_get_line_stream_uni (strid_t str, uint32 *buf, uint len)
 
strid_t glk_stream_open_file_uni (frefid_t fileref, FileMode fmode, uint rock=0)
 
strid_t glk_stream_open_memory_uni (uint32 *buf, uint buflen, FileMode fmode, uint rock=0)
 
void glk_request_char_event_uni (winid_t win)
 
void glk_request_line_event_uni (winid_t win, uint32 *buf, uint maxlen, uint initlen)
 
const char * garglk_fileref_get_name (frefid_t fref) const
 
void garglk_set_program_name (const char *name)
 
void garglk_set_program_info (const char *info)
 
void garglk_set_story_name (const char *name)
 
void garglk_set_story_title (const char *title)
 
void garglk_set_config (const char *name)
 
void garglk_unput_string (const char *str)
 Removes the specified string from the end of the output buffer, if indeed it is there. More...
 
void garglk_unput_string_uni (const uint32 *str)
 Removes the specified string from the end of the output buffer, if indeed it is there. More...
 
void garglk_set_zcolors (uint fg, uint bg)
 
void garglk_set_zcolors_stream (strid_t str, uint fg, uint bg)
 
void garglk_set_reversevideo (uint reverse)
 
void garglk_set_reversevideo_stream (strid_t str, uint reverse)
 
void garglk_window_get_cursor (winid_t win, uint *xpos, uint *ypos)
 
void garglk_window_get_cursor_current (uint *xpos, uint *ypos)
 
void gidispatch_set_object_registry (gidispatch_rock_t(*regi)(void *obj, uint objclass), void(*unregi)(void *obj, uint objclass, gidispatch_rock_t objrock))
 
void gidispatch_set_retained_registry (gidispatch_rock_t(*regi)(void *array, uint len, const char *typecode), void(*unregi)(void *array, uint len, const char *typecode, gidispatch_rock_t objrock))
 
uint32 gidispatch_count_classes () const
 
const gidispatch_intconst_tgidispatch_get_class (uint32 index) const
 
uint32 gidispatch_count_intconst () const
 
const gidispatch_intconst_tgidispatch_get_intconst (uint32 index) const
 
const char * gidispatch_prototype (uint32 funcnum) const
 
void gidispatch_call (uint32 funcnum, uint32 numargs, gluniversal_t *arglist)
 
gidispatch_rock_t gidispatch_get_objrock (void *obj, uint objclass)
 
- Public Member Functions inherited from Glk::GlkEngine
 GlkEngine (OSystem *syst, const GlkGameDescription &gameDesc)
 
virtual ~GlkEngine ()
 
virtual bool canLoadGameStateCurrently () override
 Returns true if a savegame can be loaded. More...
 
virtual bool canSaveGameStateCurrently () override
 Returns true if the game can be saved. More...
 
Common::Language getLanguage () const
 Returns the language. More...
 
const Common::StringgetGameID () const
 Returns the game's Id. More...
 
const Common::StringgetGameMD5 () const
 Returns the game's md5. More...
 
const Common::StringgetFilename () const
 Returns the primary filename for the game. More...
 
uint getOptions () const
 Returns any options returned with the game's detection entry. More...
 
const Common::StringgetTargetName () const
 Return the game engine's target name. More...
 
Common::String getSaveName (uint slot) const
 Return the filename for a given save slot. More...
 
Common::Error loadGame ()
 Prompt the user for a savegame to load, and then load it. More...
 
Common::Error saveGame ()
 Prompt the user to save their game, and then save it. More...
 
virtual void syncSoundSettings () override
 Updates sound settings. More...
 
void beep ()
 Generate a beep. More...
 
uint getRandomNumber (uint max)
 Get a random number. More...
 
void setRandomNumberSeed (uint seed)
 Set a random number seed. More...
 
- Public Member Functions inherited from Engine
void pauseEngine (bool pause)
 Pause or resume the engine. More...
 
bool isPaused () const
 Return whether the engine is currently paused or not. More...
 
void openMainMenuDialog ()
 Run the Global Main Menu Dialog. More...
 
uint32 getTotalPlayTime () const
 Get the total play time. More...
 
void setTotalPlayTime (uint32 time=0)
 Set the game time counter to the specified time. More...
 
Common::TimerManagergetTimerManager ()
 
Common::EventManagergetEventManager ()
 
Common::SaveFileManagergetSaveFileManager ()
 
void checkCD ()
 On some systems, check if the game appears to be run from CD. More...
 
 Engine (OSystem *syst)
 
virtual ~Engine ()
 
virtual void initializePath (const Common::FSNode &gamePath)
 Init SearchMan according to the game path. More...
 
virtual void errorString (const char *buf_input, char *buf_output, int buf_output_size)
 Prepare an error string, which is printed by the error() function. More...
 
virtual GUI::DebuggergetDebugger ()
 Return the engine's debugger instance, if any. More...
 
virtual void initKeymap ()
 
virtual void deinitKeymap ()
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 
- Public Member Functions inherited from Glk::Frotz::UserOptions
 UserOptions ()
 Constructor. More...
 
void initialize (uint hVersion, uint storyId)
 Initializes the options. More...
 
bool isInfocom () const
 Returns true if the game being played is one of the original Infocom releases. More...
 
- Public Member Functions inherited from Glk::Frotz::Mem
 Mem ()
 Constructor. More...
 
virtual ~Mem ()
 Destructor. More...
 
void initialize ()
 Initialize. More...
 
- Public Member Functions inherited from Glk::Frotz::Header
 Header ()
 Constructor. More...
 
void loadHeader (Common::SeekableReadStream &f)
 Load the header. More...
 

Protected Member Functions

virtual void initGraphicsMode ()
 Setup the video mode. More...
 
virtual ScreencreateScreen () override
 Create the screen class. More...
 
- Protected Member Functions inherited from Glk::Frotz::Processor
void load_operand (zbyte type)
 Load an operand, either a variable or a constant. More...
 
void load_all_operands (zbyte specifier)
 Given the operand specifier byte, load all (up to four) operands for a VAR or EXT opcode. More...
 
void call (zword routine, int argc, zword *args, int ct)
 Call a subroutine. More...
 
void ret (zword value)
 Return from the current subroutine and restore the previous _stack frame. More...
 
void branch (bool flag)
 Take a jump after an instruction based on the flag, either true or false. More...
 
void store (zword value)
 Store an operand, either as a variable or pushed on the stack. More...
 
int direct_call (zword addr)
 
void seed_random (int value)
 Set the seed value for the random number generator. More...
 
void print_char (zchar c)
 High level output function. More...
 
void print_string (const char *s)
 Print a string of ASCII characters. More...
 
void print_long (uint value, int base)
 Print an unsigned 32bit number in decimal or hex. More...
 
void new_line ()
 High level newline function. More...
 
void flush_buffer ()
 Copy the contents of the text buffer to the output streams. More...
 
bool bufferEmpty () const
 Returns true if the buffer is empty. More...
 
void runtimeError (ErrorCode errNum)
 An error has occurred. More...
 
bool is_terminator (zchar key)
 Check if the given key is an input terminator. More...
 
bool read_yes_or_no (const char *s)
 Ask the user a question; return true if the answer is yes. More...
 
void read_string (int max, zchar *buffer)
 Read a string from the current input stream. More...
 
int read_number ()
 Ask the user to type in a number and return it. More...
 
virtual void flagsChanged (zbyte value) override
 Called when the H_FLAGS field of the header has changed. More...
 
int save_undo ()
 This function does the dirty work for z_save_undo. More...
 
int restore_undo ()
 This function does the dirty work for z_restore_undo. More...
 
void memory_open (zword table, zword xsize, bool buffering)
 Begin output redirection to the memory of the Z-machine. More...
 
void memory_close ()
 End of output redirection. More...
 
void memory_new_line ()
 Redirect a newline to the memory of the Z-machine. More...
 
void memory_word (const zchar *s)
 Redirect a string of characters to the memory of the Z-machine. More...
 
zword object_address (zword obj)
 Calculate the address of an object. More...
 
zword object_name (zword object)
 Return the address of the given object's name. More...
 
zword first_property (zword obj)
 Calculate the start address of the property list associated with an object. More...
 
zword next_property (zword prop_addr)
 Calculate the address of the next property in a property list. More...
 
void unlink_object (zword object)
 Unlink an object from its parent and siblings. More...
 
void screen_mssg_on ()
 Start printing a so-called debugging message. More...
 
void screen_mssg_off ()
 Stop printing a "debugging" message. More...
 
uint32 zchar_to_unicode_rune (zchar c)
 Map a runic character to its Unicode equivalent, if there is one. More...
 
void screen_char (zchar c)
 Display a single character on the screen. More...
 
void screen_new_line ()
 Print a newline to the screen. More...
 
void screen_word (const zchar *s)
 Print a newline to the screen. More...
 
void erase_screen (zword win)
 Erase the entire screen to background colour. More...
 
void erase_window (zword win)
 Erase a window to background colour. More...
 
zchar console_read_input (int max, zchar *buf, zword timeout, bool continued)
 Waits for the user to type an input line. More...
 
zchar console_read_key (zword timeout)
 Waits for a keypress. More...
 
void scrollback_char (zchar c)
 Write a single character to the scrollback buffer. More...
 
void scrollback_word (const zchar *s)
 Write a string to the scrollback buffer. More...
 
void scrollback_write_input (const zchar *buf, zchar key)
 Send an input line to the scrollback buffer. More...
 
void scrollback_erase_input (const zchar *buf)
 Remove an input line from the scrollback buffer. More...
 
void stream_mssg_on ()
 Start printing a "debugging" message. More...
 
void stream_mssg_off ()
 Stop printing a "debugging" message. More...
 
void stream_char (zchar c)
 Send a single character to the output stream. More...
 
void stream_word (const zchar *s)
 Send a string of characters to the output streams. More...
 
void stream_new_line ()
 Send a newline to the output streams. More...
 
zchar stream_read_key (zword timeout, zword routine, bool hot_keys)
 Read a single keystroke from the current input stream. More...
 
zchar stream_read_input (int max, zchar *buf, zword timeout, zword routine, bool hot_keys, bool no_scripting)
 Read a line of input from the current input stream. More...
 
void script_open ()
 
void script_close ()
 
void script_new_line ()
 Write a newline to the transscript file. More...
 
void script_char (zchar c)
 Write a single character to the transscript file. More...
 
void script_word (const zchar *s)
 Write a string to the transscript file. More...
 
void script_write_input (const zchar *buf, zchar key)
 Send an input line to the transscript file. More...
 
void script_erase_input (const zchar *buf)
 Remove an input line from the transscript file. More...
 
void script_mssg_on ()
 Start sending a "debugging" message to the transscript file. More...
 
void script_mssg_off ()
 Stop writing a "debugging" message. More...
 
void record_open ()
 Open a file to record the player's input. More...
 
void record_close ()
 Stop recording the player's input. More...
 
void record_code (int c, bool force_encoding)
 Helper function for record_char. More...
 
void record_char (zchar c)
 Write a character to the command file. More...
 
void record_write_key (zchar key)
 Copy a keystroke to the command file. More...
 
void record_write_input (const zchar *buf, zchar key)
 Copy a line of input to a command file. More...
 
void replay_open ()
 Open a file of commands for playback. More...
 
void replay_close ()
 Stop playback of commands. More...
 
int replay_code ()
 
zchar replay_char ()
 Read a character from the command file. More...
 
zchar replay_read_key ()
 Read a keystroke from a command file. More...
 
zchar replay_read_input (zchar *buf)
 
zchar translate_from_zscii (zbyte c)
 Map a ZSCII character into Unicode. More...
 
zbyte unicode_to_zscii (zchar c)
 Convert a Unicode character to ZSCII, returning 0 on failure. More...
 
zbyte translate_to_zscii (zchar c)
 Map a Unicode character onto the ZSCII alphabet. More...
 
zchar alphabet (int set, int index)
 Return a character from one of the three character sets. More...
 
void find_resolution ()
 Find the number of bytes used for dictionary resolution. More...
 
void load_string (zword addr, zword length)
 Copy a ZSCII string from the memory to the global "decoded" string. More...
 
void encode_text (int padding)
 Encode the Unicode text in the global "decoded" string then write the result to the global "encoded" array. More...
 
void decode_text (string_type st, zword addr)
 Convert _encoded text to Unicode. More...
 
void print_num (zword value)
 Print a signed 16bit number. More...
 
void print_object (zword object)
 print_object More...
 
zword lookup_text (int padding, zword dct)
 Scan a dictionary searching for the given word. More...
 
void handleAbbreviations ()
 Handles converting abbreviations that weren't handled by early Infocom games into their expanded versions. More...
 
void tokenise_text (zword text, zword length, zword from, zword parse, zword dct, bool flag)
 Translate a single word to a token and append it to the token buffer. More...
 
void tokenise_line (zword text, zword token, zword dct, bool flag)
 Split an input line into words and translate the words to tokens. More...
 
int completion (const zchar *buffer, zchar *result)
 Scan the vocabulary to complete the last word on the input line (similar to "tcsh" under Unix). More...
 
zchar unicode_tolower (zchar c)
 Convert a Unicode character to lowercase. More...
 
zword winarg0 ()
 Return the window number in zargs[0]. More...
 
zword winarg2 ()
 Return the (optional) window number in zargs[2]. More...
 
void __extended__ ()
 
void __illegal__ ()
 
void z_catch ()
 
void z_throw ()
 Go back to the given _stack frame and return the given value. More...
 
void z_call_n ()
 
void z_call_s ()
 Call a subroutine and store its result. More...
 
void z_check_arg_count ()
 Branch if subroutine was called with >= n arg's. More...
 
void z_jump ()
 Jump unconditionally to the given address. More...
 
void z_nop ()
 
void z_quit ()
 
void z_ret ()
 
void z_ret_popped ()
 
void z_rfalse ()
 
void z_rtrue ()
 
void z_random ()
 Store a random number or set the random number seed. More...
 
void z_sound_effect ()
 Load / play / stop / discard a sound effect. More...
 
void z_piracy ()
 Branch if the story file is a legal copy. More...
 
void z_save_undo ()
 Save the current Z-machine state for a future undo. More...
 
void z_restore_undo ()
 Restore a Z-machine state from memory. More...
 
void z_make_menu ()
 Add or remove a menu and branch if successful. More...
 
void z_read ()
 Read a line of input and (in V5+) store the terminating key. More...
 
void z_read_char ()
 Read and store a key. More...
 
void z_read_mouse ()
 z_read_mouse, write the current mouse status into a table. More...
 
void z_add ()
 16 bit addition. More...
 
void z_and ()
 Bitwise AND operation. More...
 
void z_art_shift ()
 Arithmetic SHIFT operation. More...
 
void z_div ()
 Signed 16bit division. More...
 
void z_je ()
 B ranch if the first value equals any of the following. More...
 
void z_jg ()
 Branch if the first value is greater than the second. More...
 
void z_jl ()
 Branch if the first value is less than the second. More...
 
void z_jz ()
 Branch if value is zero. More...
 
void z_log_shift ()
 Logical SHIFT operation. More...
 
void z_mod ()
 
void z_mul ()
 16 bit multiplication. More...
 
void z_not ()
 Bitwise NOT operation. More...
 
void z_or ()
 Bitwise OR operation. More...
 
void z_sub ()
 16 bit substraction. More...
 
void z_test ()
 Branch if all the flags of a bit mask are set in a value. More...
 
void z_jin ()
 Branch if the first object is inside the second. More...
 
void z_get_child ()
 Store the child of an object. More...
 
void z_get_next_prop ()
 Store the number of the first or next property. More...
 
void z_get_parent ()
 Store the parent of an object. More...
 
void z_get_prop ()
 Store the value of an object property. More...
 
void z_get_prop_addr ()
 Store the address of an object property. More...
 
void z_get_prop_len ()
 Store the length of an object property. More...
 
void z_get_sibling ()
 Store the sibling of an object. More...
 
void z_insert_obj ()
 Make an object the first child of another object. More...
 
void z_put_prop ()
 Set the value of an object property. More...
 
void z_remove_obj ()
 Unlink an object from its parent and siblings. More...
 
void z_set_attr ()
 Set an object attribute. More...
 
void z_test_attr ()
 Branch if an object attribute is set. More...
 
void z_clear_attr ()
 Clear an object attribute. More...
 
void z_buffer_mode ()
 Turn text buffering on/off. More...
 
void z_buffer_screen ()
 Set the screen buffering mode. More...
 
void z_erase_line ()
 Erase the line starting at the cursor position. More...
 
void z_erase_window ()
 Erase a window or the screen to background colour. More...
 
void z_get_cursor ()
 Write the cursor coordinates into a table. More...
 
void z_print_table ()
 Print ASCII text in a rectangular area. More...
 
void z_set_true_colour ()
 Set the foreground and background colours to specific RGB colour values. More...
 
void z_set_colour ()
 Set the foreground and background colours. More...
 
void z_set_font ()
 Set the font for text output and store the previous font. More...
 
void z_set_cursor ()
 Set the cursor position or turn the cursor on/off. More...
 
void z_set_text_style ()
 z_set_text_style, set the style for text output. More...
 
void z_set_window ()
 Select the current window. More...
 
void pad_status_line (int column)
 Display the status line for V1 to V3 games. More...
 
void z_show_status ()
 Display the status line for V1 to V3 games. More...
 
void z_split_window ()
 Split the screen into an upper (1) and lower (0) window. More...
 
void z_input_stream ()
 Select an input stream. More...
 
void z_output_stream ()
 Open or close an output stream. More...
 
void z_restart ()
 Re-load dynamic area, clear the stack and set the PC. More...
 
void z_save ()
 Save [a part of] the Z-machine state to disk. More...
 
void z_restore ()
 Restore [a part of] a Z-machine state from disk. More...
 
void z_verify ()
 Check the story file integrity. More...
 
void z_copy_table ()
 Copy a table or fill it with zeroes. More...
 
void z_loadb ()
 Store a value from a table of bytes. More...
 
void z_loadw ()
 Store a value from a table of words. More...
 
void z_scan_table ()
 Find and store the address of a target within a table. More...
 
void z_storeb ()
 Write a byte into a table of bytes. More...
 
void z_storew ()
 Write a word into a table of words. More...
 
void z_check_unicode ()
 Test if a unicode character can be printed (bit 0) and read (bit 1). More...
 
void z_encode_text ()
 Encode a ZSCII string for use in a dictionary. More...
 
void z_new_line ()
 Print a new line. More...
 
void z_print ()
 Print a string embedded in the instruction stream. More...
 
void z_print_addr ()
 Print a string from the lower 64KB. More...
 
void z_print_char ()
 Print a single ZSCII character. More...
 
void z_print_form ()
 Print a formatted table. More...
 
void z_print_num ()
 Print a signed number. More...
 
void z_print_obj ()
 Print an object description. More...
 
void z_print_paddr ()
 Print the string at the given packed address. More...
 
void z_print_ret ()
 
void z_print_unicode ()
 Print unicode character. More...
 
void z_tokenise ()
 Make a lexical analysis of a ZSCII string. More...
 
void z_dec ()
 Decrement a variable. More...
 
void z_dec_chk ()
 Decrement a variable and branch if now less than value. More...
 
void z_inc ()
 Increment a variable. More...
 
void z_inc_chk ()
 Increment a variable and branch if now greater than value. More...
 
void z_load ()
 Store the value of a variable. More...
 
void z_pop ()
 Pop a value off the game stack and discard it. More...
 
void z_pop_stack ()
 Pop n values off the game or user stack and discard them. More...
 
void z_pull ()
 Pop a value off... More...
 
void z_push ()
 Push a value onto the game stack. More...
 
void z_push_stack ()
 Push a value onto a user stack then branch if successful. More...
 
void z_store ()
 Write a value to a variable. More...
 
void z_draw_picture ()
 z_draw_picture, draw a picture. More...
 
void z_picture_data ()
 Get information on a picture or the graphics file. More...
 
void z_erase_picture ()
 Erase a picture with background colour. More...
 
void z_set_margins ()
 Set the left and right margins of a window. More...
 
void z_move_window ()
 Place a window on the screen. More...
 
void z_window_size ()
 Change the width and height of a window. More...
 
void z_window_style ()
 Set / clear / toggle window attributes. More...
 
void z_get_wind_prop ()
 Store the value of a window property. More...
 
void z_put_wind_prop ()
 Set the value of a window property. More...
 
void z_scroll_window ()
 Scroll a window up or down. More...
 
void z_mouse_window ()
 Select a window as mouse window. More...
 
void z_picture_table ()
 Prepare a group of pictures for faster display. More...
 
- Protected Member Functions inherited from Glk::Frotz::GlkInterface
int os_char_width (zchar z)
 Return the length of the character in screen units. More...
 
int os_string_width (const zchar *s)
 Calculate the length of a word in screen units. More...
 
int os_string_length (zchar *s)
 Return the length of a string. More...
 
void os_prepare_sample (int a)
 Prepare a sample for playing. More...
 
void os_finish_with_sample (int a)
 Signal that a given sample is finished with. More...
 
void os_start_sample (int number, int volume, int repeats, zword eos)
 Play the given sample at the given volume (ranging from 1 to 8 and 255 meaning a default volume). More...
 
void os_stop_sample (int a)
 Stop playing a given sound number. More...
 
void os_beep (int volume)
 Make a beep sound. More...
 
bool os_picture_data (int picture, uint *height, uint *width)
 Return true if the given picture is available. More...
 
void os_draw_picture (int picture, const Common::Point &pos)
 Display a picture at the given coordinates. More...
 
int os_peek_color ()
 Return the colour of the pixel below the cursor. More...
 
void start_sample (int number, int volume, int repeats, zword eos)
 Call the IO interface to play a sample. More...
 
void start_next_sample ()
 
void gos_update_width ()
 
void gos_update_height ()
 
void reset_status_ht ()
 
void erase_window (zword w)
 
void split_window (zword lines)
 
void restart_screen ()
 
void packspaces (zchar *src, zchar *dst)
 statusline overflowed the window size ... More...
 
void smartstatusline ()
 
void gos_cancel_pending_line ()
 Cancels any pending line. More...
 
void os_restart_game (RestartAction stage)
 Called during game restarts. More...
 
zword os_read_mouse ()
 Reads the mouse buttons. More...
 
void os_scrollback_char (zchar z)
 
void os_scrollback_erase (int amount)
 
zchar os_read_key (int timeout, bool show_cursor)
 Waits for a keypress. More...
 
zchar os_read_line (int max, zchar *buf, int timeout, int width, int continued)
 Waits for the user to type an input line. More...
 
- Protected Member Functions inherited from Glk::GlkEngine
virtual Common::Error run ()
 Init the engine and start its main loop. More...
 
virtual bool hasFeature (EngineFeature f) const override
 Returns true whether a given feature is supported by the engine. More...
 
virtual DebuggercreateDebugger ()
 Creates a debugger instance. More...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
bool shouldPerformAutoSave (int lastSaveTime)
 Indicate whether an autosave should be performed. More...
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 
- Protected Member Functions inherited from Glk::Frotz::Mem
zword get_header_extension (int entry)
 Read a value from the header extension (former mouse table). More...
 
void set_header_extension (int entry, zword val)
 Set an entry in the header extension (former mouse table). More...
 
void restart_header ()
 Set all header fields which hold information about the interpreter. More...
 
void storeb (zword addr, zbyte value)
 Write a byte value to the dynamic Z-machine memory. More...
 
void storew (zword addr, zword value)
 Write a word value to the dynamic Z-machine memory. More...
 
void free_undo (int count)
 Free count undo blocks from the beginning of the undo list. More...
 
void reset_memory ()
 Close the story file and deallocate memory. More...
 
long mem_diff (zbyte *a, zbyte *b, zword mem_size, zbyte *diff)
 Set diff to a Quetzal-like difference between a and b, copying a to b as we go. More...
 
void mem_undiff (zbyte *diff, long diff_length, zbyte *dest)
 Applies a quetzal-like diff to dest. More...
 

Friends

class FrotzScreen
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature {
  kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime,
  kSupportsJoystick
}
 A feature in this context means an ability of the engine which can be either available or not. More...
 
- Static Public Member Functions inherited from Engine
static void quitGame ()
 Request the engine to quit. More...
 
static bool shouldQuit ()
 Return whether the ENGINE should quit respectively should return to the launcher. More...
 
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 
- Public Attributes inherited from Glk::Frotz::GlkInterface
Pics_pics
 
zchar statusline [256]
 
uint zcolors [zcolor_NUMCOLORS]
 
int fixforced
 
int curr_status_ht
 
int mach_status_ht
 
Windows _wp
 
winid_t gos_status
 
int gos_linepending
 
zchargos_linebuf
 
winid_t gos_linewin
 
schanid_t gos_channel
 
int mwin
 
int mouse_y
 
int mouse_x
 
int menu_selected
 
bool enable_wrapping
 
bool enable_scripting
 
bool enable_scrolling
 
bool enable_buffering
 
int next_sample
 
int next_volume
 
bool _soundLocked
 
bool _soundPlaying
 
- Public Attributes inherited from Glk::GlkEngine
Blorb_blorb
 
Clipboard_clipboard
 
Conf_conf
 
Debugger_debugger
 
Events_events
 
Pictures_pictures
 
Screen_screen
 
Selection_selection
 
Streams_streams
 
Sounds_sounds
 
Windows_windows
 
bool _copySelect
 
bool _terminated
 
gidispatch_rock_t(* gli_register_obj )(void *obj, uint objclass)
 
void(* gli_unregister_obj )(void *obj, uint objclass, gidispatch_rock_t objrock)
 
gidispatch_rock_t(* gli_register_arr )(void *array, uint len, const char *typecode)
 
void(* gli_unregister_arr )(void *array, uint len, const char *typecode, gidispatch_rock_t objrock)
 
- Public Attributes inherited from Engine
OSystem_system
 
Audio::Mixer_mixer
 
- Public Attributes inherited from Glk::Frotz::UserOptions
bool _attribute_assignment
 
bool _attribute_testing
 
bool _object_locating
 
bool _object_movement
 
bool _expand_abbreviations
 
bool _ignore_errors
 
bool _piracy
 
bool _quetzal
 
bool _sound
 
bool _tandyBit
 
int _left_margin
 
int _right_margin
 
int _undo_slots
 
int _script_cols
 
int _err_report_mode
 
uint _defaultForeground
 
uint _defaultBackground
 
bool _color_enabled
 
- Public Attributes inherited from Glk::Frotz::Header
zbyte h_version
 
zbyte h_config
 
zword h_release
 
zword h_resident_size
 
zword h_start_pc
 
zword h_dictionary
 
zword h_objects
 
zword h_globals
 
zword h_dynamic_size
 
zword h_flags
 
zbyte h_serial [6]
 
zword h_abbreviations
 
zword h_file_size
 
zword h_checksum
 
zbyte h_interpreter_number
 
zbyte h_interpreter_version
 
zbyte h_screen_rows
 
zbyte h_screen_cols
 
zword h_screen_width
 
zword h_screen_height
 
zbyte h_font_height
 
zbyte h_font_width
 
zword h_functions_offset
 
zword h_strings_offset
 
zbyte h_default_background
 
zbyte h_default_foreground
 
zword h_terminating_keys
 
zword h_line_width
 
zbyte h_standard_high
 
zbyte h_standard_low
 
zword h_alphabet
 
zword h_extension_table
 
zbyte h_user_name [8]
 
zword hx_table_size
 
zword hx_mouse_x
 
zword hx_mouse_y
 
zword hx_unicode_table
 
zword hx_flags
 
zword hx_fore_colour
 
zword hx_back_colour
 
Story _storyId
 
- Protected Attributes inherited from Glk::GlkEngine
const GlkGameDescription _gameDescription
 
Common::RandomSource _random
 
int _loadSaveSlot
 
Common::File _gameFile
 
PCSpeaker_pcSpeaker
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 
- Protected Attributes inherited from Glk::Frotz::Mem
Common::SeekableReadStreamstory_fp
 
uint story_size
 
bytepcp
 
bytezmp
 
undo_tfirst_undo
 
undo_tlast_undo
 
undo_tcurr_undo
 
zbyteundo_mem
 
zbyteprev_zmp
 
zbyteundo_diff
 
int undo_count
 
int reserve_mem
 

Detailed Description

Frotz interpreter for Z-code games.

Definition at line 36 of file frotz.h.

Constructor & Destructor Documentation

◆ Frotz()

Glk::Frotz::Frotz::Frotz ( OSystem syst,
const GlkGameDescription gameDesc 
)

Constructor.

Definition at line 36 of file frotz.cpp.

◆ ~Frotz()

Glk::Frotz::Frotz::~Frotz ( )
virtual

Destructor.

Definition at line 41 of file frotz.cpp.

Member Function Documentation

◆ createScreen()

Screen * Glk::Frotz::Frotz::createScreen ( )
overrideprotectedvirtual

Create the screen class.

Reimplemented from Glk::GlkEngine.

Definition at line 58 of file frotz.cpp.

◆ getInterpreterType()

virtual InterpreterType Glk::Frotz::Frotz::getInterpreterType ( ) const
inlineoverridevirtual

Returns the running interpreter type.

Implements Glk::GlkEngine.

Definition at line 67 of file frotz.h.

◆ initGraphicsMode()

void Glk::Frotz::Frotz::initGraphicsMode ( )
protectedvirtual

Setup the video mode.

Reimplemented from Glk::GlkEngine.

Definition at line 45 of file frotz.cpp.

◆ initialize()

void Glk::Frotz::Frotz::initialize ( )

Initialization.

Definition at line 86 of file frotz.cpp.

◆ loadGameState()

Common::Error Glk::Frotz::Frotz::loadGameState ( int  slot)
overridevirtual

Load a savegame from a given slot.

Reimplemented from Glk::GlkEngine.

Definition at line 94 of file frotz.cpp.

◆ readSaveData()

virtual Common::Error Glk::Frotz::Frotz::readSaveData ( Common::SeekableReadStream rs)
inlineoverridevirtual

Loading method not used for Frotz sub-engine.

Implements Glk::GlkEngine.

Definition at line 87 of file frotz.h.

◆ runGame()

void Glk::Frotz::Frotz::runGame ( )
overridevirtual

Execute the game.

Implements Glk::GlkEngine.

Definition at line 62 of file frotz.cpp.

◆ saveGameState()

Common::Error Glk::Frotz::Frotz::saveGameState ( int  slot,
const Common::String desc 
)
overridevirtual

Save the game to a given slot.

Reimplemented from Glk::GlkEngine.

Definition at line 132 of file frotz.cpp.

◆ writeGameData()

virtual Common::Error Glk::Frotz::Frotz::writeGameData ( Common::WriteStream ws)
inlineoverridevirtual

Saving method not used for Frotz sub-engine.

Implements Glk::GlkEngine.

Definition at line 92 of file frotz.h.

Friends And Related Function Documentation

◆ FrotzScreen

friend class FrotzScreen
friend

Definition at line 37 of file frotz.h.


The documentation for this class was generated from the following files: