From 1a2d6fbdf5d126bc58237bb2a896414dec264a24 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 16 Sep 2019 04:00:44 +0200 Subject: Hookup ARM data abort line --- hash/archimedes.xml | 38 ++++++++++++++++++++++++-------------- src/devices/cpu/arm/arm.cpp | 24 ++++++++++++++++++------ src/devices/cpu/arm/arm.h | 2 ++ src/mame/machine/archimds.cpp | 12 ++++++++++++ 4 files changed, 56 insertions(+), 20 deletions(-) diff --git a/hash/archimedes.xml b/hash/archimedes.xml index 5b496d91e8b..478b38ba398 100644 --- a/hash/archimedes.xml +++ b/hash/archimedes.xml @@ -218,7 +218,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Aggressor 1992 @@ -302,8 +303,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - - + + Aliped 1990 Archimedes World @@ -314,7 +315,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + Aliped (Alt) 1990 @@ -1076,11 +1077,12 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + Elite 1991 Hybrid Technology + @@ -1088,11 +1090,12 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + Elite (Alt) 1991 Hybrid Technology + @@ -1315,7 +1318,9 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + + Flight Sim Toolkit 1991 @@ -1776,8 +1781,10 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - - + + + + Legend of the Lost Temple 1992 Eterna @@ -2650,7 +2657,7 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + Star Fighter 3000 1994 @@ -2669,8 +2676,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - - + + Star Fighter 3000 (Demo) 1994 Fednet @@ -2943,7 +2950,8 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + White Magic 2 1989 @@ -3496,12 +3504,14 @@ Zelanites: The Onslaught by Micro Power (RiscOS2) - + + Time Zone 19?? <homebrew> + diff --git a/src/devices/cpu/arm/arm.cpp b/src/devices/cpu/arm/arm.cpp index 2003421fa48..285c51d64fe 100644 --- a/src/devices/cpu/arm/arm.cpp +++ b/src/devices/cpu/arm/arm.cpp @@ -451,8 +451,8 @@ void arm_cpu_device::execute_run() void arm_cpu_device::HandleTrap(uint8_t vector) { - if (vector == 0x04) - printf("%08x\n",R15&0x3fffffc); +// if (vector == 0x04) +// printf("%08x\n",R15&0x3fffffc); uint32_t pc = R15+4; R15 = eARM_MODE_SVC; /* Set SVC mode so PC is saved to correct R14 bank */ @@ -462,6 +462,18 @@ void arm_cpu_device::HandleTrap(uint8_t vector) m_icount -= 2 * S_CYCLE + N_CYCLE; } +WRITE_LINE_MEMBER( arm_cpu_device::data_abort_w ) +{ + if (state) + { + //printf("%08x\n",R15 & 0x3fffffc); + R15 -= 4; + // TODO: it's really vector 0x10 + HandleTrap(0x10-4); + //machine().debug_break(); + } +} + void arm_cpu_device::arm_check_irq_state() { uint32_t pc = R15+4; /* save old pc (already incremented in pipeline) */ @@ -1522,7 +1534,7 @@ bool arm_cpu_device::HandleCoProVL86C020( uint32_t insn ) // TODO: check for user mode, throw access violation m_coproFPcr = GetRegister(rn); // TODO: check what it tries to do - printf("%08x: WFC write %08x\n", R15 & 0x3fffffc, m_coproFPcr); + //printf("%08x: WFC write %08x\n", R15 & 0x3fffffc, m_coproFPcr); } // RFC - Read Floating Point Control else if ( (insn&0x0fff0fff) == 0x0e500110) @@ -1532,10 +1544,10 @@ bool arm_cpu_device::HandleCoProVL86C020( uint32_t insn ) } else { - printf("%08x OPCODE\n",insn); + //printf("%08x OPCODE\n",insn); HandleTrap(0x04); - if ((insn & 0x0e000000) == 0x0e000000) - machine().debug_break(); + //if ((insn & 0x0e000000) == 0x0e000000) + // machine().debug_break(); // HandleFPU(insn); //printf("%08x: Unimplemented VL86C020 copro instruction %08x %d %d\n", R15 & 0x3ffffff, insn,rn,crn); diff --git a/src/devices/cpu/arm/arm.h b/src/devices/cpu/arm/arm.h index bedd2b7b3f5..75f5a7a6d08 100644 --- a/src/devices/cpu/arm/arm.h +++ b/src/devices/cpu/arm/arm.h @@ -30,6 +30,7 @@ public: arm_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void set_copro_type(copro_type type) { m_copro_type = type; } + DECLARE_WRITE_LINE_MEMBER( data_abort_w ); protected: enum @@ -72,6 +73,7 @@ protected: uint32_t m_coproRegister[16]; uint8_t m_pendingIrq; uint8_t m_pendingFiq; + uint8_t m_pendingDataAbort; address_space *m_program; std::function m_pr32; endianness_t m_endian; diff --git a/src/mame/machine/archimds.cpp b/src/mame/machine/archimds.cpp index 319c963afa5..d9025a28b58 100644 --- a/src/mame/machine/archimds.cpp +++ b/src/mame/machine/archimds.cpp @@ -322,6 +322,10 @@ void archimedes_state::archimedes_init() m_snd_timer->adjust(attotime::never); } +// TODO: access level permissions against current ARM mode +// 1x SVC can r/w, OS read only, punt if user mode +// 01 SVC and OS can r/w, user read only, punt otherwise +// 00 free for all READ32_MEMBER(archimedes_state::archimedes_memc_logical_r) { uint32_t page, poffs; @@ -350,6 +354,8 @@ READ32_MEMBER(archimedes_state::archimedes_memc_logical_r) else { //printf("ARCHIMEDES_MEMC: Reading unmapped page %02x\n",page); + if (!machine().side_effects_disabled()) + m_maincpu->data_abort_w(ASSERT_LINE); return 0xdeadbeef; } } @@ -367,6 +373,7 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_logical_w) // if the boot ROM is mapped, ignore writes if (m_memc_latchrom) { + // TODO: verify if this causes data abort or not return; } else @@ -383,6 +390,8 @@ WRITE32_MEMBER(archimedes_state::archimedes_memc_logical_w) } else { + if (!machine().side_effects_disabled()) + m_maincpu->data_abort_w(ASSERT_LINE); //printf("ARCHIMEDES_MEMC: Writing unmapped page %02x, what do we do?\n",page); } } @@ -423,6 +432,7 @@ READ32_MEMBER(archimedes_state::aristmk5_drame_memc_logical_r) In this state, DRAM memory space is disabled. ****************************************************************************************/ + // TODO: make this an override of above if(!(m_memc_pages[page] & 0x10) && (offset <= 0x3ff)) return 0xEAD0000A; return m_archimedes_memc_physmem[((m_memc_pages[page] * page_sizes[m_memc_pagesize]) + poffs)>>2]; @@ -430,6 +440,8 @@ READ32_MEMBER(archimedes_state::aristmk5_drame_memc_logical_r) else { //printf("ARCHIMEDES_MEMC: Reading unmapped page %02x\n",page); + if (!machine().side_effects_disabled()) + m_maincpu->data_abort_w(ASSERT_LINE); return 0xdeadbeef; } } -- cgit v1.2.3