ScummVM
Glk::Magnetic::Magnetic Class Reference

Magnetic game interpreter. More...

#include <magnetic.h>

+ Inheritance diagram for Glk::Magnetic::Magnetic:
+ Collaboration diagram for Glk::Magnetic::Magnetic:

Public Member Functions

 Magnetic (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
void runGame () override
 Run the game. More...
 
InterpreterType getInterpreterType () const override
 Returns the running interpreter type. More...
 
bool canLoadGameStateCurrently () override
 The Magnetic engine currently doesn't support loading savegames from the GMM. More...
 
bool canSaveGameStateCurrently () override
 The Magnetic engine currently doesn't support saving games from the GMM. More...
 
Common::Error readSaveData (Common::SeekableReadStream *rs) override
 Load a savegame from the passed Quetzal file chunk stream. More...
 
Common::Error writeGameData (Common::WriteStream *ws) override
 Save the game. More...
 
- Public Member Functions inherited from Glk::GlkAPI
 GlkAPI (OSystem *syst, const GlkGameDescription &gameDesc)
 Constructor. More...
 
 ~GlkAPI () override
 
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)
 
void glk_set_echo_line_event (winid_t win, uint val)
 
void glk_set_terminators_line_event (winid_t win, const uint32 *keycodes, uint count)
 
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)
 
uint glk_buffer_canon_decompose_uni (uint32 *buf, uint len, uint numchars)
 
uint glk_buffer_canon_normalize_uni (uint32 *buf, uint len, uint numchars)
 
bool glk_image_draw (winid_t win, uint image, int val1, int val2)
 
bool glk_image_draw_scaled (winid_t win, uint image, int val1, int val2, uint width, uint height)
 
bool glk_image_draw (winid_t win, const Graphics::Surface &image, uint transColor=(uint) -1, int xp=0, int yp=0)
 
bool glk_image_draw_scaled (winid_t win, const Graphics::Surface &image, uint transColor, int xp, int yp, uint width, uint height)
 
bool glk_image_get_info (uint image, uint *width, uint *height)
 
void glk_window_flow_break (winid_t win)
 
void glk_window_erase_rect (winid_t win, int left, int top, uint width, uint height)
 
void glk_window_fill_rect (winid_t win, uint color, int left, int top, uint width, uint height)
 
void glk_window_set_background_color (winid_t win, uint color)
 
schanid_t glk_schannel_create (uint rock=0)
 
void glk_schannel_destroy (schanid_t chan)
 
schanid_t glk_schannel_iterate (schanid_t chan, uint *rockptr)
 
uint glk_schannel_get_rock (schanid_t chan)
 
uint glk_schannel_play (schanid_t chan, uint snd)
 
uint glk_schannel_play_ext (schanid_t chan, uint snd, uint repeats, uint notify)
 
void glk_schannel_stop (schanid_t chan)
 
void glk_schannel_set_volume (schanid_t chan, uint vol)
 
void glk_sound_load_hint (uint snd, uint flag)
 
schanid_t glk_schannel_create_ext (uint rock, uint volume)
 
uint glk_schannel_play_multi (schanid_t *chanarray, uint chancount, uint *sndarray, uint soundcount, uint notify)
 
void glk_schannel_pause (schanid_t chan)
 
void glk_schannel_unpause (schanid_t chan)
 
void glk_schannel_set_volume_ext (schanid_t chan, uint vol, uint duration, uint notify)
 
void glk_set_hyperlink (uint linkval)
 
void glk_set_hyperlink_stream (strid_t str, uint linkval)
 
void glk_request_hyperlink_event (winid_t win)
 
void glk_cancel_hyperlink_event (winid_t win)
 
void glk_current_time (glktimeval_t *time)
 
int glk_current_simple_time (uint factor)
 
void glk_time_to_date_utc (const glktimeval_t *time, glkdate_t *date)
 
void glk_time_to_date_local (const glktimeval_t *time, glkdate_t *date)
 
void glk_simple_time_to_date_utc (int time, uint factor, glkdate_t *date)
 
void glk_simple_time_to_date_local (int time, uint factor, glkdate_t *date)
 
void glk_date_to_time_utc (const glkdate_t *date, glktimeval_t *time)
 
void glk_date_to_time_local (const glkdate_t *date, glktimeval_t *time)
 
int glk_date_to_simple_time_utc (const glkdate_t *date, uint factor)
 
int glk_date_to_simple_time_local (const glkdate_t *date, uint factor)
 
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)
 
 ~GlkEngine () override
 
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...
 
Common::Error loadGameState (int slot) override
 Load a savegame from a given slot. More...
 
Common::Error saveGameState (int slot, const Common::String &desc, bool isAutosave=false) override
 Save the game to a given slot. More...
 
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...
 
void quitGame ()
 Flags to quit the game. More...
 
bool shouldQuit () const
 Returns true if the game should be quit. More...
 
- Public Member Functions inherited from Engine
 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...
 
void setDebugger (GUI::Debugger *debugger)
 Sets the engine's debugger. More...
 
GUI::DebuggergetOrCreateDebugger ()
 Return the engine's debugger instance, or create one if none is present. More...
 
virtual void flipMute ()
 Flip mute all sound option. More...
 
virtual Common::String getSaveStateName (int slot) const
 Generates the savegame filename. More...
 
virtual Common::Error loadGameStream (Common::SeekableReadStream *stream)
 Load a game state. More...
 
void setGameToLoadSlot (int slot)
 Sets the game slot for a savegame to be loaded after global main menu execution. More...
 
virtual Common::Error saveGameStream (Common::WriteStream *stream, bool isAutosave=false)
 Save a game state. More...
 
bool saveGameDialog ()
 Shows the ScummVM save dialog, allowing users to save their game. More...
 
bool loadGameDialog ()
 Shows the ScummVM Restore dialog, allowing users to load a game. More...
 
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...
 
void handleAutoSave ()
 Checks for whether it's time to do an autosave, and if so, does it. More...
 
void saveAutosaveIfEnabled ()
 Does an autosave immediately if autosaves are turned on. More...
 
virtual bool canSaveAutosaveCurrently ()
 Indicates whether an autosave can currently be saved. More...
 
virtual int getAutosaveSlot () const
 Returns the slot that should be used for autosaves. More...
 
bool shouldPerformAutoSave (int lastSaveTime)
 

Static Public Attributes

static const gms_command_t GMS_COMMAND_TABLE [14]
 
static const gms_gamma_t GMS_GAMMA_TABLE [38]
 

Private Member Functions

void initialize ()
 Performs initialization. More...
 
void initializeSettings ()
 Initializes settings from the ScummVM configuration. More...
 
void initializeCRC ()
 Initializes the CRC table. More...
 
void initializeLinearGamma ()
 Initializes the linear gamma entry. More...
 
void gms_fatal (const char *string)
 Fatal error handler. More...
 
void * gms_malloc (size_t size)
 Non-failing malloc. More...
 
void * gms_realloc (void *ptr, size_t size)
 Non-failing realloc. More...
 
int gms_strncasecmp (const char *s1, const char *s2, size_t n)
 Local comparison routine that doesn't have an ANSI standard. More...
 
int gms_strcasecmp (const char *s1, const char *s2)
 Local comparison routine that doesn't have an ANSI standard. More...
 
glui32 gms_get_buffer_crc (const void *void_buffer, size_t length)
 Return the CRC of the bytes in buffer[0..length-1]. More...
 
type32 gms_gameid_read_uint32 (int offset, Common::SeekableReadStream *stream)
 Endian-safe unsigned 32 bit integer read from game text file. More...
 
void gms_gameid_identify_game (const Common::String &text_file)
 Identify a game from its text file header, and cache the game's name for later queries. More...
 
const char * gms_gameid_get_game_name () const
 Return the name of the game, or NULL if not identifiable. More...
 
int gms_graphics_open ()
 If it's not open, open the graphics window. More...
 
void gms_graphics_close ()
 If open, close the graphics window and set back to NULL. More...
 
void gms_graphics_start ()
 If graphics enabled, start any background picture update processing. More...
 
void gms_graphics_stop ()
 Stop any background picture update processing. More...
 
int gms_graphics_are_displayed () const
 Return TRUE if graphics are currently being displayed, FALSE otherwise. More...
 
void gms_graphics_paint ()
 Set up a complete repaint of the current picture in the graphics window. More...
 
void gms_graphics_restart ()
 Restart graphics as if the current picture is a new picture. More...
 
void gms_graphics_count_colors (type8 bitmap[], type16 width, type16 height, int *color_count, long color_usage[])
 Analyze an image, and return the usage count of each palette color, and an overall count of how many colors out of the palette are used. More...
 
void gms_graphics_game_to_rgb_color (type16 color, gms_gammaref_t gamma, gms_rgbref_t rgb_color)
 General graphics color conversion. More...
 
void gms_graphics_split_color (glui32 color, gms_rgbref_t rgb_color)
 General graphics color conversion. More...
 
glui32 gms_graphics_combine_color (gms_rgbref_t rgb_color)
 General graphics color conversion. More...
 
int gms_graphics_color_luminance (gms_rgbref_t rgb_color)
 General graphics color conversion. More...
 
long gms_graphics_contrast_variance (type16 palette[], long color_usage[], gms_gammaref_t gamma)
 Calculate the contrast variance of the given palette and color usage, at the given gamma correction level. More...
 
gms_gammaref_t gms_graphics_equal_contrast_gamma (type16 palette[], long color_usage[])
 Try to find a gamma correction for the given palette and color usage that gives relatively equal contrast among the displayed colors. More...
 
gms_gammaref_t gms_graphics_select_gamma (type8 bitmap[], type16 width, type16 height, type16 palette[])
 Select a suitable gamma for the picture, based on the current gamma mode. More...
 
void gms_graphics_clear_and_border (winid_t glk_window, int x_offset, int y_offset, int pixel_size, type16 width, type16 height)
 Clear the graphics window, and border and shade the area where the picture is going to be rendered. More...
 
void gms_graphics_convert_palette (type16 ms_palette[], gms_gammaref_t gamma, glui32 glk_palette[])
 Convert a Magnetic Scrolls color palette to a Glk one, using the given gamma corrections. More...
 
void gms_graphics_position_picture (winid_t glk_window, int pixel_size, type16 width, type16 height, int *x_offset, int *y_offset)
 Given a picture width and height, return the x and y offsets to center this picture in the current graphics window. More...
 
void gms_graphics_apply_animation_frame (type8 bitmap[], type16 frame_width, type16 frame_height, type8 mask[], int frame_x, int frame_y, type8 off_screen[], type16 width, type16 height)
 Apply a single animation frame to the given off-screen image buffer, using the frame bitmap, width, height and mask, the off-screen buffer, and the width and height of the main picture. More...
 
int gms_graphics_animate (type8 off_screen[], type16 width, type16 height)
 This function finds and applies the next set of animation frames to the given off-screen image buffer. More...
 
int gms_graphics_is_vertex (type8 off_screen[], type16 width, type16 height, int x, int y)
 Given a point, return TRUE if that point is the vertex of a fillable region. More...
 
int gms_graphics_compare_layering_inverted (const void *void_first, const void *void_second)
 gms_graphics_compare_layering_inverted() gms_graphics_assign_layers() More...
 
void gms_graphics_assign_layers (type8 off_screen[], type8 on_screen[], type16 width, type16 height, int layers[], long layer_usage[])
 
void gms_graphics_paint_region (winid_t glk_window, glui32 palette[], int layers[], type8 off_screen[], type8 on_screen[], int x, int y, int x_offset, int y_offset, int pixel_size, type16 width, type16 height)
 This is a partially optimized point plot. More...
 
void gms_graphics_paint_everything (winid_t glk_window, glui32 palette[], type8 off_screen[], int x_offset, int y_offset, type16 width, type16 height)
 
void gms_graphics_timeout ()
 This is a background function, called on Glk timeouts. More...
 
void ms_showpic (type32 picture, type8 mode)
 Called by the main interpreter when it wants us to display a picture. More...
 
int gms_graphics_picture_is_available () const
 Return TRUE if the graphics module data is loaded with a usable picture, FALSE if there is no picture available to display. More...
 
int gms_graphics_get_picture_details (int *width, int *height, int *is_animated)
 Return the width, height, and animation flag of the currently loaded picture. More...
 
int gms_graphics_get_rendering_details (const char **gamma, int *color_count, int *is_active)
 Returns the current level of applied gamma correction, as a string, the count of colors in the picture, and a flag indicating if graphics is active (busy). More...
 
