mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
(MESS) Simpler config by joyport mods. (nw)
This commit is contained in:
parent
e0c6a203b8
commit
365fc03dcf
@ -770,7 +770,7 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state )
|
||||
MCFG_DEVICE_ADD( GKEYBOARD_TAG, GENEVE_KEYBOARD, 0 )
|
||||
MCFG_GENEVE_KBINT_HANDLER( WRITELINE(geneve_state, keyboard_interrupt) )
|
||||
MCFG_GENEVE_MOUSE_ADD( GMOUSE_TAG )
|
||||
MCFG_GENEVE_JOYPORT_ADD( JOYPORT_TAG, 60 )
|
||||
MCFG_GENEVE_JOYPORT_ADD( JOYPORT_TAG )
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -905,7 +905,7 @@ static MACHINE_CONFIG_START( ti99_4p_60hz, ti99_4p_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG )
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -99,13 +99,12 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER( console_ready_cart );
|
||||
DECLARE_WRITE_LINE_MEMBER( console_ready_grom );
|
||||
DECLARE_WRITE_LINE_MEMBER( console_reset );
|
||||
DECLARE_WRITE_LINE_MEMBER( extint );
|
||||
DECLARE_WRITE_LINE_MEMBER( notconnected );
|
||||
|
||||
// Connections with the system interface chip 9901
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT2 );
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT12 );
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT2_from_v9938);
|
||||
DECLARE_WRITE_LINE_MEMBER( extint );
|
||||
DECLARE_WRITE_LINE_MEMBER( video_interrupt_in );
|
||||
DECLARE_WRITE_LINE_MEMBER( handset_interrupt_in );
|
||||
|
||||
// Connections with the system interface TMS9901
|
||||
DECLARE_READ8_MEMBER(read_by_9901);
|
||||
@ -135,7 +134,7 @@ private:
|
||||
void console_ready_join(int id, int state);
|
||||
|
||||
// Console type
|
||||
int m_console;
|
||||
int m_model;
|
||||
|
||||
// Latch for 9901 INT1, INT2, and INT12 lines
|
||||
line_state m_int1;
|
||||
@ -384,7 +383,7 @@ READ8_MEMBER( ti99_4x_state::cruread )
|
||||
// Also, we translate the bit addresses to base addresses
|
||||
|
||||
// The QI version does not propagate the CRU signals to the cartridge slot
|
||||
if (m_console != MODEL_4QI) m_gromport->crureadz(space, offset<<4, &value);
|
||||
if (m_model != MODEL_4QI) m_gromport->crureadz(space, offset<<4, &value);
|
||||
m_peribox->crureadz(space, offset<<4, &value);
|
||||
|
||||
return value;
|
||||
@ -394,7 +393,7 @@ WRITE8_MEMBER( ti99_4x_state::cruwrite )
|
||||
{
|
||||
if (TRACE_CRU) logerror("ti99_4x: write access to CRU address %04x\n", offset << 1);
|
||||
// The QI version does not propagate the CRU signals to the cartridge slot
|
||||
if (m_console != MODEL_4QI) m_gromport->cruwrite(space, offset<<1, data);
|
||||
if (m_model != MODEL_4QI) m_gromport->cruwrite(space, offset<<1, data);
|
||||
m_peribox->cruwrite(space, offset<<1, data);
|
||||
}
|
||||
|
||||
@ -452,7 +451,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 )
|
||||
//
|
||||
// |K|K|K|K|K|I2|I1|C|
|
||||
//
|
||||
if (m_keyboard_column >= (m_console==MODEL_4? 5:6)) // joy 1, 2, handset
|
||||
if (m_keyboard_column >= (m_model==MODEL_4? 5:6)) // joy 1, 2, handset
|
||||
{
|
||||
answer = m_joyport->read_port();
|
||||
// The hardware bug of the TI-99/4A: you have to release the
|
||||
@ -463,7 +462,7 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 )
|
||||
// the line enough to make the TMS9901 sense the low level.
|
||||
// A reported, feasible fix was to cut the line and insert a diode
|
||||
// below the Alphalock key.
|
||||
if ((ioport("ALPHABUG")!=0) && (m_console!=MODEL_4)) answer |= ioport("ALPHA")->read();
|
||||
if ((ioport("ALPHABUG")!=0) && (m_model!=MODEL_4)) answer |= ioport("ALPHA")->read();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -481,10 +480,10 @@ READ8_MEMBER( ti99_4x_state::read_by_9901 )
|
||||
|
||||
case TMS9901_INT8_INT15:
|
||||
// |1|1|1|INT12|0|K|K|K|
|
||||
if (m_keyboard_column >= (m_console==MODEL_4? 5:6)) answer = 0x07;
|
||||
if (m_keyboard_column >= (m_model==MODEL_4? 5:6)) answer = 0x07;
|
||||
else answer = ((ioport(column[m_keyboard_column])->read())>>5) & 0x07;
|
||||
answer |= 0xe0;
|
||||
if (m_console != MODEL_4 || m_int12==CLEAR_LINE) answer |= 0x10;
|
||||
if (m_model != MODEL_4 || m_int12==CLEAR_LINE) answer |= 0x10;
|
||||
break;
|
||||
|
||||
case TMS9901_P0_P7:
|
||||
@ -530,9 +529,9 @@ void ti99_4x_state::set_keyboard_column(int number, int data)
|
||||
else
|
||||
m_keyboard_column &= ~ (1 << number);
|
||||
|
||||
if (m_keyboard_column >= (m_console==MODEL_4? 5:6))
|
||||
if (m_keyboard_column >= (m_model==MODEL_4? 5:6))
|
||||
{
|
||||
m_joyport->write_port(m_keyboard_column - (m_console==MODEL_4? 5:6) + 1);
|
||||
m_joyport->write_port(m_keyboard_column - (m_model==MODEL_4? 5:6) + 1);
|
||||
}
|
||||
|
||||
// TI-99/4: joystick 1 = column 5
|
||||
@ -640,16 +639,13 @@ WRITE_LINE_MEMBER( ti99_4x_state::dbin_line )
|
||||
/*
|
||||
set the state of TMS9901's INT2 (called by the tms9928 core)
|
||||
*/
|
||||
WRITE_LINE_MEMBER( ti99_4x_state::set_tms9901_INT2 )
|
||||
WRITE_LINE_MEMBER( ti99_4x_state::video_interrupt_in )
|
||||
{
|
||||
if (TRACE_INTERRUPTS) logerror("ti99_4x: VDP INT2 on tms9901, level=%d\n", state);
|
||||
m_int2 = (line_state)state;
|
||||
m_tms9901->set_single_int(2, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ti99_4x_state::set_tms9901_INT2_from_v9938)
|
||||
{
|
||||
if (TRACE_INTERRUPTS) logerror("ti99_4x: VDP INT2 on tms9901, level=%d\n", state);
|
||||
// Pulse for the handset
|
||||
if (m_model == MODEL_4) m_joyport->pulse_clock();
|
||||
|
||||
m_int2 = (line_state)state;
|
||||
m_tms9901->set_single_int(2, state);
|
||||
}
|
||||
@ -657,7 +653,7 @@ WRITE_LINE_MEMBER(ti99_4x_state::set_tms9901_INT2_from_v9938)
|
||||
/*
|
||||
set the state of TMS9901's INT12 (called by the handset prototype of TI-99/4)
|
||||
*/
|
||||
WRITE_LINE_MEMBER( ti99_4x_state::set_tms9901_INT12)
|
||||
WRITE_LINE_MEMBER( ti99_4x_state::handset_interrupt_in)
|
||||
{
|
||||
if (TRACE_INTERRUPTS) logerror("ti99_4x: joyport INT12 on tms9901, level=%d\n", state);
|
||||
m_int12 = (line_state)state;
|
||||
@ -746,7 +742,7 @@ WRITE_LINE_MEMBER( ti99_4x_state::extint )
|
||||
{
|
||||
if (TRACE_INTERRUPTS) logerror("ti99_4x: EXTINT level = %02x\n", state);
|
||||
m_int1 = (line_state)state;
|
||||
m_tms9901->set_single_int(11, state);
|
||||
m_tms9901->set_single_int(1, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( ti99_4x_state::notconnected )
|
||||
@ -759,7 +755,7 @@ WRITE_LINE_MEMBER( ti99_4x_state::notconnected )
|
||||
static TMS9928A_INTERFACE(ti99_4_tms9928a_interface)
|
||||
{
|
||||
0x4000,
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, set_tms9901_INT2)
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_4x_state, video_interrupt_in)
|
||||
};
|
||||
|
||||
/*
|
||||
@ -815,7 +811,7 @@ MACHINE_START_MEMBER(ti99_4x_state,ti99_4)
|
||||
m_peribox->senila(CLEAR_LINE);
|
||||
m_peribox->senilb(CLEAR_LINE);
|
||||
m_nready_combined = 0;
|
||||
m_console = MODEL_4;
|
||||
m_model = MODEL_4;
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(ti99_4x_state,ti99_4)
|
||||
@ -889,6 +885,10 @@ static MACHINE_CONFIG_START( ti99_4, ti99_4x_state )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
|
||||
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG )
|
||||
MCFG_JOYPORT_INT_HANDLER( WRITELINE(ti99_4x_state, handset_interrupt_in) )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
@ -896,10 +896,6 @@ MACHINE_CONFIG_END
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4_60hz, ti99_4 )
|
||||
MCFG_TI_TMS991x_ADD_NTSC(VIDEO_SYSTEM_TAG, TMS9918, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, 60 )
|
||||
MCFG_JOYPORT_INT_HANDLER( WRITELINE(ti99_4x_state, set_tms9901_INT12) )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
@ -907,10 +903,6 @@ MACHINE_CONFIG_END
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4_50hz, ti99_4 )
|
||||
MCFG_TI_TMS991x_ADD_PAL(VIDEO_SYSTEM_TAG, TMS9929, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4_ADD( JOYPORT_TAG, 50 )
|
||||
MCFG_JOYPORT_INT_HANDLER( WRITELINE(ti99_4x_state, set_tms9901_INT12) )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/**********************************************************************
|
||||
@ -922,7 +914,7 @@ MACHINE_START_MEMBER(ti99_4x_state,ti99_4a)
|
||||
m_peribox->senila(CLEAR_LINE);
|
||||
m_peribox->senilb(CLEAR_LINE);
|
||||
m_nready_combined = 0;
|
||||
m_console = MODEL_4A;
|
||||
m_model = MODEL_4A;
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(ti99_4x_state,ti99_4a)
|
||||
@ -992,28 +984,23 @@ static MACHINE_CONFIG_START( ti99_4a, ti99_4x_state )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
|
||||
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
US version: 60 Hz, NTSC
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4a_60hz, ti99_4a )
|
||||
// Video hardware
|
||||
MCFG_TI_TMS991x_ADD_NTSC(VIDEO_SYSTEM_TAG, TMS9918A, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
European version: 50 Hz, PAL
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4a_50hz, ti99_4a )
|
||||
// Video hardware
|
||||
MCFG_TI_TMS991x_ADD_PAL(VIDEO_SYSTEM_TAG, TMS9929A, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 50 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/************************************************************************
|
||||
@ -1029,7 +1016,7 @@ MACHINE_START_MEMBER(ti99_4x_state, ti99_4qi)
|
||||
{
|
||||
m_peribox->senila(CLEAR_LINE);
|
||||
m_peribox->senilb(CLEAR_LINE);
|
||||
m_console = MODEL_4QI;
|
||||
m_model = MODEL_4QI;
|
||||
m_nready_combined = 0;
|
||||
}
|
||||
|
||||
@ -1041,22 +1028,14 @@ MACHINE_CONFIG_END
|
||||
US version: 60 Hz, NTSC
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4qi_60hz, ti99_4qi )
|
||||
/* Video hardware */
|
||||
MCFG_TI_TMS991x_ADD_NTSC(VIDEO_SYSTEM_TAG, TMS9918A, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
European version: 50 Hz, PAL
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_4qi_50hz, ti99_4qi )
|
||||
// Video hardware
|
||||
MCFG_TI_TMS991x_ADD_PAL(VIDEO_SYSTEM_TAG, TMS9929A, ti99_4_tms9928a_interface)
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 50 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/************************************************************************
|
||||
@ -1085,7 +1064,7 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state )
|
||||
// interlace mode, but in non-interlace modes only half of the lines are
|
||||
// painted. Accordingly, the full set of lines is refreshed at 30 Hz,
|
||||
// not 60 Hz. This should be fixed in the v9938 emulation.
|
||||
MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, ti99_4x_state, set_tms9901_INT2_from_v9938)
|
||||
MCFG_TI_V9938_ADD(VIDEO_SYSTEM_TAG, 30, SCREEN_TAG, 2500, 512+32, (212+28)*2, ti99_4x_state, video_interrupt_in)
|
||||
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ti99_4x_state, ti99_4ev_hblank_interrupt, SCREEN_TAG, 0, 1)
|
||||
|
||||
/* Main board */
|
||||
@ -1137,7 +1116,7 @@ static MACHINE_CONFIG_START( ti99_4ev_60hz, ti99_4x_state )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_4x_state, console_ready_grom))
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG )
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -218,7 +218,6 @@ Known Issues (MZ, 2010-11-07)
|
||||
#define TRACE_READY 0
|
||||
#define TRACE_INTERRUPTS 0
|
||||
#define TRACE_CRU 0
|
||||
#define LOG logerror
|
||||
|
||||
/*
|
||||
READY bits.
|
||||
@ -265,14 +264,11 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER( console_ready_grom );
|
||||
DECLARE_WRITE_LINE_MEMBER( console_ready_speech );
|
||||
DECLARE_WRITE_LINE_MEMBER( console_reset );
|
||||
DECLARE_WRITE_LINE_MEMBER( extint );
|
||||
DECLARE_WRITE_LINE_MEMBER( notconnected );
|
||||
|
||||
// Connections with the system interface chip 9901
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT2 );
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT12 );
|
||||
DECLARE_WRITE_LINE_MEMBER( set_tms9901_INT2_from_v9938);
|
||||
DECLARE_WRITE_LINE_MEMBER( extint );
|
||||
DECLARE_WRITE_LINE_MEMBER( video_interrupt );
|
||||
|
||||
// Connections with the system interface TMS9901
|
||||
DECLARE_READ8_MEMBER(read_by_9901);
|
||||
@ -298,8 +294,8 @@ private:
|
||||
void console_ready_join(int id, int state);
|
||||
|
||||
// Latch for 9901 INT2, INT1 lines
|
||||
int m_9901_int;
|
||||
void set_9901_int(int line, line_state state);
|
||||
line_state m_int1;
|
||||
line_state m_int2;
|
||||
|
||||
// Connected devices
|
||||
required_device<tms9995_device> m_cpu;
|
||||
@ -523,7 +519,7 @@ GROM_LIBRARY_CONFIG3(pascal3, region_gromlib3)
|
||||
|
||||
READ8_MEMBER( ti99_8_state::cruread )
|
||||
{
|
||||
// if (VERBOSE>6) LOG("read access to CRU address %04x\n", offset << 4);
|
||||
// if (VERBOSE>6) logerror("read access to CRU address %04x\n", offset << 4);
|
||||
UINT8 value = 0;
|
||||
|
||||
// Similar to the bus8z_devices, just let the mapper, the gromport, and the p-box
|
||||
@ -533,13 +529,13 @@ READ8_MEMBER( ti99_8_state::cruread )
|
||||
m_gromport->crureadz(space, offset<<4, &value);
|
||||
m_peribox->crureadz(space, offset<<4, &value);
|
||||
|
||||
if (TRACE_CRU) LOG("ti99_8: CRU %04x -> %02x\n", offset<<4, value);
|
||||
if (TRACE_CRU) logerror("ti99_8: CRU %04x -> %02x\n", offset<<4, value);
|
||||
return value;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( ti99_8_state::cruwrite )
|
||||
{
|
||||
if (TRACE_CRU) LOG("ti99_8: CRU %04x <- %x\n", offset<<1, data);
|
||||
if (TRACE_CRU) logerror("ti99_8: CRU %04x <- %x\n", offset<<1, data);
|
||||
m_mainboard->cruwrite(space, offset<<1, data);
|
||||
m_gromport->cruwrite(space, offset<<1, data);
|
||||
m_peribox->cruwrite(space, offset<<1, data);
|
||||
@ -584,7 +580,9 @@ READ8_MEMBER( ti99_8_state::read_by_9901 )
|
||||
{
|
||||
answer = ioport(column[m_keyboard_column])->read();
|
||||
}
|
||||
answer = (answer << 6) | m_9901_int;
|
||||
answer = (answer << 6);
|
||||
if (m_int1 == CLEAR_LINE) answer |= 0x02;
|
||||
if (m_int2 == CLEAR_LINE) answer |= 0x04;
|
||||
|
||||
break;
|
||||
|
||||
@ -632,8 +630,10 @@ READ8_MEMBER( ti99_8_state::read_by_9901 )
|
||||
*/
|
||||
void ti99_8_state::set_keyboard_column(int number, int data)
|
||||
{
|
||||
if (data != 0) m_keyboard_column |= 1 << number;
|
||||
else m_keyboard_column &= ~(1 << number);
|
||||
if (data != 0)
|
||||
m_keyboard_column |= 1 << number;
|
||||
else
|
||||
m_keyboard_column &= ~(1 << number);
|
||||
|
||||
if (m_keyboard_column >= 14)
|
||||
{
|
||||
@ -667,6 +667,9 @@ WRITE_LINE_MEMBER( ti99_8_state::keyC3 )
|
||||
WRITE_LINE_MEMBER( ti99_8_state::CRUS )
|
||||
{
|
||||
m_mainboard->CRUS_set(state==ASSERT_LINE);
|
||||
|
||||
// In Armadillo mode, GROMs are located at f830; accordingly, the
|
||||
// gromport must be reconfigured
|
||||
if (state==ASSERT_LINE)
|
||||
{
|
||||
m_gromport->set_grom_base(0x9800, 0xfbf1);
|
||||
@ -718,55 +721,16 @@ WRITE8_MEMBER( ti99_8_state::tms9901_interrupt )
|
||||
m_cpu->set_input_line(INT_9995_INT1, data);
|
||||
}
|
||||
|
||||
/*
|
||||
const tms9901_interface tms9901_wiring_ti99_8 =
|
||||
{
|
||||
TMS9901_INT1 | TMS9901_INT2 | TMS9901_INTC,
|
||||
|
||||
// read handler
|
||||
DEVCB_DRIVER_MEMBER(ti99_8_state, read_by_9901),
|
||||
|
||||
// write handlers
|
||||
{
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, keyC0),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, keyC1),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, keyC2),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, keyC3),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, CRUS),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, PTGEN),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, cassette_motor),
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, audio_gate),
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, cassette_output),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL
|
||||
},
|
||||
|
||||
DEVCB_DRIVER_MEMBER(ti99_8_state, tms9901_interrupt)
|
||||
};
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void ti99_8_state::set_9901_int( int line, line_state state)
|
||||
{
|
||||
m_tms9901->set_single_int(line, state);
|
||||
// We latch the value for the read operation. Mind the negative logic.
|
||||
if (state==CLEAR_LINE) m_9901_int |= (1<<line);
|
||||
else m_9901_int &= ~(1<<line);
|
||||
}
|
||||
|
||||
/*
|
||||
set the state of TMS9901's INT2 (called by the tms9928 core)
|
||||
*/
|
||||
WRITE_LINE_MEMBER( ti99_8_state::set_tms9901_INT2 )
|
||||
WRITE_LINE_MEMBER( ti99_8_state::video_interrupt )
|
||||
{
|
||||
if (TRACE_INTERRUPTS) LOG("ti99_8: VDP int 2 on tms9901, level=%02x\n", state);
|
||||
set_9901_int(2, (line_state)state);
|
||||
if (TRACE_INTERRUPTS) logerror("ti99_8: VDP int 2 on tms9901, level=%02x\n", state);
|
||||
m_int2 = (line_state)state;
|
||||
m_tms9901->set_single_int(2, state);
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
@ -787,7 +751,7 @@ void ti99_8_state::console_ready_join(int id, int state)
|
||||
|
||||
if (TRACE_READY)
|
||||
{
|
||||
if (m_nready_prev != m_nready_combined) LOG("ti99_8: READY bits = %04x\n", ~m_nready_combined);
|
||||
if (m_nready_prev != m_nready_combined) logerror("ti99_8: READY bits = %04x\n", ~m_nready_combined);
|
||||
}
|
||||
|
||||
m_nready_prev = m_nready_combined;
|
||||
@ -842,19 +806,20 @@ WRITE_LINE_MEMBER( ti99_8_state::console_reset )
|
||||
|
||||
WRITE_LINE_MEMBER( ti99_8_state::extint )
|
||||
{
|
||||
if (TRACE_READY) LOG("ti99_8: EXTINT level = %02x\n", state);
|
||||
set_9901_int(1, (line_state)state);
|
||||
if (TRACE_READY) logerror("ti99_8: EXTINT level = %02x\n", state);
|
||||
m_int1 = (line_state)state;
|
||||
m_tms9901->set_single_int(1, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( ti99_8_state::notconnected )
|
||||
{
|
||||
if (TRACE_READY) LOG("ti99_8: Setting a not connected line ... ignored\n");
|
||||
if (TRACE_READY) logerror("ti99_8: Setting a not connected line ... ignored\n");
|
||||
}
|
||||
|
||||
static TMS9928A_INTERFACE(ti99_8_tms9118a_interface)
|
||||
{
|
||||
0x4000,
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, set_tms9901_INT2)
|
||||
DEVCB_DRIVER_LINE_MEMBER(ti99_8_state, video_interrupt)
|
||||
};
|
||||
|
||||
WRITE8_MEMBER( ti99_8_state::external_operation )
|
||||
@ -863,7 +828,7 @@ WRITE8_MEMBER( ti99_8_state::external_operation )
|
||||
if (offset == IDLE_OP) return;
|
||||
else
|
||||
{
|
||||
LOG("ti99_4x: External operation %s not implemented on TI-99/8 board\n", extop[offset]);
|
||||
logerror("ti99_4x: External operation %s not implemented on TI-99/8 board\n", extop[offset]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1002,11 +967,12 @@ MACHINE_RESET_MEMBER(ti99_8_state, ti99_8)
|
||||
m_nready_combined = 0;
|
||||
m_gromport->set_grom_base(0x9800, 0xfff1);
|
||||
|
||||
// Clear INT1 and INT2 latch (negative logic)
|
||||
m_9901_int = 0x03;
|
||||
// Clear INT1 and INT2 latch
|
||||
m_int1 = CLEAR_LINE;
|
||||
m_int2 = CLEAR_LINE;
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( ti99_8_60hz, ti99_8_state )
|
||||
static MACHINE_CONFIG_START( ti99_8, ti99_8_state )
|
||||
// basic machine hardware */
|
||||
// TMS9995-MP9537 CPU @ 10.7 MHz
|
||||
// MP9537 mask: This variant of the TMS9995 does not contain on-chip RAM
|
||||
@ -1017,9 +983,6 @@ static MACHINE_CONFIG_START( ti99_8_60hz, ti99_8_state )
|
||||
MCFG_MACHINE_START_OVERRIDE(ti99_8_state, ti99_8 )
|
||||
MCFG_MACHINE_RESET_OVERRIDE(ti99_8_state, ti99_8 )
|
||||
|
||||
/* Video hardware */
|
||||
MCFG_TI998_ADD_NTSC(VIDEO_SYSTEM_TAG, TMS9118, ti99_8_tms9118a_interface)
|
||||
|
||||
/* Main board */
|
||||
MCFG_DEVICE_ADD(TMS9901_TAG, TMS9901, XTAL_10_738635MHz/4.0)
|
||||
MCFG_TMS9901_READBLOCK_HANDLER( READ8(ti99_8_state, read_by_9901) )
|
||||
@ -1074,77 +1037,21 @@ static MACHINE_CONFIG_START( ti99_8_60hz, ti99_8_state )
|
||||
MCFG_SPEECH8_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_speech))
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 60 )
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
TI-99/8 US version (NTSC, 60 Hz)
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_8_60hz, ti99_8 )
|
||||
MCFG_TI998_ADD_NTSC(VIDEO_SYSTEM_TAG, TMS9118, ti99_8_tms9118a_interface)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
static MACHINE_CONFIG_START( ti99_8_50hz, ti99_8_state )
|
||||
/* basic machine hardware */
|
||||
/* TMS9995-MP9537 CPU @ 10.7 MHz */
|
||||
MCFG_TMS99xx_ADD("maincpu", TMS9995_MP9537, XTAL_10_738635MHz, memmap, crumap)
|
||||
MCFG_TMS9995_EXTOP_HANDLER( WRITE8(ti99_8_state, external_operation) )
|
||||
MCFG_TMS9995_CLKOUT_HANDLER( WRITELINE(ti99_8_state, clock_out) )
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(ti99_8_state, ti99_8 )
|
||||
MCFG_MACHINE_RESET_OVERRIDE(ti99_8_state, ti99_8 )
|
||||
|
||||
/* Video hardware */
|
||||
/*
|
||||
TI-99/8 European version (PAL, 50 Hz)
|
||||
*/
|
||||
static MACHINE_CONFIG_DERIVED( ti99_8_50hz, ti99_8 )
|
||||
MCFG_TI998_ADD_PAL(VIDEO_SYSTEM_TAG, TMS9129, ti99_8_tms9118a_interface)
|
||||
|
||||
/* Main board */
|
||||
MCFG_DEVICE_ADD(TMS9901_TAG, TMS9901, XTAL_10_738635MHz/4.0)
|
||||
MCFG_TMS9901_READBLOCK_HANDLER( READ8(ti99_8_state, read_by_9901) )
|
||||
MCFG_TMS9901_P0_HANDLER( WRITELINE( ti99_8_state, keyC0) )
|
||||
MCFG_TMS9901_P1_HANDLER( WRITELINE( ti99_8_state, keyC1) )
|
||||
MCFG_TMS9901_P2_HANDLER( WRITELINE( ti99_8_state, keyC2) )
|
||||
MCFG_TMS9901_P3_HANDLER( WRITELINE( ti99_8_state, keyC3) )
|
||||
MCFG_TMS9901_P4_HANDLER( WRITELINE( ti99_8_state, CRUS) )
|
||||
MCFG_TMS9901_P5_HANDLER( WRITELINE( ti99_8_state, PTGEN) )
|
||||
MCFG_TMS9901_P6_HANDLER( WRITELINE( ti99_8_state, cassette_motor) )
|
||||
MCFG_TMS9901_P8_HANDLER( WRITELINE( ti99_8_state, audio_gate) )
|
||||
MCFG_TMS9901_P9_HANDLER( WRITELINE( ti99_8_state, cassette_output) )
|
||||
MCFG_TMS9901_INTLEVEL_HANDLER( WRITE8( ti99_8_state, tms9901_interrupt) )
|
||||
|
||||
MCFG_MAINBOARD8_ADD( MAINBOARD8_TAG, mapper_conf )
|
||||
MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG )
|
||||
MCFG_GROMPORT_READY_HANDLER( WRITELINE(ti99_8_state, console_ready_cart) )
|
||||
MCFG_GROMPORT_RESET_HANDLER( WRITELINE(ti99_8_state, console_reset) )
|
||||
|
||||
/* Peripheral expansion box */
|
||||
MCFG_DEVICE_ADD( PERIBOX_TAG, PERIBOX_998, 0)
|
||||
MCFG_PERIBOX_INTA_HANDLER( WRITELINE(ti99_8_state, extint) )
|
||||
MCFG_PERIBOX_INTB_HANDLER( WRITELINE(ti99_8_state, notconnected) )
|
||||
MCFG_PERIBOX_READY_HANDLER( WRITELINE(ti99_8_state, console_ready_pbox) )
|
||||
|
||||
/* Sound hardware */
|
||||
MCFG_TI_SOUND_76496_ADD( TISOUND_TAG )
|
||||
MCFG_TI_SOUND_READY_HANDLER( WRITELINE(ti99_8_state, console_ready_sound) )
|
||||
|
||||
/* Cassette drives */
|
||||
MCFG_SPEAKER_STANDARD_MONO("cass_out")
|
||||
MCFG_CASSETTE_ADD( "cassette", default_cassette_interface )
|
||||
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cass_out", 0.25)
|
||||
|
||||
/* Console GROMs */
|
||||
MCFG_GROM_ADD( GROM0_TAG, grom0_config )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
|
||||
MCFG_GROM_ADD( GROM1_TAG, grom1_config )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
|
||||
MCFG_GROM_ADD( GROM2_TAG, grom2_config )
|
||||
MCFG_GROM_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_grom))
|
||||
|
||||
/* Pascal GROM libraries. */
|
||||
MCFG_GROM_LIBRARY_ADD8(pascal1_grom, pascal1)
|
||||
MCFG_GROM_LIBRARY_ADD8(pascal2_grom, pascal2)
|
||||
MCFG_GROM_LIBRARY_ADD3(pascal3_grom, pascal3)
|
||||
|
||||
/* Devices */
|
||||
MCFG_DEVICE_ADD(SPEECH_TAG, TI99_SPEECH8, 0)
|
||||
MCFG_SPEECH8_READY_CALLBACK(WRITELINE(ti99_8_state, console_ready_speech))
|
||||
|
||||
// Joystick port
|
||||
MCFG_TI_JOYPORT4A_ADD( JOYPORT_TAG, 50 )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*
|
||||
|
@ -87,34 +87,26 @@ void ti99_handset_device::write_dev(UINT8 data)
|
||||
*/
|
||||
void ti99_handset_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if (id==DELAY_TIMER)
|
||||
m_clock_high = !m_clock_high;
|
||||
m_buf >>= 4;
|
||||
m_buflen--;
|
||||
|
||||
// Clear the INT12 line
|
||||
m_joyport->set_interrupt(CLEAR_LINE);
|
||||
|
||||
if (m_buflen == 1)
|
||||
{
|
||||
m_clock_high = !m_clock_high;
|
||||
m_buf >>= 4;
|
||||
m_buflen--;
|
||||
|
||||
// Clear the INT12 line
|
||||
m_joyport->set_interrupt(CLEAR_LINE);
|
||||
|
||||
if (m_buflen == 1)
|
||||
{
|
||||
// Unless I am missing something, the third and last nibble of the
|
||||
// message is not acknowledged by the DSR in any way, and the first nibble
|
||||
// of next message is not requested for either, so we need to decide on
|
||||
// our own when we can post a new event. Currently, we wait for 1000us
|
||||
// after the DSR acknowledges the second nybble.
|
||||
m_delay_timer->adjust(attotime::from_usec(1000));
|
||||
}
|
||||
|
||||
if (m_buflen == 0)
|
||||
/* See if we need to post a new event */
|
||||
do_task();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Poll timer
|
||||
do_task();
|
||||
// Unless I am missing something, the third and last nibble of the
|
||||
// message is not acknowledged by the DSR in any way, and the first nibble
|
||||
// of next message is not requested for either, so we need to decide on
|
||||
// our own when we can post a new event. Currently, we wait for 1000us
|
||||
// after the DSR acknowledges the second nybble.
|
||||
m_delay_timer->adjust(attotime::from_usec(1000));
|
||||
}
|
||||
|
||||
if (m_buflen == 0)
|
||||
/* See if we need to post a new event */
|
||||
do_task();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -318,18 +310,21 @@ void ti99_handset_device::do_task()
|
||||
}
|
||||
}
|
||||
|
||||
void ti99_handset_device::pulse_clock()
|
||||
{
|
||||
logerror("handset: pulse_clock\n");
|
||||
do_task();
|
||||
}
|
||||
|
||||
void ti99_handset_device::device_start(void)
|
||||
{
|
||||
m_delay_timer = timer_alloc(DELAY_TIMER);
|
||||
m_poll_timer = timer_alloc(POLL_TIMER);
|
||||
m_poll_timer->adjust(attotime::from_hz(m_joyport->clock()), 0, attotime::from_hz(m_joyport->clock()));
|
||||
}
|
||||
|
||||
void ti99_handset_device::device_reset(void)
|
||||
{
|
||||
if (VERBOSE>5) LOG("ti99_handset_device: Reset\n");
|
||||
m_delay_timer->enable(true);
|
||||
m_poll_timer->enable(true);
|
||||
m_buf = 0;
|
||||
m_buflen = 0;
|
||||
m_clock_high = false;
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
UINT8 read_dev();
|
||||
void write_dev(UINT8 data);
|
||||
|
||||
void pulse_clock();
|
||||
|
||||
protected:
|
||||
virtual void device_start(void);
|
||||
virtual void device_reset(void);
|
||||
@ -54,7 +56,6 @@ private:
|
||||
UINT8 previous_key[MAX_HANDSETS];
|
||||
|
||||
emu_timer *m_delay_timer;
|
||||
emu_timer *m_poll_timer;
|
||||
};
|
||||
|
||||
#define MCFG_HANDSET_ADD(_tag, _intf, _clock ) \
|
||||
|
@ -63,6 +63,14 @@ void joyport_device::write_port(int data)
|
||||
m_connected->write_dev(data);
|
||||
}
|
||||
|
||||
/*
|
||||
This is only used for the handset device of the TI-99/4. It is driven by the VDP interrupt.
|
||||
*/
|
||||
void joyport_device::pulse_clock()
|
||||
{
|
||||
m_connected->pulse_clock();
|
||||
}
|
||||
|
||||
/*
|
||||
Propagate the interrupt to the defined target. Only used for the handset
|
||||
at the prototype 99/4.
|
||||
@ -75,7 +83,6 @@ WRITE_LINE_MEMBER( joyport_device::set_interrupt )
|
||||
void joyport_device::device_start()
|
||||
{
|
||||
m_interrupt.resolve();
|
||||
logerror("joyport: Set clock to %d\n", m_clock);
|
||||
}
|
||||
|
||||
void joyport_device::device_config_complete()
|
||||
|
@ -31,18 +31,17 @@ class joyport_device;
|
||||
********************************************************************/
|
||||
class joyport_attached_device : public device_t
|
||||
{
|
||||
friend class joyport_device;
|
||||
public:
|
||||
joyport_attached_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)
|
||||
: device_t(mconfig, type, name, tag, owner, clock, shortname, source) { }
|
||||
|
||||
virtual UINT8 read_dev() =0;
|
||||
virtual void write_dev(UINT8 data) =0;
|
||||
virtual void pulse_clock() { };
|
||||
|
||||
protected:
|
||||
virtual void device_config_complete();
|
||||
joyport_device* m_joyport;
|
||||
|
||||
private:
|
||||
virtual UINT8 read_dev() =0;
|
||||
virtual void write_dev(UINT8 data) =0;
|
||||
};
|
||||
|
||||
/********************************************************************
|
||||
@ -55,6 +54,7 @@ public:
|
||||
UINT8 read_port();
|
||||
void write_port(int data);
|
||||
void set_interrupt(int state);
|
||||
void pulse_clock();
|
||||
|
||||
template<class _Object> static devcb2_base &static_set_int_callback(device_t &device, _Object object) { return downcast<joyport_device &>(device).m_interrupt.set_callback(object); }
|
||||
|
||||
@ -74,16 +74,16 @@ SLOT_INTERFACE_EXTERN(joystick_port_gen);
|
||||
#define MCFG_JOYPORT_INT_HANDLER( _intcallb ) \
|
||||
devcb = &joyport_device::static_set_int_callback( *device, DEVCB2_##_intcallb );
|
||||
|
||||
#define MCFG_GENEVE_JOYPORT_ADD( _tag, _clock ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, _clock) \
|
||||
#define MCFG_GENEVE_JOYPORT_ADD( _tag ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(joystick_port_gen, "twinjoy", false)
|
||||
|
||||
#define MCFG_TI_JOYPORT4A_ADD( _tag, _clock ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, _clock) \
|
||||
#define MCFG_TI_JOYPORT4A_ADD( _tag ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(joystick_port, "twinjoy", false)
|
||||
|
||||
#define MCFG_TI_JOYPORT4_ADD( _tag, _clock ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, _clock) \
|
||||
#define MCFG_TI_JOYPORT4_ADD( _tag ) \
|
||||
MCFG_DEVICE_ADD(_tag, JOYPORT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(joystick_port_994, "twinjoy", false)
|
||||
|
||||
#endif /* __JOYPORT__ */
|
||||
|
@ -171,7 +171,10 @@ void mecmouse_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
void mecmouse_device::device_start(void)
|
||||
{
|
||||
m_poll_timer = timer_alloc(POLL_TIMER);
|
||||
m_poll_timer->adjust(attotime::from_hz(m_joyport->clock()), 0, attotime::from_hz(m_joyport->clock()));
|
||||
// The poll time cannot depend on the console settings, since the TI-99/4A
|
||||
// has no clock line on the joystick port. The rate is not mentioned in
|
||||
// the specs; however, if it is too low, the mouse pointer will do jumps
|
||||
m_poll_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100));
|
||||
}
|
||||
|
||||
void mecmouse_device::device_reset(void)
|
||||
|
Loading…
Reference in New Issue
Block a user