diff options
Diffstat (limited to 'src/mame/jpm/pluto5.cpp')
-rw-r--r-- | src/mame/jpm/pluto5.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/mame/jpm/pluto5.cpp b/src/mame/jpm/pluto5.cpp index 53b83adfae3..b630fbd30b9 100644 --- a/src/mame/jpm/pluto5.cpp +++ b/src/mame/jpm/pluto5.cpp @@ -188,6 +188,9 @@ #include "machine/68340.h" #include "speaker.h" + +namespace { + class pluto5_state : public driver_device { public: @@ -201,11 +204,11 @@ public: void init_hb(); private: - uint32_t* m_cpuregion = 0; - std::unique_ptr<uint32_t[]> m_mainram; + uint16_t* m_cpuregion = 0; + std::unique_ptr<uint16_t[]> m_mainram; - uint32_t pluto5_mem_r(offs_t offset, uint32_t mem_mask = ~0); - void pluto5_mem_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + uint16_t pluto5_mem_r(offs_t offset, uint16_t mem_mask = ~0); + void pluto5_mem_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void pluto5_map(address_map &map); @@ -215,15 +218,14 @@ private: virtual void machine_start() override; }; -uint32_t pluto5_state::pluto5_mem_r(offs_t offset, uint32_t mem_mask) +uint16_t pluto5_state::pluto5_mem_r(offs_t offset, uint16_t mem_mask) { int pc = m_maincpu->pc(); - int cs = m_maincpu->get_cs(offset * 4); - + int cs = m_maincpu->get_cs(offset * 2); switch ( cs ) { case 1: - if (offset < 0x100000) // If reading beyond end of region, log error instead of crashing + if (offset < 0x200000) // If reading beyond end of region, log error instead of crashing return m_cpuregion[offset]; [[fallthrough]]; default: @@ -234,10 +236,10 @@ uint32_t pluto5_state::pluto5_mem_r(offs_t offset, uint32_t mem_mask) return 0x0000; } -void pluto5_state::pluto5_mem_w(offs_t offset, uint32_t data, uint32_t mem_mask) +void pluto5_state::pluto5_mem_w(offs_t offset, uint16_t data, uint16_t mem_mask) { int pc = m_maincpu->pc(); - int cs = m_maincpu->get_cs(offset * 4); + int cs = m_maincpu->get_cs(offset * 2); switch ( cs ) { @@ -259,8 +261,8 @@ INPUT_PORTS_END void pluto5_state::machine_start() { - m_cpuregion = (uint32_t*)memregion( "maincpu" )->base(); - m_mainram = make_unique_clear<uint32_t[]>(0x10000); + m_cpuregion = (uint16_t*)memregion( "maincpu" )->base(); + m_mainram = make_unique_clear<uint16_t[]>(0x20000); } @@ -903,8 +905,8 @@ static void astra_addresslines( uint16_t* src, size_t srcsize, int small ) { for (int x = 0; x<blocksize/2;x+=2) { - dst[((block/2)+(x/2))^1] = src[(block/2)+x+1]; - dst[((block/2)+(x/2+blocksize/4))^1] = src[(block/2)+x]; + dst[((block/2)+(x/2))] = src[(block/2)+x]; + dst[((block/2)+(x/2+blocksize/4))] = src[(block/2)+x+1]; } } @@ -931,6 +933,9 @@ void pluto5_state::init_hb() #endif } +} // anonymous namespace + + GAME( 2003, hb_junglet, 0, pluto5, pluto5, pluto5_state, init_hb, ROT0, "Sega", "Jungle Treasures", MACHINE_IS_SKELETON_MECHANICAL ) GAME( 200?, hb_cr, 0, pluto5, pluto5, pluto5_state, init_hb, ROT0, "Qps", "Cash Raker (Qps) (set 1)", MACHINE_IS_SKELETON_MECHANICAL ) |