Difference between revisions of "SCI/Specifications/SCI virtual machine/Kernel functions"

Jump to navigation Jump to search
m
Linkify reference to sections
m (oops, fixed formatting again)
m (Linkify reference to sections)
Line 118: Line 118:


===Kernel function 0x07: RespondsTo(?)===
===Kernel function 0x07: RespondsTo(?)===
 
Kernel function 0x08: DrawPic(word[, word, word, word])
===Kernel function 0x08: DrawPic(word[, word, word, word])===
KDrawPickfunct 0x08: DrawPic();
KDrawPickfunct 0x08: DrawPic();
word PicNr[, word Animation, word Flags, word DefaultPalette];
word PicNr[, word Animation, word Flags, word DefaultPalette];
Line 148: Line 147:
</ol>
</ol>


The animation is executed when kAnimate() (see [[SCI/Specifications/SCI in action/Views and animation in SCI|Views and animation in SCI]] section) is invoked. If not specified, it is assumed to be the same animation as last time.
The animation is executed when kAnimate() (see (see [[SCI/Specifications/SCI_in_action/Views_and_animation_in_SCI|Views and animation in SCI]] section) is invoked. If not specified, it is assumed to be the same animation as last time.
(word) Flags:
(word) Flags:


Line 189: Line 188:
Returns: (void)<br>
Returns: (void)<br>


This function draws a background picture plus some views to the foreground. If the background picture had not been drawn previously, it is animated with the animation style set during kDrawPic (see section Kernel function 0x08). Drawing the views is a rather complex issue. Refer to Views and animation in SCI section for its description.
This function draws a background picture plus some views to the foreground. If the background picture had not been drawn previously, it is animated with the animation style set during kDrawPic (see section [[SCI/Specifications/SCI_virtual_machine/Kernel_functions#Kernel_function_0x08:_DrawPic.28word.5B.2C_word.2C_word.2C_word.5D.29|Kernel function 0x08]]). Drawing the views is a rather complex issue. Refer to [[SCI/Specifications/SCI in action/Views and animation in SCI|Views and animation in SCI]] section for its description.


===Kernel function 0x0c: <tt>SetNowSeen(DblList)</tt>===
===Kernel function 0x0c: <tt>SetNowSeen(DblList)</tt>===
Line 257: Line 256:
Returns: (void)<br>
Returns: (void)<br>


This function stores the list of PicViews for later use by the Animate() syscall. See Kernel function 0x0b section for more details.
This function stores the list of PicViews for later use by the Animate() syscall. See [[SCI/Specifications/SCI_virtual_machine/Kernel_functions#Kernel_function_0x0b:_Animate.28.5BDblList.5D.2C_.5Bword.5D.29|Kernel function 0x0b]] section for more details.


===Kernel function 0x13: NewWindow(Rect, HeapPtr, word, word, word, word)===
===Kernel function 0x13: NewWindow(Rect, HeapPtr, word, word, word, word)===
Line 279: Line 278:
Returns: (HeapPtr): The position of the window structure on the heap<br>
Returns: (HeapPtr): The position of the window structure on the heap<br>


This function creates a window (see also Windows, Dialogs and Controls section), sets this window as the active port, draws the window (if neccessary), and returns with the window's heap address.
This function creates a window (see also [[SCI/Specifications/Graphics/Windows, Dialogs and Controls|Windows, Dialogs and Controls]] section), sets this window as the active port, draws the window (if neccessary), and returns with the window's heap address.


===Kernel function 0x14: GetPort()===
===Kernel function 0x14: GetPort()===
Line 317: Line 316:
Returns: (void)<br>
Returns: (void)<br>


This function draws a Control (see Windows, Dialogs and Controls section for details). Please note that the correct port must be selected beforehand.
This function draws a Control (see [[SCI/Specifications/Graphics/Windows, Dialogs and Controls|Windows, Dialogs and Controls]] section for details). Please note that the correct port must be selected beforehand.


===Kernel function 0x18: HiliteControl(HeapPtr)===
===Kernel function 0x18: HiliteControl(HeapPtr)===
Line 338: Line 337:
Returns: (void)<br>
Returns: (void)<br>


This function will apply the event provided to edit a type 3 (Edit window) Control (see Windows, Dialogs and Controls section for a description of the control system). Normal keypresses are added to the area pointed to by Control::text, unless the total string length would be greater than Control::max. Cursor keys, backspace and a few other keys may be used to manipulate the control. In FreeSCI, some of the libreadline control keys can be used to edit and move the cursor as well. If it is called to edit a Control which is not of type 3, it returns without error. Please note that the correct port (usually the window which the Control was drawn in) must be selected beforehand.
This function will apply the event provided to edit a type 3 (Edit window) Control (see [[SCI/Specifications/Graphics/Windows, Dialogs and Controls|Windows, Dialogs and Controls]] section for a description of the control system). Normal keypresses are added to the area pointed to by Control::text, unless the total string length would be greater than Control::max. Cursor keys, backspace and a few other keys may be used to manipulate the control. In FreeSCI, some of the libreadline control keys can be used to edit and move the cursor as well. If it is called to edit a Control which is not of type 3, it returns without error. Please note that the correct port (usually the window which the Control was drawn in) must be selected beforehand.


===Kernel function 0x1a: TextSize(HeapPtr, HeapPtr, word[, word])===
===Kernel function 0x1a: TextSize(HeapPtr, HeapPtr, word[, word])===
Line 601: Line 600:
* The heap status is reset, but the heap is not cleared
* The heap status is reset, but the heap is not cleared


After this is done, the engine restarts at a certain point (see Interpreter initialization and the main execution loop section for more details), re-initializes the stack, and executes the replay method of the game object.
After this is done, the engine restarts at a certain point (see [[SCI/Specifications/SCI virtual machine/Interpreter initialization and the main execution loop|Interpreter initialization and the main execution loop]] section for more details), re-initializes the stack, and executes the replay method of the game object.


===Kernel function 0x30: GameIsRestarting()===
===Kernel function 0x30: GameIsRestarting()===
245

edits

Navigation menu