Skip to content

Commit

Permalink
Pause & step options
Browse files Browse the repository at this point in the history
Added PAGE DOWN to toggle pause emulation
Added ARROW RIGHT to step a frame whilst paused
  • Loading branch information
kieranhj committed Dec 28, 2016
1 parent 097188d commit 7adb94f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void initmenu()

static HANDLE mainthread;

static int bempause = 0, bemwaiting = 0;
static int bempause = 0, bemwaiting = 0, bemstep = 0;
static int doautoboot = 0;

void _mainthread(PVOID pvoid)
Expand All @@ -199,15 +199,16 @@ void _mainthread(PVOID pvoid)

while (1)
{
if (bempause)
if (bempause && !bemstep)
{
bemwaiting = 1;
Sleep(100);
//Sleep(100);
}
else
{
bemwaiting = 0;
main_run();
bemstep = 0;
}
if (doautoboot)
{
Expand Down Expand Up @@ -913,6 +914,9 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
if (LOWORD(wParam) == VK_NEXT) c = KEY_PGDN;
//rpclog("MVK2 %i %i %i\n",c,hw_to_mycode[c],KEY_PGUP);
key[c]=1;

if (c == KEY_PGDN) bempause ^= 1; // let PAGE DOWN be toggle pause
if (c == KEY_RIGHT && bempause) bemstep = 1; // let CURSOR RIGHT be step if paused
}
break;
case WM_SYSKEYUP:
Expand Down

3 comments on commit 7adb94f

@ThomasAdam
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, apart from the broken indentation and commented out code. Can you fix this, please?

@SteveFosdick
Copy link

@SteveFosdick SteveFosdick commented on 7adb94f Dec 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet the indentation looked fine in Visual Studio. Unfortunately some of B-Em's code doesn't seem to look consistent across different editors, probably from mixing spaces and tabs.

For a change I am going to be the one to suggest taking a step back rather than rushing to merge because I have a suspicion the original pause feature is Windows-only and I'd like to see if we can make it work for both. But I have a Christmas meal to go to so it will have to be later on.

But it is a good idea, and one way or another, should make it into the Stardot B-Em.

@SteveFosdick
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I refer this back to stardot/b-em#34, please, because I want to propose something very similar but not quite the same which will work on Linux too.

Please sign in to comment.