trunk/src/mame/drivers/toki.c
| r243383 | r243384 | |
| 42 | 42 | #include "sound/3812intf.h" |
| 43 | 43 | #include "includes/toki.h" |
| 44 | 44 | |
| 45 | | WRITE16_MEMBER(toki_state::tokib_soundcommand16_w) |
| 45 | WRITE16_MEMBER(toki_state::tokib_soundcommand_w) |
| 46 | 46 | { |
| 47 | 47 | soundlatch_byte_w(space, 0, data & 0xff); |
| 48 | 48 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | | READ16_MEMBER(toki_state::pip16_r) |
| 51 | READ16_MEMBER(toki_state::pip_r) |
| 52 | 52 | { |
| 53 | 53 | return ~0; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | | WRITE_LINE_MEMBER(toki_state::toki_adpcm_int) |
| 58 | WRITE_LINE_MEMBER(toki_state::tokib_adpcm_int) |
| 59 | 59 | { |
| 60 | 60 | m_msm->data_w(m_msm5205next); |
| 61 | 61 | m_msm5205next >>= 4; |
| r243383 | r243384 | |
| 65 | 65 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | WRITE8_MEMBER(toki_state::toki_adpcm_control_w) |
| 68 | WRITE8_MEMBER(toki_state::tokib_adpcm_control_w) |
| 69 | 69 | { |
| 70 | 70 | int bankaddress; |
| 71 | 71 | UINT8 *RAM = memregion("audiocpu")->base(); |
| r243383 | r243384 | |
| 78 | 78 | m_msm->reset_w(data & 0x08); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | | WRITE8_MEMBER(toki_state::toki_adpcm_data_w) |
| 81 | WRITE8_MEMBER(toki_state::tokib_adpcm_data_w) |
| 82 | 82 | { |
| 83 | 83 | m_msm5205next = data; |
| 84 | 84 | } |
| r243383 | r243384 | |
| 114 | 114 | AM_RANGE(0x071804, 0x071807) AM_WRITENOP /* sprite related, always 01be0100 */ |
| 115 | 115 | AM_RANGE(0x07180e, 0x071e45) AM_WRITEONLY AM_SHARE("spriteram") |
| 116 | 116 | AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r) /* probably */ |
| 117 | | AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand16_w) |
| 117 | AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand_w) |
| 118 | 118 | AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram") |
| 119 | 119 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW") |
| 120 | 120 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS") |
| 121 | 121 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM") |
| 122 | | AM_RANGE(0x0c000e, 0x0c000f) AM_READ(pip16_r) /* sound related, if we return 0 the code writes */ |
| 122 | AM_RANGE(0x0c000e, 0x0c000f) AM_READ(pip_r) /* sound related, if we return 0 the code writes */ |
| 123 | 123 | /* the sound command quickly followed by 0 and the */ |
| 124 | 124 | /* sound CPU often misses the command. */ |
| 125 | 125 | ADDRESS_MAP_END |
| r243383 | r243384 | |
| 129 | 129 | static ADDRESS_MAP_START( tokib_audio_map, AS_PROGRAM, 8, toki_state ) |
| 130 | 130 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 131 | 131 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 132 | | AM_RANGE(0xe000, 0xe000) AM_WRITE(toki_adpcm_control_w) /* MSM5205 + ROM bank */ |
| 133 | | AM_RANGE(0xe400, 0xe400) AM_WRITE(toki_adpcm_data_w) |
| 132 | AM_RANGE(0xe000, 0xe000) AM_WRITE(tokib_adpcm_control_w) /* MSM5205 + ROM bank */ |
| 133 | AM_RANGE(0xe400, 0xe400) AM_WRITE(tokib_adpcm_data_w) |
| 134 | 134 | AM_RANGE(0xec00, 0xec01) AM_MIRROR(0x0008) AM_DEVREADWRITE("ymsnd", ym3812_device, read, write) |
| 135 | 135 | AM_RANGE(0xf000, 0xf7ff) AM_RAM |
| 136 | 136 | AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) |
| r243383 | r243384 | |
| 463 | 463 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 464 | 464 | |
| 465 | 465 | MCFG_SOUND_ADD("msm", MSM5205, 384000) |
| 466 | | MCFG_MSM5205_VCLK_CB(WRITELINE(toki_state, toki_adpcm_int)) /* interrupt function */ |
| 466 | MCFG_MSM5205_VCLK_CB(WRITELINE(toki_state, tokib_adpcm_int)) /* interrupt function */ |
| 467 | 467 | MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B) /* 4KHz */ |
| 468 | 468 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 469 | 469 | MACHINE_CONFIG_END |
trunk/src/mame/includes/toki.h
| r243383 | r243384 | |
| 41 | 41 | tilemap_t *m_foreground_layer; |
| 42 | 42 | tilemap_t *m_text_layer; |
| 43 | 43 | |
| 44 | | DECLARE_WRITE16_MEMBER(tokib_soundcommand16_w); |
| 45 | | DECLARE_READ16_MEMBER(pip16_r); |
| 44 | DECLARE_WRITE16_MEMBER(tokib_soundcommand_w); |
| 45 | DECLARE_READ16_MEMBER(pip_r); |
| 46 | 46 | DECLARE_WRITE16_MEMBER(toki_control_w); |
| 47 | 47 | DECLARE_WRITE16_MEMBER(foreground_videoram_w); |
| 48 | 48 | DECLARE_WRITE16_MEMBER(background1_videoram_w); |
| 49 | 49 | DECLARE_WRITE16_MEMBER(background2_videoram_w); |
| 50 | | DECLARE_WRITE8_MEMBER(toki_adpcm_control_w); |
| 51 | | DECLARE_WRITE8_MEMBER(toki_adpcm_data_w); |
| 52 | | DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); |
| 50 | DECLARE_WRITE8_MEMBER(tokib_adpcm_control_w); |
| 51 | DECLARE_WRITE8_MEMBER(tokib_adpcm_data_w); |
| 52 | DECLARE_WRITE_LINE_MEMBER(tokib_adpcm_int); |
| 53 | 53 | |
| 54 | 54 | DECLARE_DRIVER_INIT(tokib); |
| 55 | 55 | DECLARE_DRIVER_INIT(jujuba); |