int gms_graphics_interpreter_enabled ()
 Return TRUE if it looks like interpreter graphics are turned on, FALSE otherwise. More...
 
void gms_graphics_cleanup ()
 
void ms_statuschar (type8 c)
 Receive one status character from the interpreter. More...
 
void gms_status_update ()
 
void gms_status_print ()
 Print the current contents of the completed status line buffer out in the main window, if it has changed since the last call. More...
 
void gms_status_notify ()
 
void gms_status_redraw ()
 
void gms_output_register_help_request ()
 
void gms_output_silence_help_hints ()
 
void gms_output_provide_help_hint ()
 
int gms_game_prompted ()
 
void gms_detect_game_prompt ()
 
void gms_output_delete ()
 
void gms_output_flush ()
 
void ms_putchar (type8 c)
 
void gms_styled_string (glui32 style, const char *message)
 
void gms_styled_char (glui32 style, char c)
 
void gms_standout_string (const char *message)
 
void gms_normal_string (const char *message)
 
void gms_normal_char (char c)
 
void gms_header_string (const char *message)
 
void gms_banner_string (const char *message)
 
void ms_flush ()
 Handle a core interpreter call to flush the output buffer. More...
 
type16 gms_get_hint_max_node (const ms_hint hints_[], type16 node)
 Return the maximum hint node referred to by the tree under the given node. More...
 
const char * gms_get_hint_content (const ms_hint hints_[], type16 node, int number)
 Return the content string for a given hint number within a given node. More...
 
const char * gms_get_hint_topic (const ms_hint hints_[], type16 node)
 Return the topic string for a given hint node. More...
 
int gms_hint_open ()
 If not already open, open the hints windows. More...
 
void gms_hint_close ()
 If open, close the hints windows. More...
 
int gms_hint_windows_available ()
 Return TRUE if hints windows are available. More...
 
void gms_hint_menu_print (int line, int column, const char *string_, glui32 width, glui32 height)
 gms_hint_menu_print() gms_hint_menu_header() gms_hint_menu_justify() gms_hint_text_print() gms_hint_menutext_done() gms_hint_menutext_start() More...
 
void gms_hint_menu_header (int line, const char *string_, glui32 width, glui32 height)
 
void gms_hint_menu_justify (int line, const char *left_string, const char *right_string, glui32 width, glui32 height)
 
void gms_hint_text_print (const char *string_)
 
void gms_hint_menutext_start ()
 
void gms_hint_menutext_done ()
 
void gms_hint_menutext_char_event (event_t *event)
 Request and return a character event from the hints windows. More...
 
void gms_hint_arrange_windows (int requested_lines, glui32 *width, glui32 *height)
 Arrange the hints windows so that the hint menu window has the requested number of lines. More...
 
void gms_hint_display_folder (const struct ms_hint hints_[], const int cursor[], type16 node)
 Update the hints windows for the given folder hint node. More...
 
void gms_hint_display_text (const struct ms_hint hints_[], const int cursor[], type16 node)
 Update the hints windows for the given text hint node. More...
 
void gms_hint_display (const struct ms_hint hints_[], const int cursor[], type16 node)
 Display the given hint using the appropriate display function. More...
 
type16 gms_hint_handle_folder (const ms_hint hints_[], int cursor[], type16 node, glui32 keycode)
 Handle a Glk keycode for the given folder hint. More...
 
type16 gms_hint_handle_text (const ms_hint hints[], int cursor[], type16 node, glui32 keycode)
 Handle a Glk keycode for the given text hint. More...
 
type16 gms_hint_handle (const ms_hint hints_[], int cursor[], type16 node, glui32 keycode)
 Handle a Glk keycode for the given hint using the appropriate handler function. More...
 
type8 ms_showhints (ms_hint *hints_)
 Start game hints. More...
 
void gms_hint_redraw ()
 Update the hints windows for the current hint. More...
 
void gms_hints_cleanup ()
 Free memory resources allocated by hints functions. More...
 
void ms_playmusic (type8 *midi_data, type32 length, type16 tempo)
 
void gms_command_undo (const char *argument)
 Stub function for the undo command. More...
 
void gms_command_script (const char *argument)
 Turn game output scripting (logging) on and off. More...
 
void gms_command_inputlog (const char *argument)
 Turn game input logging on and off. More...
 
void gms_command_readlog (const char *argument)
 Set the game input log, to read input from a file. More...
 
void gms_command_abbreviations (const char *argument)
 Turn abbreviation expansions on and off. More...
 
void gms_command_graphics (const char *argument)
 Enable or disable graphics more permanently than is done by the main interpreter. More...
 
void gms_command_gamma (const char *argument)
 Enable or disable picture gamma corrections. More...
 
void gms_command_animations (const char *argument)
 Enable or disable picture animations. More...
 
void gms_command_prompts (const char *argument)
 Turn the extra "> " prompt output on and off. More...
 
void gms_command_print_version_number (glui32 version)
 gms_command_print_version_number() gms_command_version() More...
 
void gms_command_version (const char *argument)
 
void gms_command_commands (const char *argument)
 Turn command escapes off. More...
 
void gms_command_summary (const char *argument)
 Report all current Glk settings. More...
 
void gms_command_help (const char *command)
 Document the available Glk commands. More...
 
int gms_command_escape (const char *string_, int *undo_command)
 This function is handed each input line. More...
 
int gms_command_undo_special (const char *string_)
 This function makes a special case of the input line containing the single word "undo", treating it as if it is "glk undo". More...
 
void gms_expand_abbreviations (char *buffer_, int size)
 Expand a few common one-character abbreviations commonly found in other game systems, but not always normal in Magnetic Scrolls games. More...
 
void gms_buffer_input ()
 Read and buffer a line of input. More...
 
type8 ms_getchar (type8 trans)
 Return the single next character to the interpreter. More...
 
void gms_event_wait (glui32 wait_type, event_t *event)
 Process Glk events until one of the expected type arrives. More...
 
int __wrap_toupper (int ch)
 __wrap_toupper() __wrap_tolower() More...
 
int __wrap_tolower (int ch)
 
void gms_establish_filenames (const char *name, char **text, char **graphics, char **hints_)
 Given a game name, try to establish three filenames from it - the main game text file, the (optional) graphics data file, and the (optional) hints file. More...
 
void gms_main ()
 
void glk_main ()
 
void write (const char *fmt,...)
 
void writeChar (char c)
 
type8effective (type32 ptr)
 
void ms_seed (type32 seed)
 
type32 rand_emu ()
 
void ms_freemem ()
 
type8 ms_is_running () const
 
type8 ms_is_magwin () const
 
void ms_stop ()
 
type8 init_gfx1 (type8 *header)
 
type8 init_gfx2 (type8 *header)
 
type8 init_snd (type8 *header)
 
type8 ms_init (const char *name, const char *gfxname, const char *hntname, const char *sndname)
 
type8 is_blank (type16 line, type16 width)
 
type8ms_extract1 (type8 pic, type16 *w, type16 *h, type16 *pal)
 
type16s find_name_in_header (const char *name, type8 upper)
 
void extract_frame (struct picture *pic)
 
type8ms_extract2 (const char *name, type16 *w, type16 *h, type16 *pal, type8 *is_anim)
 
type8ms_extract (type32 pic, type16 *w, type16 *h, type16 *pal, type8 *is_anim)
 
type8 ms_animate (struct ms_position **positions, type16 *count)
 
type8ms_get_anim_frame (type16s number, type16 *width, type16 *height, type8 **mask)
 
type8 ms_anim_is_repeating () const
 
type16s find_name_in_sndheader (const char *name)
 
type8sound_extract (const char *name, type32 *length, type16 *tempo)
 
void save_undo ()
 
type8 ms_undo ()
 
void log_status ()
 
void ms_status ()
 
type32 ms_count () const
 
type8reg_align (type8 *ptr, type8 size)
 
type32 read_reg (int i, int s)
 
void write_reg (int i, int s, type32 val)
 
void char_out (type8 c)
 
void set_info (type8 b)
 
void read_word ()
 
void set_arg1 ()
 
void set_arg2_nosize (int use_dx, type8 b)
 
void set_arg2 (int use_dx, type8 b)
 
void swap_args ()
 
void push (type32 c)
 
type32 pop ()
 
void get_arg ()
 
void set_flags ()
 
int condition (type8 b)
 
void branch (type8 b)
 
void do_add (type8 adda)
 
void do_sub (type8 suba)
 
void do_eor ()
 
void do_and ()
 
void do_or ()
 
void do_cmp ()
 
void do_move ()
 
type8 do_btst (type8 a)
 
void do_bop (type8 b, type8 a)
 
void check_btst ()
 
void check_lea ()
 
void check_movem ()
 
void check_movem2 ()
 
void dict_lookup ()
 
void do_findprop ()
 
void write_string ()
 
void output_number (type16 number)
 
type16 output_text (const char *text)
 
type16s hint_input ()
 
type16 show_hints_text (ms_hint *hintsData, type16 index)
 
void do_line_a ()
 
type8 ms_rungame ()
 
type8 ms_load_file (const char *name, type8 *ptr, type16 size)
 
type8 ms_save_file (const char *name, type8 *ptr, type16 size)
 
void script_write (type8 c)
 
void transcript_write (type8 c)
 

Static Private Member Functions

static int gms_graphics_compare_luminance (const void *void_first, const void *void_second)
 Calculate the contrast variance of the given palette and color usage, at the given gamma correction level. More...
 
static type32 read_l (type8 *ptr)
 
static type16 read_w (type8 *ptr)
 
static type32 read_l2 (type8 *ptr)
 
static type16 read_w2 (type8 *ptr)
 
static void write_l (type8 *ptr, type32 val)
 
static void write_w (type8 *ptr, type16 val)
 

Private Attributes

GammaMode gms_gamma_mode
 
bool gms_animation_enabled
 
bool gms_prompt_enabled
 
bool gms_abbreviations_enabled
 
bool gms_commands_enabled
 
bool gms_graphics_enabled
 
const glui32 GMS_PORT_VERSION
 
winid_t gms_main_window
 We use a maximum of five Glk windows, one for status, one for pictures, two for hints, and one for everything else. More...
 
winid_t gms_status_window
 
winid_t gms_graphics_window
 
winid_t gms_hint_menu_window
 
winid_t gms_hint_text_window
 
strid_t gms_transcript_stream
 Transcript stream and input log. More...
 
strid_t gms_inputlog_stream
 
strid_t gms_readlog_stream
 
bool gms_graphics_possible
 
const char *const GMS_INPUT_PROMPT
 
const char * gms_gameid_game_name
 The game's name, suitable for printing out on a status line, or other location where game information is relevant. More...
 
type8gms_graphics_bitmap
 
type16 gms_graphics_width
 
type16 gms_graphics_height
 
type16 gms_graphics_palette [GMS_PALETTE_SIZE]
 
bool gms_graphics_animated
 
type32 gms_graphics_picture
 
bool gms_graphics_new_picture
 
bool gms_graphics_repaint
 
bool gms_graphics_active
 
bool gms_graphics_interpreter
 
type8gms_graphics_off_screen
 
type8gms_graphics_on_screen
 
gms_gammaref_t gms_graphics_current_gamma
 
int gms_graphics_color_count
 
char gms_status_buffer [GMS_STATBUFFER_LENGTH]
 The interpreter feeds us status line characters one at a time, with Tab indicating right justify, and CR indicating the line is complete. More...
 
int gms_status_length
 
int gms_help_requested
 
int gms_help_hints_silenced
 
char * gms_output_buffer
 
int gms_output_allocation
 
int gms_output_length
 
int gms_output_prompt
 
ms_hintgms_hints
 
type16 gms_current_hint_node
 
int * gms_hint_cursor
 
char gms_input_buffer [GMS_INPUTBUFFER_LENGTH]
 
int gms_input_length
 
int gms_input_cursor
 
int gms_undo_notification
 
const char * gms_game_message
 
int gms_startup_called
 
int gms_main_called
 
type32 dreg [8]
 
type32 areg [8]
 
type32 i_count
 
type32 string_size
 
type32 rseed
 
type32 pc
 
type32 arg1i
 
type32 mem_size
 
type16 properties
 
type16 fl_sub
 
type16 fl_tab
 
type16 fl_size
 
type16 fp_tab
 
type16 fp_size
 
type8 zflag
 
type8 nflag
 
type8 cflag
 
type8 vflag
 
type8 byte1
 
type8 byte2
 
type8 regnr
 
type8 admode
 
type8 opsize
 
type8arg1
 
type8arg2
 
type8 is_reversible
 
type8 running
 
type8 tmparg [4]
 
type8 lastchar
 
type8 version
 
type8 sd
 
type8decode_table
 
type8restart
 
type8code
 
type8string
 
type8string2
 
type8string3
 
type8dict
 
type8 quick_flag
 
type8 gfx_ver
 
type8gfx_buf
 
type8gfx_data
 
type8gfx2_hdr
 
type8gfx2_buf
 
const char * gfx2_name
 
type16 gfx2_hsize
 
Common::Filegfx_fp
 
type8snd_buf
 
type8snd_hdr
 
type16 snd_hsize
 
Common::Filesnd_fp
 
type32 undo_regs [2][18]
 
type32 undo_pc
 
type32 undo_size
 
type8undo [2]
 
type8 undo_stat [2]
 
type16 gfxtable
 
type16 table_dist
 
type16 v4_id
 
type16 next_table
 
type16 pos_table_size
 
type8command_table
 
type16s command_index
 
type16s pos_table_index
 
type16s pos_table_max
 
type8 anim_repeat
 
type16 pos_table_count [MAX_POSITIONS]
 
picture anim_frame_table [MAX_ANIMS]
 
ms_position pos_table [MAX_POSITIONS][MAX_ANIMS]
 
lookup anim_table [MAX_POSITIONS]
 
ms_position pos_array [MAX_FRAMES]
 
ms_hinthints
 
type8hint_contents
 
const gms_rgb_t GMS_LUMINANCE_WEIGHTS
 Weighting values for calculating the luminance of a color. More...
 
type8_saveData
 
size_t _saveSize
 
type8 buffer [80]
 
type8 xpos
 
type8 bufpos
 
type8 log_on
 
type8 ms_gfx_enabled
 
type8 filename [256]
 
Common::DumpFile_log1
 
Common::DumpFile_log2
 
glui32 crc_table [BYTE_MAX_VAL+1]
 
int luminance_weighting
 
gms_gammaref_t linear_gamma
 
uint32 pic_current_crc
 
uint32 hints_current_crc
 
bool hints_crc_initialized
 

Additional Inherited Members

- Public Types inherited from Engine
enum  EngineFeature { kSupportsSubtitleOptions, kSupportsRTL, kSupportsLoadingDuringRuntime, kSupportsSavingDuringRuntime }
 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 MetaEnginegetMetaEngine ()
 
static bool warnUserAboutUnsupportedGame ()
 Display a warning to the user that the game is not fully supported. More...
 
- Public Attributes inherited from Glk::GlkEngine
Blorb_blorb
 
Clipboard_clipboard
 
Conf_conf
 
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
 
- Protected Member Functions inherited from Glk::GlkEngine
Common::Error run () override
 Init the engine and start its main loop. More...
 
bool hasFeature (EngineFeature f) const override
 Returns true whether a given feature is supported by the engine. More...
 
virtual void initGraphicsMode ()
 Setup the video mode. More...
 
virtual ScreencreateScreen ()
 Create the screen. More...
 
- Protected Member Functions inherited from Engine
virtual int runDialog (GUI::Dialog &dialog)
 
virtual void pauseEngineIntern (bool pause)
 Actual implementation of pauseEngine by subclasses. More...
 
- Protected Attributes inherited from Glk::GlkEngine
const GlkGameDescription _gameDescription
 
Common::RandomSource _random
 
int _loadSaveSlot
 
Common::File _gameFile
 
PCSpeaker_pcSpeaker
 
bool _quitFlag
 
- Protected Attributes inherited from Engine
Common::TimerManager_timer
 
Common::EventManager_eventMan
 
Common::SaveFileManager_saveFileMan
 
GUI::Dialog_mainMenuDialog
 
const Common::String _targetName
 

Detailed Description

Magnetic game interpreter.

Definition at line 54 of file magnetic.h.

Constructor & Destructor Documentation

◆ Magnetic()

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

Constructor.

Definition at line 32 of file magnetic.cpp.

Member Function Documentation

◆ __wrap_tolower()

int Glk::Magnetic::Magnetic::__wrap_tolower ( int  ch)
private

Definition at line 3716 of file glk.cpp.

◆ __wrap_toupper()

int Glk::Magnetic::Magnetic::__wrap_toupper ( int  ch)
private

__wrap_toupper() __wrap_tolower()

Wrapper functions around toupper() and tolower(). The Linux linker's –wrap option will convert calls to mumble() to __wrap_mumble() if we give it the right options. We'll use this feature to translate all toupper() and tolower() calls in the interpreter code into calls to Glk's versions of these functions.

It's not critical that we do this. If a linker, say a non-Linux one, won't do –wrap, then just do without it. It's unlikely that there will be much noticeable difference.

Definition at line 3709 of file glk.cpp.

◆ branch()

void Glk::Magnetic::Magnetic::branch ( type8  b)
private

◆ canLoadGameStateCurrently()

bool Glk::Magnetic::Magnetic::canLoadGameStateCurrently ( )
inlineoverridevirtual

The Magnetic engine currently doesn't support loading savegames from the GMM.

Reimplemented from Glk::GlkEngine.

Definition at line 1389 of file magnetic.h.

◆ canSaveGameStateCurrently()

bool Glk::Magnetic::Magnetic::canSaveGameStateCurrently ( )
inlineoverridevirtual

The Magnetic engine currently doesn't support saving games from the GMM.

Reimplemented from Glk::GlkEngine.

Definition at line 1396 of file magnetic.h.

◆ char_out()

void Glk::Magnetic::Magnetic::char_out ( type8  c)
private

◆ check_btst()

void Glk::Magnetic::Magnetic::check_btst ( )
private

◆ check_lea()

void Glk::Magnetic::Magnetic::check_lea ( )
private

◆ check_movem()

void Glk::Magnetic::Magnetic::check_movem ( )
private

◆ check_movem2()

void Glk::Magnetic::Magnetic::check_movem2 ( )
private

◆ condition()

int Glk::Magnetic::Magnetic::condition ( type8  b)
private

◆ dict_lookup()

void Glk::Magnetic::Magnetic::dict_lookup ( )
private

◆ do_add()

void Glk::Magnetic::Magnetic::do_add ( type8  adda)
private

◆ do_and()

void Glk::Magnetic::Magnetic::do_and ( )
private

◆ do_bop()

void Glk::Magnetic::Magnetic::do_bop ( type8  b,
type8  a 
)
private

◆ do_btst()

type8 Glk::Magnetic::Magnetic::do_btst ( type8  a)
private

◆ do_cmp()

void Glk::Magnetic::Magnetic::do_cmp ( )
private

◆ do_eor()

void Glk::Magnetic::Magnetic::do_eor ( )
private

◆ do_findprop()

void Glk::Magnetic::Magnetic::do_findprop ( )
private

◆ do_line_a()

void Glk::Magnetic::Magnetic::do_line_a ( )
private

◆ do_move()

void Glk::Magnetic::Magnetic::do_move ( )
private

◆ do_or()

void Glk::Magnetic::Magnetic::do_or ( )
private

◆ do_sub()

void Glk::Magnetic::Magnetic::do_sub ( type8  suba)
private

◆ effective()

type8* Glk::Magnetic::Magnetic::effective ( type32  ptr)
private

◆ extract_frame()

void Glk::Magnetic::Magnetic::extract_frame ( struct picture pic)
private

◆ find_name_in_header()

type16s Glk::Magnetic::Magnetic::find_name_in_header ( const char *  name,
type8  upper 
)
private

◆ find_name_in_sndheader()

type16s Glk::Magnetic::Magnetic::find_name_in_sndheader ( const char *  name)
private

◆ get_arg()

void Glk::Magnetic::Magnetic::get_arg ( )
private

◆ getInterpreterType()

InterpreterType Glk::Magnetic::Magnetic::getInterpreterType ( ) const
inlineoverridevirtual

Returns the running interpreter type.

Implements Glk::GlkEngine.

Definition at line 1382 of file magnetic.h.

◆ glk_main()

void Glk::Magnetic::Magnetic::glk_main ( )
private

Definition at line 3969 of file glk.cpp.

◆ gms_banner_string()

void Glk::Magnetic::Magnetic::gms_banner_string ( const char *  message)
private

Definition at line 1905 of file glk.cpp.

◆ gms_buffer_input()

void Glk::Magnetic::Magnetic::gms_buffer_input ( )
private

Read and buffer a line of input.

If there is an input log active, then data is taken by reading this first. Otherwise, the function gets a line from Glk.

It also makes special cases of some lines read from the user, either handling commands inside them directly, or expanding abbreviations as appropriate. This is not reflected in the buffer, which is adjusted as required before returning.

Definition at line 3482 of file glk.cpp.

◆ gms_command_abbreviations()

void Glk::Magnetic::Magnetic::gms_command_abbreviations ( const char *  argument)
private

Turn abbreviation expansions on and off.

Definition at line 2749 of file glk.cpp.

◆ gms_command_animations()

void Glk::Magnetic::Magnetic::gms_command_animations ( const char *  argument)
private

Enable or disable picture animations.

Definition at line 2981 of file glk.cpp.

◆ gms_command_commands()

void Glk::Magnetic::Magnetic::gms_command_commands ( const char *  argument)
private

Turn command escapes off.

Once off, there's no way to turn them back on. Commands must be on already to enter this function.

Definition at line 3106 of file glk.cpp.

◆ gms_command_escape()

int Glk::Magnetic::Magnetic::gms_command_escape ( const char *  string_,
int *  undo_command 
)
private

This function is handed each input line.

If the line contains a specific Glk port command, handle it and return TRUE, otherwise return FALSE.

On unambiguous returns, it will also set the value for undo_command to the table undo return value.

Definition at line 3323 of file glk.cpp.

◆ gms_command_gamma()

void Glk::Magnetic::Magnetic::gms_command_gamma ( const char *  argument)
private

Enable or disable picture gamma corrections.

Definition at line 2901 of file glk.cpp.

◆ gms_command_graphics()

void Glk::Magnetic::Magnetic::gms_command_graphics ( const char *  argument)
private

Enable or disable graphics more permanently than is done by the main interpreter.

Also, print out a few brief details about the graphics state of the program.

Definition at line 2787 of file glk.cpp.

◆ gms_command_help()

void Glk::Magnetic::Magnetic::gms_command_help ( const char *  command)
private

Document the available Glk commands.

Definition at line 3151 of file glk.cpp.

◆ gms_command_inputlog()

void Glk::Magnetic::Magnetic::gms_command_inputlog ( const char *  argument)
private

Turn game input logging on and off.

Definition at line 2630 of file glk.cpp.

◆ gms_command_print_version_number()

void Glk::Magnetic::Magnetic::gms_command_print_version_number ( glui32  version)
private

gms_command_print_version_number() gms_command_version()

Print out the Glk library version number.

Definition at line 3084 of file glk.cpp.

◆ gms_command_prompts()

void Glk::Magnetic::Magnetic::gms_command_prompts ( const char *  argument)
private

Turn the extra "> " prompt output on and off.

Definition at line 3043 of file glk.cpp.

◆ gms_command_readlog()

void Glk::Magnetic::Magnetic::gms_command_readlog ( const char *  argument)
private

Set the game input log, to read input from a file.

Definition at line 2687 of file glk.cpp.

◆ gms_command_script()

void Glk::Magnetic::Magnetic::gms_command_script ( const char *  argument)
private

Turn game output scripting (logging) on and off.

Definition at line 2569 of file glk.cpp.

◆ gms_command_summary()

void Glk::Magnetic::Magnetic::gms_command_summary ( const char *  argument)
private

Report all current Glk settings.

Definition at line 3133 of file glk.cpp.

◆ gms_command_undo()

void Glk::Magnetic::Magnetic::gms_command_undo ( const char *  argument)
private

Stub function for the undo command.

The real work is to return the undo code to the input functions.

Definition at line 2565 of file glk.cpp.

◆ gms_command_undo_special()

int Glk::Magnetic::Magnetic::gms_command_undo_special ( const char *  string_)
private

This function makes a special case of the input line containing the single word "undo", treating it as if it is "glk undo".

This makes life a bit more convenient for the player, since it's the same behavior that most other IF systems have. It returns TRUE if "undo" found, FALSE otherwise.

Definition at line 3416 of file glk.cpp.

◆ gms_command_version()

void Glk::Magnetic::Magnetic::gms_command_version ( const char *  argument)
private

Definition at line 3092 of file glk.cpp.

◆ gms_detect_game_prompt()

void Glk::Magnetic::Magnetic::gms_detect_game_prompt ( )
private

