From d3eeb13429b91a416fde3d8d66d421a9f40e6003 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sun, 3 Apr 2016 00:10:37 +0200 Subject: [PATCH] ti99: Unwrapped sound access --- src/devices/bus/ti99x/datamux.cpp | 44 ++++++--- src/devices/bus/ti99x/datamux.h | 7 +- src/devices/bus/ti99x/genboard.cpp | 56 +++++++---- src/devices/bus/ti99x/genboard.h | 5 +- src/devices/bus/ti99x/videowrp.cpp | 152 ++--------------------------- src/devices/bus/ti99x/videowrp.h | 91 +---------------- src/mame/drivers/geneve.cpp | 12 +-- src/mame/drivers/ti99_4p.cpp | 81 +++++---------- src/mame/drivers/ti99_4x.cpp | 41 ++++---- 9 files changed, 140 insertions(+), 349 deletions(-) diff --git a/src/devices/bus/ti99x/datamux.cpp b/src/devices/bus/ti99x/datamux.cpp index da971c4ceec..85030665b41 100644 --- a/src/devices/bus/ti99x/datamux.cpp +++ b/src/devices/bus/ti99x/datamux.cpp @@ -122,7 +122,19 @@ void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *val } // Video - if ((addr & 0xf801)==0x8800) m_video->readz(space, addr, value); + if ((addr & 0xf801)==0x8800) + { + if (addr & 2) + { + // Read VDP status + *value = m_video->register_read(space, 0); + } + else + { + // Read VDP RAM + *value = m_video->vram_read(space, 0); + } + } } // GROMport (ROMs) @@ -147,10 +159,23 @@ void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 val m_gromport->write(space, addr, value); } - // Other devices + // Cartridge port and sound if ((addr & 0xe000)==0x6000) m_gromport->write(space, addr, value); - if ((addr & 0xfc01)==0x8400) m_sound->write(space, addr, value); - if ((addr & 0xf801)==0x8800) m_video->write(space, addr, value); + if ((addr & 0xfc01)==0x8400) m_sound->write(space, 0, value); + + // Video + if ((addr & 0xf801)==0x8800) + { + if (addr & 2) + { + // Write VDP address + m_video->register_write(space, 0, value); + } + else + { // Write VDP data + m_video->vram_write(space, 0, value); + } + } // PEB gets all accesses m_peb->write(space, addr, value); @@ -182,12 +207,7 @@ void ti99_datamux_device::setaddress_all(address_space& space, UINT16 addr) // GROMport (GROMs) m_gromport->set_gromlines(space, lines, select); - if (validaccess) - { - // Other devices - if ((addr & 0xfc01)==0x8400) m_sound->setaddress_dbin(space, addr, m_dbin); - if ((addr & 0xf801)==0x8800) m_video->setaddress_dbin(space, addr, m_dbin); - } + // Sound chip and video chip do not require the address to be set before access // GROMport (ROMs) m_gromport->romgq_line(iscartrom? ASSERT_LINE : CLEAR_LINE); @@ -557,8 +577,8 @@ void ti99_datamux_device::device_reset(void) void ti99_datamux_device::device_config_complete() { - m_video = downcast(owner()->subdevice(VIDEO_SYSTEM_TAG)); - m_sound = downcast(owner()->subdevice(TISOUND_TAG)); + m_video = downcast(owner()->subdevice(VDP_TAG)); + m_sound = downcast(owner()->subdevice(TISOUNDCHIP_TAG)); m_gromport = downcast(owner()->subdevice(GROMPORT_TAG)); m_peb = downcast(owner()->subdevice(PERIBOX_TAG)); m_grom[0] = downcast(owner()->subdevice(GROM0_TAG)); diff --git a/src/devices/bus/ti99x/datamux.h b/src/devices/bus/ti99x/datamux.h index eaad45b7238..27908d403c6 100644 --- a/src/devices/bus/ti99x/datamux.h +++ b/src/devices/bus/ti99x/datamux.h @@ -15,10 +15,11 @@ #define __DMUX__ #include "ti99defs.h" -#include "videowrp.h" #include "machine/tmc0430.h" #include "gromport.h" #include "bus/ti99_peb/peribox.h" +#include "sound/sn76496.h" +#include "video/tms9928a.h" extern const device_type DATAMUX; @@ -54,10 +55,10 @@ protected: private: // Link to the video processor - bus8z_device* m_video; + tms9928a_device* m_video; // Link to the sound processor - ti_sound_sn94624_device* m_sound; + sn76496_base_device* m_sound; // Link to the peripheral expansion box peribox_device* m_peb; diff --git a/src/devices/bus/ti99x/genboard.cpp b/src/devices/bus/ti99x/genboard.cpp index 1abdd7c6762..10f560ce6bd 100644 --- a/src/devices/bus/ti99x/genboard.cpp +++ b/src/devices/bus/ti99x/genboard.cpp @@ -207,7 +207,10 @@ geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, GENEVE_MAPPER, "Geneve Gate Array", tag, owner, clock, "geneve_mapper", __FILE__), m_gromwaddr_LSB(false), m_gromraddr_LSB(false), m_grom_address(0), m_video_waitstates(false), m_extra_waitstates(false), m_ready_asserted(false), m_read_mode(false), m_debug_no_ws(false), m_geneve_mode(false), m_direct_mode(false), m_cartridge_size(0), m_cartridge_secondpage(false), m_cartridge6_writable(false), m_cartridge7_writable(false), m_turbo(false), m_genmod(false), m_timode(false), m_pfm_mode(0), m_pfm_bank(0), m_pfm_output_enable(false), m_sram_mask(0), m_sram_val(0), - m_ready(*this), m_waitcount(0), m_ext_waitcount(0), m_clock(nullptr), m_cpu(nullptr), m_pfm512(nullptr), m_pfm512a(nullptr), m_keyboard(nullptr), m_video(nullptr), m_peribox(nullptr), m_sound(nullptr), m_sram(nullptr), m_dram(nullptr) + m_ready(*this), m_waitcount(0), m_ext_waitcount(0), + m_clock(nullptr), m_cpu(nullptr), m_pfm512(nullptr), + m_pfm512a(nullptr), m_sound(nullptr), m_keyboard(nullptr), + m_video(nullptr), m_peribox(nullptr), m_sram(nullptr), m_dram(nullptr) { m_eprom = nullptr; } @@ -466,11 +469,14 @@ READ8_MEMBER( geneve_mapper_device::readm ) switch (dec->function) { case MLGVIDEO: - m_video->readz(space, dec->offset, &value, 0xff); - if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); - // Video wait states are created *after* the access - // Accordingly, they have no effect when execution is in onchip RAM - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + value = m_video->read(space, dec->offset>>1); + if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); + // Video wait states are created *after* the access + // Accordingly, they have no effect when execution is in onchip RAM + if (m_video_waitstates) set_ext_wait(15); + } break; case MLGMAPPER: @@ -523,10 +529,13 @@ READ8_MEMBER( geneve_mapper_device::readm ) // video // ++++ ++-- ---- ---+ // 1000 1000 0000 00x0 - m_video->readz(space, dec->offset, &value, 0xff); - if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); - // See above - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + value = m_video->read(space, dec->offset>>1); + if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLTSPEECH: @@ -649,10 +658,14 @@ WRITE8_MEMBER( geneve_mapper_device::writem ) // video // ++++ ++++ ++++ ---+ // 1111 0001 0000 .cc0 - m_video->write(space, dec->offset, data, 0xff); - if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); - // See above - if (m_video_waitstates) set_ext_wait(15); + + if (!space.debugger_access()) + { + m_video->write(space, dec->offset>>1, data); + if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLGMAPPER: @@ -692,10 +705,13 @@ WRITE8_MEMBER( geneve_mapper_device::writem ) // ++++ ++-- ---- ---+ // 1000 1100 0000 00c0 // Initialize waitstate timer - m_video->write(space, dec->offset, data, 0xff); - if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); - // See above - if (m_video_waitstates) set_ext_wait(15); + if (!space.debugger_access()) + { + m_video->write(space, dec->offset>>1, data); + if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data); + // See above + if (m_video_waitstates) set_ext_wait(15); + } break; case MLTSPEECH: @@ -1360,8 +1376,8 @@ void geneve_mapper_device::device_start() // Get pointers m_peribox = machine().device(PERIBOX_TAG); m_keyboard = machine().device(GKEYBOARD_TAG); - m_video = machine().device(VIDEO_SYSTEM_TAG); - m_sound = machine().device(TISOUND_TAG); + m_video = machine().device(VDP_TAG); + m_sound = machine().device(TISOUNDCHIP_TAG); m_clock = machine().device(GCLOCK_TAG); // PFM expansion diff --git a/src/devices/bus/ti99x/genboard.h b/src/devices/bus/ti99x/genboard.h index 8f49cb6906e..4f9c5da7f27 100644 --- a/src/devices/bus/ti99x/genboard.h +++ b/src/devices/bus/ti99x/genboard.h @@ -20,6 +20,7 @@ #include "cpu/tms9900/tms9995.h" #include "machine/at29x.h" #include "bus/ti99_peb/peribox.h" +#include "sound/sn76496.h" extern const device_type GENEVE_MOUSE; extern const device_type GENEVE_KEYBOARD; @@ -205,11 +206,11 @@ private: tms9995_device* m_cpu; at29c040_device* m_pfm512; at29c040a_device* m_pfm512a; + sn76496_base_device* m_sound; geneve_keyboard_device* m_keyboard; - bus8z_device* m_video; + v9938_device* m_video; peribox_device* m_peribox; - bus8z_device* m_sound; UINT8* m_eprom; UINT8* m_sram; UINT8* m_dram; diff --git a/src/devices/bus/ti99x/videowrp.cpp b/src/devices/bus/ti99x/videowrp.cpp index 387872bba5d..a6bba316700 100644 --- a/src/devices/bus/ti99x/videowrp.cpp +++ b/src/devices/bus/ti99x/videowrp.cpp @@ -2,7 +2,7 @@ // copyright-holders:Michael Zapf /**************************************************************************** - TI-99/4(A) and /8 Video subsystem + TI-99/4A Video subsystem This device actually wraps the naked video chip implementation EVPC (Enhanced Video Processor Card) from SNUG @@ -11,18 +11,12 @@ The SGCPU ("TI-99/4P") only runs with EVPC - We also include a class wrapper for the sound chip here. - Michael Zapf - October 2010 - February 2012: Rewritten as class - *****************************************************************************/ #include "emu.h" #include "videowrp.h" -#include "sound/sn76496.h" /* Constructors @@ -45,19 +39,9 @@ ti_exp_video_device::ti_exp_video_device(const machine_config &mconfig, const ch { } -ti_sound_sn94624_device::ti_sound_sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_sound_system_device(mconfig, TISOUND_94624, "Onboard sound (SN94624)", tag, owner, clock, "ti_sound_sn94624", __FILE__) -{ -} - -ti_sound_sn76496_device::ti_sound_sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : ti_sound_system_device(mconfig, TISOUND_76496, "Onboard sound (SN76496)", tag, owner, clock, "ti_sound_sn76496", __FILE__) -{ -} - /*****************************************************************************/ /* - Memory access (TI-99/4A and TI-99/8) + Accessing TMS9928A (TI-99/4A) */ READ8Z_MEMBER( ti_std_video_device::readz ) { @@ -90,45 +74,18 @@ WRITE8_MEMBER( ti_std_video_device::write ) /*****************************************************************************/ /* - Memory access (EVPC) via 16 bit bus + Accessing v9938 via 16 bit bus (SGCPU) */ READ16_MEMBER( ti_exp_video_device::read16 ) { if (space.debugger_access()) return 0; - - if (offset & 1) - { /* read VDP status */ - return ((int) m_v9938->status_r()) << 8; - } - else - { /* read VDP RAM */ - return ((int) m_v9938->vram_r()) << 8; - } + return (int)(m_v9938->read(space, offset)<<8); } WRITE16_MEMBER( ti_exp_video_device::write16 ) { if (space.debugger_access()) return; - - switch (offset & 3) - { - case 0: - /* write VDP data */ - m_v9938->vram_w((data >> 8) & 0xff); - break; - case 1: - /* write VDP address */ - m_v9938->command_w((data >> 8) & 0xff); - break; - case 2: - /* write VDP palette */ - m_v9938->palette_w((data >> 8) & 0xff); - break; - case 3: - /* write VDP register pointer (indirect access) */ - m_v9938->register_w((data >> 8) & 0xff); - break; - } + m_v9938->write(space, offset, (data>>8)&0xff); } void ti_exp_video_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -142,60 +99,20 @@ void ti_exp_video_device::device_timer(emu_timer &timer, device_timer_id id, int /******************************************************************************/ /* - Video read (Geneve) via 8 bit bus + Accessing v9938 via 8 bit bus (EVPC) */ READ8Z_MEMBER( ti_exp_video_device::readz ) { if (space.debugger_access()) return; - - if (offset & 2) - { /* read VDP status */ - *value = m_v9938->status_r(); - } - else - { /* read VDP RAM */ - *value = m_v9938->vram_r(); - } + *value = m_v9938->read(space, offset>>1); } -/* - Video write (Geneve) -*/ WRITE8_MEMBER( ti_exp_video_device::write ) { if (space.debugger_access()) return; - - switch (offset & 6) - { - case 0: - /* write VDP data */ - m_v9938->vram_w(data); - break; - case 2: - /* write VDP address */ - m_v9938->command_w(data); - break; - case 4: - /* write VDP palette */ - m_v9938->palette_w(data); - break; - case 6: - /* write VDP register pointer (indirect access) */ - m_v9938->register_w(data); - break; - } + m_v9938->write(space, offset>>1, data); } -/**************************************************************************/ -// Interfacing to mouse attached to v9938 - -void ti_exp_video_device::video_update_mouse(int delta_x, int delta_y, int buttons) -{ - m_v9938->update_mouse_state(delta_x, delta_y, buttons & 3); -} - -/**************************************************************************/ - void ti_video_device::device_start(void) { m_tms9928a = static_cast(machine().device(VDP_TAG)); @@ -215,58 +132,5 @@ void ti_exp_video_device::device_reset(void) /**************************************************************************/ -/* - Sound subsystem. - TODO: Seriously consider to simplify this by connecting to the datamux - directly. We don't do anything reasonable here. -*/ - -WRITE8_MEMBER( ti_sound_system_device::write ) -{ - if (space.debugger_access()) return; - m_sound_chip->write(space, 0, data); -} - -void ti_sound_system_device::device_start(void) -{ - m_console_ready.resolve(); - m_sound_chip = subdevice(TISOUNDCHIP_TAG); -} - -WRITE_LINE_MEMBER( ti_sound_system_device::sound_ready ) -{ - m_console_ready(state); -} - -MACHINE_CONFIG_FRAGMENT( sn94624 ) - MCFG_SPEAKER_STANDARD_MONO("sound_out") - - MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) - MCFG_SN76496_READY_HANDLER(WRITELINE(ti_sound_system_device, sound_ready)) -MACHINE_CONFIG_END - -MACHINE_CONFIG_FRAGMENT( sn76496 ) - MCFG_SPEAKER_STANDARD_MONO("sound_out") - - MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN76496, 3579545) /* 3.579545 MHz */ - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) - MCFG_SN76496_READY_HANDLER(WRITELINE(ti_sound_system_device, sound_ready)) -MACHINE_CONFIG_END - -machine_config_constructor ti_sound_sn94624_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sn94624 ); -} - -machine_config_constructor ti_sound_sn76496_device::device_mconfig_additions() const -{ - return MACHINE_CONFIG_NAME( sn76496 ); -} - -/**************************************************************************/ - const device_type TI99VIDEO = &device_creator; const device_type V9938VIDEO = &device_creator; -const device_type TISOUND_94624 = &device_creator; -const device_type TISOUND_76496 = &device_creator; diff --git a/src/devices/bus/ti99x/videowrp.h b/src/devices/bus/ti99x/videowrp.h index 49c4ce73f16..ca52a99902e 100644 --- a/src/devices/bus/ti99x/videowrp.h +++ b/src/devices/bus/ti99x/videowrp.h @@ -2,7 +2,7 @@ // copyright-holders:Michael Zapf /**************************************************************************** - TI-99/4(A) and /8 Video subsystem + TI-99/4A / EVPC Video subsystem See videowrp.c for documentation Michael Zapf @@ -17,7 +17,6 @@ #include "video/tms9928a.h" #include "video/v9938.h" #include "ti99defs.h" -#include "sound/sn76496.h" class ti_video_device : public bus8z_device { @@ -49,7 +48,7 @@ public: }; /* - Used in the EVPC and Geneve + Used in the EVPC */ class ti_exp_video_device : public ti_video_device { @@ -57,7 +56,6 @@ public: ti_exp_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); template static devcb_base &set_out_gromclk_callback(device_t &device, _Object object) { return downcast(device).m_out_gromclk_cb.set_callback(object); } - void video_update_mouse(int delta_x, int delta_y, int buttons); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_READ16_MEMBER(read16); @@ -82,64 +80,6 @@ private: extern const device_type TI99VIDEO; extern const device_type V9938VIDEO; -/****************************************************************************/ -/* - Sound device -*/ - -extern const device_type TISOUND_94624; -extern const device_type TISOUND_76496; - -#define TI_SOUND_CONFIG(name) \ - const ti_sound_config(name) = - -class ti_sound_system_device : public bus8z_device -{ -public: - ti_sound_system_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : bus8z_device(mconfig, type, name, tag, owner, clock, shortname, source), m_sound_chip(nullptr), - m_console_ready(*this) { }; - - // Cannot read from sound; just ignore silently - DECLARE_READ8Z_MEMBER(readz) override { }; - DECLARE_WRITE8_MEMBER(write) override; - DECLARE_WRITE_LINE_MEMBER( sound_ready ); // connect to console READY - - template static devcb_base &static_set_int_callback(device_t &device, _Object object) { return downcast(device).m_console_ready.set_callback(object); } - -protected: - virtual void device_start(void) override; - virtual machine_config_constructor device_mconfig_additions() const override =0; - -private: - sn76496_base_device* m_sound_chip; - devcb_write_line m_console_ready; -}; - -/* - The version that sits in the TI-99/4A -*/ -class ti_sound_sn94624_device : public ti_sound_system_device -{ -public: - ti_sound_sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual machine_config_constructor device_mconfig_additions() const override; -}; - -/* - The version that sits in the TI-99/8 and Geneve -*/ -class ti_sound_sn76496_device : public ti_sound_system_device -{ -public: - ti_sound_sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - -protected: - virtual machine_config_constructor device_mconfig_additions() const override; -}; - /****************************************************************************/ @@ -161,31 +101,4 @@ protected: MCFG_TMS9928A_SCREEN_ADD_PAL( SCREEN_TAG ) \ MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) -#define MCFG_TI998_ADD_NTSC(_tag, _chip, _vsize, _class, _int, _gclk) \ - MCFG_DEVICE_ADD(_tag, TI99VIDEO, 0) \ - MCFG_DEVICE_ADD( VDP_TAG, _chip, XTAL_10_738635MHz / 2 ) \ - MCFG_TMS9928A_VRAM_SIZE(_vsize) \ - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(_class,_int)) \ - MCFG_TMS9928A_OUT_GROMCLK_CB(WRITELINE(_class,_gclk)) \ - MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) \ - MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) - -#define MCFG_TI998_ADD_PAL(_tag, _chip, _vsize, _class, _int, _gclk) \ - MCFG_DEVICE_ADD(_tag, TI99VIDEO, 0) \ - MCFG_DEVICE_ADD( VDP_TAG, _chip, XTAL_10_738635MHz / 2 ) \ - MCFG_TMS9928A_VRAM_SIZE(_vsize) \ - MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(_class,_int)) \ - MCFG_TMS9928A_OUT_GROMCLK_CB(WRITELINE(_class,_gclk)) \ - MCFG_TMS9928A_SCREEN_ADD_PAL( SCREEN_TAG ) \ - MCFG_SCREEN_UPDATE_DEVICE( VDP_TAG, tms9928a_device, screen_update ) - -#define MCFG_TI_SOUND_94624_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TISOUND_94624, 0) - -#define MCFG_TI_SOUND_76496_ADD(_tag) \ - MCFG_DEVICE_ADD(_tag, TISOUND_76496, 0) - -#define MCFG_TI_SOUND_READY_HANDLER( _ready ) \ - devcb = &ti_sound_system_device::static_set_int_callback( *device, DEVCB_##_ready ); - #endif /* __TIVIDEO__ */ diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp index 8d413333bbd..bcf8acee880 100644 --- a/src/mame/drivers/geneve.cpp +++ b/src/mame/drivers/geneve.cpp @@ -210,7 +210,6 @@ #include "sound/sn76496.h" #include "bus/ti99x/genboard.h" -#include "bus/ti99x/videowrp.h" #include "bus/ti99x/joyport.h" #include "bus/ti99_peb/peribox.h" @@ -690,8 +689,7 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state ) MCFG_TMS9995_CLKOUT_HANDLER( WRITELINE(geneve_state, clock_out) ) MCFG_TMS9995_DBIN_HANDLER( WRITELINE(geneve_state, dbin_line) ) - // video hardware - MCFG_DEVICE_ADD(VIDEO_SYSTEM_TAG, V9938VIDEO, 0) + // Video hardware MCFG_V9938_ADD(VDP_TAG, SCREEN_TAG, 0x20000, XTAL_21_4772MHz) /* typical 9938 clock, not verified */ MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(geneve_state, set_tms9901_INT2_from_v9938)) MCFG_V99X8_SCREEN_ADD_NTSC(SCREEN_TAG, VDP_TAG, XTAL_21_4772MHz) @@ -726,9 +724,11 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(geneve_state, intb) ) MCFG_PERIBOX_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) - // sound hardware - MCFG_TI_SOUND_76496_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN76496, 3579545) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(geneve_state, ext_ready) ) // User interface devices MCFG_DEVICE_ADD( GKEYBOARD_TAG, GENEVE_KEYBOARD, 0 ) diff --git a/src/mame/drivers/ti99_4p.cpp b/src/mame/drivers/ti99_4p.cpp index 7da4302262b..4650d391c08 100644 --- a/src/mame/drivers/ti99_4p.cpp +++ b/src/mame/drivers/ti99_4p.cpp @@ -41,6 +41,7 @@ #include "cpu/tms9900/tms9900.h" #include "sound/wave.h" #include "sound/dac.h" +#include "sound/sn76496.h" #include "machine/tms9901.h" #include "imagedev/cassette.h" @@ -53,8 +54,9 @@ #define TMS9901_TAG "tms9901" #define SGCPU_TAG "sgcpu" -#define VERBOSE 1 -#define LOG logerror +#define TRACE_ILLWRITE 0 +#define TRACE_READY 0 +#define TRACE_INT 0 class ti99_4p_state : public driver_device { @@ -63,7 +65,7 @@ public: : driver_device(mconfig, type, tag), m_cpu(*this, "maincpu"), m_tms9901(*this, TMS9901_TAG), - m_sound(*this, TISOUND_TAG), + m_sound(*this, TISOUNDCHIP_TAG), m_video(*this, VIDEO_SYSTEM_TAG), m_cassette(*this, "cassette"), m_peribox(*this, PERIBOX_TAG), @@ -103,13 +105,13 @@ public: DECLARE_WRITE_LINE_MEMBER(set_tms9901_INT2_from_v9938); - required_device m_cpu; - required_device m_tms9901; - required_device m_sound; - required_device m_video; - required_device m_cassette; - required_device m_peribox; - required_device m_joyport; + required_device m_cpu; + required_device m_tms9901; + required_device m_sound; + required_device m_video; + required_device m_cassette; + required_device m_peribox; + required_device m_joyport; // Pointer to ROM0 UINT16 *m_rom0; @@ -354,7 +356,7 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) if (zone==0x0000) { // ROM0 - if (VERBOSE>4) LOG("sgcpu: ignoring ROM write access at %04x\n", addroff); + if (TRACE_ILLWRITE) logerror("Ignoring ROM write access at %04x\n", addroff); return; } @@ -368,7 +370,7 @@ WRITE16_MEMBER( ti99_4p_state::memwrite ) { if (m_internal_dsr) { - if (VERBOSE>4) LOG("sgcpu: ignoring DSR write access at %04x\n", addroff); + if (TRACE_ILLWRITE) logerror("Ignoring DSR write access at %04x\n", addroff); return; } else @@ -692,39 +694,6 @@ WRITE_LINE_MEMBER( ti99_4p_state::cassette_output ) m_cassette->output((state!=0)? +1 : -1); } -/* -// TMS9901 setup. The callback functions pass a reference to the TMS9901 as device. -const tms9901_interface tms9901_wiring_sgcpu = -{ - TMS9901_INT1 | TMS9901_INT2 | TMS9901_INTC, // only input pins whose state is always known - - // read handler - DEVCB_DRIVER_MEMBER(ti99_4p_state, read_by_9901), - - { // write handlers - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC0), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC1), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, keyC2), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, alphaW), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, cs_motor), - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, audio_gate), - DEVCB_DRIVER_LINE_MEMBER(ti99_4p_state, cassette_output), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL - }, - - // interrupt handler - DEVCB_DRIVER_MEMBER(ti99_4p_state, tms9901_interrupt) -}; - -*/ /*************************************************************************** Control lines @@ -741,9 +710,9 @@ WRITE_LINE_MEMBER( ti99_4p_state::console_ready ) m_ready_line = state; int combined = (m_ready_line == ASSERT_LINE && m_ready_line_dmux == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE; - if (VERBOSE>6) + if (TRACE_READY) { - if (m_ready_prev != combined) LOG("ti99_4p: READY level = %d\n", combined); + if (m_ready_prev != combined) logerror("READY level = %d\n", combined); } m_ready_prev = combined; m_cpu->set_ready(combined); @@ -759,9 +728,9 @@ WRITE_LINE_MEMBER( ti99_4p_state::console_ready_dmux ) m_ready_line_dmux = state; int combined = (m_ready_line == ASSERT_LINE && m_ready_line_dmux == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE; - if (VERBOSE>7) + if (TRACE_READY) { - if (m_ready_prev != combined) LOG("ti99_4p: READY dmux level = %d\n", state); + if (m_ready_prev != combined) logerror("READY dmux level = %d\n", state); } m_ready_prev = combined; m_cpu->set_ready(combined); @@ -777,13 +746,13 @@ void ti99_4p_state::set_9901_int( int line, line_state state) WRITE_LINE_MEMBER( ti99_4p_state::extint ) { - if (VERBOSE>6) LOG("ti99_4p: EXTINT level = %02x\n", state); + if (TRACE_INT) logerror("EXTINT level = %02x\n", state); set_9901_int(1, (line_state)state); } WRITE_LINE_MEMBER( ti99_4p_state::notconnected ) { - if (VERBOSE>6) LOG("ti99_4p: Setting a not connected line ... ignored\n"); + if (TRACE_INT) logerror("Setting a not connected line ... ignored\n"); } /* @@ -812,7 +781,7 @@ READ8_MEMBER( ti99_4p_state::interrupt_level ) WRITE8_MEMBER( ti99_4p_state::external_operation ) { static const char* extop[8] = { "inv1", "inv2", "IDLE", "RSET", "inv3", "CKON", "CKOF", "LREX" }; - if (VERBOSE>1) LOG("External operation %s not implemented on the SGCPU board\n", extop[offset]); + logerror("External operation %s not implemented on the SGCPU board\n", extop[offset]); } /*****************************************************************************/ @@ -891,9 +860,11 @@ static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4p_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) - // sound hardware - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4p_state, console_ready) ) // Cassette drives MCFG_SPEAKER_STANDARD_MONO("cass_out") diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index 107f3a466e8..f3cf196e8ba 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -814,9 +814,11 @@ static MACHINE_CONFIG_START( ti99_4, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -911,9 +913,11 @@ static MACHINE_CONFIG_START( ti99_4a, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -1034,9 +1038,11 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_4x_state, notconnected) ) MCFG_PERIBOX_READY_HANDLER( DEVWRITELINE(DATAMUX_TAG, ti99_datamux_device, ready_line) ) - /* sound hardware */ - MCFG_TI_SOUND_94624_ADD( TISOUND_TAG ) - MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) + // Sound hardware + MCFG_SPEAKER_STANDARD_MONO("sound_out") + MCFG_SOUND_ADD(TISOUNDCHIP_TAG, SN94624, 3579545/8) /* 3.579545 MHz */ + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "sound_out", 0.75) + MCFG_SN76496_READY_HANDLER( WRITELINE(ti99_4x_state, console_ready_sound) ) /* Cassette drives */ MCFG_SPEAKER_STANDARD_MONO("cass_out") @@ -1100,7 +1106,6 @@ ROM_START(ti99_4qi) ROM_LOAD("994qigr2.bin", 0x4000, 0x1800, CRC(e0bb5341) SHA1(e255f0d65d69b927cecb8fcfac7a4c17d585ea96)) /* system GROM 2 */ ROM_END - ROM_START(ti99_4ev) /*CPU memory space*/ ROM_REGION16_BE(0x2000, CONSOLEROM, 0) @@ -1111,11 +1116,11 @@ ROM_START(ti99_4ev) ROM_LOAD("994agr38.bin", 0x0000, 0x6000, CRC(bdd9f09b) SHA1(9b058a55d2528d2a6a69d7081aa296911ed7c0de)) /* system GROMs */ ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ -COMP( 1979, ti99_4, 0, 0, ti99_4_60hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (US)" , 0) -COMP( 1980, ti99_4e, ti99_4, 0, ti99_4_50hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (Europe)" , 0) -COMP( 1981, ti99_4a, 0, 0, ti99_4a_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (US)" , 0) -COMP( 1981, ti99_4ae, ti99_4a, 0, ti99_4a_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (Europe)" , 0) -COMP( 1983, ti99_4qe, ti99_4qi, 0, ti99_4qi_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (Europe)" , 0) -COMP( 1983, ti99_4qi, 0, 0, ti99_4qi_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer" , 0) -COMP( 1994, ti99_4ev, ti99_4a, 0, ti99_4ev_60hz,ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer with EVPC" , 0) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1979, ti99_4, 0, 0, ti99_4_60hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (US)", 0) +COMP( 1980, ti99_4e, ti99_4, 0, ti99_4_50hz, ti99_4, driver_device, 0, "Texas Instruments", "TI-99/4 Home Computer (Europe)", 0) +COMP( 1981, ti99_4a, 0, 0, ti99_4a_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (US)", 0) +COMP( 1981, ti99_4ae, ti99_4a, 0, ti99_4a_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer (Europe)", 0) +COMP( 1983, ti99_4qe, ti99_4qi, 0, ti99_4qi_50hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (Europe)", 0) +COMP( 1983, ti99_4qi, 0, 0, ti99_4qi_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4QI Home Computer (US)", 0) +COMP( 1994, ti99_4ev, ti99_4a, 0, ti99_4ev_60hz, ti99_4a, driver_device, 0, "Texas Instruments", "TI-99/4A Home Computer with EVPC", 0)