1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-06-02 07:41:32 +00:00
erc-c/src/apple2/event.c
Peter Evans 6e77e99813 Add ability to debug separate from pausing
Also, pausing just pauses now; no debugger prompt is shown. ALT+P
toggles pausing, so just hit it again to unpause. Also, when things are
paused, you can perform other keyboard events (like quitting).
2018-04-07 11:14:12 -05:00

35 lines
691 B
C

/*
* apple2.reflect.c
*
* Implement the reflection handlers for the virtual machine when the
* apple2 machine is being emulated.
*/
#include "apple2/apple2.h"
#include "apple2/event.h"
#include "vm_di.h"
/*
* Initialize the reflection struct for the apple2 machine, setting up
* all of the reflect methods we may want to use.
*/
void
apple2_event_init()
{
vm_di_set(VM_PAUSE_FUNC, apple2_event_pause);
vm_di_set(VM_DEBUG_FUNC, apple2_event_debug);
}
EVENT_DO(apple2_event_pause)
{
apple2 *mach = (apple2 *)_mach;
mach->paused = !mach->paused;
}
EVENT_DO(apple2_event_debug)
{
apple2 *mach = (apple2 *)_mach;
mach->debug = true;
mach->paused = true;
}