Compare commits

...

2 commits

Author SHA1 Message Date
Gwenhael Le Moine
7655c92ae6
print_config() 2024-09-24 20:27:18 +02:00
Gwenhael Le Moine
66c6450252
disable file related params 2024-09-24 20:23:21 +02:00
4 changed files with 133 additions and 82 deletions

10
dist/saturn40g vendored
View file

@ -8,7 +8,7 @@ STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
STATEDIR=$STATE_HOME/saturn/40g
mkdir -p "$STATEDIR"
if [ ! -e "$STATEDIR"/rom.39g ]; then
if [ ! -e "$STATEDIR"/rom ]; then
if [ ! -d ../share/saturn/ROMs/ ]; then
echo "Error: No ROMs/ dir found"
exit 1
@ -17,12 +17,12 @@ if [ ! -e "$STATEDIR"/rom.39g ]; then
cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs
fi
make -C "$STATEDIR"/../ROMs rom.39g
cp "$STATEDIR"/../ROMs/rom.39g "$STATEDIR"/rom.39g
cp "$STATEDIR"/../ROMs/rom.39g "$STATEDIR"/rom
fi
RAM=''
RESET=''
if [ ! -e "$STATEDIR"/ram ]; then
RAM=-reset
RESET=-reset
fi
./saturn --hw hp40 --40g --state-dir "$STATEDIR" --rom rom.39g "$RAM" --mod mod --cpu cpu --hdw hdw "$@"
./saturn --40g --state-dir "$STATEDIR" "$RESET" "$@"

18
dist/saturn48gx vendored
View file

@ -8,7 +8,7 @@ STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
STATEDIR=$STATE_HOME/saturn/48gx
mkdir -p "$STATEDIR"
if [ ! -e "$STATEDIR"/gxrom-r ]; then
if [ ! -e "$STATEDIR"/rom ]; then
if [ ! -d ../share/saturn/ROMs/ ]; then
echo "Error: No ROMs/ dir found"
exit 1
@ -17,17 +17,15 @@ if [ ! -e "$STATEDIR"/gxrom-r ]; then
cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs
fi
make -C "$STATEDIR"/../ROMs gxrom-r
cp "$STATEDIR"/../ROMs/gxrom-r "$STATEDIR"/gxrom-r
fi
RAM=''
if [ ! -e "$STATEDIR"/ram ]; then
RAM=--reset
else
RAM="--ram ram"
cp "$STATEDIR"/../ROMs/gxrom-r "$STATEDIR"/rom
fi
[ ! -e "$STATEDIR"/port1 ] && dd if=/dev/zero of="$STATEDIR"/port1 bs=1k count=128
[ ! -e "$STATEDIR"/port2 ] && dd if=/dev/zero of="$STATEDIR"/port2 bs=1k count=4096
./saturn --hw hp48 --48gx --state-dir "$STATEDIR" --rom gxrom-r "$RAM" --port1 port1 --port2 port2 --mod mod --cpu cpu --hdw hdw "$@"
RESET=''
if [ ! -e "$STATEDIR"/ram ]; then
RESET=--reset
fi
./saturn --48gx --state-dir "$STATEDIR" "$RESET" "$@"

10
dist/saturn49g vendored
View file

@ -8,7 +8,7 @@ STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
STATEDIR=$STATE_HOME/saturn/49g
mkdir -p "$STATEDIR"
if [ ! -e "$STATEDIR"/rom.49g ]; then
if [ ! -e "$STATEDIR"/rom ]; then
if [ ! -d ../share/saturn/ROMs/ ]; then
echo "Error: No ROMs/ dir found"
exit 1
@ -17,12 +17,12 @@ if [ ! -e "$STATEDIR"/rom.49g ]; then
cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs
fi
make -C "$STATEDIR"/../ROMs rom.49g
cp "$STATEDIR"/../ROMs/rom.49g "$STATEDIR"/rom.49g
cp "$STATEDIR"/../ROMs/rom.49g "$STATEDIR"/rom
fi
RAM=''
RESET=''
if [ ! -e "$STATEDIR"/ram ]; then
RAM=-reset
RESET=-reset
fi
./saturn --hw hp49 --49g --state-dir "$STATEDIR" --rom rom.49g "$RAM" --mod mod --cpu cpu --hdw hdw "$@"
./saturn --49g --state-dir "$STATEDIR" "$RESET" "$@"

View file

