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
2018-04-07 19:54:05 -05:00

42 lines
869 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);
}
/*
* Pause the running state of the apple2 machine
*/
EVENT_DO(apple2_event_pause)
{
apple2 *mach = (apple2 *)_mach;
mach->paused = !mach->paused;
}
/*
* Enter into a debugging state. This also implies a pause in execution
* (which can be resumed in the debugger).
*/
EVENT_DO(apple2_event_debug)
{
apple2 *mach = (apple2 *)_mach;
mach->debug = true;
mach->paused = true;
}