mirror of
https://github.com/holub/mame
synced 2025-05-18 11:39:29 +03:00
Added ay8910_reset_w() function, used by Joyful Road / Munch Mobile for resetting the AYs on-the-fly. Fixes substained sounds in the aforementioned game. [Lord Nightmare, Angelo Salese]
This commit is contained in:
parent
fcdd0a5c1d
commit
1b880198ff
@ -1116,6 +1116,11 @@ WRITE8_DEVICE_HANDLER( ay8910_data_w )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WRITE8_DEVICE_HANDLER( ay8910_reset_w )
|
||||||
|
{
|
||||||
|
ay8910_reset_ym(get_safe_token(device));
|
||||||
|
}
|
||||||
|
|
||||||
static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8, 9, 10, 14, 15 };
|
static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8, 9, 10, 14, 15 };
|
||||||
|
|
||||||
READ8_DEVICE_HANDLER( ay8914_r )
|
READ8_DEVICE_HANDLER( ay8914_r )
|
||||||
@ -1132,6 +1137,8 @@ WRITE8_DEVICE_HANDLER( ay8914_w )
|
|||||||
ay8910_data_w(device, 0, data & 0xff);
|
ay8910_data_w(device, 0, data & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
|
DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910);
|
||||||
DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
|
DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912);
|
||||||
DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
|
DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913);
|
||||||
|
@ -91,6 +91,9 @@ READ8_DEVICE_HANDLER( ay8910_r );
|
|||||||
WRITE8_DEVICE_HANDLER( ay8910_address_w );
|
WRITE8_DEVICE_HANDLER( ay8910_address_w );
|
||||||
WRITE8_DEVICE_HANDLER( ay8910_data_w );
|
WRITE8_DEVICE_HANDLER( ay8910_data_w );
|
||||||
|
|
||||||
|
/* /RES */
|
||||||
|
WRITE8_DEVICE_HANDLER( ay8910_reset_w );
|
||||||
|
|
||||||
/* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
|
/* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */
|
||||||
WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
|
WRITE8_DEVICE_HANDLER( ay8910_data_address_w );
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
Known Issues:
|
Known Issues:
|
||||||
- it's unclear if mirroring the videoram chunks is correct behavior
|
- it's unclear if mirroring the videoram chunks is correct behavior
|
||||||
- several unmapped registers
|
- several unmapped registers
|
||||||
- sustained sounds (when there should be silence)
|
|
||||||
|
|
||||||
Stephh's notes (based on the game Z80 code and some tests) :
|
Stephh's notes (based on the game Z80 code and some tests) :
|
||||||
|
|
||||||
@ -55,10 +54,9 @@ static TIMER_DEVICE_CALLBACK( mnchmobl_interrupt )
|
|||||||
|
|
||||||
static INTERRUPT_GEN( mnchmobl_sound_irq )
|
static INTERRUPT_GEN( mnchmobl_sound_irq )
|
||||||
{
|
{
|
||||||
munchmo_state *state = device->machine().driver_data<munchmo_state>();
|
//munchmo_state *state = device->machine().driver_data<munchmo_state>();
|
||||||
|
|
||||||
if (!(state->m_sound_nmi_enable))
|
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
|
||||||
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( mnchmobl_soundlatch_w )
|
static WRITE8_HANDLER( mnchmobl_soundlatch_w )
|
||||||
@ -69,12 +67,6 @@ static WRITE8_HANDLER( mnchmobl_soundlatch_w )
|
|||||||
device_set_input_line(state->m_audiocpu, 0, HOLD_LINE );
|
device_set_input_line(state->m_audiocpu, 0, HOLD_LINE );
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( sound_nmi_enable_w )
|
|
||||||
{
|
|
||||||
munchmo_state *state = space->machine().driver_data<munchmo_state>();
|
|
||||||
state->m_sound_nmi_enable = data & 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static WRITE8_HANDLER( sound_nmi_ack_w )
|
static WRITE8_HANDLER( sound_nmi_ack_w )
|
||||||
{
|
{
|
||||||
@ -82,6 +74,11 @@ static WRITE8_HANDLER( sound_nmi_ack_w )
|
|||||||
device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
|
device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static READ8_DEVICE_HANDLER( munchmo_ayreset_r )
|
||||||
|
{
|
||||||
|
ay8910_reset_w(device,0,0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************
|
/*************************************
|
||||||
*
|
*
|
||||||
@ -113,17 +110,18 @@ static ADDRESS_MAP_START( mnchmobl_map, AS_PROGRAM, 8 )
|
|||||||
AM_RANGE(0xbf03, 0xbf03) AM_READ_PORT("P2")
|
AM_RANGE(0xbf03, 0xbf03) AM_READ_PORT("P2")
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
/* memory map provided thru schematics */
|
||||||
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
|
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
|
||||||
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
AM_RANGE(0x0000, 0x1fff) AM_ROM
|
||||||
AM_RANGE(0x2000, 0x2000) AM_READ(soundlatch_r)
|
AM_RANGE(0x2000, 0x3fff) AM_READ(soundlatch_r)
|
||||||
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_data_w)
|
AM_RANGE(0x4000, 0x4fff) AM_DEVWRITE("ay1", ay8910_data_w)
|
||||||
AM_RANGE(0x5000, 0x5000) AM_DEVWRITE("ay1", ay8910_address_w)
|
AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("ay1", ay8910_address_w)
|
||||||
AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_data_w)
|
AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE("ay2", ay8910_data_w)
|
||||||
AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("ay2", ay8910_address_w)
|
AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE("ay2", ay8910_address_w)
|
||||||
//AM_RANGE(0x8000, 0x8000) AM_WRITE(mnchmobl_soundlatch_w) /* ? */
|
AM_RANGE(0x8000, 0x9fff) AM_DEVREADWRITE("ay1", munchmo_ayreset_r, ay8910_reset_w)
|
||||||
AM_RANGE(0xa000, 0xa000) AM_WRITE(sound_nmi_enable_w)
|
AM_RANGE(0xa000, 0xbfff) AM_DEVREADWRITE("ay2", munchmo_ayreset_r, ay8910_reset_w)
|
||||||
AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_nmi_ack_w)
|
AM_RANGE(0xc000, 0xdfff) AM_WRITE(sound_nmi_ack_w)
|
||||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM
|
AM_RANGE(0xe000, 0xe7ff) AM_MIRROR(0x1800) AM_RAM // is mirror ok?
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
|
|
||||||
@ -435,5 +433,5 @@ ROM_END
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
GAME( 1983, joyfulr, 0, mnchmobl, mnchmobl, 0, ROT270, "SNK", "Joyful Road (Japan)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
|
GAME( 1983, joyfulr, 0, mnchmobl, mnchmobl, 0, ROT270, "SNK", "Joyful Road (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
|
||||||
GAME( 1983, mnchmobl, joyfulr, mnchmobl, mnchmobl, 0, ROT270, "SNK (Centuri license)", "Munch Mobile (US)", GAME_IMPERFECT_SOUND | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
|
GAME( 1983, mnchmobl, joyfulr, mnchmobl, mnchmobl, 0, ROT270, "SNK (Centuri license)", "Munch Mobile (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
|
||||||
|
@ -25,7 +25,6 @@ public:
|
|||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
int m_nmi_enable;
|
int m_nmi_enable;
|
||||||
UINT8 m_sound_nmi_enable;
|
|
||||||
|
|
||||||
/* devices */
|
/* devices */
|
||||||
device_t *m_maincpu;
|
device_t *m_maincpu;
|
||||||
|
Loading…
Reference in New Issue
Block a user