diff --git a/cg.c b/cg.c index e317b44..3622f06 100644 --- a/cg.c +++ b/cg.c @@ -114,32 +114,26 @@ struct cg *cg_load(int no) // size is only pixel data size switch(type) { case ALCG_VSP: - sys_message("extracting VSP"); cg = vsp_extract(dfile->data); size = cg->width * cg->height; break; case ALCG_PMS8: - sys_message("extracting PMS8"); cg = pms256_extract(dfile->data); size = cg->width * cg->height; break; case ALCG_PMS16: - sys_message("extracting PMS16"); cg = pms64k_extract(dfile->data); size = (cg->width * cg->height) * sizeof(uint16_t); break; case ALCG_BMP8: - sys_message("extracting BMP8"); cg = bmp256_extract(dfile->data); size = cg->width * cg->height; break; case ALCG_BMP24: - sys_message("extracting BMP24"); cg = bmp16m_extract(dfile->data); size = (cg->width * cg->height) * sizeof(uint16_t); break; case ALCG_QNT: - sys_message("extracting QNT"); cg = qnt_extract(dfile->data); size = (cg->width * cg->height) * 3; break; diff --git a/system4.c b/system4.c index f42f12d..f518f76 100644 --- a/system4.c +++ b/system4.c @@ -28,6 +28,7 @@ struct config config = { .game_name = NULL, .ain_filename = NULL, + .save_dir = NULL, .view_width = 800, .view_height = 600 }; @@ -52,6 +53,8 @@ static int config_handler(void *user, possibly_unused const char *section, const config->game_name = config_strdup(value); } else if (!strcmp(name, "CodeName")) { config->ain_filename = config_strdup(value); + } else if (!strcmp(name, "SaveFolder")) { + config->save_dir = config_strdup(value); } else if (!strcmp(name, "ViewWidth")) { config->view_width = atoi(value); } else if (!strcmp(name, "ViewHeight")) { diff --git a/system4.h b/system4.h index 79b0520..f87cabe 100644 --- a/system4.h +++ b/system4.h @@ -72,6 +72,7 @@ mem_alloc char *_xstrdup(const char *in, const char *func); struct config { char *game_name; char *ain_filename; + char *save_dir; int view_width; int view_height; }; diff --git a/vm.c b/vm.c index f2d9756..126c112 100644 --- a/vm.c +++ b/vm.c @@ -362,6 +362,12 @@ static void system_call(int32_t code) free(utf); // XXX: caller S_POPs break; + case 0xC: + if (config.save_dir) + stack_push_string(make_string(config.save_dir, strlen(config.save_dir))); + else + stack_push_string(string_ref(&EMPTY_STRING)); + break; case 0xD: stack_push(vm_time()); break;