From 09017aa171de4196f461f5547c3d88c333f64364 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 7 Feb 2018 00:01:27 -0600 Subject: [PATCH] Use DI to obtain the reflect struct --- include/apple2.reflect.h | 2 +- src/apple2.reflect.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/apple2.reflect.h b/include/apple2.reflect.h index 69ee600..6952190 100644 --- a/include/apple2.reflect.h +++ b/include/apple2.reflect.h @@ -3,7 +3,7 @@ #include "vm_reflect.h" -extern void apple2_reflect_init(vm_reflect *); +extern void apple2_reflect_init(); extern REFLECT(apple2_reflect_cpu_info); diff --git a/src/apple2.reflect.c b/src/apple2.reflect.c index ac0c6c2..337d373 100644 --- a/src/apple2.reflect.c +++ b/src/apple2.reflect.c @@ -4,18 +4,22 @@ #include "apple2.reflect.h" #include "mos6502.h" +#include "vm_di.h" #define CPU(x) \ mos6502 *x = (mos6502 *)ref->cpu void -apple2_reflect_init(vm_reflect *ref) +apple2_reflect_init() { + vm_reflect *ref = (vm_reflect *)vm_di_get(VM_REFLECT); + + ref->cpu_info = apple2_reflect_cpu_info; } REFLECT(apple2_reflect_cpu_info) { - CPU(cpu); +// CPU(cpu); printf("hey\n"); }