summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2017-09-14 21:53:02 +0200
committer angelosa <salese_corp_ltd@email.it>2017-09-14 21:56:30 +0200
commitb4eda1ffb324ff27e3186bbf138316508c87cd00 (patch)
tree8749a9fc633911842067db83c89c3d5bfbf75f1b
parent227ae7045d085f7ca400d24ea1901c5974891e9e (diff)
pacman.cpp: changed RNG function for alibaba, fixes inp playback [Angelo Salese]
smc777.cpp: minor cleanup (nw)
-rw-r--r--src/mame/drivers/pacman.cpp5
-rw-r--r--src/mame/drivers/smc777.cpp4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp
index b1c2bd2924f..21dc50083a0 100644
--- a/src/mame/drivers/pacman.cpp
+++ b/src/mame/drivers/pacman.cpp
@@ -554,7 +554,10 @@ READ8_MEMBER(pacman_state::alibaba_mystery_1_r)
{
/* The return value determines what the mystery item is. Each bit corresponds
to a question mark */
- return machine().rand() & 0x0f;
+ // we use z80 R register due of a bug in rand() function (inp desyncing on playback, supposedly caused by emu/ioport.cpp line 498)
+ // it needs to be changed anyway by testing this device on real HW
+ //return machine().rand() & 0x0f;
+ return m_maincpu->state_int(Z80_R) & 0x0f;
}
diff --git a/src/mame/drivers/smc777.cpp b/src/mame/drivers/smc777.cpp
index 052c8b5d3f2..b652ead85a8 100644
--- a/src/mame/drivers/smc777.cpp
+++ b/src/mame/drivers/smc777.cpp
@@ -515,7 +515,7 @@ WRITE8_MEMBER(smc777_state::system_output_w)
{
case 0x00:
m_raminh_pending_change = ((data & 0x10) >> 4) ^ 1;
- m_raminh_prefetch = (uint8_t)(space.device().state().state_int(Z80_R)) & 0x7f;
+ m_raminh_prefetch = (uint8_t)(m_maincpu->state_int(Z80_R)) & 0x7f;
break;
case 0x02: printf("Interlace %s\n",data & 0x10 ? "on" : "off"); break;
case 0x05: m_beeper->set_state(data & 0x10); break;
@@ -571,7 +571,7 @@ READ8_MEMBER(smc777_state::smc777_mem_r)
if(m_raminh_prefetch != 0xff) //do the bankswitch AFTER that the prefetch instruction is executed (FIXME: this is an hackish implementation)
{
- z80_r = (uint8_t)space.device().state().state_int(Z80_R);
+ z80_r = (uint8_t)m_maincpu->state_int(Z80_R);
if(z80_r == ((m_raminh_prefetch+2) & 0x7f))
{