mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-17 19:30:13 +00:00
Add pause function, flesh out machine_info
This commit is contained in:
parent
a84b4c12e9
commit
433d9a436f
@ -6,5 +6,7 @@
|
||||
extern void apple2_reflect_init();
|
||||
|
||||
extern REFLECT(apple2_reflect_cpu_info);
|
||||
extern REFLECT(apple2_reflect_machine_info);
|
||||
extern REFLECT(apple2_reflect_pause);
|
||||
|
||||
#endif
|
||||
|
@ -2,6 +2,7 @@
|
||||
* apple2.reflect.c
|
||||
*/
|
||||
|
||||
#include "apple2.h"
|
||||
#include "apple2.reflect.h"
|
||||
#include "mos6502.h"
|
||||
#include "vm_di.h"
|
||||
@ -12,6 +13,8 @@ apple2_reflect_init()
|
||||
vm_reflect *ref = (vm_reflect *)vm_di_get(VM_REFLECT);
|
||||
|
||||
ref->cpu_info = apple2_reflect_cpu_info;
|
||||
ref->machine_info = apple2_reflect_machine_info;
|
||||
ref->pause = apple2_reflect_pause;
|
||||
}
|
||||
|
||||
REFLECT(apple2_reflect_cpu_info)
|
||||
@ -23,3 +26,26 @@ REFLECT(apple2_reflect_cpu_info)
|
||||
fprintf(out, " A:%02x X:%02x Y:%02x P:%02x S:%02x PC:%04x\n",
|
||||
cpu->A, cpu->X, cpu->Y, cpu->P, cpu->S, cpu->PC);
|
||||
}
|
||||
|
||||
REFLECT(apple2_reflect_machine_info)
|
||||
{
|
||||
apple2 *mach = (apple2 *)vm_di_get(VM_MACHINE);
|
||||
FILE *out = (FILE *)vm_di_get(VM_OUTPUT);
|
||||
|
||||
fprintf(out, "MACHINE:\n");
|
||||
fprintf(out, " display_mode: %02x\n", mach->display_mode);
|
||||
fprintf(out, " color_mode: %02x\n", mach->color_mode);
|
||||
fprintf(out, " bank_switch: %02x\n", mach->bank_switch);
|
||||
fprintf(out, " memory_mode: %02x\n", mach->memory_mode);
|
||||
fprintf(out, " strobe: %02x\n", mach->strobe);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are paused, we will unpause; if we are not paused, we will
|
||||
* pause.
|
||||
*/
|
||||
REFLECT(apple2_reflect_pause)
|
||||
{
|
||||
apple2 *mach = (apple2 *)vm_di_get(VM_MACHINE);
|
||||
mach->paused = !mach->paused;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user