1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-01-31 04:31:01 +00:00

Use DI to obtain the reflect struct

This commit is contained in:
Peter Evans 2018-02-07 00:01:27 -06:00
parent 8450ccd3c5
commit 09017aa171
2 changed files with 7 additions and 3 deletions

View File

@ -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);

View File

@ -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");
}