(MESS) microvsn.c: Simplified code a bit by adding separate PLA configurations.

This commit is contained in:
Wilbert Pol 2014-03-24 21:26:31 +00:00
parent 34ade444e9
commit 738a0b82ab

View File

@ -207,32 +207,11 @@ MACHINE_RESET_MEMBER(microvision_state, microvision)
UINT32 microvision_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (m_pla)
for ( UINT8 i = 0; i < 16; i++ )
{
// This works for bowling, vegas slots, alien raiders
static UINT8 coord[16] = {3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12};
for ( UINT8 i = 0; i < 16; i++ )
for ( UINT8 j = 0; j < 16; j++ )
{
for ( UINT8 j = 0; j < 16; j++ )
{
bitmap.pix16(i,j) = m_lcd [coord[i]] [coord[j]];
}
}
}
else
// this works for pinball, blockbuster, phaser strike (remainder: its unknown what they should look like)
{
for ( UINT8 i = 0; i < 16; i++ )
{
for ( UINT8 j = 0; j < 16; j++ )
{
bitmap.pix16(i,j) = m_lcd [i] [j];
}
bitmap.pix16(i,j) = m_lcd [i] [j];
}
}
@ -260,20 +239,37 @@ void microvision_state::screen_vblank(screen_device &screen, bool state)
/*
control is signals LCD5 LCD4
LCD5 = -Data Clk on 0488
LCD4 = Latch pulse on 0488
LCD3 = Data 0
LCD2 = Data 1
LCD1 = Data 2
LCD0 = Data 3
data is signals LCD3 LCD2 LCD1 LCD0
*/
void microvision_state::lcd_write(UINT8 control, UINT8 data)
{
data &= 0xf;
if ( ( control == 2 ) && ( m_lcd_control_old == 0 ) )
{
m_lcd_latch[ m_lcd_latch_index & 0x07 ] = data;
m_lcd_latch_index++;
}
else if ( ( control == 3 ) && ( m_lcd_control_old == 2 ) )
{
// Latch pulse, when high, resets the %8 latch address counter
if ( control & 0x01 ) {
m_lcd_latch_index = 0;
}
// The addressed latches load when -Data Clk is low
if ( ! ( control & 0x02 ) ) {
m_lcd_latch[ m_lcd_latch_index & 0x07 ] = data & 0x0f;
}
// The latch address counter is incremented on rising edges of -Data Clk
if ( ( ! ( m_lcd_control_old & 0x02 ) ) && ( control & 0x02 ) ) {
// Check if Latch pule is low
if ( ! ( control & 0x01 ) ) {
m_lcd_latch_index++;
}
}
// A parallel transfer of data from the addressed latches to the holding latches occurs
// whenever Latch Pulse is high and -Data Clk is high
if ( control == 3 ) {
UINT16 row = ( m_lcd_latch[0] << 12 ) | ( m_lcd_latch[1] << 8 ) | ( m_lcd_latch[2] << 4 ) | m_lcd_latch[3];
UINT16 col = ( m_lcd_latch[4] << 12 ) | ( m_lcd_latch[5] << 8 ) | ( m_lcd_latch[6] << 4 ) | m_lcd_latch[7];
@ -293,6 +289,7 @@ void microvision_state::lcd_write(UINT8 control, UINT8 data)
col <<= 1;
}
}
m_lcd_control_old = control;
}
@ -476,6 +473,27 @@ WRITE16_MEMBER( microvision_state::tms1100_write_r )
}
static const UINT16 microvision_output_pla_0[0x20] =
{
/* O output PLA configuration currently unknown */
0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E,
0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00
};
static const UINT16 microvision_output_pla_1[0x20] =
{
/* O output PLA configuration currently unknown */
/* Reversed bit order */
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00
};
DEVICE_IMAGE_LOAD_MEMBER(microvision_state,microvision_cart)
{
UINT8 *rom1 = memregion("maincpu1")->base();
@ -520,6 +538,8 @@ DEVICE_IMAGE_LOAD_MEMBER(microvision_state,microvision_cart)
m_pla = 1;
}
tms1xxx_cpu_device::set_output_pla( m_tms1100, m_pla ? microvision_output_pla_1 : microvision_output_pla_0 );
// Set default setting for PCB type and RC type
m_pcb_type = microvision_state::PCB_TYPE_UNKNOWN;
m_rc_type = microvision_state::RC_TYPE_UNKNOWN;
@ -623,21 +643,11 @@ static ADDRESS_MAP_START( microvision_8021_io, AS_IO, 8, microvision_state )
ADDRESS_MAP_END
static const UINT16 microvision_output_pla[0x20] =
{
/* O output PLA configuration currently unknown */
0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E,
0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00,
0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00, 0xFF00
};
static MACHINE_CONFIG_START( microvision, microvision_state )
MCFG_CPU_ADD("maincpu1", I8021, 2000000) // approximately
MCFG_CPU_IO_MAP( microvision_8021_io )
MCFG_CPU_ADD("maincpu2", TMS1100, 500000) // most games seem to be running at approximately this speed
MCFG_TMS1XXX_OUTPUT_PLA( microvision_output_pla )
MCFG_TMS1XXX_OUTPUT_PLA( microvision_output_pla_0 )
MCFG_TMS1XXX_READ_K( READ8( microvision_state, tms1100_read_k ) )
MCFG_TMS1XXX_WRITE_O( WRITE16( microvision_state, tms1100_write_o ) )
MCFG_TMS1XXX_WRITE_R( WRITE16( microvision_state, tms1100_write_r ) )