m68k fix for non-68000 opcode 0x6fff (iq, if you have a cleaner solution feel free to change it)

This commit is contained in:
Barry Harris 2012-12-27 14:59:54 +00:00
parent f0ababe1ef
commit 1f2ee4ce23
2 changed files with 11 additions and 9 deletions

View File

@ -102,7 +102,7 @@ M68KMAKE_PROTOTYPE_FOOTER
/* Build the opcode handler table */
void m68ki_build_opcode_table(void);
void m68ki_build_opcode_table(int is_000);
extern void (*m68ki_instruction_jump_table[0x10000])(void); /* opcode handler jump table */
extern unsigned char m68ki_cycles[][0x10000];
@ -162,7 +162,7 @@ static void m68k_66ff(void)
}
/* Build the opcode handler jump table */
void m68ki_build_opcode_table(void)
void m68ki_build_opcode_table(int is_000)
{
opcode_handler_struct *ostruct;
int instr;
@ -256,7 +256,7 @@ void m68ki_build_opcode_table(void)
ostruct++;
}
m68ki_instruction_jump_table[0x66ff] = m68k_66ff; // hack
if (is_000) m68ki_instruction_jump_table[0x66ff] = m68k_66ff; // hack
}

View File

@ -607,7 +607,7 @@ void m68k_set_cpu_type(unsigned int cpu_type)
CYC_MOVEM_L = 3;
CYC_SHIFT = 1;
CYC_RESET = 132;
return;
break;
case M68K_CPU_TYPE_68008:
CPU_TYPE = CPU_TYPE_008;
CPU_ADDRESS_MASK = 0x003fffff;
@ -623,7 +623,7 @@ void m68k_set_cpu_type(unsigned int cpu_type)
CYC_MOVEM_L = 3;
CYC_SHIFT = 1;
CYC_RESET = 132;
return;
break;
case M68K_CPU_TYPE_68010:
CPU_TYPE = CPU_TYPE_010;
CPU_ADDRESS_MASK = 0x00ffffff;
@ -639,7 +639,7 @@ void m68k_set_cpu_type(unsigned int cpu_type)
CYC_MOVEM_L = 3;
CYC_SHIFT = 1;
CYC_RESET = 130;
return;
break;
case M68K_CPU_TYPE_68EC020:
CPU_TYPE = CPU_TYPE_EC020;
CPU_ADDRESS_MASK = 0x00ffffff;
@ -655,7 +655,7 @@ void m68k_set_cpu_type(unsigned int cpu_type)
CYC_MOVEM_L = 2;
CYC_SHIFT = 0;
CYC_RESET = 518;
return;
break;
case M68K_CPU_TYPE_68020:
CPU_TYPE = CPU_TYPE_020;
CPU_ADDRESS_MASK = 0xffffffff;
@ -671,8 +671,10 @@ void m68k_set_cpu_type(unsigned int cpu_type)
CYC_MOVEM_L = 2;
CYC_SHIFT = 0;
CYC_RESET = 518;
return;
break;
}
m68ki_build_opcode_table(CPU_TYPE_IS_000(CPU_TYPE));
}
/* Execute some instructions until we use up num_cycles clock cycles */
@ -785,7 +787,7 @@ void m68k_init(void)
/* The first call to this function initializes the opcode handler jump table */
if(!emulation_initialized)
{
m68ki_build_opcode_table();
m68ki_build_opcode_table(CPU_TYPE_IS_000(CPU_TYPE));
emulation_initialized = 1;
}