diff options
Diffstat (limited to 'engines/sci/include/kernel.h')
-rw-r--r-- | engines/sci/include/kernel.h | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h index 21a7e7b79b..332e12fd9f 100644 --- a/engines/sci/include/kernel.h +++ b/engines/sci/include/kernel.h @@ -85,19 +85,19 @@ typedef struct { */ -reg_t read_selector(struct _state *s, reg_t object, selector_t selector_id, const char *fname, int line); -void write_selector(struct _state *s, reg_t object, selector_t selector_id, reg_t value, +reg_t read_selector(EngineState *s, reg_t object, selector_t selector_id, const char *fname, int line); +void write_selector(EngineState *s, reg_t object, selector_t selector_id, reg_t value, const char *fname, int line); -int invoke_selector(struct _state *s, reg_t object, int selector_id, int noinvalid, int kfunct, +int invoke_selector(EngineState *s, reg_t object, int selector_id, int noinvalid, int kfunct, stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...); /******************** Text functionality ********************/ -char *kernel_lookup_text(struct _state *s, reg_t address, int index); +char *kernel_lookup_text(EngineState *s, reg_t address, int index); /* Looks up text referenced by scripts -** Parameters: (state_t *s): The current state +** Parameters: (EngineState *s): The current state ** (reg_t) address: The address to look up ** (int) index: The relative index ** Returns : (char *): The referenced text, or NULL on error. @@ -131,9 +131,9 @@ char *kernel_lookup_text(struct _state *s, reg_t address, int index); #endif /* !SCI_KERNEL_DEBUG */ -bool is_object(struct _state *s, reg_t obj); +bool is_object(EngineState *s, reg_t obj); /* Checks whether a heap address contains an object -** Parameters: (state_t *) s: The current state +** Parameters: (EngineState *) s: The current state ** (reg_t) obj: The address to check ** Returns : (int) 1 if it is an object, 0 otherwise */ @@ -155,11 +155,11 @@ bool is_object(struct _state *s, reg_t obj); #define SKPV_OR_ALT(x,a) KP_SINT(KP_ALT(x, make_reg(0, a))) #define UKPV_OR_ALT(x,a) KP_UINT(KP_ALT(x, make_reg(0, a))) -reg_t *kernel_dereference_reg_pointer(struct _state *s, reg_t pointer, int entries); -byte *kernel_dereference_bulk_pointer(struct _state *s, reg_t pointer, int entries); +reg_t *kernel_dereference_reg_pointer(EngineState *s, reg_t pointer, int entries); +byte *kernel_dereference_bulk_pointer(EngineState *s, reg_t pointer, int entries); #define kernel_dereference_char_pointer(state, pointer, entries) (char*)kernel_dereference_bulk_pointer(state, pointer, entries) /* Dereferences a heap pointer -** Parameters: (state_t *) s: The state to operate on +** Parameters: (EngineState *) s: The state to operate on ** (reg_t ) pointer: The pointer to dereference ** (int) entries: The number of values expected (for checking) ** (use 0 for strings) @@ -180,9 +180,9 @@ byte *kernel_dereference_bulk_pointer(struct _state *s, reg_t pointer, int entri -int kernel_oops(struct _state *s, const char *file, int line, const char *reason); +int kernel_oops(EngineState *s, const char *file, int line, const char *reason); /* Halts script execution and informs the user about an internal kernel error or failed assertion -** Paramters: (state_t *) s: The state to use +** Paramters: (EngineState *) s: The state to use ** (const char *) file: The file the oops occured in ** (int) line: The line the oops occured in ** (const char *) reason: Reason for the kernel oops @@ -193,20 +193,18 @@ int kernel_oops(struct _state *s, const char *file, int line, const char *reason /******************** Priority macros/functions ********************/ -struct _state; - extern int sci01_priority_table_flags; /* 1: delete, 2: print */ -int _find_priority_band(struct _state *s, int band); +int _find_priority_band(EngineState *s, int band); /* Finds the position of the priority band specified -** Parameters: (state_t *) s: State to search in +** Parameters: (EngineState *) s: State to search in ** (int) band: Band to look for ** Returns : (int) Offset at which the band starts */ -int _find_view_priority(struct _state *s, int y); +int _find_view_priority(EngineState *s, int y); /* Does the opposite of _find_priority_band -** Parameters: (state_t *) s: State +** Parameters: (EngineState *) s: State ** (int) y: Coordinate to check ** Returns : (int) The priority band y belongs to */ @@ -232,16 +230,16 @@ int _find_view_priority(struct _state *s, int y); /******************** Dynamic view list functions ********************/ -abs_rect_t set_base(struct _state *s, reg_t object); +abs_rect_t set_base(EngineState *s, reg_t object); /* Determines the base rectangle of the specified view object -** Parameters: (state_t *) s: The state to use +** Parameters: (EngineState *) s: The state to use ** (reg_t) object: The object to set ** Returns : (abs_rect) The absolute base rectangle */ -extern abs_rect_t get_nsrect(struct _state *s, reg_t object, byte clip); +extern abs_rect_t get_nsrect(EngineState *s, reg_t object, byte clip); /* Determines the now-seen rectangle of a view object -** Parameters: (state_t *) s: The state to use +** Parameters: (EngineState *) s: The state to use ** (reg_t) object: The object to check ** (byte) clip: Flag to determine wheter priority band ** clipping should be performed @@ -249,9 +247,9 @@ extern abs_rect_t get_nsrect(struct _state *s, reg_t object, byte clip); ** now-seen area. */ -void _k_dyn_view_list_prepare_change(struct _state *s); +void _k_dyn_view_list_prepare_change(EngineState *s); /* Removes all views in anticipation of a new window or text */ -void _k_dyn_view_list_accept_change(struct _state *s); +void _k_dyn_view_list_accept_change(EngineState *s); /* Redraws all views after a new window or text was added */ @@ -259,14 +257,14 @@ void _k_dyn_view_list_accept_change(struct _state *s); /******************** Misc functions ********************/ -void process_sound_events(struct _state *s); /* Get all sound events, apply their changes to the heap */ +void process_sound_events(EngineState *s); /* Get all sound events, apply their changes to the heap */ #define LOOKUP_NODE(addr) lookup_node(s, (addr), __FILE__, __LINE__) #define LOOKUP_LIST(addr) lookup_list(s, addr, __FILE__, __LINE__) -node_t *lookup_node(struct _state *s, reg_t addr, const char *file, int line); +node_t *lookup_node(EngineState *s, reg_t addr, const char *file, int line); /* Resolves an address into a list node -** Parameters: (state_t *) s: The state to operate on +** Parameters: (EngineState *) s: The state to operate on ** (reg_t) addr: The address to resolve ** (const char *) file: The file the function was called from ** (int) line: The line number the function was called from @@ -274,9 +272,9 @@ node_t *lookup_node(struct _state *s, reg_t addr, const char *file, int line); */ -list_t *lookup_list(struct _state *s, reg_t addr, const char *file, int line); +list_t *lookup_list(EngineState *s, reg_t addr, const char *file, int line); /* Resolves a list pointer to a list -** Parameters: (state_t *) s: The state to operate on +** Parameters: (EngineState *) s: The state to operate on ** (reg_t) addr: The address to resolve ** (const char *) file: The file the function was called from ** (int) line: The line number the function was called from @@ -327,7 +325,7 @@ list_t *lookup_list(struct _state *s, reg_t addr, const char *file, int line); /******************** Kernel functions ********************/ /* Generic description: */ -typedef reg_t kfunct(struct _state *s, int funct_nr, int argc, reg_t *argv); +typedef reg_t kfunct(EngineState *s, int funct_nr, int argc, reg_t *argv); #define FREESCI_KFUNCT_GLUTTON 1 |