Skip to content

Commit

Permalink
pacman.cpp: changed RNG function for alibaba, fixes inp playback [Ang…
Browse files Browse the repository at this point in the history
…elo Salese]

smc777.cpp: minor cleanup (nw)
  • Loading branch information
angelosa committed Sep 14, 2017
1 parent 227ae70 commit b4eda1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/mame/drivers/pacman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
4 changes: 2 additions & 2 deletions src/mame/drivers/smc777.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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))
{
Expand Down

0 comments on commit b4eda1f

Please sign in to comment.