Implement vmSystem functions for DALK Gaiden

This commit is contained in:
kichikuou
2024-07-28 09:00:40 +09:00
parent d3bd28a0c1
commit 877ca1f74e
3 changed files with 13 additions and 7 deletions
+1
View File
@@ -128,6 +128,7 @@ struct string *string_format(struct string *fmt, union vm_value arg, enum string
void vm_stack_trace(void);
_Noreturn void _vm_error(const char *fmt, ...);
_Noreturn void vm_exit(int code);
_Noreturn void vm_reset(void);
#ifdef __ANDROID__
// Report the error with a message box and exit.
+11 -4
View File
@@ -49,8 +49,15 @@ void vmSystem_CurrentTime(struct page **page)
date[6].i = tm->tm_wday;
}
//void vmSystem_Reset(void);
//void vmSystem_Shutdown(void);
static void vmSystem_Reset(void)
{
vm_reset();
}
static void vmSystem_Shutdown(void)
{
vm_exit(0);
}
static int vmSystem_OpenWeb(struct string *url)
{
@@ -62,8 +69,8 @@ HLL_WARN_UNIMPLEMENTED(0, int, vmSystem, AddURLMenu, struct string *title, struc
HLL_LIBRARY(vmSystem,
HLL_EXPORT(Init, vmSystem_Init),
HLL_EXPORT(CurrentTime, vmSystem_CurrentTime),
HLL_TODO_EXPORT(Reset, vmSystem_Reset),
HLL_TODO_EXPORT(Shutdown, vmSystem_Shutdown),
HLL_EXPORT(Reset, vmSystem_Reset),
HLL_EXPORT(Shutdown, vmSystem_Shutdown),
HLL_EXPORT(OpenWeb, vmSystem_OpenWeb),
HLL_EXPORT(AddURLMenu, vmSystem_AddURLMenu)
);
+1 -3
View File
@@ -458,8 +458,6 @@ static const SDL_MessageBoxButtonData buttons[] = {
{ SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, 0, "Cancel" },
};
static _Noreturn void vm_reset(void);
static struct string *get_func_stack_name(int index)
{
int i = call_stack_ptr - (1 + index);
@@ -2337,7 +2335,7 @@ static void vm_free(void)
static jmp_buf reset_buf;
static _Noreturn void vm_reset(void)
_Noreturn void vm_reset(void)
{
vm_free();
longjmp(reset_buf, 1);