Previous 199869 Revisions Next

r29502 Wednesday 9th April, 2014 at 17:36:55 UTC by Angelo Salese
Added Co-Processor sub-types to ARM CPU, hooking a special case for VL86C020 used by Acorn Archimedes, nw
[src/emu/cpu/arm]arm.c arm.h
[src/emu/machine]aakart.c
[src/mess/drivers]a310.c

trunk/src/emu/machine/aakart.c
r29501r29502
138138                    m_rx = m_keyb_row;
139139                    m_out_tx_func(ASSERT_LINE);
140140                }
141
141142                break;
142143            case 0x3f:
143144                if(m_keyb_enable & 1 && m_keyb_state & 1)
r29501r29502
147148                    m_out_tx_func(ASSERT_LINE);
148149                    m_keyb_state = 0;
149150                }
151
152
150153                break;
151154            case 0xfd:
152155                m_rx = 0xfd;
trunk/src/emu/cpu/arm/arm.c
r29501r29502
248248}
249249
250250
251
251252void arm_cpu_device::cpu_write32( int addr, UINT32 data )
252253{
253254   /* Unaligned writes are treated as normal writes */
r29501r29502
309310
310311/***************************************************************************/
311312
313void arm_cpu_device::device_config_complete()
314{
315   // inherit a copy of the static data
316   const arm_interface *intf = reinterpret_cast<const arm_interface *>(static_config());
317   if (intf != NULL)
318      *static_cast<arm_interface *>(this) = *intf;
319
320   // or set default if none provided
321   else
322   {
323      coprotype = ARM_COPRO_TYPE_UNKNOWN_CP15;
324   }
325}
326
312327void arm_cpu_device::device_reset()
313328{
314329   for ( int i = 0; i < 27; i++ )
r29501r29502
413428      }
414429      else if ((insn & 0x0f000000u) == 0x0e000000u)   /* Coprocessor */
415430      {
416         HandleCoPro(insn);
431         if(coprotype == 1)
432            HandleCoProVL86C020(insn);
433         else
434            HandleCoPro(insn);
435
417436         R15 += 4;
418437      }
419438      else if ((insn & 0x0f000000u) == 0x0f000000u)   /* Software interrupt */
r29501r29502
13631382   return accumulator;
13641383}
13651384
1385void arm_cpu_device::HandleCoProVL86C020( UINT32 insn )
1386{
1387   UINT32 rn=(insn>>12)&0xf;
1388   UINT32 crn=(insn>>16)&0xf;
13661389
1390   m_icount -= S_CYCLE;
1391
1392   /* MRC - transfer copro register to main register */
1393   if( (insn&0x0f100010)==0x0e100010 )
1394   {
1395      if(crn == 0) // ID, read only
1396      {
1397         /*
1398         0x41<<24 <- Designer code, Acorn Computer Ltd.
1399         0x56<<16 <- Manufacturer code, VLSI Technology Inc.
1400         0x03<<8 <- Part type, VLC86C020
1401         0x00<<0 <- Revision number, 0
1402         */
1403         SetRegister(rn, 0x41560300);
1404         debugger_break(machine());
1405      }
1406      else
1407         SetRegister(rn, m_coproRegister[crn]);
1408
1409   }
1410   /* MCR - transfer main register to copro register */
1411   else if( (insn&0x0f100010)==0x0e000010 )
1412   {
1413      if(crn != 0)
1414         m_coproRegister[crn]=GetRegister(rn);
1415
1416      printf("%08x:  VL86C020 copro instruction write %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn);
1417   }
1418   else
1419   {
1420      printf("%08x:  Unimplemented VL86C020 copro instruction %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn);
1421      debugger_break(machine());
1422   }
1423}
1424
13671425void arm_cpu_device::HandleCoPro( UINT32 insn )
13681426{
13691427   UINT32 rn=(insn>>12)&0xf;
trunk/src/emu/cpu/arm/arm.h
r29501r29502
1414 *  PUBLIC FUNCTIONS
1515 ***************************************************************************************************/
1616
17enum
18{
19   ARM_COPRO_TYPE_UNKNOWN_CP15 = 0,
20   ARM_COPRO_TYPE_VL86C020
21};
1722
23struct arm_interface
24{
25   UINT8 coprotype;
26};
27
28#define ARM_INTERFACE(name) \
29   const arm_interface (name) =
30
31
1832enum
1933{
2034   ARM32_PC=0,
r29501r29502
2539};
2640
2741
28class arm_cpu_device : public cpu_device
42class arm_cpu_device : public cpu_device,
43                    public arm_interface
2944{
3045public:
3146   // construction/destruction
r29501r29502
3449
3550protected:
3651   // device-level overrides
52   virtual void device_config_complete();
3753   virtual void device_start();
3854   virtual void device_reset();
3955
r29501r29502
8096   void HandleMemSingle(UINT32 insn);
8197   void HandleMemBlock(UINT32 insn);
8298   void HandleCoPro(UINT32 insn);
99   void HandleCoProVL86C020(UINT32 insn);
83100   UINT32 decodeShift(UINT32 insn, UINT32 *pCarry);
84101   void arm_check_irq_state();
85102   int loadInc(UINT32 pat, UINT32 rbv, UINT32 s);
trunk/src/mess/drivers/a310.c
r29501r29502
134134{
135135   archimedes_init();
136136
137
138
137139   // reset the DAC to centerline
138140   //m_dac->write_signed8(0x80);
139141}
r29501r29502
160162
161163   if(newval && !oldval)
162164      m_kart->send_keycode_down(row_val,col_val);
163   
165
164166   if(oldval && !newval)
165167      m_kart->send_keycode_up(row_val,col_val);
166168}
r29501r29502
277279    PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?)
278280    PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?)
279281
280
281282   PORT_START("via1a") /* VIA #1 PORT A */
282283   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1)
283284   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2)
r29501r29502
325326   DEVCB_DRIVER_LINE_MEMBER(archimedes_state, a310_kart_rx_w)
326327};
327328
329static ARM_INTERFACE( a310_config )
330{
331   ARM_COPRO_TYPE_VL86C020
332};
333
328334static MACHINE_CONFIG_START( a310, a310_state )
329335   /* basic machine hardware */
330336   MCFG_CPU_ADD("maincpu", ARM, 8000000)        /* 8 MHz */
331337   MCFG_CPU_PROGRAM_MAP(a310_mem)
338   MCFG_CPU_CONFIG(a310_config)
332339
333340   MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency
334341

Previous 199869 Revisions Next


© 1997-2024 The MAME Team