If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working soon.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Crystal Beans from Dungeon Explorer/Switch Functions: Difference between revisions
Jump to navigation
Jump to search
m (Xkeeper moved page Crystal Beans From Dungeon Explorer:Switch Functions to Crystal Beans From Dungeon Explorer/Switch Functions: normalize subpages and titles) |
m (Hawk moved page Crystal Beans From Dungeon Explorer/Switch Functions to Crystal Beans from Dungeon Explorer/Switch Functions) |
(No difference)
|
Latest revision as of 21:03, 28 January 2024
This is a sub-page of Crystal Beans from Dungeon Explorer.
Overview
The ShortSwitch() (at 0x0089CF) and LongSwitch() (at 0x0089E9) functions are used to simulate the switch statement in C for the objects subtype.
They both work the same way excepted that the ShortSwitch() function uses 16-bits pointers to jump to the destination and the LongSwitch() function uses 24-bits pointers.
These function do not return to the instruction following their call but rather to the instruction following the calling function.
Example
CALL SomeFunction ; ShortSwitch will return here after jumping to its target . . . SomeFunction: CALL ShortSwitch .DW Case00, Case01