This commit is contained in:
Arigadam 2026-10-11 13:12:12 +03:00
parent cc07193c23
commit 155ce36531
5 changed files with 114 additions and 18 deletions

View file

@ -35,10 +35,23 @@
typedef VARIABLE_TYPE (*peek_func)(VARIABLE_TYPE);
typedef void (*poke_func)(VARIABLE_TYPE, VARIABLE_TYPE);
enum {
UBASIC_OK = 0,
UBASIC_ERR_SYNTAX,
UBASIC_ERR_DIV_ZERO,
UBASIC_ERR_STACK, /* GOSUB/FOR overflow or RETURN without GOSUB */
UBASIC_ERR_NO_LINE, /* GOTO/GOSUB to a nonexistent line */
UBASIC_ERR_NO_CALLBACK /* PEEK/POKE without a registered callback */
};
void ubasic_init(const char *program);
void ubasic_init_peek_poke(const char *program, peek_func peek, poke_func poke);
void ubasic_run(void);
int ubasic_finished(void);
int ubasic_error(void);
const char *ubasic_error_message(void);
VARIABLE_TYPE ubasic_get_variable(int varnum);
void ubasic_set_variable(int varum, VARIABLE_TYPE value);