mirror of
https://github.com/holub/mame
synced 2025-07-07 19:03:29 +03:00
Added Co-Processor sub-types to ARM CPU, hooking a special case for VL86C020 used by Acorn Archimedes, nw
This commit is contained in:
parent
1532668b9c
commit
a3774a2b9e
@ -248,6 +248,7 @@ arm_be_cpu_device::arm_be_cpu_device(const machine_config &mconfig, const char *
|
||||
}
|
||||
|
||||
|
||||
|
||||
void arm_cpu_device::cpu_write32( int addr, UINT32 data )
|
||||
{
|
||||
/* Unaligned writes are treated as normal writes */
|
||||
@ -309,6 +310,20 @@ void arm_cpu_device::SetModeRegister( int mode, int rIndex, UINT32 value )
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
void arm_cpu_device::device_config_complete()
|
||||
{
|
||||
// inherit a copy of the static data
|
||||
const arm_interface *intf = reinterpret_cast<const arm_interface *>(static_config());
|
||||
if (intf != NULL)
|
||||
*static_cast<arm_interface *>(this) = *intf;
|
||||
|
||||
// or set default if none provided
|
||||
else
|
||||
{
|
||||
coprotype = ARM_COPRO_TYPE_UNKNOWN_CP15;
|
||||
}
|
||||
}
|
||||
|
||||
void arm_cpu_device::device_reset()
|
||||
{
|
||||
for ( int i = 0; i < 27; i++ )
|
||||
@ -413,7 +428,11 @@ void arm_cpu_device::execute_run()
|
||||
}
|
||||
else if ((insn & 0x0f000000u) == 0x0e000000u) /* Coprocessor */
|
||||
{
|
||||
HandleCoPro(insn);
|
||||
if(coprotype == 1)
|
||||
HandleCoProVL86C020(insn);
|
||||
else
|
||||
HandleCoPro(insn);
|
||||
|
||||
R15 += 4;
|
||||
}
|
||||
else if ((insn & 0x0f000000u) == 0x0f000000u) /* Software interrupt */
|
||||
@ -1363,6 +1382,45 @@ UINT32 arm_cpu_device::DecimalToBCD(UINT32 value)
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
void arm_cpu_device::HandleCoProVL86C020( UINT32 insn )
|
||||
{
|
||||
UINT32 rn=(insn>>12)&0xf;
|
||||
UINT32 crn=(insn>>16)&0xf;
|
||||
|
||||
m_icount -= S_CYCLE;
|
||||
|
||||
/* MRC - transfer copro register to main register */
|
||||
if( (insn&0x0f100010)==0x0e100010 )
|
||||
{
|
||||
if(crn == 0) // ID, read only
|
||||
{
|
||||
/*
|
||||
0x41<<24 <- Designer code, Acorn Computer Ltd.
|
||||
0x56<<16 <- Manufacturer code, VLSI Technology Inc.
|
||||
0x03<<8 <- Part type, VLC86C020
|
||||
0x00<<0 <- Revision number, 0
|
||||
*/
|
||||
SetRegister(rn, 0x41560300);
|
||||
debugger_break(machine());
|
||||
}
|
||||
else
|
||||
SetRegister(rn, m_coproRegister[crn]);
|
||||
|
||||
}
|
||||
/* MCR - transfer main register to copro register */
|
||||
else if( (insn&0x0f100010)==0x0e000010 )
|
||||
{
|
||||
if(crn != 0)
|
||||
m_coproRegister[crn]=GetRegister(rn);
|
||||
|
||||
printf("%08x: VL86C020 copro instruction write %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%08x: Unimplemented VL86C020 copro instruction %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn);
|
||||
debugger_break(machine());
|
||||
}
|
||||
}
|
||||
|
||||
void arm_cpu_device::HandleCoPro( UINT32 insn )
|
||||
{
|
||||
|
@ -14,6 +14,20 @@
|
||||
* PUBLIC FUNCTIONS
|
||||
***************************************************************************************************/
|
||||
|
||||
enum
|
||||
{
|
||||
ARM_COPRO_TYPE_UNKNOWN_CP15 = 0,
|
||||
ARM_COPRO_TYPE_VL86C020
|
||||
};
|
||||
|
||||
struct arm_interface
|
||||
{
|
||||
UINT8 coprotype;
|
||||
};
|
||||
|
||||
#define ARM_INTERFACE(name) \
|
||||
const arm_interface (name) =
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
@ -25,7 +39,8 @@ enum
|
||||
};
|
||||
|
||||
|
||||
class arm_cpu_device : public cpu_device
|
||||
class arm_cpu_device : public cpu_device,
|
||||
public arm_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -34,6 +49,7 @@ public:
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
|
||||
@ -80,6 +96,7 @@ protected:
|
||||
void HandleMemSingle(UINT32 insn);
|
||||
void HandleMemBlock(UINT32 insn);
|
||||
void HandleCoPro(UINT32 insn);
|
||||
void HandleCoProVL86C020(UINT32 insn);
|
||||
UINT32 decodeShift(UINT32 insn, UINT32 *pCarry);
|
||||
void arm_check_irq_state();
|
||||
int loadInc(UINT32 pat, UINT32 rbv, UINT32 s);
|
||||
|
@ -138,6 +138,7 @@ void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_rx = m_keyb_row;
|
||||
m_out_tx_func(ASSERT_LINE);
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x3f:
|
||||
if(m_keyb_enable & 1 && m_keyb_state & 1)
|
||||
@ -147,6 +148,8 @@ void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_out_tx_func(ASSERT_LINE);
|
||||
m_keyb_state = 0;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 0xfd:
|
||||
m_rx = 0xfd;
|
||||
|
@ -134,6 +134,8 @@ void a310_state::machine_start()
|
||||
{
|
||||
archimedes_init();
|
||||
|
||||
|
||||
|
||||
// reset the DAC to centerline
|
||||
//m_dac->write_signed8(0x80);
|
||||
}
|
||||
@ -160,7 +162,7 @@ INPUT_CHANGED_MEMBER(a310_state::key_stroke)
|
||||
|
||||
if(newval && !oldval)
|
||||
m_kart->send_keycode_down(row_val,col_val);
|
||||
|
||||
|
||||
if(oldval && !newval)
|
||||
m_kart->send_keycode_up(row_val,col_val);
|
||||
}
|
||||
@ -277,7 +279,6 @@ static INPUT_PORTS_START( a310 )
|
||||
PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?)
|
||||
PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?)
|
||||
|
||||
|
||||
PORT_START("via1a") /* VIA #1 PORT A */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2)
|
||||
@ -325,10 +326,16 @@ static AAKART_INTERFACE( kart_interface )
|
||||
DEVCB_DRIVER_LINE_MEMBER(archimedes_state, a310_kart_rx_w)
|
||||
};
|
||||
|
||||
static ARM_INTERFACE( a310_config )
|
||||
{
|
||||
ARM_COPRO_TYPE_VL86C020
|
||||
};
|
||||
|
||||
static MACHINE_CONFIG_START( a310, a310_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", ARM, 8000000) /* 8 MHz */
|
||||
MCFG_CPU_PROGRAM_MAP(a310_mem)
|
||||
MCFG_CPU_CONFIG(a310_config)
|
||||
|
||||
MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user