Definition at line 1789 of file glk.cpp.

◆ gms_establish_filenames()

void Glk::Magnetic::Magnetic::gms_establish_filenames ( const char *  name,
char **  text,
char **  graphics,
char **  hints_ 
)
private

Given a game name, try to establish three filenames from it - the main game text file, the (optional) graphics data file, and the (optional) hints file.

Given an input "file" X, the function looks for X.MAG or X.mag for game data, X.GFX or X.gfx for graphics, and X.HNT or X.hnt for hints. If the input file already ends with .MAG, .GFX, or .HNT, the extension is stripped first.

The function returns NULL for filenames not available. It's not fatal if the graphics filename or hints filename is NULL, but it is if the main game filename is NULL. Filenames are malloc'ed, and need to be freed by the caller.

Definition at line 3727 of file glk.cpp.

◆ gms_event_wait()

void Glk::Magnetic::Magnetic::gms_event_wait ( glui32  wait_type,
event_t event 
)
private

Process Glk events until one of the expected type arrives.

Return the event of that type.

Definition at line 3676 of file glk.cpp.

◆ gms_expand_abbreviations()

void Glk::Magnetic::Magnetic::gms_expand_abbreviations ( char *  buffer_,
int  size 
)
private

Expand a few common one-character abbreviations commonly found in other game systems, but not always normal in Magnetic Scrolls games.

Definition at line 3439 of file glk.cpp.

◆ gms_fatal()

void Glk::Magnetic::Magnetic::gms_fatal ( const char *  string)
private

Fatal error handler.

The function returns, expecting the caller to abort() or otherwise handle the error.

Definition at line 194 of file glk.cpp.

◆ gms_game_prompted()

int Glk::Magnetic::Magnetic::gms_game_prompted ( )
private

Definition at line 1780 of file glk.cpp.

◆ gms_gameid_get_game_name()

const char* Glk::Magnetic::Magnetic::gms_gameid_get_game_name ( ) const
inlineprivate

Return the name of the game, or NULL if not identifiable.

Definition at line 340 of file magnetic.h.

◆ gms_gameid_identify_game()

void Glk::Magnetic::Magnetic::gms_gameid_identify_game ( const Common::String text_file)
private

Identify a game from its text file header, and cache the game's name for later queries.

Sets the cache to NULL if not found.

Definition at line 306 of file glk.cpp.

◆ gms_gameid_read_uint32()

type32 Glk::Magnetic::Magnetic::gms_gameid_read_uint32 ( int  offset,
Common::SeekableReadStream stream 
)
private

Endian-safe unsigned 32 bit integer read from game text file.

Returns 0 on error, a known unused table value.

Definition at line 300 of file glk.cpp.

◆ gms_get_buffer_crc()

glui32 Glk::Magnetic::Magnetic::gms_get_buffer_crc ( const void *  void_buffer,
size_t  length 
)
private

Return the CRC of the bytes in buffer[0..length-1].

This algorithm is taken from the PNG specification, version 1.0.

Definition at line 281 of file glk.cpp.

◆ gms_get_hint_content()

const char * Glk::Magnetic::Magnetic::gms_get_hint_content ( const ms_hint  hints_[],
type16  node,
int  number 
)
private

Return the content string for a given hint number within a given node.

This counts over 'number' ASCII NULs in the node's content, returning the address of the string located this way.

Definition at line 1955 of file glk.cpp.

◆ gms_get_hint_max_node()

type16 Glk::Magnetic::Magnetic::gms_get_hint_max_node ( const ms_hint  hints_[],
type16  node 
)
private

Return the maximum hint node referred to by the tree under the given node.

The result is the largest index found, or node, if greater. Because the interpreter doesn't supply it, we need to uncover it the hard way. The function is recursive, and since it is a tree search, assumes that hints is a tree, not a graph.

Definition at line 1916 of file glk.cpp.

◆ gms_get_hint_topic()

const char * Glk::Magnetic::Magnetic::gms_get_hint_topic ( const ms_hint  hints_[],
type16  node 
)
private

Return the topic string for a given hint node.

This is found by searching the parent node for a link to the node handed in. For the root node, the string is defaulted, since the root node has no parent.

Definition at line 1971 of file glk.cpp.

◆ gms_graphics_animate()

int Glk::Magnetic::Magnetic::gms_graphics_animate ( type8  off_screen[],
type16  width,
type16  height 
)
private

This function finds and applies the next set of animation frames to the given off-screen image buffer.

It's handed the width and height of the main picture, and the off-screen buffer.

It returns FALSE if at the end of animations, TRUE if more animations remain.

Definition at line 834 of file glk.cpp.

◆ gms_graphics_apply_animation_frame()

void Glk::Magnetic::Magnetic::gms_graphics_apply_animation_frame ( type8  bitmap[],
type16  frame_width,
type16  frame_height,
type8  mask[],
int  frame_x,
int  frame_y,
type8  off_screen[],
type16  width,
type16  height 
)
private

Apply a single animation frame to the given off-screen image buffer, using the frame bitmap, width, height and mask, the off-screen buffer, and the width and height of the main picture.

Note that 'mask' may be NULL, implying that no frame pixel is transparent.

Definition at line 756 of file glk.cpp.

◆ gms_graphics_are_displayed()

int Glk::Magnetic::Magnetic::gms_graphics_are_displayed ( ) const
inlineprivate

Return TRUE if graphics are currently being displayed, FALSE otherwise.

Definition at line 368 of file magnetic.h.

◆ gms_graphics_assign_layers()

void Glk::Magnetic::Magnetic::gms_graphics_assign_layers ( type8  off_screen[],
type8  on_screen[],
type16  width,
type16  height,
int  layers[],
long  layer_usage[] 
)
private

Definition at line 922 of file glk.cpp.

◆ gms_graphics_cleanup()

void Glk::Magnetic::Magnetic::gms_graphics_cleanup ( )
private

Definition at line 1597 of file glk.cpp.

◆ gms_graphics_clear_and_border()

void Glk::Magnetic::Magnetic::gms_graphics_clear_and_border ( winid_t  glk_window,
int  x_offset,
int  y_offset,
int  pixel_size,
type16  width,
type16  height 
)
private

Clear the graphics window, and border and shade the area where the picture is going to be rendered.

This attempts a small raised effect for the picture, in keeping with modern trends.

Definition at line 620 of file glk.cpp.

◆ gms_graphics_close()

void Glk::Magnetic::Magnetic::gms_graphics_close ( )
private

If open, close the graphics window and set back to NULL.

Definition at line 340 of file glk.cpp.

◆ gms_graphics_color_luminance()

int Glk::Magnetic::Magnetic::gms_graphics_color_luminance ( gms_rgbref_t  rgb_color)
private

General graphics color conversion.

Definition at line 475 of file glk.cpp.

◆ gms_graphics_combine_color()

glui32 Glk::Magnetic::Magnetic::gms_graphics_combine_color ( gms_rgbref_t  rgb_color)
private

General graphics color conversion.

Definition at line 467 of file glk.cpp.

◆ gms_graphics_compare_layering_inverted()

int Glk::Magnetic::Magnetic::gms_graphics_compare_layering_inverted ( const void *  void_first,
const void *  void_second 
)
private

gms_graphics_compare_layering_inverted() gms_graphics_assign_layers()

Given two sets of image bitmaps, and a palette, this function will assign layers palette colors.

Layers are assigned by first counting the number of vertices in the color plane, to get a measure of the complexity of shapes displayed in this color, and also the raw number of times each palette color is used. This is then sorted, so that layers are assigned to colors, with the lowest layer being the color with the most complex shapes, and within this (or where the count of vertices is zero, as it could be in some animation frames) the most used color.

The function compares pixels in the two image bitmaps given, these being the off-screen and on-screen buffers, and generates counts only where these bitmaps differ. This ensures that only pixels not yet painted are included in layering.

As well as assigning layers, this function returns a set of layer usage flags, to help the rendering loop to terminate as early as possible.

By painting lower layers first, the paint can take in larger areas if it's permitted to include not-yet-validated higher levels. This helps minimize the amount of Glk areas fills needed to render a picture.

Definition at line 903 of file glk.cpp.

◆ gms_graphics_compare_luminance()

int Glk::Magnetic::Magnetic::gms_graphics_compare_luminance ( const void *  void_first,
const void *  void_second 
)
staticprivate

Calculate the contrast variance of the given palette and color usage, at the given gamma correction level.

Helper functions for automatic gamma correction.

Definition at line 485 of file glk.cpp.

◆ gms_graphics_contrast_variance()

long Glk::Magnetic::Magnetic::gms_graphics_contrast_variance ( type16  palette[],
long  color_usage[],
gms_gammaref_t  gamma 
)
private

Calculate the contrast variance of the given palette and color usage, at the given gamma correction level.

Helper functions for automatic gamma correction.

Definition at line 493 of file glk.cpp.

◆ gms_graphics_convert_palette()

void Glk::Magnetic::Magnetic::gms_graphics_convert_palette ( type16  ms_palette[],
gms_gammaref_t  gamma,
glui32  glk_palette[] 
)
private

Convert a Magnetic Scrolls color palette to a Glk one, using the given gamma corrections.

Definition at line 723 of file glk.cpp.

◆ gms_graphics_count_colors()

void Glk::Magnetic::Magnetic::gms_graphics_count_colors ( type8  bitmap[],
type16  width,
type16  height,
int *  color_count,
long  color_usage[] 
)
private

Analyze an image, and return the usage count of each palette color, and an overall count of how many colors out of the palette are used.

NULL arguments indicate no interest in the return value.

Definition at line 410 of file glk.cpp.

◆ gms_graphics_equal_contrast_gamma()

gms_gammaref_t Glk::Magnetic::Magnetic::gms_graphics_equal_contrast_gamma ( type16  palette[],
long  color_usage[] 
)
private

Try to find a gamma correction for the given palette and color usage that gives relatively equal contrast among the displayed colors.

To do this, we search the gamma tables, computing color luminance for each color in the palette given this gamma. From luminances, we then compute the contrasts between the colors, and settle on the gamma correction that gives the most even and well-distributed picture contrast. We ignore colors not used in the palette.

Note that we don't consider how often a palette color is used, only whether it's represented, or not. Some weighting might improve things, but the simple method seems to work adequately. In practice, as there are only 16 colors in a palette, most pictures use most colors in a relatively well distributed manner. This algorithm probably wouldn't work well on real photographs, though.

Definition at line 551 of file glk.cpp.

◆ gms_graphics_game_to_rgb_color()

void Glk::Magnetic::Magnetic::gms_graphics_game_to_rgb_color ( type16  color,
gms_gammaref_t  gamma,
gms_rgbref_t  rgb_color 
)
private

General graphics color conversion.

Definition at line 444 of file glk.cpp.

◆ gms_graphics_get_picture_details()

int Glk::Magnetic::Magnetic::gms_graphics_get_picture_details ( int *  width,
int *  height,
int *  is_animated 
)
private

Return the width, height, and animation flag of the currently loaded picture.

The function returns FALSE if no picture is loaded, otherwise TRUE, with picture details in the return arguments.

Definition at line 1548 of file glk.cpp.

◆ gms_graphics_get_rendering_details()

int Glk::Magnetic::Magnetic::gms_graphics_get_rendering_details ( const char **  gamma,
int *  color_count,
int *  is_active 
)
private

Returns the current level of applied gamma correction, as a string, the count of colors in the picture, and a flag indicating if graphics is active (busy).

The function return FALSE if graphics is not enabled or if not being displayed, otherwise TRUE with the gamma, color count, and active flag in the return arguments.

This function races with the graphics timeout, as it returns information set up by the first timeout following a new picture. There's a very, very small chance that it might win the race, in which case out-of-date gamma and color count values are returned.

Definition at line 1563 of file glk.cpp.

◆ gms_graphics_interpreter_enabled()

int Glk::Magnetic::Magnetic::gms_graphics_interpreter_enabled ( )
private

Return TRUE if it looks like interpreter graphics are turned on, FALSE otherwise.

Definition at line 1593 of file glk.cpp.

◆ gms_graphics_is_vertex()

int Glk::Magnetic::Magnetic::gms_graphics_is_vertex ( type8  off_screen[],
type16  width,
type16  height,
int  x,
int  y 
)
private

Given a point, return TRUE if that point is the vertex of a fillable region.

This is a helper function for layering pictures. When assign- ing layers, we want to weight the colors that have the most complex shapes, or the largest count of isolated areas, heavier than simpler areas.

