Files
nunuhara_xsystem4/include/savedata.h
T
kichikuou bf3c4feb9d SystemService: Persist "wait vsync" setting to disk
This setting has a significant impact on system load, so users may want
xsystem4 to remember their preference.

This implementation uses a JSON format, while the AliceSoft's
implementation saves it to a binary file (WindowSetting.sav).

This only records the wait_vsync setting, since the other fields in
window_settings are currently no-op.
2025-02-23 11:02:27 +09:00

32 lines
1.2 KiB
C

/* Copyright (C) 2019 Nunuhara Cabbage <nunuhara@haniwa.technology>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://gnu.org/licenses/>.
*/
#ifndef SYSTEM4_SAVEDATA_H
#define SYSTEM4_SAVEDATA_H
#include "cJSON.h"
#include "vm.h"
void json_load_page(struct page *page, cJSON *vars, bool call_dtors);
int save_json(const char *filename, cJSON *json);
cJSON *load_json(const char *filename);
int save_globals(const char *keyname, const char *filename, const char *group_name, int *n);
int load_globals(const char *keyname, const char *filename, const char *group_name, int *n);
int delete_save_file(const char *filename);
#endif /* SYSTEM4_SAVEDATA_H */