Last active
May 6, 2019 21:22
-
-
Save thomas-alrek/94d5c99760de51f83a30dafbda6cea15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ScriptRunner.h" | |
| UWORD script_ptr = NULL; | |
| UWORD script_start_ptr = NULL; | |
| UBYTE script_ptr_bank = NULL; | |
| UBYTE script_continue = NULL; | |
| UBYTE script_stack_ptr = NULL; | |
| STACKFRAME script_stack[8] = { | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL}, | |
| {NULL, NULL, NULL} | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef SCRIPT_RUNNER_H | |
| #define SCRIPT_RUNNER_H | |
| extern UWORD script_ptr; | |
| extern UWORD script_start_ptr; | |
| extern UBYTE script_ptr_bank; | |
| extern UBYTE script_continue; | |
| typedef struct _STACKFRAME { | |
| UWORD script_ptr; | |
| UWORD script_start_ptr; | |
| UBYTE script_ptr_bank; | |
| } STACKFRAME; | |
| extern STACKFRAME script_stack[8]; | |
| extern UBYTE script_stack_ptr; | |
| void Script_StackPush_b(); | |
| void Script_StackPop_b(); | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ScriptRunner.h" | |
| void Script_StackPush_b() | |
| { | |
| script_stack[script_stack_ptr].script_ptr = script_ptr; | |
| script_stack[script_stack_ptr].script_ptr += 1 + script_cmd_args_len; | |
| script_stack[script_stack_ptr].script_start_ptr = script_start_ptr; | |
| script_stack[script_stack_ptr].script_ptr_bank = script_ptr_bank; | |
| script_stack_ptr++; | |
| } | |
| void Script_StackPop_b() | |
| { | |
| script_stack_ptr--; | |
| script_ptr = script_stack[script_stack_ptr].script_ptr; | |
| script_start_ptr = script_stack[script_stack_ptr].script_start_ptr; | |
| script_ptr_bank = script_stack[script_stack_ptr].script_ptr_bank; | |
| script_continue = TRUE; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment