trunk/src/mess/machine/mtx.c
| r18230 | r18231 | |
| 114 | 114 | mtx_sound_strobe_r - sound strobe |
| 115 | 115 | -------------------------------------------------*/ |
| 116 | 116 | |
| 117 | | READ8_DEVICE_HANDLER( mtx_sound_strobe_r ) |
| 117 | READ8_MEMBER(mtx_state::mtx_sound_strobe_r) |
| 118 | 118 | { |
| 119 | | mtx_state *state = space.machine().driver_data<mtx_state>(); |
| 119 | m_sn->write(space, 0, m_sound_latch); |
| 120 | 120 | |
| 121 | | sn76496_w(device, space, 0, state->m_sound_latch); |
| 122 | | |
| 123 | 121 | return 0xff; |
| 124 | 122 | } |
| 125 | 123 | |
| r18230 | r18231 | |
| 129 | 127 | |
| 130 | 128 | WRITE8_MEMBER(mtx_state::mtx_sound_latch_w) |
| 131 | 129 | { |
| 132 | | |
| 133 | 130 | m_sound_latch = data; |
| 134 | 131 | } |
| 135 | 132 | |
| r18230 | r18231 | |
| 191 | 188 | |
| 192 | 189 | WRITE8_MEMBER(mtx_state::mtx_sense_w) |
| 193 | 190 | { |
| 194 | | |
| 195 | 191 | m_key_sense = data; |
| 196 | 192 | } |
| 197 | 193 | |
| r18230 | r18231 | |
| 201 | 197 | |
| 202 | 198 | READ8_MEMBER(mtx_state::mtx_key_lo_r) |
| 203 | 199 | { |
| 204 | | |
| 205 | 200 | UINT8 data = 0xff; |
| 206 | 201 | |
| 207 | 202 | if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read(); |
| r18230 | r18231 | |
| 222 | 217 | |
| 223 | 218 | READ8_MEMBER(mtx_state::mtx_key_hi_r) |
| 224 | 219 | { |
| 225 | | |
| 226 | 220 | UINT8 data = ioport("country_code")->read(); |
| 227 | 221 | |
| 228 | 222 | if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read() >> 8; |
trunk/src/mess/includes/mtx.h
| r18230 | r18231 | |
| 11 | 11 | #include "imagedev/cassette.h" |
| 12 | 12 | #include "machine/ctronics.h" |
| 13 | 13 | #include "machine/z80ctc.h" |
| 14 | #include "sound/sn76496.h" |
| 14 | 15 | |
| 15 | 16 | #define Z80_TAG "z80" |
| 16 | 17 | #define Z80CTC_TAG "z80ctc" |
| r18230 | r18231 | |
| 26 | 27 | { |
| 27 | 28 | public: |
| 28 | 29 | mtx_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | | : driver_device(mconfig, type, tag) { } |
| 30 | : driver_device(mconfig, type, tag), |
| 31 | m_sn(*this, SN76489A_TAG) |
| 32 | { } |
| 30 | 33 | |
| 34 | required_device<sn76489a_new_device> m_sn; |
| 35 | |
| 31 | 36 | /* keyboard state */ |
| 32 | 37 | UINT8 m_key_sense; |
| 33 | 38 | |
| r18230 | r18231 | |
| 46 | 51 | |
| 47 | 52 | /* timers */ |
| 48 | 53 | device_t *m_cassette_timer; |
| 54 | |
| 55 | DECLARE_READ8_MEMBER(mtx_sound_strobe_r); |
| 49 | 56 | DECLARE_WRITE8_MEMBER(mtx_bankswitch_w); |
| 50 | 57 | DECLARE_WRITE8_MEMBER(mtx_sound_latch_w); |
| 51 | 58 | DECLARE_WRITE8_MEMBER(mtx_sense_w); |
| r18230 | r18231 | |
| 64 | 71 | |
| 65 | 72 | /*----------- defined in machine/mtx.c -----------*/ |
| 66 | 73 | |
| 67 | | |
| 68 | | |
| 69 | 74 | SNAPSHOT_LOAD( mtx ); |
| 70 | 75 | |
| 71 | | |
| 72 | | /* Sound */ |
| 73 | | DECLARE_READ8_DEVICE_HANDLER( mtx_sound_strobe_r ); |
| 74 | | |
| 75 | 76 | /* Cassette */ |
| 76 | 77 | DECLARE_WRITE8_DEVICE_HANDLER( mtx_cst_w ); |
| 77 | 78 | |
trunk/src/mess/drivers/mtx.c
| r18230 | r18231 | |
| 59 | 59 | AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_strobe_r) AM_WRITE(mtx_bankswitch_w) |
| 60 | 60 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("tms9929a", tms9929a_device, vram_read, vram_write) |
| 61 | 61 | AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("tms9929a", tms9929a_device, register_read, register_write) |
| 62 | | AM_RANGE(0x03, 0x03) AM_DEVREAD_LEGACY(SN76489A_TAG, mtx_sound_strobe_r) AM_DEVWRITE_LEGACY(CASSETTE_TAG, mtx_cst_w) |
| 62 | AM_RANGE(0x03, 0x03) AM_READ(mtx_sound_strobe_r) AM_DEVWRITE_LEGACY(CASSETTE_TAG, mtx_cst_w) |
| 63 | 63 | AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_prt_r) |
| 64 | 64 | AM_RANGE(0x04, 0x04) AM_DEVWRITE(CENTRONICS_TAG, centronics_device, write) |
| 65 | 65 | AM_RANGE(0x05, 0x05) AM_READWRITE(mtx_key_lo_r, mtx_sense_w) |
| r18230 | r18231 | |
| 334 | 334 | DEVCB_LINE(mtx_tms9929a_interrupt) |
| 335 | 335 | }; |
| 336 | 336 | |
| 337 | /*------------------------------------------------- |
| 338 | sn76496_config psg_intf |
| 339 | -------------------------------------------------*/ |
| 340 | |
| 341 | static const sn76496_config psg_intf = |
| 342 | { |
| 343 | DEVCB_NULL |
| 344 | }; |
| 345 | |
| 346 | |
| 337 | 347 | /*************************************************************************** |
| 338 | 348 | MACHINE DRIVERS |
| 339 | 349 | ***************************************************************************/ |
| r18230 | r18231 | |
| 360 | 370 | |
| 361 | 371 | /* sound hardware */ |
| 362 | 372 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 363 | | MCFG_SOUND_ADD(SN76489A_TAG, SN76489A, XTAL_4MHz) |
| 373 | MCFG_SOUND_ADD(SN76489A_TAG, SN76489A_NEW, XTAL_4MHz) |
| 374 | MCFG_SOUND_CONFIG(psg_intf) |
| 364 | 375 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 365 | 376 | |
| 366 | 377 | /* devices */ |