@ -50,6 +50,45 @@ static config_t config = {
};
static void print_config( void )
{
fprintf( stderr, " *** config\n" );
fprintf( stderr, "config.progname = %s\n", config.progname );
fprintf( stderr, "config.model = %i\n", config.model );
fprintf( stderr, "config.verbose = %s\n", config.verbose ? "true" : "false" );
fprintf( stderr, "config.shiftless = %s\n", config.shiftless ? "true" : "false" );
fprintf( stderr, "config.frontend = %i\n", config.frontend );
fprintf( stderr, "config.mono = %s\n", config.mono ? "true" : "false" );
fprintf( stderr, "config.gray = %s\n", config.gray ? "true" : "false" );
fprintf( stderr, "config.chromeless = %s\n", config.chromeless ? "true" : "false" );
fprintf( stderr, "config.fullscreen = %s\n", config.fullscreen ? "true" : "false" );
fprintf( stderr, "config.scale = %f\n", config.scale );
fprintf( stderr, "config.tiny = %s\n", config.tiny ? "true" : "false" );
fprintf( stderr, "config.small = %s\n", config.small ? "true" : "false" );
fprintf( stderr, "config.wire_name = %s\n", config.wire_name );
fprintf( stderr, "config.ir_name = %s\n", config.ir_name );
fprintf( stderr, "config.reset = %s\n", config.reset ? "true" : "false" );
fprintf( stderr, "config.monitor = %s\n", config.monitor ? "true" : "false" );
fprintf( stderr, "config.batchXfer = %s\n", config.batchXfer ? "true" : "false" );
fprintf( stderr, "config.state_dir_path = %s\n", config.state_dir_path );
fprintf( stderr, "config.mod_file_name = %s\n", config.mod_file_name );
fprintf( stderr, "config.cpu_file_name = %s\n", config.cpu_file_name );
fprintf( stderr, "config.hdw_file_name = %s\n", config.hdw_file_name );
fprintf( stderr, "config.rom_file_name = %s\n", config.rom_file_name );
fprintf( stderr, "config.ram_file_name = %s\n", config.ram_file_name );
fprintf( stderr, "config.port_1_file_name = %s\n", config.port_1_file_name );
fprintf( stderr, "config.port_2_file_name = %s\n", config.port_2_file_name );
fprintf( stderr, "config.hw = %s\n", config.hw );
fprintf( stderr, " *** /config\n" );
}
/* Path/name dynamic allocator */
/* static char* GetPathname( char* path, char* name ) */
/* { */
@ -82,16 +121,16 @@ config_t* config_init( int argc, char* argv[] )
int clopt_reset = -1;
int clopt_monitor = -1;
int clopt_batchXfer = -1;
char* clopt_state_dir_path;
char* clopt_mod_file_name;
char* clopt_cpu_file_name;
char* clopt_hdw_file_name;
char* clopt_rom_file_name;
char* clopt_ram_file_name;
char* clopt_port_1_file_name;
char* clopt_port_2_file_name;
char* clopt_hw;
/* int clopt_batchXfer = -1; */
char* clopt_state_dir_path = ".";
/* char* clopt_mod_file_name = "mod"; */
/* char* clopt_cpu_file_name = "cpu"; */
/* char* clopt_hdw_file_name = "hdw"; */
/* char* clopt_rom_file_name = "gxrom-r"; */
/* char* clopt_ram_file_name = "ram"; */
/* char* clopt_port_1_file_name = "port1"; */
/* char* clopt_port_2_file_name = "port2"; */
/* char* clopt_hw = "hp48"; */
const char* optstring = "h";
struct option long_options[] = {
@ -115,16 +154,16 @@ config_t* config_init( int argc, char* argv[] )
{"reset", no_argument, &clopt_reset, true },
{"monitor", no_argument, &clopt_monitor, true },
{"batchXfer", no_argument, &clopt_batchXfer, true },
/* {"batchXfer", no_argument, &clopt_batchXfer, true }, */
{"state-dir", required_argument, NULL, 8999 },
{"mod", required_argument, NULL, 8000 },
{"cpu", required_argument, NULL, 8010 },
{"hdw", required_argument, NULL, 8020 },
{"rom", required_argument, NULL, 8030 },
{"ram", required_argument, NULL, 8040 },
{"port1", required_argument, NULL, 8050 },
{"port2", required_argument, NULL, 8060 },
{"hw", required_argument, NULL, 8070 },
/* {"mod", required_argument, NULL, 8000 }, */
/* {"cpu", required_argument, NULL, 8010 }, */
/* {"hdw", required_argument, NULL, 8020 }, */
/* {"rom", required_argument, NULL, 8030 }, */
/* {"ram", required_argument, NULL, 8040 }, */
/* {"port1", required_argument, NULL, 8050 }, */
/* {"port2", required_argument, NULL, 8060 }, */
/* {"hw", required_argument, NULL, 8070 }, */
{0, 0, 0, 0 }
};
@ -177,30 +216,30 @@ config_t* config_init( int argc, char* argv[] )
case 8999:
clopt_state_dir_path = optarg;
break;
case 8000:
clopt_mod_file_name = optarg;
break;
case 8010:
clopt_cpu_file_name = optarg;
break;
case 8020:
clopt_hdw_file_name = optarg;
break;
case 8030:
clopt_rom_file_name = optarg;
break;
case 8040:
clopt_ram_file_name = optarg;
break;
case 8050:
clopt_port_1_file_name = optarg;
break;
case 8060:
clopt_port_2_file_name = optarg;
break;
case 8070:
clopt_hw = optarg;
break;
/* case 8000: */
/* clopt_mod_file_name = optarg; */
/* break; */
/* case 8010: */
/* clopt_cpu_file_name = optarg; */
/* break; */
/* case 8020: */
/* clopt_hdw_file_name = optarg; */
/* break; */
/* case 8030: */
/* clopt_rom_file_name = optarg; */
/* break; */
/* case 8040: */
/* clopt_ram_file_name = optarg; */
/* break; */
/* case 8050: */
/* clopt_port_1_file_name = optarg; */
/* break; */
/* case 8060: */
/* clopt_port_2_file_name = optarg; */
/* break; */
/* case 8070: */
/* clopt_hw = optarg; */
/* break; */
default:
break;
@ -244,28 +283,42 @@ config_t* config_init( int argc, char* argv[] )
config.reset = clopt_reset;
if ( clopt_monitor != -1 )
config.monitor = clopt_monitor;
if ( clopt_batchXfer != -1 )
config.batchXfer = clopt_batchXfer;
/* if ( clopt_batchXfer != -1 ) */
/* config.batchXfer = clopt_batchXfer; */
if ( clopt_state_dir_path != NULL )
config.state_dir_path = strdup( clopt_state_dir_path );
if ( clopt_mod_file_name != NULL )
config.mod_file_name = strdup( clopt_mod_file_name );
if ( clopt_cpu_file_name != NULL )
config.cpu_file_name = strdup( clopt_cpu_file_name );
if ( clopt_hdw_file_name != NULL )
config.hdw_file_name = strdup( clopt_hdw_file_name );
if ( clopt_rom_file_name != NULL )
config.rom_file_name = strdup( clopt_rom_file_name );
if ( clopt_ram_file_name != NULL )
config.ram_file_name = strdup( clopt_ram_file_name );
if ( clopt_port_1_file_name != NULL )
config.port_1_file_name = strdup( clopt_port_1_file_name );
if ( clopt_port_2_file_name != NULL )
config.port_2_file_name = strdup( clopt_port_2_file_name );
if ( clopt_hw != NULL )
config.hw = strdup( clopt_hw );
/* if ( clopt_mod_file_name != NULL ) */
/* config.mod_file_name = strdup( clopt_mod_file_name ); */
/* if ( clopt_cpu_file_name != NULL ) */
/* config.cpu_file_name = strdup( clopt_cpu_file_name ); */
/* if ( clopt_hdw_file_name != NULL ) */
/* config.hdw_file_name = strdup( clopt_hdw_file_name ); */
/* if ( clopt_rom_file_name != NULL ) */
/* config.rom_file_name = strdup( clopt_rom_file_name ); */
/* if ( clopt_ram_file_name != NULL ) */
/* config.ram_file_name = strdup( clopt_ram_file_name ); */
/* if ( clopt_port_1_file_name != NULL ) */
/* config.port_1_file_name = strdup( clopt_port_1_file_name ); */
/* if ( clopt_port_2_file_name != NULL ) */
/* config.port_2_file_name = strdup( clopt_port_2_file_name ); */
/* if ( clopt_hw != NULL ) */
/* config.hw = strdup( clopt_hw ); */
fprintf( stderr, "config.chromeless = %s\n\n", config.chromeless ? "true" : "false" );
switch ( clopt_model ) {
case MODEL_40G:
config.hw = "hp40";
break;
case MODEL_49G:
config.hw = "hp49";
break;
case MODEL_48SX:
case MODEL_48GX:
default:
config.hw = "hp48";
break;
}
print_config();
return &config;
}