added m6809 config option to control where opcodes 10 and 11 fetch the second byte.

The disassembler needs to respect the setting too but I don't know how to inform it.
This commit is contained in:
Nicola Salmoria 2008-11-16 12:21:58 +00:00
parent c675126853
commit 6aabfb37cb
4 changed files with 77 additions and 59 deletions

View File

@ -374,6 +374,8 @@ CPU_DISASSEMBLE( m6809 )
do
{
opcode = oprom[p++];
// FIXME if (m68_state->config->encrypt_only_first_byte) we should to this
// opcode = page == 0 ? oprom[p++] : opram[p++];
for (i = 0; i < m6809_numops[page]; i++)
if (m6809_pgpointers[page][i].opcode == opcode)
break;

View File

@ -2913,7 +2913,7 @@ OP_HANDLER( sts_ex )
/* $10xx opcodes */
OP_HANDLER( pref10 )
{
UINT8 ireg2 = ROP(PCD);
UINT8 ireg2 = m68_state->config->encrypt_only_first_byte ? ROP_ARG(PCD) : ROP(PCD);
PC++;
switch( ireg2 )
{
@ -2974,7 +2974,7 @@ OP_HANDLER( pref10 )
/* $11xx opcodes */
OP_HANDLER( pref11 )
{
UINT8 ireg2 = ROP(PCD);
UINT8 ireg2 = m68_state->config->encrypt_only_first_byte ? ROP_ARG(PCD) : ROP(PCD);
PC++;
switch( ireg2 )
{

View File

@ -98,6 +98,7 @@ struct _m68_state_t
int extra_cycles; /* cycles used up by interrupts */
cpu_irq_callback irq_callback;
const device_config *device;
const m6809_config *config;
UINT8 int_state; /* SYNC and CWAI flags */
UINT8 nmi_state;
};
@ -362,8 +363,16 @@ static CPU_SET_CONTEXT( m6809 )
/****************************************************************************/
static CPU_INIT( m6809 )
{
/* default configuration */
static const m6809_config default_config =
{
0
};
const m6809_config *configdata = device->static_config ? device->static_config : &default_config;
m68_state_t *m68_state = device->token;
m68_state->config = configdata;
m68_state->irq_callback = irqcallback;
m68_state->device = device;

View File

@ -53,4 +53,11 @@ CPU_GET_INFO( m6809e );
CPU_DISASSEMBLE( m6809 );
typedef struct _m6809_config m6809_config;
struct _m6809_config
{
UINT8 encrypt_only_first_byte; /* encrypt only the first byte in 10 xx and 11 xx opcodes */
};
#endif /* __M6809_H__ */