From 535bc443302d13811fb16e9fc17ac5783df41ba2 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sun, 3 Apr 2016 01:45:39 +0200 Subject: [PATCH] ti99: Removed GROMCLK generator from wrapper --- src/devices/bus/ti99x/datamux.cpp | 23 ++------------ src/devices/bus/ti99x/datamux.h | 3 +- src/devices/bus/ti99x/videowrp.cpp | 17 +---------- src/devices/bus/ti99x/videowrp.h | 13 +------- src/mame/drivers/ti99_4x.cpp | 49 +++++++++++++++++++++++++++--- 5 files changed, 51 insertions(+), 54 deletions(-) diff --git a/src/devices/bus/ti99x/datamux.cpp b/src/devices/bus/ti99x/datamux.cpp index 85030665b41..034ecfe114d 100644 --- a/src/devices/bus/ti99x/datamux.cpp +++ b/src/devices/bus/ti99x/datamux.cpp @@ -124,16 +124,7 @@ void ti99_datamux_device::read_all(address_space& space, UINT16 addr, UINT8 *val // Video 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); - } + m_video->readz(space, addr, value); } } @@ -166,15 +157,7 @@ void ti99_datamux_device::write_all(address_space& space, UINT16 addr, UINT8 val // 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); - } + m_video->write(space, addr, value); } // PEB gets all accesses @@ -577,7 +560,7 @@ void ti99_datamux_device::device_reset(void) void ti99_datamux_device::device_config_complete() { - m_video = downcast(owner()->subdevice(VDP_TAG)); + m_video = downcast(owner()->subdevice(VIDEO_SYSTEM_TAG)); m_sound = downcast(owner()->subdevice(TISOUNDCHIP_TAG)); m_gromport = downcast(owner()->subdevice(GROMPORT_TAG)); m_peb = downcast(owner()->subdevice(PERIBOX_TAG)); diff --git a/src/devices/bus/ti99x/datamux.h b/src/devices/bus/ti99x/datamux.h index 27908d403c6..5b59ea7d134 100644 --- a/src/devices/bus/ti99x/datamux.h +++ b/src/devices/bus/ti99x/datamux.h @@ -20,6 +20,7 @@ #include "bus/ti99_peb/peribox.h" #include "sound/sn76496.h" #include "video/tms9928a.h" +#include "bus/ti99x/videowrp.h" extern const device_type DATAMUX; @@ -55,7 +56,7 @@ protected: private: // Link to the video processor - tms9928a_device* m_video; + bus8z_device* m_video; // Link to the sound processor sn76496_base_device* m_sound; diff --git a/src/devices/bus/ti99x/videowrp.cpp b/src/devices/bus/ti99x/videowrp.cpp index a6bba316700..4aa1935f226 100644 --- a/src/devices/bus/ti99x/videowrp.cpp +++ b/src/devices/bus/ti99x/videowrp.cpp @@ -34,8 +34,7 @@ ti_std_video_device::ti_std_video_device(const machine_config &mconfig, const ch ti_exp_video_device::ti_exp_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : ti_video_device(mconfig, V9938VIDEO, "TI99 EXP Video subsystem", tag, owner, clock, "v9938_video", __FILE__), - m_v9938(nullptr), - m_out_gromclk_cb(*this) + m_v9938(nullptr) { } @@ -88,13 +87,6 @@ WRITE16_MEMBER( ti_exp_video_device::write16 ) 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) -{ - // Pulse it - m_out_gromclk_cb(ASSERT_LINE); - m_out_gromclk_cb(CLEAR_LINE); -} - /******************************************************************************/ @@ -121,13 +113,6 @@ void ti_video_device::device_start(void) void ti_exp_video_device::device_start(void) { m_v9938 = static_cast(machine().device(VDP_TAG)); - m_out_gromclk_cb.resolve(); - m_gromclk_timer = timer_alloc(0); -} - -void ti_exp_video_device::device_reset(void) -{ - if (!m_out_gromclk_cb.isnull()) m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(XTAL_10_738635MHz/24)); } /**************************************************************************/ diff --git a/src/devices/bus/ti99x/videowrp.h b/src/devices/bus/ti99x/videowrp.h index ca52a99902e..787f0e2d44f 100644 --- a/src/devices/bus/ti99x/videowrp.h +++ b/src/devices/bus/ti99x/videowrp.h @@ -43,7 +43,6 @@ public: ti_std_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; - void reset_vdp(int state) override { m_tms9928a->reset_line(state); } }; @@ -54,8 +53,6 @@ class ti_exp_video_device : public ti_video_device { 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); } - DECLARE_READ8Z_MEMBER(readz) override; DECLARE_WRITE8_MEMBER(write) override; DECLARE_READ16_MEMBER(read16); @@ -63,20 +60,12 @@ public: void reset_vdp(int state) override { m_v9938->reset_line(state); } protected: - virtual void device_start(void) override; - virtual void device_reset(void) override; + virtual void device_start(void) override; private: - void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; v9938_device *m_v9938; - devcb_write_line m_out_gromclk_cb; // GROMCLK line is optional; if present, pulse it by XTAL/24 rate - emu_timer *m_gromclk_timer; }; -#define MCFG_ADD_GROMCLK_CB(_devcb) \ - devcb = &ti_exp_video_device::set_out_gromclk_callback(*device, DEVCB_##_devcb); - - extern const device_type TI99VIDEO; extern const device_type V9938VIDEO; diff --git a/src/mame/drivers/ti99_4x.cpp b/src/mame/drivers/ti99_4x.cpp index f3cf196e8ba..45d71a08872 100644 --- a/src/mame/drivers/ti99_4x.cpp +++ b/src/mame/drivers/ti99_4x.cpp @@ -82,8 +82,11 @@ public: DECLARE_MACHINE_START(ti99_4); DECLARE_MACHINE_START(ti99_4a); DECLARE_MACHINE_START(ti99_4qi); + DECLARE_MACHINE_START(ti99_4ev); + DECLARE_MACHINE_RESET(ti99_4); DECLARE_MACHINE_RESET(ti99_4a); + DECLARE_MACHINE_RESET(ti99_4ev); // Processor connections with the main board DECLARE_READ8_MEMBER( cruread ); @@ -126,6 +129,9 @@ public: // Interrupt triggers DECLARE_INPUT_CHANGED_MEMBER( load_interrupt ); + // Used by EVPC + void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + private: void set_keyboard_column(int number, int data); int m_keyboard_column; @@ -154,6 +160,9 @@ private: required_device m_video; required_device m_cassette1; required_device m_cassette2; + + // Timer for EVPC (provided by the TMS9929A, but EVPC replaces that VDP) + emu_timer *m_gromclk_timer; }; /* @@ -631,6 +640,18 @@ WRITE_LINE_MEMBER( ti99_4x_state::gromclk_in ) m_datamux->gromclk_in(state); } +/* + Used by the EVPC +*/ +void ti99_4x_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + // Pulse it + if (m_datamux != nullptr) + { + gromclk_in(ASSERT_LINE); + gromclk_in(CLEAR_LINE); + } +} /*****************************************************************************/ @@ -990,6 +1011,27 @@ MACHINE_CONFIG_END replacing the console video processor. *************************************************************************/ +MACHINE_START_MEMBER(ti99_4x_state, ti99_4ev) +{ + m_peribox->senila(CLEAR_LINE); + m_peribox->senilb(CLEAR_LINE); + m_nready_combined = 0; + m_model = MODEL_4A; + // Removing the TMS9928a requires to add a replacement for the GROMCLK. + // In the real hardware this is a circuit (REPL99x) that fits into the VDP socket + m_gromclk_timer = timer_alloc(0); +} + +MACHINE_RESET_MEMBER(ti99_4x_state, ti99_4ev) +{ + m_cpu->set_ready(ASSERT_LINE); + m_cpu->set_hold(CLEAR_LINE); + m_int1 = CLEAR_LINE; + m_int2 = CLEAR_LINE; + m_int12 = CLEAR_LINE; + m_gromclk_timer->adjust(attotime::zero, 0, attotime::from_hz(XTAL_10_738635MHz/24)); +} + static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) /* CPU */ MCFG_TMS99xx_ADD("maincpu", TMS9900, 3000000, memmap, cru_map) @@ -998,14 +1040,11 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state ) MCFG_TMS99xx_CLKOUT_HANDLER( WRITELINE(ti99_4x_state, clock_out) ) MCFG_TMS99xx_DBIN_HANDLER( WRITELINE(ti99_4x_state, dbin_line) ) - MCFG_MACHINE_START_OVERRIDE(ti99_4x_state, ti99_4a ) + MCFG_MACHINE_START_OVERRIDE(ti99_4x_state, ti99_4ev ) + MCFG_MACHINE_RESET_OVERRIDE(ti99_4x_state, ti99_4ev ) /* video hardware */ MCFG_DEVICE_ADD(VIDEO_SYSTEM_TAG, V9938VIDEO, 0) - // Removing the TMS9928a requires to add a replacement for the GROMCLK. - // In the real hardware this is a circuit (REPL99x) that fits into the VDP socket - MCFG_ADD_GROMCLK_CB( WRITELINE(ti99_4x_state, gromclk_in) ) - MCFG_V9938_ADD(VDP_TAG, SCREEN_TAG, 0x20000, XTAL_21_4772MHz) /* typical 9938 clock, not verified */ MCFG_V99X8_INTERRUPT_CALLBACK(WRITELINE(ti99_4x_state, video_interrupt_in)) MCFG_V99X8_SCREEN_ADD_NTSC(SCREEN_TAG, VDP_TAG, XTAL_21_4772MHz)