From: Javier S. Pedro Date: Sat, 29 Aug 2009 01:14:27 +0000 (+0200) Subject: display-framerate and mappings options in gconf X-Git-Tag: drnoksnes_0_9_5~1 X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=68882cd135395450b1bcb25d2e1765d34ac0cfbb;p=drnoksnes display-framerate and mappings options in gconf --- diff --git a/debian/changelog b/debian/changelog index 771ea0d..63491e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,11 @@ drnoksnes (0.9.5) unstable; urgency=low * Icon in packaging + * Fixing GUI bugs and improved ROM compatibility. + * Touchscreen controls. + * Mouse/Touchscreen options in GUI. - -- Javier S. Pedro Wed, 26 Aug 2009 00:02:31 +0200 + -- Javier S. Pedro Sat, 29 Aug 2009 03:12:42 +0200 drnoksnes (0.9.4) unstable; urgency=low diff --git a/platform/hgw.cpp b/platform/hgw.cpp index dee9427..d1c813d 100644 --- a/platform/hgw.cpp +++ b/platform/hgw.cpp @@ -15,6 +15,7 @@ bool hgwLaunched; static HgwContext *hgw; +static void createActionMappingsOnly(); static void parseGConfKeyMappings(); void HgwInit() @@ -82,6 +83,11 @@ void HgwConfig() if (hgw_conf_request_bool(hgw, kGConfTransparency, &transparency) == HGW_ERR_NONE) { Settings.Transparency = transparency ? TRUE : FALSE; } + + char displayFramerate = FALSE; + if (hgw_conf_request_bool(hgw, kGConfDisplayFramerate, &displayFramerate) == HGW_ERR_NONE) { + Settings.DisplayFrameRate = displayFramerate ? TRUE : FALSE; + } int speedhacks = 0; if (hgw_conf_request_int(hgw, kGConfFrameskip, &speedhacks) == HGW_ERR_NONE) { @@ -100,7 +106,27 @@ void HgwConfig() int mappings = 0; if (hgw_conf_request_int(hgw, kGConfMapping, &mappings) == HGW_ERR_NONE) { switch (mappings) { - case 1: + case 0: + // Do nothing, leave mappings as is. + break; + case 1: // Keys + parseGConfKeyMappings(); + break; + case 2: // Touchscreen + Config.touchscreenInput = true; + createActionMappingsOnly(); + break; + case 3: // Touchscreen + keys + Config.touchscreenInput = true; + parseGConfKeyMappings(); + break; + case 4: // Mouse + Settings.Mouse = TRUE; + Settings.ControllerOption = SNES_MOUSE_SWAPPED; + break; + case 5: // Mouse + keys + Settings.Mouse = TRUE; + Settings.ControllerOption = SNES_MOUSE; parseGConfKeyMappings(); break; } @@ -192,6 +218,17 @@ static const ButtonEntry buttons[] = { BUTTON_LAST }; +static void createActionMappingsOnly() +{ + // Discard any other mapping + ZeroMemory(Config.joypad1Mapping, sizeof(Config.joypad1Mapping)); + ZeroMemory(Config.action, sizeof(Config.action)); + + // Map quit to fullscreen and escape + Config.action[72] = kActionQuit; + Config.action[9] = kActionQuit; +} + static void parseGConfKeyMappings() { // Discard any other mapping diff --git a/platform/hgw.h b/platform/hgw.h index 47200f5..21832f9 100644 --- a/platform/hgw.h +++ b/platform/hgw.h @@ -16,6 +16,7 @@ void HgwPollEvents(); #define kGConfTurboMode kGConfPath "/" "turbo" #define kGConfFrameskip kGConfPath "/" "frameskip" #define kGConfTransparency kGConfPath "/" "transparency" +#define kGConfDisplayFramerate kGConfPath "/" "display-framerate" #define kGConfSpeedhacks kGConfPath "/" "speedhacks" #define kGConfMapping kGConfPath "/" "mapping" #define kGConfKeysPath kGConfPath "/" "keys"