mirror of
https://github.com/holub/mame
synced 2025-04-25 01:40:16 +03:00
pacman.cpp: changed RNG function for alibaba, fixes inp playback [Angelo Salese]
smc777.cpp: minor cleanup (nw)
This commit is contained in:
parent
227ae7045d
commit
b4eda1ffb3
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user