From e23dbc99c5046bbedde25ac46afed9b42f62e4ce Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:52:13 +0100 Subject: misc/crystal.cpp: Removed hacks: (#11054) * cpu/se3208: Removed hack to ignore misaligned memory accesses. * machine/vrender0.cpp: Removed idle skip hack (it causes stability issues). * misc/crystal.cpp: Added default NVRAM contents for wulybuly with valid coinage settings. --- src/devices/cpu/se3208/se3208.cpp | 10 ---------- src/devices/machine/vrender0.cpp | 36 ------------------------------------ src/devices/machine/vrender0.h | 15 --------------- src/mame/misc/crystal.cpp | 5 ++++- 4 files changed, 4 insertions(+), 62 deletions(-) diff --git a/src/devices/cpu/se3208/se3208.cpp b/src/devices/cpu/se3208/se3208.cpp index a93aee29762..ced0649feb0 100644 --- a/src/devices/cpu/se3208/se3208.cpp +++ b/src/devices/cpu/se3208/se3208.cpp @@ -31,10 +31,6 @@ enum : uint32_t //Precompute the instruction decoding in a big table #define INST(a) void se3208_device::a(uint16_t Opcode) -// officeye and donghaer perform unaligned DWORD accesses, allowing them to happen causes the games to malfunction. -// are such accesses simply illegal, be handled in a different way, or simply not be happening in the first place? -#define ALLOW_UNALIGNED_DWORD_ACCESS 0 - DEFINE_DEVICE_TYPE(SE3208, se3208_device, "se3208", "ADChips SE3208") @@ -82,11 +78,7 @@ uint32_t se3208_device::SE3208_Read32(uint32_t address) else { osd_printf_debug("%08x: dword READ unaligned %08x\n", m_PC, address); -#if ALLOW_UNALIGNED_DWORD_ACCESS return m_program.read_byte(address) | m_program.read_byte(address + 1) << 8 | m_program.read_byte(address + 2) << 16 | m_program.read_byte(address + 3) << 24; -#else - return 0; -#endif } } @@ -114,12 +106,10 @@ void se3208_device::SE3208_Write32(uint32_t address, uint32_t data) m_program.write_dword(address, data); else { -#if ALLOW_UNALIGNED_DWORD_ACCESS m_program.write_byte(address, data & 0xff); m_program.write_byte(address + 1, (data >> 8) & 0xff); m_program.write_byte(address + 2, (data >> 16) & 0xff); m_program.write_byte(address + 3, (data >> 24) & 0xff); -#endif osd_printf_debug("%08x: dword WRITE unaligned %08x\n", m_PC, address); } } diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp index f59edbe4a2e..23bd8b5b1d5 100644 --- a/src/devices/machine/vrender0.cpp +++ b/src/devices/machine/vrender0.cpp @@ -131,9 +131,6 @@ void vrender0soc_device::device_add_mconfig(machine_config &config) m_screen->set_palette(m_palette); VIDEO_VRENDER0(config, m_vr0vid, 14318180); -#ifdef IDLE_LOOP_SPEEDUP - m_vr0vid->idleskip_cb().set(FUNC(vrender0soc_device::idle_skip_speedup_w)); -#endif PALETTE(config, m_palette, palette_device::RGB_565); @@ -192,10 +189,6 @@ void vrender0soc_device::device_start() save_item(NAME(m_dma[1].src)); save_item(NAME(m_dma[1].dst)); save_item(NAME(m_dma[1].size)); - -#ifdef IDLE_LOOP_SPEEDUP - save_item(NAME(m_FlipCntRead)); -#endif } void vrender0soc_device::write_line_tx(int port, uint8_t value) @@ -226,10 +219,6 @@ void vrender0soc_device::device_reset() m_timer_control[i] = 0xff << 8; m_Timer[i]->adjust(attotime::never); } - -#ifdef IDLE_LOOP_SPEEDUP - m_FlipCntRead = 0; -#endif } @@ -318,10 +307,6 @@ void vrender0soc_device::IntReq( int num ) m_intst |= (1 << num); m_host_cpu->set_input_line(SE3208_INT, ASSERT_LINE); } - -#ifdef IDLE_LOOP_SPEEDUP - idle_skip_resume_w(ASSERT_LINE); -#endif } @@ -733,24 +718,3 @@ WRITE_LINE_MEMBER(vrender0soc_device::screen_vblank) m_vr0vid->execute_flipping(); } } - -/* - * - * Hacks - * - */ - -#ifdef IDLE_LOOP_SPEEDUP -WRITE_LINE_MEMBER(vrender0soc_device::idle_skip_resume_w) -{ - m_FlipCntRead = 0; - m_host_cpu->resume(SUSPEND_REASON_SPIN); -} - -WRITE_LINE_MEMBER(vrender0soc_device::idle_skip_speedup_w) -{ - m_FlipCntRead++; - if (m_FlipCntRead >= 16 && irq_pending() == false && state == ASSERT_LINE) - m_host_cpu->suspend(SUSPEND_REASON_SPIN, 1); -} -#endif diff --git a/src/devices/machine/vrender0.h b/src/devices/machine/vrender0.h index 8a3b19d59fb..b5c3774e425 100644 --- a/src/devices/machine/vrender0.h +++ b/src/devices/machine/vrender0.h @@ -19,14 +19,6 @@ #include "speaker.h" #include "diserial.h" -//************************************************************************** -// INTERFACE CONFIGURATION MACROS -//************************************************************************** - -#define IDLE_LOOP_SPEEDUP - - - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -191,13 +183,6 @@ private: void textureram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t frameram_r(offs_t offset); void frameram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - // Hacks -#ifdef IDLE_LOOP_SPEEDUP - uint8_t m_FlipCntRead = 0; - DECLARE_WRITE_LINE_MEMBER(idle_skip_resume_w); - DECLARE_WRITE_LINE_MEMBER(idle_skip_speedup_w); -#endif }; diff --git a/src/mame/misc/crystal.cpp b/src/mame/misc/crystal.cpp index 8106a9dce37..0d1cf1e1882 100644 --- a/src/mame/misc/crystal.cpp +++ b/src/mame/misc/crystal.cpp @@ -655,6 +655,9 @@ ROM_START( wulybuly ) ROM_REGION32_LE( 0x1000000, "flash", 0 ) ROM_LOAD( "u1", 0x0000000, 0x1000000, CRC(7406f5db) SHA1(dd53afb08d0567241d08d2422c672d429ef9b78f) ) + + ROM_REGION( 0x10000, "nvram", 0 ) // otherwise it defaults to completely invalid coinage + ROM_LOAD( "nvram", 0x0000000, 0x10000, CRC(5908b829) SHA1(c23180f1b3a80e29c61e25584ffa929e41479b56) ) ROM_END ROM_START( urachamu ) @@ -819,5 +822,5 @@ GAME( 2001, officeye, 0, crystal, officeye, crystal_state, init_officeye GAME( 2001, donghaer, crysbios, crystal, crystal, crystal_state, init_donghaer, ROT0, "Danbi", "Donggul Donggul Haerong", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // 2 players mode has GFX issues, seldomly hangs GAME( 2002, urachamu, crysbios, crystal, urachamu, crystal_state, empty_init, ROT0, "GamToU", "Urachacha Mudaeri (Korea)", 0 ) // lamps, verify game timings GAME( 2003, topbladv, crysbios, crystal, topbladv, crystal_state, init_topbladv, ROT0, "SonoKong / Expotato", "Top Blade V", 0 ) -GAME( 200?, wulybuly, crysbios, crystal, wulybuly, crystal_state, empty_init, ROT0, "", "Wully Bully", MACHINE_NOT_WORKING ) // no actual graphics except offset text, confirmed to have no PIC protection so failing elsewhere +GAME( 200?, wulybuly, crysbios, crystal, wulybuly, crystal_state, empty_init, ROT0, "", "Wully Bully", MACHINE_NOT_WORKING ) GAME( 2002, maldaiza, crysbios, crystal, crystal, crystal_state, init_maldaiza, ROT0, "Big A Korea", "Maldaliza", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // PIC hookup -- cgit v1.2.3