trunk/src/emu/cpu/arm/arm.c
| r29501 | r29502 | |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
| 251 | |
| 251 | 252 | void arm_cpu_device::cpu_write32( int addr, UINT32 data ) |
| 252 | 253 | { |
| 253 | 254 | /* Unaligned writes are treated as normal writes */ |
| r29501 | r29502 | |
| 309 | 310 | |
| 310 | 311 | /***************************************************************************/ |
| 311 | 312 | |
| 313 | void 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 | |
| 312 | 327 | void arm_cpu_device::device_reset() |
| 313 | 328 | { |
| 314 | 329 | for ( int i = 0; i < 27; i++ ) |
| r29501 | r29502 | |
| 413 | 428 | } |
| 414 | 429 | else if ((insn & 0x0f000000u) == 0x0e000000u) /* Coprocessor */ |
| 415 | 430 | { |
| 416 | | HandleCoPro(insn); |
| 431 | if(coprotype == 1) |
| 432 | HandleCoProVL86C020(insn); |
| 433 | else |
| 434 | HandleCoPro(insn); |
| 435 | |
| 417 | 436 | R15 += 4; |
| 418 | 437 | } |
| 419 | 438 | else if ((insn & 0x0f000000u) == 0x0f000000u) /* Software interrupt */ |
| r29501 | r29502 | |
| 1363 | 1382 | return accumulator; |
| 1364 | 1383 | } |
| 1365 | 1384 | |
| 1385 | void arm_cpu_device::HandleCoProVL86C020( UINT32 insn ) |
| 1386 | { |
| 1387 | UINT32 rn=(insn>>12)&0xf; |
| 1388 | UINT32 crn=(insn>>16)&0xf; |
| 1366 | 1389 | |
| 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 | |
| 1367 | 1425 | void arm_cpu_device::HandleCoPro( UINT32 insn ) |
| 1368 | 1426 | { |
| 1369 | 1427 | UINT32 rn=(insn>>12)&0xf; |
trunk/src/emu/cpu/arm/arm.h
| r29501 | r29502 | |
| 14 | 14 | * PUBLIC FUNCTIONS |
| 15 | 15 | ***************************************************************************************************/ |
| 16 | 16 | |
| 17 | enum |
| 18 | { |
| 19 | ARM_COPRO_TYPE_UNKNOWN_CP15 = 0, |
| 20 | ARM_COPRO_TYPE_VL86C020 |
| 21 | }; |
| 17 | 22 | |
| 23 | struct arm_interface |
| 24 | { |
| 25 | UINT8 coprotype; |
| 26 | }; |
| 27 | |
| 28 | #define ARM_INTERFACE(name) \ |
| 29 | const arm_interface (name) = |
| 30 | |
| 31 | |
| 18 | 32 | enum |
| 19 | 33 | { |
| 20 | 34 | ARM32_PC=0, |
| r29501 | r29502 | |
| 25 | 39 | }; |
| 26 | 40 | |
| 27 | 41 | |
| 28 | | class arm_cpu_device : public cpu_device |
| 42 | class arm_cpu_device : public cpu_device, |
| 43 | public arm_interface |
| 29 | 44 | { |
| 30 | 45 | public: |
| 31 | 46 | // construction/destruction |
| r29501 | r29502 | |
| 34 | 49 | |
| 35 | 50 | protected: |
| 36 | 51 | // device-level overrides |
| 52 | virtual void device_config_complete(); |
| 37 | 53 | virtual void device_start(); |
| 38 | 54 | virtual void device_reset(); |
| 39 | 55 | |
| r29501 | r29502 | |
| 80 | 96 | void HandleMemSingle(UINT32 insn); |
| 81 | 97 | void HandleMemBlock(UINT32 insn); |
| 82 | 98 | void HandleCoPro(UINT32 insn); |
| 99 | void HandleCoProVL86C020(UINT32 insn); |
| 83 | 100 | UINT32 decodeShift(UINT32 insn, UINT32 *pCarry); |
| 84 | 101 | void arm_check_irq_state(); |
| 85 | 102 | int loadInc(UINT32 pat, UINT32 rbv, UINT32 s); |
trunk/src/mess/drivers/a310.c
| r29501 | r29502 | |
| 134 | 134 | { |
| 135 | 135 | archimedes_init(); |
| 136 | 136 | |
| 137 | |
| 138 | |
| 137 | 139 | // reset the DAC to centerline |
| 138 | 140 | //m_dac->write_signed8(0x80); |
| 139 | 141 | } |
| r29501 | r29502 | |
| 160 | 162 | |
| 161 | 163 | if(newval && !oldval) |
| 162 | 164 | m_kart->send_keycode_down(row_val,col_val); |
| 163 | | |
| 165 | |
| 164 | 166 | if(oldval && !newval) |
| 165 | 167 | m_kart->send_keycode_up(row_val,col_val); |
| 166 | 168 | } |
| r29501 | r29502 | |
| 277 | 279 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?) |
| 278 | 280 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?) |
| 279 | 281 | |
| 280 | | |
| 281 | 282 | PORT_START("via1a") /* VIA #1 PORT A */ |
| 282 | 283 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(1) |
| 283 | 284 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_PLAYER(2) |
| r29501 | r29502 | |
| 325 | 326 | DEVCB_DRIVER_LINE_MEMBER(archimedes_state, a310_kart_rx_w) |
| 326 | 327 | }; |
| 327 | 328 | |
| 329 | static ARM_INTERFACE( a310_config ) |
| 330 | { |
| 331 | ARM_COPRO_TYPE_VL86C020 |
| 332 | }; |
| 333 | |
| 328 | 334 | static MACHINE_CONFIG_START( a310, a310_state ) |
| 329 | 335 | /* basic machine hardware */ |
| 330 | 336 | MCFG_CPU_ADD("maincpu", ARM, 8000000) /* 8 MHz */ |
| 331 | 337 | MCFG_CPU_PROGRAM_MAP(a310_mem) |
| 338 | MCFG_CPU_CONFIG(a310_config) |
| 332 | 339 | |
| 333 | 340 | MCFG_AAKART_ADD("kart", 8000000/256, kart_interface) // TODO: frequency |
| 334 | 341 | |