mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-03 15:55:37 +00:00
target/m68k: Fix initialization of m68k targets
m68k is now able to be used for emulation again. It just needed to properly have the unicorn context be set within the base type for the CPUs
This commit is contained in:
parent
3dc1c40462
commit
44ca501cd3
|
@ -20,9 +20,8 @@
|
||||||
static int dummy_m68k_init(struct uc_struct *uc, MachineState *machine)
|
static int dummy_m68k_init(struct uc_struct *uc, MachineState *machine)
|
||||||
{
|
{
|
||||||
CPUM68KState *env;
|
CPUM68KState *env;
|
||||||
const char *cpu_type = parse_cpu_model(uc, "cf4ve");
|
|
||||||
|
|
||||||
uc->cpu = cpu_create(uc, cpu_type);
|
uc->cpu = cpu_create(uc, machine->cpu_type);
|
||||||
if (!uc->cpu) {
|
if (!uc->cpu) {
|
||||||
fprintf(stderr, "Unable to find m68k CPU definition\n");
|
fprintf(stderr, "Unable to find m68k CPU definition\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -268,7 +268,7 @@ static void m68k_cpu_class_init(struct uc_struct *uc, ObjectClass *c, void *data
|
||||||
initfn, \
|
initfn, \
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo m68k_cpus_type_infos[] = {
|
static TypeInfo m68k_cpus_type_infos[] = {
|
||||||
{ /* base class should be registered first */
|
{ /* base class should be registered first */
|
||||||
TYPE_M68K_CPU,
|
TYPE_M68K_CPU,
|
||||||
TYPE_CPU,
|
TYPE_CPU,
|
||||||
|
@ -302,5 +302,7 @@ static const TypeInfo m68k_cpus_type_infos[] = {
|
||||||
|
|
||||||
void m68k_cpu_register_types(void *opaque)
|
void m68k_cpu_register_types(void *opaque)
|
||||||
{
|
{
|
||||||
|
m68k_cpus_type_infos[0].instance_userdata = opaque;
|
||||||
|
|
||||||
type_register_static_array(opaque, m68k_cpus_type_infos, ARRAY_SIZE(m68k_cpus_type_infos));
|
type_register_static_array(opaque, m68k_cpus_type_infos, ARRAY_SIZE(m68k_cpus_type_infos));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue