{
// hildon-games-wrapper sets this env variable for itself.
char* service = getenv("HGW_EXEC_SERVICE");
-
+
if (!service) {
// Not launched from hildon-games-wrapper
hgwLaunched = false;
return;
}
-
+
hgw = hgw_context_init();
-
+
if (!hgw) {
fprintf(stderr, "Error opening hgw context\n");
hgwLaunched = false;
}
-
+
hgwLaunched = true;
printf("Loading in HGW mode\n");
}
void HgwConfig()
{
if (!hgwLaunched) return;
-
+
Config.fullscreen = true;
-
+
char romFile[PATH_MAX + 1];
- if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE) {
+ if (hgw_conf_request_string(hgw, kGConfRomFile, romFile) == HGW_ERR_NONE
+ && strlen(romFile) > 0) {
S9xSetRomFile(romFile);
} else {
- hgw_context_destroy(hgw, HGW_BYE_INACTIVE);
- DIE("No Rom in Gconf!");
+ printf("Exiting gracefully because there's no ROM in Gconf\n");
+ HgwDeinit();
+ exit(0);
}
- char no_audio = FALSE;
- if (hgw_conf_request_bool(hgw, kGConfDisableAudio, &no_audio) == HGW_ERR_NONE) {
- Config.enableAudio = no_audio ? false : true;
+ char sound = FALSE;
+ if (hgw_conf_request_bool(hgw, kGConfSound, &sound) == HGW_ERR_NONE) {
+ Config.enableAudio = sound ? true : false;
}
char turbo = FALSE;
Settings.Transparency = transparency ? TRUE : FALSE;
}
+ char scaler[NAME_MAX];
+ if (hgw_conf_request_string(hgw, kGConfScaler, scaler) == HGW_ERR_NONE
+ && strlen(scaler) > 0) {
+ free(Config.scaler);
+ Config.scaler = strdup(scaler);
+ }
+
char displayFramerate = FALSE;
if (hgw_conf_request_bool(hgw, kGConfDisplayFramerate, &displayFramerate) == HGW_ERR_NONE) {
Settings.DisplayFrameRate = displayFramerate ? TRUE : FALSE;
}
+ char displayControls = FALSE;
+ if (hgw_conf_request_bool(hgw, kGConfDisplayControls, &displayControls) == HGW_ERR_NONE) {
+ Config.touchscreenShow = displayControls ? true : false;
+ }
+
int speedhacks = 0;
if (hgw_conf_request_int(hgw, kGConfSpeedhacks, &speedhacks) == HGW_ERR_NONE) {
if (speedhacks <= 0) {