(MESS) Added pal/ntsc switch to ef934x; prevents garbage at the bottom of the screen for odyssey3. (nw)

This commit is contained in:
Wilbert Pol 2013-02-27 20:22:58 +00:00
parent b3a34bdaba
commit 75cb110ab1
2 changed files with 4 additions and 11 deletions

View File

@ -66,6 +66,7 @@ void ef9340_1_device::device_reset()
m_ef9340.Y0 = 0;
m_ef9340.R = 0;
m_ef9340.M = 0;
m_ef9340.max_vpos = 210;
m_ef9341.TA = 0;
m_ef9341.TB = 0;
m_ef9341.busy = 0;
@ -139,32 +140,26 @@ void ef9340_1_device::ef9341_write( UINT8 command, UINT8 b, UINT8 data )
switch( m_ef9341.TB & 0xE0 )
{
case 0x00: /* Begin row */
logerror("begin row\n");
m_ef9340.X = 0;
m_ef9340.Y = m_ef9341.TA & 0x1F;
break;
case 0x20: /* Load Y */
logerror("load y\n");
m_ef9340.Y = m_ef9341.TA & 0x1F;
break;
case 0x40: /* Load X */
logerror("load x\n");
m_ef9340.X = m_ef9341.TA & 0x3F;
break;
case 0x60: /* INC C */
logerror("inc c\n");
ef9340_inc_c();
break;
case 0x80: /* Load M */
logerror("load m\n");
m_ef9340.M = m_ef9341.TA;
break;
case 0xA0: /* Load R */
logerror("load r\n");
m_ef9340.R = m_ef9341.TA;
m_ef9340.max_vpos = ( m_ef9340.R & 0x40 ) ? 250 : 210;
break;
case 0xC0: /* Load Y0 */
logerror("load y0\n");
m_ef9340.Y0 = m_ef9341.TA & 0x3F;
break;
}
@ -186,7 +181,6 @@ logerror("load y0\n");
switch ( m_ef9340.M & 0xE0 )
{
case 0x00: /* Write */
logerror("%d,%d = %02x, %02x\n", m_ef9340.X, m_ef9340.Y, m_ef9341.TB, m_ef9341.TA);
m_ef934x_ram_a[addr] = m_ef9341.TA;
m_ef934x_ram_b[addr] = m_ef9341.TB;
ef9340_inc_c();
@ -214,10 +208,8 @@ logerror("%d,%d = %02x, %02x\n", m_ef9340.X, m_ef9340.Y, m_ef9341.TB, m_ef9341.T
UINT8 b = m_ef934x_ram_b[addr];
UINT8 slice = ( m_ef9340.M & 0x0f ) % 10;
logerror("write slice addr=%04x, b=%02x\n", addr, b);
if ( b >= 0xa0 )
{
logerror("write slice external ram %04x\n", external_chargen_address(b,slice));
m_ef934x_ext_char_ram[ ( ( a & 0x80 ) << 3 ) | external_chargen_address( b, slice ) ] = BITSWAP8(m_ef9341.TA,0,1,2,3,4,5,6,7);
}
@ -274,7 +266,7 @@ UINT8 ef9340_1_device::ef9341_read( UINT8 command, UINT8 b )
void ef9340_1_device::ef9340_scanline(int vpos)
{
if ( vpos < 250 )
if ( vpos < m_ef9340.max_vpos )
{
int y = vpos - 0;
int y_row, slice;

View File

@ -70,6 +70,7 @@ protected:
UINT8 Y0;
UINT8 R;
UINT8 M;
int max_vpos;
} m_ef9340;
UINT8 m_ef934x_ram_a[1024];
UINT8 m_ef934x_ram_b[1024];