Pause the debugger on SIGINT in the SDL port

This commit is contained in:
Lior Halphon 2016-04-06 22:58:30 +03:00
parent 1c2af7fa5b
commit eb3e0eaa1e
1 changed files with 10 additions and 1 deletions

View File

@ -126,12 +126,18 @@ static uint32_t rgb_encode(GB_gameboy_t *gb, unsigned char r, unsigned char g, u
return SDL_MapRGB(screen->format, r, g, b);
}
GB_gameboy_t gb;
static void debugger_interrupt(int ignore)
{
gb.debug_stopped = true;
}
#ifdef __APPLE__
extern void cocoa_disable_filtering(void);
#endif
int main(int argc, char **argv)
{
GB_gameboy_t gb;
bool dmg = false;
#define str(x) #x
@ -174,6 +180,9 @@ usage:
exit(1);
}
signal(SIGINT, debugger_interrupt);
SDL_Init( SDL_INIT_EVERYTHING );
screen = SDL_SetVideoMode(160, 144, 32, SDL_SWSURFACE );
#ifdef __APPLE__