Default all unhandled opcodes to be illegal opcodes
Print the illegal/unhandled opcode in debug mode Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1736
This commit is contained in:
parent
2c9077f9e2
commit
2b1e4671e4
1 changed files with 18 additions and 11 deletions
|
@ -16,6 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "mem.h"
|
||||
|
@ -187,23 +188,29 @@ restart_opcode:
|
|||
#include "core_normal/prefix_66.h"
|
||||
#include "core_normal/prefix_66_0f.h"
|
||||
default:
|
||||
ADDIPFAST(-1);
|
||||
#if C_DEBUG
|
||||
LOG_MSG("Unhandled code %X",core.opcode_index+Fetchb());
|
||||
#else
|
||||
E_Exit("Unhandled CPU opcode");
|
||||
illegal_opcode:
|
||||
LEAVECORE;
|
||||
reg_eip-=core.ip_lookup-core.op_start;
|
||||
#if C_DEBUG
|
||||
{
|
||||
Bitu len=core.ip_lookup-core.op_start;
|
||||
if (len>16) len=16;
|
||||
char tempcode[16*2+1];char * writecode=tempcode;
|
||||
for (;len>0;len--) {
|
||||
sprintf(writecode,"%X",mem_readb(core.op_start++));
|
||||
writecode+=2;
|
||||
}
|
||||
LOG(LOG_CPU,LOG_ERROR)("Illegal/Unhandled opcode %s",tempcode);
|
||||
}
|
||||
#endif
|
||||
CPU_Exception(6,0);
|
||||
goto decode_start;
|
||||
|
||||
}
|
||||
}
|
||||
decode_end:
|
||||
LEAVECORE;
|
||||
return CBRET_NONE;
|
||||
|
||||
illegal_opcode:
|
||||
LEAVECORE;
|
||||
reg_eip-=core.ip_lookup-core.op_start;
|
||||
CPU_Exception(6,0);
|
||||
goto decode_start;
|
||||
}
|
||||
|
||||
Bits CPU_Core_Normal_Trap_Run(void) {
|
||||
|
|
Loading…
Add table
Reference in a new issue