By painting the colors with the largest number of isolated areas or the most complex shapes first, we help to minimize the number of fill regions needed to render the complete picture.

Definition at line 871 of file glk.cpp.

◆ gms_graphics_open()

int Glk::Magnetic::Magnetic::gms_graphics_open ( )
private

If it's not open, open the graphics window.

Returns TRUE if graphics was successfully started, or already on.

Definition at line 328 of file glk.cpp.

◆ gms_graphics_paint()

void Glk::Magnetic::Magnetic::gms_graphics_paint ( )
private

Set up a complete repaint of the current picture in the graphics window.

This function should be called on the appropriate Glk window resize and arrange events.

Definition at line 365 of file glk.cpp.

◆ gms_graphics_paint_everything()

void Glk::Magnetic::Magnetic::gms_graphics_paint_everything ( winid_t  glk_window,
glui32  palette[],
type8  off_screen[],
int  x_offset,
int  y_offset,
type16  width,
type16  height 
)
private

Definition at line 1083 of file glk.cpp.

◆ gms_graphics_paint_region()

void Glk::Magnetic::Magnetic::gms_graphics_paint_region ( winid_t  glk_window,
glui32  palette[],
int  layers[],
type8  off_screen[],
type8  on_screen[],
int  x,
int  y,
int  x_offset,
int  y_offset,
int  pixel_size,
type16  width,
type16  height 
)
private

This is a partially optimized point plot.

Given a point in the graphics bitmap, it tries to extend the point to a color region, and fill a number of pixels in a single Glk rectangle fill. The goal here is to reduce the number of Glk rectangle fills, which tend to be extremely inefficient operations for generalized point plotting.

The extension works in image layers; each palette color is assigned a layer, and we paint each layer individually, starting at the lowest. So, the region is free to fill any invalidated pixel in a higher layer, and all pixels, invalidated or already validated, in the same layer. In practice, it is good enough to look for either invalidated pixels or pixels in the same layer, and construct a region as large as possible from these, then on marking points as validated, mark only those in the same layer as the initial point.

The optimization here is not the best possible, but is reasonable. What we do is to try and stretch the region horizontally first, then vertically. In practice, we might find larger areas by stretching vertically and then horizontally, or by stretching both dimensions at the same time. In mitigation, the number of colors in a picture is small (16), and the aspect ratio of pictures makes them generally wider than they are tall.

Once we've found the region, we render it with a single Glk rectangle fill, and mark all the pixels in this region that match the layer of the initial given point as validated.

Definition at line 977 of file glk.cpp.

◆ gms_graphics_picture_is_available()

int Glk::Magnetic::Magnetic::gms_graphics_picture_is_available ( ) const
inlineprivate

Return TRUE if the graphics module data is loaded with a usable picture, FALSE if there is no picture available to display.

Definition at line 638 of file magnetic.h.

◆ gms_graphics_position_picture()

void Glk::Magnetic::Magnetic::gms_graphics_position_picture ( winid_t  glk_window,
int  pixel_size,
type16  width,
type16  height,
int *  x_offset,
int *  y_offset 
)
private

Given a picture width and height, return the x and y offsets to center this picture in the current graphics window.

Definition at line 740 of file glk.cpp.

◆ gms_graphics_restart()

void Glk::Magnetic::Magnetic::gms_graphics_restart ( )
private

Restart graphics as if the current picture is a new picture.

This function should be called whenever graphics is re-enabled after being disabled, on change of gamma color correction policy, and on change of animation policy.

Definition at line 373 of file glk.cpp.

◆ gms_graphics_select_gamma()

gms_gammaref_t Glk::Magnetic::Magnetic::gms_graphics_select_gamma ( type8  bitmap[],
type16  width,
type16  height,
type16  palette[] 
)
private

Select a suitable gamma for the picture, based on the current gamma mode.

The function returns either the linear gamma, a gamma value half way between linear and the gamma that gives the most even contrast, or just the gamma that gives the most even contrast.

In the normal case, a value half way to the extreme case of making color contrast equal for all colors is, subjectively, a reasonable value to use. The problem cases are the darkest pictures, and selecting this value brightens them while at the same time not making them look overbright or too "sunny".

Definition at line 580 of file glk.cpp.

◆ gms_graphics_split_color()

void Glk::Magnetic::Magnetic::gms_graphics_split_color ( glui32  color,
gms_rgbref_t  rgb_color 
)
private

General graphics color conversion.

Definition at line 459 of file glk.cpp.

◆ gms_graphics_start()

void Glk::Magnetic::Magnetic::gms_graphics_start ( )
private

If graphics enabled, start any background picture update processing.

Definition at line 347 of file glk.cpp.

◆ gms_graphics_stop()

void Glk::Magnetic::Magnetic::gms_graphics_stop ( )
private

Stop any background picture update processing.

Definition at line 357 of file glk.cpp.

◆ gms_graphics_timeout()

void Glk::Magnetic::Magnetic::gms_graphics_timeout ( )
private

This is a background function, called on Glk timeouts.

Its job is to repaint some of the current graphics image. On successive calls, it does a part of the repaint, then yields to other processing. This is useful since the Glk primitive to plot points in graphical windows is extremely slow; this way, the repaint doesn't block game play.

The function should be called on Glk timeout events. When the repaint is complete, the function will turn off Glk timers.

The function uses double-buffering to track how much of the graphics buffer has been rendered. This helps to minimize the amount of point plots required, as only the differences between the two buffers need to be rendered.

Definition at line 1101 of file glk.cpp.

◆ gms_header_string()

void Glk::Magnetic::Magnetic::gms_header_string ( const char *  message)
private

Definition at line 1901 of file glk.cpp.

◆ gms_hint_arrange_windows()

void Glk::Magnetic::Magnetic::gms_hint_arrange_windows ( int  requested_lines,
glui32 width,
glui32 height 
)
private

Arrange the hints windows so that the hint menu window has the requested number of lines.

Returns the actual hint menu window width and height, or defaults if no hints windows are available.

Definition at line 2191 of file glk.cpp.

◆ gms_hint_close()

void Glk::Magnetic::Magnetic::gms_hint_close ( )
private

If open, close the hints windows.

Definition at line 2032 of file glk.cpp.

◆ gms_hint_display()

void Glk::Magnetic::Magnetic::gms_hint_display ( const struct ms_hint  hints_[],
const int  cursor[],
type16  node 
)
private

Display the given hint using the appropriate display function.

Definition at line 2313 of file glk.cpp.

◆ gms_hint_display_folder()

void Glk::Magnetic::Magnetic::gms_hint_display_folder ( const struct ms_hint  hints_[],
const int  cursor[],
type16  node 
)
private

Update the hints windows for the given folder hint node.

Definition at line 2224 of file glk.cpp.

◆ gms_hint_display_text()

void Glk::Magnetic::Magnetic::gms_hint_display_text ( const struct ms_hint  hints_[],
const int  cursor[],
type16  node 
)
private

Update the hints windows for the given text hint node.

Definition at line 2274 of file glk.cpp.

◆ gms_hint_handle()

type16 Glk::Magnetic::Magnetic::gms_hint_handle ( const ms_hint  hints_[],
int  cursor[],
type16  node,
glui32  keycode 
)
private

Handle a Glk keycode for the given hint using the appropriate handler function.

Return the next node to handle.

Definition at line 2443 of file glk.cpp.

◆ gms_hint_handle_folder()

type16 Glk::Magnetic::Magnetic::gms_hint_handle_folder ( const ms_hint  hints_[],
int  cursor[],
type16  node,
glui32  keycode 
)
private

Handle a Glk keycode for the given folder hint.

Return the next node to handle, or the special end-hints on Quit at the root node.

Definition at line 2331 of file glk.cpp.

◆ gms_hint_handle_text()

type16 Glk::Magnetic::Magnetic::gms_hint_handle_text ( const ms_hint  hints[],
int  cursor[],
type16  node,
glui32  keycode 
)
private

Handle a Glk keycode for the given text hint.

Return the next node to handle.

Definition at line 2398 of file glk.cpp.

◆ gms_hint_menu_header()

void Glk::Magnetic::Magnetic::gms_hint_menu_header ( int  line,
const char *  string_,
glui32  width,
glui32  height 
)
private

Definition at line 2108 of file glk.cpp.

◆ gms_hint_menu_justify()

void Glk::Magnetic::Magnetic::gms_hint_menu_justify ( int  line,
const char *  left_string,
const char *  right_string,
glui32  width,
glui32  height 
)
private

Definition at line 2119 of file glk.cpp.

◆ gms_hint_menu_print()

void Glk::Magnetic::Magnetic::gms_hint_menu_print ( int  line,
int  column,
const char *  string_,
glui32  width,
glui32  height 
)
private

gms_hint_menu_print() gms_hint_menu_header() gms_hint_menu_justify() gms_hint_text_print() gms_hint_menutext_done() gms_hint_menutext_start()

Output functions for writing hints. These functions will write to hints windows where available, and to the main window where not. When writing to hints windows, they also take care not to line wrap in the menu window. Limited formatting is available.

Definition at line 2047 of file glk.cpp.

◆ gms_hint_menutext_char_event()

void Glk::Magnetic::Magnetic::gms_hint_menutext_char_event ( event_t event)
private

Request and return a character event from the hints windows.

In practice, this means either of the hints windows if available, or the main window if not.

Definition at line 2172 of file glk.cpp.

◆ gms_hint_menutext_done()

void Glk::Magnetic::Magnetic::gms_hint_menutext_done ( )
private

Definition at line 2160 of file glk.cpp.

◆ gms_hint_menutext_start()

void Glk::Magnetic::Magnetic::gms_hint_menutext_start ( )
private

Definition at line 2144 of file glk.cpp.

◆ gms_hint_open()

int Glk::Magnetic::Magnetic::gms_hint_open ( )
private

If not already open, open the hints windows.

Returns TRUE if the windows opened, or were already open.

The function creates two hints windows – a text grid on top, for menus, and a text buffer below for hints.

Definition at line 2000 of file glk.cpp.

◆ gms_hint_redraw()

void Glk::Magnetic::Magnetic::gms_hint_redraw ( )
private

Update the hints windows for the current hint.

This function should be called from the event handler on resize events, to repaint the hints display. It does nothing if no hints windows have been opened, since in this case, there's no resize action required – either we're not in the hints subsystem, or hints are being displayed in the main game window, for whatever reason.

Definition at line 2543 of file glk.cpp.

◆ gms_hint_text_print()

void Glk::Magnetic::Magnetic::gms_hint_text_print ( const char *  string_)
private

Definition at line 2133 of file glk.cpp.

◆ gms_hint_windows_available()

int Glk::Magnetic::Magnetic::gms_hint_windows_available ( )
private

Return TRUE if hints windows are available.

If they're not, the hints system will need to use alternative output methods.

Definition at line 2043 of file glk.cpp.

◆ gms_hints_cleanup()

void Glk::Magnetic::Magnetic::gms_hints_cleanup ( )
private

Free memory resources allocated by hints functions.

Called on game end.

Definition at line 2550 of file glk.cpp.

◆ gms_main()

void Glk::Magnetic::Magnetic::gms_main ( )
private

Definition at line 3826 of file glk.cpp.

◆ gms_malloc()

void * Glk::Magnetic::Magnetic::gms_malloc ( size_t  size)
private

Non-failing malloc.

Calls error if memory allocation fails

Definition at line 225 of file glk.cpp.

◆ gms_normal_char()

void Glk::Magnetic::Magnetic::gms_normal_char ( char  c)
private

Definition at line 1897 of file glk.cpp.

◆ gms_normal_string()

void Glk::Magnetic::Magnetic::gms_normal_string ( const char *  message)
private

Definition at line 1893 of file glk.cpp.

◆ gms_output_delete()

void Glk::Magnetic::Magnetic::gms_output_delete ( )
private

Definition at line 1807 of file glk.cpp.

◆ gms_output_flush()

void Glk::Magnetic::Magnetic::gms_output_flush ( )
private

Definition at line 1813 of file glk.cpp.

◆ gms_output_provide_help_hint()

void Glk::Magnetic::Magnetic::gms_output_provide_help_hint ( )
private

Definition at line 1769 of file glk.cpp.

◆ gms_output_register_help_request()

void Glk::Magnetic::Magnetic::gms_output_register_help_request ( )
private

Definition at line 1761 of file glk.cpp.

◆ gms_output_silence_help_hints()

void Glk::Magnetic::Magnetic::gms_output_silence_help_hints ( )
private

Definition at line 1765 of file glk.cpp.

◆ gms_realloc()

