Previous 199869 Revisions Next

r18231 Monday 1st October, 2012 at 13:11:37 UTC by hap
(MESS) mtx.c SN76489A_NEW, from Osso
[src/mess/drivers]mtx.c
[src/mess/includes]mtx.h
[src/mess/machine]mtx.c

trunk/src/mess/machine/mtx.c
r18230r18231
114114    mtx_sound_strobe_r - sound strobe
115115-------------------------------------------------*/
116116
117READ8_DEVICE_HANDLER( mtx_sound_strobe_r )
117READ8_MEMBER(mtx_state::mtx_sound_strobe_r)
118118{
119   mtx_state *state = space.machine().driver_data<mtx_state>();
119   m_sn->write(space, 0, m_sound_latch);
120120
121   sn76496_w(device, space, 0, state->m_sound_latch);
122
123121   return 0xff;
124122}
125123
r18230r18231
129127
130128WRITE8_MEMBER(mtx_state::mtx_sound_latch_w)
131129{
132
133130   m_sound_latch = data;
134131}
135132
r18230r18231
191188
192189WRITE8_MEMBER(mtx_state::mtx_sense_w)
193190{
194
195191   m_key_sense = data;
196192}
197193
r18230r18231
201197
202198READ8_MEMBER(mtx_state::mtx_key_lo_r)
203199{
204
205200   UINT8 data = 0xff;
206201
207202   if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read();
r18230r18231
222217
223218READ8_MEMBER(mtx_state::mtx_key_hi_r)
224219{
225
226220   UINT8 data = ioport("country_code")->read();
227221
228222   if (!(m_key_sense & 0x01)) data &= ioport("ROW0")->read() >> 8;
trunk/src/mess/includes/mtx.h
r18230r18231
1111#include "imagedev/cassette.h"
1212#include "machine/ctronics.h"
1313#include "machine/z80ctc.h"
14#include "sound/sn76496.h"
1415
1516#define Z80_TAG         "z80"
1617#define Z80CTC_TAG      "z80ctc"
r18230r18231
2627{
2728public:
2829   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   { }
3033
34   required_device<sn76489a_new_device> m_sn;
35
3136   /* keyboard state */
3237   UINT8 m_key_sense;
3338
r18230r18231
4651
4752   /* timers */
4853   device_t *m_cassette_timer;
54
55   DECLARE_READ8_MEMBER(mtx_sound_strobe_r);
4956   DECLARE_WRITE8_MEMBER(mtx_bankswitch_w);
5057   DECLARE_WRITE8_MEMBER(mtx_sound_latch_w);
5158   DECLARE_WRITE8_MEMBER(mtx_sense_w);
r18230r18231
6471
6572/*----------- defined in machine/mtx.c -----------*/
6673
67
68
6974SNAPSHOT_LOAD( mtx );
7075
71
72/* Sound */
73DECLARE_READ8_DEVICE_HANDLER( mtx_sound_strobe_r );
74
7576/* Cassette */
7677DECLARE_WRITE8_DEVICE_HANDLER( mtx_cst_w );
7778
trunk/src/mess/drivers/mtx.c
r18230r18231
5959   AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_strobe_r) AM_WRITE(mtx_bankswitch_w)
6060   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("tms9929a", tms9929a_device, vram_read, vram_write)
6161   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)
6363   AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_prt_r)
6464   AM_RANGE(0x04, 0x04) AM_DEVWRITE(CENTRONICS_TAG, centronics_device, write)
6565   AM_RANGE(0x05, 0x05) AM_READWRITE(mtx_key_lo_r, mtx_sense_w)
r18230r18231
334334    DEVCB_LINE(mtx_tms9929a_interrupt)
335335};
336336
337/*-------------------------------------------------
338    sn76496_config psg_intf
339-------------------------------------------------*/
340
341static const sn76496_config psg_intf =
342{
343    DEVCB_NULL
344};
345
346
337347/***************************************************************************
338348    MACHINE DRIVERS
339349***************************************************************************/
r18230r18231
360370
361371   /* sound hardware */
362372   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)
364375   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
365376
366377   /* devices */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team