mirror of https://github.com/snes9xgit/snes9x.git
Add ability to force backdrop color for sprite extraction.
Only Gtk hotkey is hooked up so far.
This commit is contained in:
parent
d29098ca44
commit
79e150886a
21
controls.cpp
21
controls.cpp
|
@ -265,6 +265,7 @@ static const int ptrspeeds[4] = { 1, 1, 4, 8 };
|
||||||
S(ToggleBG1), \
|
S(ToggleBG1), \
|
||||||
S(ToggleBG2), \
|
S(ToggleBG2), \
|
||||||
S(ToggleBG3), \
|
S(ToggleBG3), \
|
||||||
|
S(ToggleBackdrop), \
|
||||||
S(ToggleEmuTurbo), \
|
S(ToggleEmuTurbo), \
|
||||||
S(ToggleSprites), \
|
S(ToggleSprites), \
|
||||||
S(ToggleTransparency) \
|
S(ToggleTransparency) \
|
||||||
|
@ -2360,6 +2361,26 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2)
|
||||||
S9xSetInfoString("All sound channels on");
|
S9xSetInfoString("All sound channels on");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ToggleBackdrop:
|
||||||
|
switch (Settings.ForcedBackdrop)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
Settings.ForcedBackdrop = 0xf81f;
|
||||||
|
break;
|
||||||
|
case 0xf81f:
|
||||||
|
Settings.ForcedBackdrop = 0x07e0;
|
||||||
|
break;
|
||||||
|
case 0x07e0:
|
||||||
|
Settings.ForcedBackdrop = 0x07ff;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Settings.ForcedBackdrop = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sprintf(buf, "Setting backdrop to 0x%04x", Settings.ForcedBackdrop);
|
||||||
|
S9xSetInfoString(buf);
|
||||||
|
break;
|
||||||
|
|
||||||
case ToggleBG0:
|
case ToggleBG0:
|
||||||
Settings.BG_Forced ^= 1;
|
Settings.BG_Forced ^= 1;
|
||||||
DisplayStateChange("BG#0", !(Settings.BG_Forced & 1));
|
DisplayStateChange("BG#0", !(Settings.BG_Forced & 1));
|
||||||
|
|
1
gfx.cpp
1
gfx.cpp
|
@ -51,6 +51,7 @@ bool8 S9xGraphicsInit (void)
|
||||||
|
|
||||||
IPPU.OBJChanged = TRUE;
|
IPPU.OBJChanged = TRUE;
|
||||||
Settings.BG_Forced = 0;
|
Settings.BG_Forced = 0;
|
||||||
|
Settings.ForcedBackdrop = 0;
|
||||||
S9xFixColourBrightness();
|
S9xFixColourBrightness();
|
||||||
S9xBuildDirectColourMaps();
|
S9xBuildDirectColourMaps();
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ const BindingLink b_links[] =
|
||||||
{ "b_bg_layer_2", "ToggleBG2" },
|
{ "b_bg_layer_2", "ToggleBG2" },
|
||||||
{ "b_bg_layer_3", "ToggleBG3" },
|
{ "b_bg_layer_3", "ToggleBG3" },
|
||||||
{ "b_sprites", "ToggleSprites" },
|
{ "b_sprites", "ToggleSprites" },
|
||||||
{ "b_bg_layering_hack", "BGLayeringHack" },
|
{ "toggle_backdrop", "ToggleBackdrop" },
|
||||||
{ "b_screenshot", "Screenshot" },
|
{ "b_screenshot", "Screenshot" },
|
||||||
{ "b_fullscreen", "GTK_fullscreen" },
|
{ "b_fullscreen", "GTK_fullscreen" },
|
||||||
{ "b_state_save_current", "GTK_state_save_current" },
|
{ "b_state_save_current", "GTK_state_save_current" },
|
||||||
|
|
|
@ -7198,7 +7198,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">BG layering hack</property>
|
<property name="label" translatable="yes">Toggle forced backdrop color</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="top_attach">5</property>
|
<property name="top_attach">5</property>
|
||||||
|
@ -7324,7 +7324,7 @@
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="b_bg_layering_hack">
|
<object class="GtkEntry" id="toggle_backdrop">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="editable">False</property>
|
<property name="editable">False</property>
|
||||||
|
|
1
snes9x.h
1
snes9x.h
|
@ -247,6 +247,7 @@ struct SSettings
|
||||||
bool8 Transparency;
|
bool8 Transparency;
|
||||||
uint8 BG_Forced;
|
uint8 BG_Forced;
|
||||||
bool8 DisableGraphicWindows;
|
bool8 DisableGraphicWindows;
|
||||||
|
uint16 ForcedBackdrop;
|
||||||
|
|
||||||
bool8 DisplayTime;
|
bool8 DisplayTime;
|
||||||
bool8 DisplayFrameRate;
|
bool8 DisplayFrameRate;
|
||||||
|
|
|
@ -481,6 +481,8 @@ namespace TileImpl {
|
||||||
|
|
||||||
GFX.RealScreenColors = IPPU.ScreenColors;
|
GFX.RealScreenColors = IPPU.ScreenColors;
|
||||||
GFX.ScreenColors = GFX.ClipColors ? BlackColourMap : GFX.RealScreenColors;
|
GFX.ScreenColors = GFX.ClipColors ? BlackColourMap : GFX.RealScreenColors;
|
||||||
|
if (Settings.ForcedBackdrop)
|
||||||
|
GFX.ScreenColors = &Settings.ForcedBackdrop;
|
||||||
|
|
||||||
OFFSET_IN_LINE;
|
OFFSET_IN_LINE;
|
||||||
for (l = GFX.StartY; l <= GFX.EndY; l++, Offset += GFX.PPL)
|
for (l = GFX.StartY; l <= GFX.EndY; l++, Offset += GFX.PPL)
|
||||||
|
|
Loading…
Reference in New Issue