void * Glk::Magnetic::Magnetic::gms_realloc ( void *  ptr,
size_t  size 
)
private

Non-failing realloc.

Calls error if memory allocation fails

Definition at line 237 of file glk.cpp.

◆ gms_standout_string()

void Glk::Magnetic::Magnetic::gms_standout_string ( const char *  message)
private

Definition at line 1889 of file glk.cpp.

◆ gms_status_notify()

void Glk::Magnetic::Magnetic::gms_status_notify ( )
private

Definition at line 1728 of file glk.cpp.

◆ gms_status_print()

void Glk::Magnetic::Magnetic::gms_status_print ( )
private

Print the current contents of the completed status line buffer out in the main window, if it has changed since the last call.

This is for non- windowing Glk libraries.

Definition at line 1678 of file glk.cpp.

◆ gms_status_redraw()

void Glk::Magnetic::Magnetic::gms_status_redraw ( )
private

Definition at line 1735 of file glk.cpp.

◆ gms_status_update()

void Glk::Magnetic::Magnetic::gms_status_update ( )
private

Definition at line 1633 of file glk.cpp.

◆ gms_strcasecmp()

int Glk::Magnetic::Magnetic::gms_strcasecmp ( const char *  s1,
const char *  s2 
)
private

Local comparison routine that doesn't have an ANSI standard.

Definition at line 263 of file glk.cpp.

◆ gms_strncasecmp()

int Glk::Magnetic::Magnetic::gms_strncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)
private

Local comparison routine that doesn't have an ANSI standard.

Definition at line 249 of file glk.cpp.

◆ gms_styled_char()

void Glk::Magnetic::Magnetic::gms_styled_char ( glui32  style,
char  c 
)
private

Definition at line 1881 of file glk.cpp.

◆ gms_styled_string()

void Glk::Magnetic::Magnetic::gms_styled_string ( glui32  style,
const char *  message 
)
private

Definition at line 1873 of file glk.cpp.

◆ hint_input()

type16s Glk::Magnetic::Magnetic::hint_input ( )
private

◆ init_gfx1()

type8 Glk::Magnetic::Magnetic::init_gfx1 ( type8 header)
private

◆ init_gfx2()

type8 Glk::Magnetic::Magnetic::init_gfx2 ( type8 header)
private

◆ init_snd()

type8 Glk::Magnetic::Magnetic::init_snd ( type8 header)
private

◆ initialize()

void Glk::Magnetic::Magnetic::initialize ( )
private

Performs initialization.

Definition at line 99 of file magnetic.cpp.

◆ initializeCRC()

void Glk::Magnetic::Magnetic::initializeCRC ( )
private

Initializes the CRC table.

Definition at line 129 of file magnetic.cpp.

◆ initializeLinearGamma()

void Glk::Magnetic::Magnetic::initializeLinearGamma ( )
private

Initializes the linear gamma entry.

Definition at line 148 of file magnetic.cpp.

◆ initializeSettings()

void Glk::Magnetic::Magnetic::initializeSettings ( )
private

Initializes settings from the ScummVM configuration.

Definition at line 108 of file magnetic.cpp.

◆ is_blank()

type8 Glk::Magnetic::Magnetic::is_blank ( type16  line,
type16  width 
)
private

◆ log_status()

void Glk::Magnetic::Magnetic::log_status ( )
private

◆ ms_anim_is_repeating()

type8 Glk::Magnetic::Magnetic::ms_anim_is_repeating ( ) const
private

◆ ms_animate()

type8 Glk::Magnetic::Magnetic::ms_animate ( struct ms_position **  positions,
type16 count 
)
private

◆ ms_count()

type32 Glk::Magnetic::Magnetic::ms_count ( ) const
inlineprivate

Definition at line 1255 of file magnetic.h.

◆ ms_extract()

type8* Glk::Magnetic::Magnetic::ms_extract ( type32  pic,
type16 w,
type16 h,
type16 pal,
type8 is_anim 
)
private

◆ ms_extract1()

type8* Glk::Magnetic::Magnetic::ms_extract1 ( type8  pic,
type16 w,
type16 h,
type16 pal 
)
private

◆ ms_extract2()

type8* Glk::Magnetic::Magnetic::ms_extract2 ( const char *  name,
type16 w,
type16 h,
type16 pal,
type8 is_anim 
)
private

◆ ms_flush()

void Glk::Magnetic::Magnetic::ms_flush ( )
private

Handle a core interpreter call to flush the output buffer.

Because Glk only flushes its buffers and displays text on g_vm->glk_select(), we can ignore these calls as long as we call gms_output_flush() when reading line input.

Taking ms_flush() at face value can cause game text to appear before status line text where we are working with a non-windowing Glk, so it's best ignored where we can.

Definition at line 1909 of file glk.cpp.

◆ ms_freemem()

void Glk::Magnetic::Magnetic::ms_freemem ( )
private

◆ ms_get_anim_frame()

type8* Glk::Magnetic::Magnetic::ms_get_anim_frame ( type16s  number,
type16 width,
type16 height,
type8 **  mask 
)
private

◆ ms_getchar()

type8 Glk::Magnetic::Magnetic::ms_getchar ( type8  trans)
private

Return the single next character to the interpreter.

This function extracts characters from the input buffer until empty, when it then tries to buffer more data.

Definition at line 3638 of file glk.cpp.

◆ ms_init()

type8 Glk::Magnetic::Magnetic::ms_init ( const char *  name,
const char *  gfxname,
const char *  hntname,
const char *  sndname 
)
private

◆ ms_is_magwin()

type8 Glk::Magnetic::Magnetic::ms_is_magwin ( ) const
inlineprivate

Definition at line 1206 of file magnetic.h.

◆ ms_is_running()

type8 Glk::Magnetic::Magnetic::ms_is_running ( ) const
inlineprivate

Definition at line 1202 of file magnetic.h.

◆ ms_load_file()

type8 Glk::Magnetic::Magnetic::ms_load_file ( const char *  name,
type8 ptr,
type16  size 
)
private

Definition at line 160 of file magnetic.cpp.

◆ ms_playmusic()

void Glk::Magnetic::Magnetic::ms_playmusic ( type8 midi_data,
type32  length,
type16  tempo 
)
private

Definition at line 2558 of file glk.cpp.

◆ ms_putchar()

void Glk::Magnetic::Magnetic::ms_putchar ( type8  c)
private

Definition at line 1845 of file glk.cpp.

◆ ms_rungame()

type8 Glk::Magnetic::Magnetic::ms_rungame ( )
private

◆ ms_save_file()

type8 Glk::Magnetic::Magnetic::ms_save_file ( const char *  name,
type8 ptr,
type16  size 
)
private

Definition at line 171 of file magnetic.cpp.

◆ ms_seed()

void Glk::Magnetic::Magnetic::ms_seed ( type32  seed)
inlineprivate

Definition at line 1194 of file magnetic.h.

◆ ms_showhints()

type8 Glk::Magnetic::Magnetic::ms_showhints ( ms_hint hints_)
private

Start game hints.

These are modal, though there's no overriding Glk reason why. It's just that this matches the way they're implemented by most Inform games. This may not be the best way of doing help, but at least it's likely to be familiar, and anything more ambitious may be beyond the current Glk capabilities.

This function uses CRCs to detect any change of hints data. Normally, we'd expect none, at least within a given game run, but we can probably handle it okay if it happens.

Definition at line 2466 of file glk.cpp.

◆ ms_showpic()

void Glk::Magnetic::Magnetic::ms_showpic ( type32  picture,
type8  mode 
)
private

Called by the main interpreter when it wants us to display a picture.

The function gets the picture bitmap, palette, and dimensions, and saves them, and the picture id, in module variables for the background rendering function.

The graphics window is opened if required, or closed if mode is zero.

The function checks for changes of actual picture by calculating the CRC for picture data; this helps to prevent unnecessary repaints in cases where the interpreter passes us the same picture as we're already displaying. There is a less than 1 in 4,294,967,296 chance that a new picture will be missed. We'll live with that.

Why use CRCs, rather than simply storing the values of picture passed in a static variable? Because some games, typically Magnetic Windows, use the picture argument as a form of string pointer, and can pass in the same value for several, perhaps all, game pictures. If we just checked for a change in the picture argument, we'd never see one. So we must instead look for changes in the real picture data.

Definition at line 1455 of file glk.cpp.

◆ ms_status()

void Glk::Magnetic::Magnetic::ms_status ( )
private

◆ ms_statuschar()

void Glk::Magnetic::Magnetic::ms_statuschar ( type8  c)
private

Receive one status character from the interpreter.

Characters are buffered internally, and on CR, the buffer is copied to the main static status buffer for use by the status line printing function.

Definition at line 1613 of file glk.cpp.

◆ ms_stop()

void Glk::Magnetic::Magnetic::ms_stop ( )
inlineprivate

Definition at line 1210 of file magnetic.h.

◆ ms_undo()

type8 Glk::Magnetic::Magnetic::ms_undo ( )
private

◆ output_number()

void Glk::Magnetic::Magnetic::output_number ( type16  number)
private

◆ output_text()

type16 Glk::Magnetic::Magnetic::output_text ( const char *  text)
private

◆ pop()

type32 Glk::Magnetic::Magnetic::pop ( )
private

◆ push()

void Glk::Magnetic::Magnetic::push ( type32  c)
private

◆ rand_emu()

type32 Glk::Magnetic::Magnetic::rand_emu ( )
private

◆ read_l()

static type32 Glk::Magnetic::Magnetic::read_l ( type8 ptr)
inlinestaticprivate

Definition at line 1173 of file magnetic.h.

◆ read_l2()

static type32 Glk::Magnetic::Magnetic::read_l2 ( type8 ptr)
inlinestaticprivate

Definition at line 1181 of file magnetic.h.

◆ read_reg()

type32 Glk::Magnetic::Magnetic::read_reg ( int  i,
int  s 
)
private

◆ read_w()

static type16 Glk::Magnetic::Magnetic::read_w ( type8 ptr)
inlinestaticprivate

Definition at line 1177 of file magnetic.h.

◆ read_w2()

static type16 Glk::Magnetic::Magnetic::read_w2 ( type8 ptr)
inlinestaticprivate

Definition at line 1185 of file magnetic.h.

◆ read_word()

void Glk::Magnetic::Magnetic::read_word ( )
private

◆ readSaveData()

Common::Error Glk::Magnetic::Magnetic::readSaveData ( Common::SeekableReadStream rs)
overridevirtual

Load a savegame from the passed Quetzal file chunk stream.

Implements Glk::GlkEngine.

Definition at line 167 of file magnetic.cpp.

◆ reg_align()

type8* Glk::Magnetic::Magnetic::reg_align ( type8 ptr,
type8  size 
)
private

◆ runGame()

void Glk::Magnetic::Magnetic::runGame ( )
overridevirtual

Run the game.

Implements Glk::GlkEngine.

Definition at line 94 of file magnetic.cpp.

◆ save_undo()

void Glk::Magnetic::Magnetic::save_undo ( )
private

◆ script_write()

void Glk::Magnetic::Magnetic::script_write ( type8  c)
private

Definition at line 3989 of file glk.cpp.

◆ set_arg1()

void Glk::Magnetic::Magnetic::set_arg1 ( )
private

◆ set_arg2()

void Glk::Magnetic::Magnetic::set_arg2 ( int  use_dx,
type8  b 
)
private

◆ set_arg2_nosize()

void Glk::Magnetic::Magnetic::set_arg2_nosize ( int  use_dx,
type8  b 
)
private

◆ set_flags()

void Glk::Magnetic::Magnetic::set_flags ( )
private

◆ set_info()

void Glk::Magnetic::Magnetic::set_info ( type8  b)
private

◆ show_hints_text()

type16 Glk::Magnetic::Magnetic::show_hints_text ( ms_hint hintsData,
type16  index 
)
private

◆ sound_extract()

type8* Glk::Magnetic::Magnetic::sound_extract ( const char *  name,
type32 length,
type16 tempo 
)
private

◆ swap_args()

void Glk::Magnetic::Magnetic::swap_args ( )
private

◆ transcript_write()

void Glk::Magnetic::Magnetic::transcript_write ( type8  c)
private

Definition at line 3997 of file glk.cpp.

◆ write()

void Glk::Magnetic::Magnetic::write ( const char *  fmt,
  ... 
)
private

Definition at line 3977 of file glk.cpp.

◆ write_l()

static void Glk::Magnetic::Magnetic::write_l ( type8 ptr,
type32  val 
)
staticprivate

