Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
configdb.c
Go to the documentation of this file.
1 /* Minimalistic Enterprise-128 emulator with focus on "exotic" hardware
2  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
3  Copyright (C)2015-2017,2020-2021 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 
20 #include "xemu/emutools.h"
21 #include "xemu/emutools_config.h"
22 #include "configdb.h"
23 #include "roms.h"
24 #include "enterprise128.h"
25 
26 /* Important WARNING:
27  * This is a trap! If you have something here with '#ifdef', it's quite possible that the macro is
28  * not defined here, but defined elsewhere, thus the emulator sees totally different structs for
29  * real but the problem is hidden! That is, be very careful at configdb_st (the type definition
30  * itself also at the usage!) that should be only dependent on macros defined in xemu-target.h,
31  * since that header file is always included by the build system, at command line level. */
32 
33 static const char *rom_parse_opt_cb ( struct xemutools_config_st *unused, const char *optname, const char *optvalue )
34 {
35  return rom_parse_opt(optname, optvalue);
36 }
37 
39 
41 {
43  { "audio", "Enable (buggy) audio output", &configdb.audio },
44  { "syscon", "Keep console window open (Windows-specific)", &configdb.syscon },
45  { "fullscreen", "Start in fullscreen mode", &configdb.fullscreen_requested },
46  { "primo", "Start in Primo emulator mode", &configdb.primo },
47  { "skiplogo", "Disables Enterprise logo on start-up via XEP ROM", &configdb.skiplogo },
48  { "noxeprom", "Disables XEP internal ROM", &cfg_noexprom },
49  { "besure", "Skip asking \"are you sure?\" on RESET or EXIT", &i_am_sure_override },
50  { "monitor", "Start monitor on console", &configdb.monitor }
51  );
53  { "ddn", NULL, "Default device name (none = not to set)", &configdb.ddn },
54  { "filedir", "@files", "Default directory for FILE: device", &configdb.filedir },
55  { "printfile", PRINT_OUT_FN, "Printing into this file", &configdb.printfile },
56  { "ram", "128", "RAM size in Kbytes (decimal) or segment specification(s) prefixed with @ in hex (VRAM is always assumed), like: @C0-CF,E0,E3-E7", &configdb.ram_setup_str },
57  { "sdimg", SDCARD_IMG_FN, "SD-card disk image (VHD) file name/path", &configdb.sdimg },
58  { "snapshot", NULL, "Load and use ep128emu snapshot", &configdb.snapshot },
59 #ifdef CONFIG_EXDOS_SUPPORT
60  { "wdimg", NULL, "EXDOS WD disk image file name/path", &configdb.wd_img_path },
61 #endif
62  { "gui", NULL, "Select GUI type for usage. Specify some insane str to get a list", &configdb.gui_selection }
63  );
65  { "sdlrenderquality", RENDER_SCALE_QUALITY, "Setting SDL hint for scaling method/quality on rendering (0, 1, 2)", &configdb.sdlrenderquality, 0, 2 },
66  { "mousemode", 1, "Set mouse mode, 1-3 = J-column 2,4,8 bytes and 4-6 the same for K-column", &configdb.mousemode, 1, 6 }
67  );
68  xemucfg_define_float_option("clock", (double)DEFAULT_CPU_CLOCK, "Z80 clock in MHz", &configdb.clock, 1.0, 12.0);
69  xemucfg_define_proc_option("rom", rom_parse_opt_cb, "ROM image, format is \"rom@xx=filename\" (xx=start segment in hex), use rom@00 for EXOS or combined ROM set");
70  //{ "epkey", CONFITEM_STR, NULL, 1, "Define a given EP/emu key, format epkey@xy=SDLname, where x/y are row/col in hex or spec code (ie screenshot, etc)." },
71 }
configdb_st::printfile
char * printfile
Definition: configdb.h:48
XEMUCFG_DEFINE_SWITCH_OPTIONS
#define XEMUCFG_DEFINE_SWITCH_OPTIONS(...)
Definition: emutools_config.h:123
configdb_st::fullscreen_requested
int fullscreen_requested
Definition: configdb.h:35
emutools.h
configdb_st::monitor
int monitor
Definition: configdb.h:41
configdb_st::audio
int audio
Definition: configdb.h:38
configdb_st::clock
double clock
Definition: configdb.h:37
i_am_sure_override
int i_am_sure_override
Definition: emutools.c:74
DEFAULT_CPU_CLOCK
#define DEFAULT_CPU_CLOCK
Definition: enterprise128.h:34
configdb_st::snapshot
char * snapshot
Definition: configdb.h:44
configdb_st::skiplogo
int skiplogo
Definition: configdb.h:36
configdb_st::wd_img_path
char * wd_img_path
Definition: configdb.h:49
configdb_st::sdlrenderquality
int sdlrenderquality
Definition: configdb.h:35
configdb_define_emulator_options
void configdb_define_emulator_options(void)
Definition: configdb.c:36
configdb_st::filedir
char * filedir
Definition: configdb.h:46
roms.h
configdb_st::ddn
char * ddn
Definition: configdb.h:47
configdb_st::ram_setup_str
char * ram_setup_str
Definition: configdb.h:42
rom_parse_opt
const char * rom_parse_opt(const char *optname, const char *optvalue)
Definition: roms.c:47
xemucfg_define_proc_option
void xemucfg_define_proc_option(const char *optname, xemucfg_parser_callback_func_t cb, const char *help)
emutools_config.h
configdb
struct configdb_st configdb
Definition: configdb.c:34
configdb.h
xemutools_config_st
Definition: emutools_config.h:44
configdb_st::primo
int primo
Definition: configdb.h:40
configdb_st::syscon
int syscon
Definition: configdb.h:34
cfg_noexprom
int cfg_noexprom
Definition: roms.c:35
configdb_st::mousemode
int mousemode
Definition: configdb.h:39
xemucfg_define_float_option
void xemucfg_define_float_option(const char *optname, const double defval, const char *help, double *storage, double min, double max)
XEMUCFG_DEFINE_STR_OPTIONS
#define XEMUCFG_DEFINE_STR_OPTIONS(...)
Definition: emutools_config.h:119
RENDER_SCALE_QUALITY
#define RENDER_SCALE_QUALITY
Definition: commodore_65.h:27
XEMUCFG_DEFINE_NUM_OPTIONS
#define XEMUCFG_DEFINE_NUM_OPTIONS(...)
Definition: emutools_config.h:120
configdb_st::sdimg
char * sdimg
Definition: configdb.h:45
enterprise128.h
PRINT_OUT_FN
#define PRINT_OUT_FN
Definition: enterprise128.h:30
configdb_st::gui_selection
char * gui_selection
Definition: configdb.h:43
configdb_st
Definition: configdb.h:29
SDCARD_IMG_FN
#define SDCARD_IMG_FN
Definition: enterprise128.h:29