1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-07-18 09:28:56 +00:00

Move reflect to event

This commit is contained in:
Peter Evans 2018-04-07 00:33:40 -05:00
parent 8a899f87a2
commit c665df3531
5 changed files with 9 additions and 18 deletions

View File

@ -6,12 +6,12 @@ set(erc_sources
apple2/dec.c
apple2/draw.c
apple2/enc.c
apple2/event.c
apple2/hires.c
apple2/kb.c
apple2/lores.c
apple2/mem.c
apple2/pc.c
apple2/reflect.c
apple2/text.c
log.c
mos6502/mos6502.c

View File

@ -341,7 +341,7 @@ apple2_run_loop(apple2 *mach)
int sleep = 5;
if (dlog != NULL) {
vm_reflect_disasm(NULL);
mach->disasm = true;
}
int i = 0;

View File

@ -6,7 +6,7 @@
*/
#include "apple2/apple2.h"
#include "apple2/reflect.h"
#include "apple2/event.h"
#include "vm_di.h"
/*

View File

@ -13,11 +13,10 @@
#include "apple2/apple2.h"
#include "apple2/draw.h"
#include "apple2/reflect.h"
#include "apple2/event.h"
#include "log.h"
#include "option.h"
#include "vm_di.h"
#include "vm_reflect.h"
#include "vm_screen.h"
/*
@ -93,7 +92,6 @@ main(int argc, char **argv)
{
apple2 *mach;
vm_screen *screen;
vm_reflect *ref;
int err;
init(argc, argv);
@ -117,9 +115,6 @@ main(int argc, char **argv)
// _to_ define a cpu field.
vm_di_set(VM_CPU, mach->cpu);
ref = vm_reflect_create();
vm_di_set(VM_REFLECT, ref);
apple2_event_init();
// Ok, it's time to boot this up!
@ -137,7 +132,6 @@ main(int argc, char **argv)
// We're all done, so let's tear everything down.
apple2_free(mach);
vm_reflect_free(ref);
// ha ha ha ha #nervous #laughter
printf("Hello, world\n");

View File

@ -15,7 +15,7 @@
#include "mos6502/dis.h"
#include "vm_debug.h"
#include "vm_di.h"
#include "vm_reflect.h"
#include "vm_event.h"
/*
* The largest address size we can set a breakpoint for
@ -321,13 +321,13 @@ DEBUG_CMD(help)
*/
DEBUG_CMD(resume)
{
mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU);
apple2 *mach = (apple2 *)vm_di_get(VM_MACHINE);
// If we paused because of a breakpoint, then we need to clear it
// before we can really keep moving.
vm_debug_unbreak(cpu->PC);
vm_debug_unbreak(mach->cpu->PC);
vm_reflect_pause(NULL);
mach->paused = false;
}
/*
@ -365,9 +365,6 @@ DEBUG_CMD(printaddr)
*/
DEBUG_CMD(jump)
{
// FIXME: same issue as for printaddr -- overall we need to refactor
// vm_reflect quite a bit
mos6502 *cpu = (mos6502 *)vm_di_get(VM_CPU);
cpu->PC = args->addr1;
}
@ -439,7 +436,7 @@ DEBUG_CMD(disasm)
apple2 *mach = (apple2 *)vm_di_get(VM_MACHINE);
FILE *stream = (FILE *)vm_di_get(VM_OUTPUT);
vm_reflect_disasm(NULL);
mach->disasm = true;
fprintf(stream, "disassembly %s\n", mach->disasm ? "ON" : "OFF");
}