◆ write_reg()

void Glk::Magnetic::Magnetic::write_reg ( int  i,
int  s,
type32  val 
)
private

◆ write_string()

void Glk::Magnetic::Magnetic::write_string ( )
private

◆ write_w()

static void Glk::Magnetic::Magnetic::write_w ( type8 ptr,
type16  val 
)
staticprivate

◆ writeChar()

void Glk::Magnetic::Magnetic::writeChar ( char  c)
private

Definition at line 3985 of file glk.cpp.

◆ writeGameData()

Common::Error Glk::Magnetic::Magnetic::writeGameData ( Common::WriteStream ws)
overridevirtual

Save the game.

The passed write stream represents access to the UMem chunk in the Quetzal save file that will be created

Implements Glk::GlkEngine.

Definition at line 178 of file magnetic.cpp.

Member Data Documentation

◆ _log1

Common::DumpFile* Glk::Magnetic::Magnetic::_log1
private

Definition at line 262 of file magnetic.h.

◆ _log2

Common::DumpFile * Glk::Magnetic::Magnetic::_log2
private

Definition at line 262 of file magnetic.h.

◆ _saveData

type8* Glk::Magnetic::Magnetic::_saveData
private

Definition at line 258 of file magnetic.h.

◆ _saveSize

size_t Glk::Magnetic::Magnetic::_saveSize
private

Definition at line 259 of file magnetic.h.

◆ admode

type8 Glk::Magnetic::Magnetic::admode
private

Definition at line 212 of file magnetic.h.

◆ anim_frame_table

picture Glk::Magnetic::Magnetic::anim_frame_table[MAX_ANIMS]
private

Definition at line 239 of file magnetic.h.

◆ anim_repeat

type8 Glk::Magnetic::Magnetic::anim_repeat
private

Definition at line 237 of file magnetic.h.

◆ anim_table

lookup Glk::Magnetic::Magnetic::anim_table[MAX_POSITIONS]
private

Definition at line 241 of file magnetic.h.

◆ areg

type32 Glk::Magnetic::Magnetic::areg[8]
private

Definition at line 210 of file magnetic.h.

◆ arg1

type8* Glk::Magnetic::Magnetic::arg1
private

Definition at line 213 of file magnetic.h.

◆ arg1i

type32 Glk::Magnetic::Magnetic::arg1i
private

Definition at line 210 of file magnetic.h.

◆ arg2

type8 * Glk::Magnetic::Magnetic::arg2
private

Definition at line 213 of file magnetic.h.

◆ buffer

type8 Glk::Magnetic::Magnetic::buffer[80]
private

Definition at line 261 of file magnetic.h.

◆ bufpos

type8 Glk::Magnetic::Magnetic::bufpos
private

Definition at line 261 of file magnetic.h.

◆ byte1

type8 Glk::Magnetic::Magnetic::byte1
private

Definition at line 212 of file magnetic.h.

◆ byte2

type8 Glk::Magnetic::Magnetic::byte2
private

Definition at line 212 of file magnetic.h.

◆ cflag

type8 Glk::Magnetic::Magnetic::cflag
private

Definition at line 212 of file magnetic.h.

◆ code

type8 * Glk::Magnetic::Magnetic::code
private

Definition at line 215 of file magnetic.h.

◆ command_index

type16s Glk::Magnetic::Magnetic::command_index
private

Definition at line 234 of file magnetic.h.

◆ command_table

type8* Glk::Magnetic::Magnetic::command_table
private

Definition at line 233 of file magnetic.h.

◆ crc_table

glui32 Glk::Magnetic::Magnetic::crc_table[BYTE_MAX_VAL+1]
private

Definition at line 265 of file magnetic.h.

◆ decode_table

type8* Glk::Magnetic::Magnetic::decode_table
private

Definition at line 215 of file magnetic.h.

◆ dict

type8 * Glk::Magnetic::Magnetic::dict
private

Definition at line 216 of file magnetic.h.

◆ dreg

type32 Glk::Magnetic::Magnetic::dreg[8]
private

Definition at line 210 of file magnetic.h.

◆ filename

type8 Glk::Magnetic::Magnetic::filename[256]
private

Definition at line 261 of file magnetic.h.

◆ fl_size

type16 Glk::Magnetic::Magnetic::fl_size
private

Definition at line 211 of file magnetic.h.

◆ fl_sub

type16 Glk::Magnetic::Magnetic::fl_sub
private

Definition at line 211 of file magnetic.h.

◆ fl_tab

type16 Glk::Magnetic::Magnetic::fl_tab
private

Definition at line 211 of file magnetic.h.

◆ fp_size

type16 Glk::Magnetic::Magnetic::fp_size
private

Definition at line 211 of file magnetic.h.

◆ fp_tab

type16 Glk::Magnetic::Magnetic::fp_tab
private

Definition at line 211 of file magnetic.h.

◆ gfx2_buf

type8 * Glk::Magnetic::Magnetic::gfx2_buf
private

Definition at line 218 of file magnetic.h.

◆ gfx2_hdr

type8* Glk::Magnetic::Magnetic::gfx2_hdr
private

Definition at line 218 of file magnetic.h.

◆ gfx2_hsize

type16 Glk::Magnetic::Magnetic::gfx2_hsize
private

Definition at line 220 of file magnetic.h.

◆ gfx2_name

const char* Glk::Magnetic::Magnetic::gfx2_name
private

Definition at line 219 of file magnetic.h.

◆ gfx_buf

type8 * Glk::Magnetic::Magnetic::gfx_buf
private

Definition at line 217 of file magnetic.h.

◆ gfx_data

type8 * Glk::Magnetic::Magnetic::gfx_data
private

Definition at line 217 of file magnetic.h.

◆ gfx_fp

Common::File* Glk::Magnetic::Magnetic::gfx_fp
private

Definition at line 221 of file magnetic.h.

◆ gfx_ver

type8 Glk::Magnetic::Magnetic::gfx_ver
private

Definition at line 217 of file magnetic.h.

◆ gfxtable

type16 Glk::Magnetic::Magnetic::gfxtable
private

Definition at line 228 of file magnetic.h.

◆ gms_abbreviations_enabled

bool Glk::Magnetic::Magnetic::gms_abbreviations_enabled
private

Definition at line 61 of file magnetic.h.

◆ gms_animation_enabled

bool Glk::Magnetic::Magnetic::gms_animation_enabled
private

Definition at line 60 of file magnetic.h.

◆ GMS_COMMAND_TABLE

const gms_command_t Glk::Magnetic::Magnetic::GMS_COMMAND_TABLE
static
Initial value:
= {
{ &Magnetic::gms_command_summary, "summary", false, false },
{ &Magnetic::gms_command_undo, "undo", false, true },
{ &Magnetic::gms_command_script, "script", true, false },
{ &Magnetic::gms_command_inputlog, "inputlog", true, false },
{ &Magnetic::gms_command_readlog, "readlog", true, false },
{ &Magnetic::gms_command_abbreviations, "abbreviations", true, false },
{ &Magnetic::gms_command_graphics, "graphics", true, false },
{ &Magnetic::gms_command_gamma, "gamma", true, false },
{ &Magnetic::gms_command_animations, "animations", true, false },
{ &Magnetic::gms_command_prompts, "prompts", true, false },
{ &Magnetic::gms_command_version, "version", false, false },
{ &Magnetic::gms_command_commands, "commands", true, false },
{ &Magnetic::gms_command_help, "help", true, false },
{ nullptr, nullptr, false, false}
}

Definition at line 56 of file magnetic.h.

◆ gms_commands_enabled

bool Glk::Magnetic::Magnetic::gms_commands_enabled
private

Definition at line 61 of file magnetic.h.

◆ gms_current_hint_node

type16 Glk::Magnetic::Magnetic::gms_current_hint_node
private

Definition at line 180 of file magnetic.h.

◆ gms_game_message

const char* Glk::Magnetic::Magnetic::gms_game_message
private

Definition at line 202 of file magnetic.h.

◆ gms_gameid_game_name

const char* Glk::Magnetic::Magnetic::gms_gameid_game_name
private

The game's name, suitable for printing out on a status line, or other location where game information is relevant.

Set on game startup, by identifying the game from its text file header.

Definition at line 97 of file magnetic.h.

◆ gms_gamma_mode

GammaMode Glk::Magnetic::Magnetic::gms_gamma_mode
private

Definition at line 59 of file magnetic.h.

◆ GMS_GAMMA_TABLE

const gms_gamma_t Glk::Magnetic::Magnetic::GMS_GAMMA_TABLE
static

Definition at line 57 of file magnetic.h.

◆ gms_graphics_active

bool Glk::Magnetic::Magnetic::gms_graphics_active
private

Definition at line 114 of file magnetic.h.

◆ gms_graphics_animated

bool Glk::Magnetic::Magnetic::gms_graphics_animated
private

Definition at line 106 of file magnetic.h.

◆ gms_graphics_bitmap

type8* Glk::Magnetic::Magnetic::gms_graphics_bitmap
private

Definition at line 103 of file magnetic.h.

◆ gms_graphics_color_count

int Glk::Magnetic::Magnetic::gms_graphics_color_count
private

Definition at line 140 of file magnetic.h.

◆ gms_graphics_current_gamma

gms_gammaref_t Glk::Magnetic::Magnetic::gms_graphics_current_gamma
private

Definition at line 133 of file magnetic.h.

◆ gms_graphics_enabled

bool Glk::Magnetic::Magnetic::gms_graphics_enabled
private

Definition at line 62 of file magnetic.h.

◆ gms_graphics_height

type16 Glk::Magnetic::Magnetic::gms_graphics_height
private

Definition at line 104 of file magnetic.h.

◆ gms_graphics_interpreter

bool Glk::Magnetic::Magnetic::gms_graphics_interpreter
private

Definition at line 117 of file magnetic.h.

◆ gms_graphics_new_picture

bool Glk::Magnetic::Magnetic::gms_graphics_new_picture
private

Definition at line 113 of file magnetic.h.

◆ gms_graphics_off_screen

type8* Glk::Magnetic::Magnetic::gms_graphics_off_screen
private

Definition at line 124 of file magnetic.h.

◆ gms_graphics_on_screen

type8 * Glk::Magnetic::Magnetic::gms_graphics_on_screen
private

Definition at line 124 of file magnetic.h.

◆ gms_graphics_palette

type16 Glk::Magnetic::Magnetic::gms_graphics_palette[GMS_PALETTE_SIZE]
private

Definition at line 105 of file magnetic.h.

◆ gms_graphics_picture

type32 Glk::Magnetic::Magnetic::gms_graphics_picture
private

Definition at line 107 of file magnetic.h.

◆ gms_graphics_possible

bool Glk::Magnetic::Magnetic::gms_graphics_possible
private

Definition at line 87 of file magnetic.h.

◆ gms_graphics_repaint

bool Glk::Magnetic::Magnetic::gms_graphics_repaint
private

Definition at line 113 of file magnetic.h.

◆ gms_graphics_width

type16 Glk::Magnetic::Magnetic::gms_graphics_width
private

Definition at line 104 of file magnetic.h.

◆ gms_graphics_window

winid_t Glk::Magnetic::Magnetic::gms_graphics_window
private

Definition at line 74 of file magnetic.h.

◆ gms_help_hints_silenced

int Glk::Magnetic::Magnetic::gms_help_hints_silenced
private

Definition at line 157 of file magnetic.h.

◆ gms_help_requested

int Glk::Magnetic::Magnetic::gms_help_requested
private

Definition at line 157 of file magnetic.h.

◆ gms_hint_cursor

int* Glk::Magnetic::Magnetic::gms_hint_cursor
private

Definition at line 188 of file magnetic.h.

◆ gms_hint_menu_window

winid_t Glk::Magnetic::Magnetic::gms_hint_menu_window
private

Definition at line 75 of file magnetic.h.

◆ gms_hint_text_window

winid_t Glk::Magnetic::Magnetic::gms_hint_text_window
private

Definition at line 75 of file magnetic.h.

◆ gms_hints

ms_hint* Glk::Magnetic::Magnetic::gms_hints
private

Definition at line 177 of file magnetic.h.

◆ gms_input_buffer

char Glk::Magnetic::Magnetic::gms_input_buffer[GMS_INPUTBUFFER_LENGTH]
private

Definition at line 195 of file magnetic.h.

◆ gms_input_cursor

int Glk::Magnetic::Magnetic::gms_input_cursor
private

Definition at line 196 of file magnetic.h.

◆ gms_input_length

int Glk::Magnetic::Magnetic::gms_input_length
private

