Skip to content

Commit

Permalink
fixed duplicate events (menu + emulation) in debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
thrust26 committed Aug 16, 2023
1 parent 58c12ca commit 8f0ea1a
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 84 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4942,7 +4942,7 @@ <h3><a name="EmulationProps"><b>Emulation Properties</b></a></h3>
<tr><td>UASW </td><td>8K UA Ltd. (swapped banks)</td><td>.UASW </td></tr>
<tr><td>WD </td><td>Wickstead Design (Pink Panther) </td><td>.WD </td></tr>
<tr><td>WDSW </td><td>Wickstead Design (Pink Panther) (bad)</td><td>.WDSW </td></tr>
<tr><td>X07 &#185;</td><td>64K AtariAge </td><td>.X07 </td></tr>
<tr><td>X07</td><td>64K AtariAge </td><td>.X07 </td></tr>
</table></td>
</tr>

Expand Down
155 changes: 79 additions & 76 deletions src/debugger/gui/DebuggerDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,90 +137,93 @@ void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
}
}

// handle emulation keys second (can be remapped)
const Event::Type event = instance().eventHandler().eventForKey(EventMode::kEmulationMode, key, mod);
switch (event)
// Do not handle emulation events which have the same mapping as menu events
if(instance().eventHandler().eventForKey(EventMode::kMenuMode, key, mod) == Event::NoType)
{
case Event::ExitMode:
// make consistent, exit debugger on key UP
if(!repeated)
myExitPressed = true;
return;

// events which can be handled 1:1
case Event::ToggleP0Collision:
case Event::ToggleP0Bit:
case Event::ToggleP1Collision:
case Event::ToggleP1Bit:
case Event::ToggleM0Collision:
case Event::ToggleM0Bit:
case Event::ToggleM1Collision:
case Event::ToggleM1Bit:
case Event::ToggleBLCollision:
case Event::ToggleBLBit:
case Event::TogglePFCollision:
case Event::TogglePFBit:
case Event::ToggleFixedColors:
case Event::ToggleCollisions:
case Event::ToggleBits:

case Event::ToggleTimeMachine:

case Event::SaveState:
case Event::SaveAllStates:
case Event::PreviousState :
case Event::NextState:
case Event::LoadState:
case Event::LoadAllStates:

case Event::ConsoleColor:
case Event::ConsoleBlackWhite:
case Event::ConsoleColorToggle:
case Event::Console7800Pause:
case Event::ConsoleLeftDiffA:
case Event::ConsoleLeftDiffB:
case Event::ConsoleLeftDiffToggle:
case Event::ConsoleRightDiffA:
case Event::ConsoleRightDiffB:
case Event::ConsoleRightDiffToggle:
if(!repeated)
instance().eventHandler().handleEvent(event);
return;

// events which need special handling in debugger
case Event::TakeSnapshot:
if(!repeated)
instance().debugger().parser().run("saveSnap");
return;

case Event::Rewind1Menu:
doRewind();
return;
// handle emulation keys second (can be remapped)
const Event::Type event = instance().eventHandler().eventForKey(EventMode::kEmulationMode, key, mod);
switch(event)
{
case Event::ExitMode:
// make consistent, exit debugger on key UP
if(!repeated)
myExitPressed = true;
return;

case Event::Rewind10Menu:
doRewind10();
return;
// events which can be handled 1:1
case Event::ToggleP0Collision:
case Event::ToggleP0Bit:
case Event::ToggleP1Collision:
case Event::ToggleP1Bit:
case Event::ToggleM0Collision:
case Event::ToggleM0Bit:
case Event::ToggleM1Collision:
case Event::ToggleM1Bit:
case Event::ToggleBLCollision:
case Event::ToggleBLBit:
case Event::TogglePFCollision:
case Event::TogglePFBit:
case Event::ToggleFixedColors:
case Event::ToggleCollisions:
case Event::ToggleBits:

case Event::ToggleTimeMachine:

case Event::SaveState:
case Event::SaveAllStates:
case Event::PreviousState:
case Event::NextState:
case Event::LoadState:
case Event::LoadAllStates:

case Event::ConsoleColor:
case Event::ConsoleBlackWhite:
case Event::ConsoleColorToggle:
case Event::Console7800Pause:
case Event::ConsoleLeftDiffA:
case Event::ConsoleLeftDiffB:
case Event::ConsoleLeftDiffToggle:
case Event::ConsoleRightDiffA:
case Event::ConsoleRightDiffB:
case Event::ConsoleRightDiffToggle:
if(!repeated)
instance().eventHandler().handleEvent(event);
return;

case Event::RewindAllMenu:
doRewindAll();
return;
// events which need special handling in debugger
case Event::TakeSnapshot:
if(!repeated)
instance().debugger().parser().run("saveSnap");
return;

case Event::Unwind1Menu:
doUnwind();
return;
case Event::Rewind1Menu:
doRewind();
return;

case Event::Unwind10Menu:
doUnwind10();
return;
case Event::Rewind10Menu:
doRewind10();
return;

case Event::UnwindAllMenu:
doUnwindAll();
return;
case Event::RewindAllMenu:
doRewindAll();
return;

default:
break;
}
case Event::Unwind1Menu:
doUnwind();
return;

case Event::Unwind10Menu:
doUnwind10();
return;

case Event::UnwindAllMenu:
doUnwindAll();
return;

default:
break;
}
}
Dialog::handleKeyDown(key, mod);
}

Expand Down
28 changes: 21 additions & 7 deletions src/os/windows/Stella.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@
<ClCompile Include="..\..\debugger\gui\Cart0840Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart0FA0Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\Cart0FA0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart2KWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -831,7 +833,9 @@
<ClCompile Include="..\..\debugger\gui\CartBFWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartBUSInfoWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartBUSInfoWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartBUSWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -868,7 +872,9 @@
<ClCompile Include="..\..\debugger\gui\CartE0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartE7Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartE7Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartEFSCWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -911,14 +917,18 @@
<ClCompile Include="..\..\debugger\gui\CartFEWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartGLWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartGLWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartMDMWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartRamWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartTVBoyWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -949,7 +959,9 @@
<ClCompile Include="..\..\debugger\gui\GenesisWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Joy2BPlusWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\Joy2BPlusWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\JoystickWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
Expand Down Expand Up @@ -977,7 +989,9 @@
<ClCompile Include="..\..\debugger\gui\TrakBallWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\TimerMap.cxx" />
<ClCompile Include="..\..\debugger\TimerMap.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\emucore\Bankswitch.cxx" />
<ClCompile Include="..\..\emucore\Cart03E0.cxx" />
<ClCompile Include="..\..\emucore\Cart3EPlus.cxx" />
Expand Down

0 comments on commit 8f0ea1a

Please sign in to comment.