Definition at line 196 of file magnetic.h.

◆ GMS_INPUT_PROMPT

const char* const Glk::Magnetic::Magnetic::GMS_INPUT_PROMPT
private

Definition at line 90 of file magnetic.h.

◆ gms_inputlog_stream

strid_t Glk::Magnetic::Magnetic::gms_inputlog_stream
private

Definition at line 81 of file magnetic.h.

◆ GMS_LUMINANCE_WEIGHTS

const gms_rgb_t Glk::Magnetic::Magnetic::GMS_LUMINANCE_WEIGHTS
private

Weighting values for calculating the luminance of a color.

There are two commonly used sets of values for these – 299,587,114, taken from NTSC (Never The Same Color) 1953 standards, and 212,716,72, which is the set that modern CRTs tend to match. The NTSC ones seem to give the best subjective results.

Definition at line 256 of file magnetic.h.

◆ gms_main_called

int Glk::Magnetic::Magnetic::gms_main_called
private

Definition at line 208 of file magnetic.h.

◆ gms_main_window

winid_t Glk::Magnetic::Magnetic::gms_main_window
private

We use a maximum of five Glk windows, one for status, one for pictures, two for hints, and one for everything else.

The status and pictures windows may be NULL, depending on user selections and the capabilities of the Glk library. The hints windows will normally be NULL, except when in the hints subsystem.

Definition at line 74 of file magnetic.h.

◆ gms_output_allocation

int Glk::Magnetic::Magnetic::gms_output_allocation
private

Definition at line 165 of file magnetic.h.

◆ gms_output_buffer

char* Glk::Magnetic::Magnetic::gms_output_buffer
private

Definition at line 164 of file magnetic.h.

◆ gms_output_length

int Glk::Magnetic::Magnetic::gms_output_length
private

Definition at line 165 of file magnetic.h.

◆ gms_output_prompt

int Glk::Magnetic::Magnetic::gms_output_prompt
private

Definition at line 171 of file magnetic.h.

◆ GMS_PORT_VERSION

const glui32 Glk::Magnetic::Magnetic::GMS_PORT_VERSION
private

Definition at line 65 of file magnetic.h.

◆ gms_prompt_enabled

bool Glk::Magnetic::Magnetic::gms_prompt_enabled
private

Definition at line 60 of file magnetic.h.

◆ gms_readlog_stream

strid_t Glk::Magnetic::Magnetic::gms_readlog_stream
private

Definition at line 84 of file magnetic.h.

◆ gms_startup_called

int Glk::Magnetic::Magnetic::gms_startup_called
private

Definition at line 208 of file magnetic.h.

◆ gms_status_buffer

char Glk::Magnetic::Magnetic::gms_status_buffer[GMS_STATBUFFER_LENGTH]
private

The interpreter feeds us status line characters one at a time, with Tab indicating right justify, and CR indicating the line is complete.

To get this to fit with the Glk event and redraw model, here we'll buffer each completed status line, so we have a stable string to output when needed. It's also handy to have this buffer for Glk libraries that don't support separate windows.

Definition at line 150 of file magnetic.h.

◆ gms_status_length

int Glk::Magnetic::Magnetic::gms_status_length
private

Definition at line 151 of file magnetic.h.

◆ gms_status_window

winid_t Glk::Magnetic::Magnetic::gms_status_window
private

Definition at line 74 of file magnetic.h.

◆ gms_transcript_stream

strid_t Glk::Magnetic::Magnetic::gms_transcript_stream
private

Transcript stream and input log.

These are NULL if there is no current collection of these strings.

Definition at line 81 of file magnetic.h.

◆ gms_undo_notification

int Glk::Magnetic::Magnetic::gms_undo_notification
private

Definition at line 196 of file magnetic.h.

◆ hint_contents

type8* Glk::Magnetic::Magnetic::hint_contents
private

Definition at line 247 of file magnetic.h.

◆ hints

ms_hint* Glk::Magnetic::Magnetic::hints
private

Definition at line 246 of file magnetic.h.

◆ hints_crc_initialized

bool Glk::Magnetic::Magnetic::hints_crc_initialized
private

Definition at line 270 of file magnetic.h.

◆ hints_current_crc

uint32 Glk::Magnetic::Magnetic::hints_current_crc
private

Definition at line 269 of file magnetic.h.

◆ i_count

type32 Glk::Magnetic::Magnetic::i_count
private

Definition at line 210 of file magnetic.h.

◆ is_reversible

type8 Glk::Magnetic::Magnetic::is_reversible
private

Definition at line 213 of file magnetic.h.

◆ lastchar

type8 Glk::Magnetic::Magnetic::lastchar
private

Definition at line 214 of file magnetic.h.

◆ linear_gamma

gms_gammaref_t Glk::Magnetic::Magnetic::linear_gamma
private

Definition at line 267 of file magnetic.h.

◆ log_on

type8 Glk::Magnetic::Magnetic::log_on
private

Definition at line 261 of file magnetic.h.

◆ luminance_weighting

int Glk::Magnetic::Magnetic::luminance_weighting
private

Definition at line 266 of file magnetic.h.

◆ mem_size

type32 Glk::Magnetic::Magnetic::mem_size
private

Definition at line 210 of file magnetic.h.

◆ ms_gfx_enabled

type8 Glk::Magnetic::Magnetic::ms_gfx_enabled
private

Definition at line 261 of file magnetic.h.

◆ next_table

type16 Glk::Magnetic::Magnetic::next_table
private

Definition at line 229 of file magnetic.h.

◆ nflag

type8 Glk::Magnetic::Magnetic::nflag
private

Definition at line 212 of file magnetic.h.

◆ opsize

type8 Glk::Magnetic::Magnetic::opsize
private

Definition at line 212 of file magnetic.h.

◆ pc

type32 Glk::Magnetic::Magnetic::pc
private

Definition at line 210 of file magnetic.h.

◆ pic_current_crc

uint32 Glk::Magnetic::Magnetic::pic_current_crc
private

Definition at line 268 of file magnetic.h.

◆ pos_array

ms_position Glk::Magnetic::Magnetic::pos_array[MAX_FRAMES]
private

Definition at line 242 of file magnetic.h.

◆ pos_table

ms_position Glk::Magnetic::Magnetic::pos_table[MAX_POSITIONS][MAX_ANIMS]
private

Definition at line 240 of file magnetic.h.

◆ pos_table_count

type16 Glk::Magnetic::Magnetic::pos_table_count[MAX_POSITIONS]
private

Definition at line 238 of file magnetic.h.

◆ pos_table_index

type16s Glk::Magnetic::Magnetic::pos_table_index
private

Definition at line 235 of file magnetic.h.

◆ pos_table_max

type16s Glk::Magnetic::Magnetic::pos_table_max
private

Definition at line 236 of file magnetic.h.

◆ pos_table_size

type16 Glk::Magnetic::Magnetic::pos_table_size
private

Definition at line 232 of file magnetic.h.

◆ properties

type16 Glk::Magnetic::Magnetic::properties
private

Definition at line 211 of file magnetic.h.

◆ quick_flag

type8 Glk::Magnetic::Magnetic::quick_flag
private

Definition at line 217 of file magnetic.h.

◆ regnr

type8 Glk::Magnetic::Magnetic::regnr
private

Definition at line 212 of file magnetic.h.

◆ restart

type8 * Glk::Magnetic::Magnetic::restart
private

Definition at line 215 of file magnetic.h.

◆ rseed

type32 Glk::Magnetic::Magnetic::rseed
private

Definition at line 210 of file magnetic.h.

◆ running

type8 Glk::Magnetic::Magnetic::running
private

Definition at line 213 of file magnetic.h.

◆ sd

type8 Glk::Magnetic::Magnetic::sd
private

Definition at line 214 of file magnetic.h.

◆ snd_buf

type8* Glk::Magnetic::Magnetic::snd_buf
private

Definition at line 222 of file magnetic.h.

◆ snd_fp

Common::File* Glk::Magnetic::Magnetic::snd_fp
private

Definition at line 224 of file magnetic.h.

◆ snd_hdr

type8 * Glk::Magnetic::Magnetic::snd_hdr
private

Definition at line 222 of file magnetic.h.

◆ snd_hsize

type16 Glk::Magnetic::Magnetic::snd_hsize
private

Definition at line 223 of file magnetic.h.

◆ string

type8 * Glk::Magnetic::Magnetic::string
private

Definition at line 215 of file magnetic.h.

◆ string2

type8 * Glk::Magnetic::Magnetic::string2
private

Definition at line 215 of file magnetic.h.

◆ string3

type8* Glk::Magnetic::Magnetic::string3
private

Definition at line 216 of file magnetic.h.

◆ string_size

type32 Glk::Magnetic::Magnetic::string_size
private

Definition at line 210 of file magnetic.h.

◆ table_dist

type16 Glk::Magnetic::Magnetic::table_dist
private

Definition at line 228 of file magnetic.h.

◆ tmparg

type8 Glk::Magnetic::Magnetic::tmparg[4]
private

Definition at line 213 of file magnetic.h.

◆ undo

type8* Glk::Magnetic::Magnetic::undo[2]
private

Definition at line 227 of file magnetic.h.

◆ undo_pc

type32 Glk::Magnetic::Magnetic::undo_pc
private

Definition at line 226 of file magnetic.h.

◆ undo_regs

type32 Glk::Magnetic::Magnetic::undo_regs[2][18]
private

Definition at line 226 of file magnetic.h.

◆ undo_size

type32 Glk::Magnetic::Magnetic::undo_size
private

Definition at line 226 of file magnetic.h.

◆ undo_stat

type8 Glk::Magnetic::Magnetic::undo_stat[2]
private

Definition at line 227 of file magnetic.h.

◆ v4_id

type16 Glk::Magnetic::Magnetic::v4_id
private

Definition at line 229 of file magnetic.h.

◆ version

type8 Glk::Magnetic::Magnetic::version
private

Definition at line 214 of file magnetic.h.

◆ vflag

type8 Glk::Magnetic::Magnetic::vflag
private

Definition at line 212 of file magnetic.h.

◆ xpos

type8 Glk::Magnetic::Magnetic::xpos
private

Definition at line 261 of file magnetic.h.

◆ zflag

type8 Glk::Magnetic::Magnetic::zflag
private

Definition at line 212 of file magnetic.h.


The documentation for this class was generated from the following files:
Glk::Magnetic::Magnetic::gms_command_inputlog
void gms_command_inputlog(const char *argument)
Turn game input logging on and off.
Definition: glk.cpp:2630
Glk::Magnetic::Magnetic::gms_command_gamma
void gms_command_gamma(const char *argument)
Enable or disable picture gamma corrections.
Definition: glk.cpp:2901
Glk::Magnetic::Magnetic::gms_command_animations
void gms_command_animations(const char *argument)
Enable or disable picture animations.
Definition: glk.cpp:2981
Glk::Magnetic::Magnetic::gms_command_abbreviations
void gms_command_abbreviations(const char *argument)
Turn abbreviation expansions on and off.
Definition: glk.cpp:2749
Glk::Magnetic::Magnetic::gms_command_undo
void gms_command_undo(const char *argument)
Stub function for the undo command.
Definition: glk.cpp:2565
Glk::Magnetic::Magnetic::gms_command_graphics
void gms_command_graphics(const char *argument)
Enable or disable graphics more permanently than is done by the main interpreter.
Definition: glk.cpp:2787
Glk::Magnetic::Magnetic::gms_command_prompts
void gms_command_prompts(const char *argument)
Turn the extra "> " prompt output on and off.
Definition: glk.cpp:3043
Glk::Magnetic::Magnetic::gms_command_summary
void gms_command_summary(const char *argument)
Report all current Glk settings.
Definition: glk.cpp:3133
Glk::Magnetic::Magnetic::gms_command_commands
void gms_command_commands(const char *argument)
Turn command escapes off.
Definition: glk.cpp:3106
Glk::Magnetic::Magnetic::gms_command_version
void gms_command_version(const char *argument)
Definition: glk.cpp:3092
Glk::Magnetic::Magnetic::gms_command_script
void gms_command_script(const char *argument)
Turn game output scripting (logging) on and off.
Definition: glk.cpp:2569
Glk::Magnetic::Magnetic::gms_command_readlog
void gms_command_readlog(const char *argument)
Set the game input log, to read input from a file.
Definition: glk.cpp:2687
Glk::Magnetic::Magnetic::gms_command_help
void gms_command_help(const char *command)
Document the available Glk commands.
Definition: glk.cpp:3151