amstrad: added Plus left border shift function

This commit is contained in:
mahlemiut 2015-11-22 20:59:18 +13:00
parent 1d0a763128
commit 27ad714680
2 changed files with 20 additions and 5 deletions

View File

@ -101,6 +101,8 @@ struct asic_t
UINT8 horiz_disp; UINT8 horiz_disp;
UINT8 hscroll; UINT8 hscroll;
UINT8 de_start; /* flag to check if DE is been enabled this frame yet */ UINT8 de_start; /* flag to check if DE is been enabled this frame yet */
bool hsync_first_tick; /* flag to check in first CRTC tick, used for knowing when to cover left side of screen to cover horizontal softscroll mess */
UINT8 hsync_tick_count;
/* DMA */ /* DMA */
UINT8 dma_status; UINT8 dma_status;

View File

@ -709,9 +709,13 @@ void amstrad_state::amstrad_plus_gate_array_get_video_data()
{ {
ma += m_asic.horiz_disp; ma += m_asic.horiz_disp;
} }
m_gate_array.address = ( ( ma & 0x3000 ) << 2 ) | ( ( ra & 0x07 ) << 11 ) | ( ( ma & 0x3ff ) << 1 ); m_gate_array.address = ( ( ma & 0x3000 ) << 2 ) | ( ( ra & 0x07 ) << 11 ) | ( ( ma & 0x3ff ) << 1 );
m_gate_array.data = m_ram->pointer()[ m_gate_array.address ]; m_gate_array.data = m_ram->pointer()[ m_gate_array.address ];
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick)
caddr = 0x2420;
else
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2;
m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 ); m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 );
m_gate_array.colour_ticks = m_gate_array.max_colour_ticks; m_gate_array.colour_ticks = m_gate_array.max_colour_ticks;
m_gate_array.ticks = 0; m_gate_array.ticks = 0;
@ -750,7 +754,10 @@ void amstrad_state::amstrad_plus_update_video()
UINT16 caddr; UINT16 caddr;
m_gate_array.data <<= 1; m_gate_array.data <<= 1;
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick)
caddr = 0x2420;
else
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2;
m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 ); m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 );
m_gate_array.colour_ticks = m_gate_array.max_colour_ticks; m_gate_array.colour_ticks = m_gate_array.max_colour_ticks;
} }
@ -762,7 +769,10 @@ void amstrad_state::amstrad_plus_update_video()
UINT16 caddr; UINT16 caddr;
m_gate_array.data = m_ram->pointer()[ m_gate_array.address + 1 ]; m_gate_array.data = m_ram->pointer()[ m_gate_array.address + 1 ];
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick)
caddr = 0x2420;
else
caddr = 0x2400 + m_gate_array.mode_lookup[m_gate_array.data] * 2;
m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 ); m_gate_array.colour = m_asic.ram[caddr] + ( m_asic.ram[caddr+1] << 8 );
} }
break; break;
@ -776,6 +786,9 @@ void amstrad_state::amstrad_plus_update_video()
m_gate_array.draw_p++; m_gate_array.draw_p++;
cycles_passed--; cycles_passed--;
m_gate_array.line_ticks++; m_gate_array.line_ticks++;
m_asic.hsync_tick_count++;
if(m_asic.hsync_tick_count > 16)
m_asic.hsync_first_tick = false;
if ( m_gate_array.line_ticks >= m_gate_array.bitmap->width() ) if ( m_gate_array.line_ticks >= m_gate_array.bitmap->width() )
{ {
m_gate_array.draw_p = NULL; m_gate_array.draw_p = NULL;
@ -1031,6 +1044,8 @@ WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_de_changed)
m_gate_array.ma = m_crtc->get_ma(); m_gate_array.ma = m_crtc->get_ma();
m_gate_array.ra = m_crtc->get_ra(); m_gate_array.ra = m_crtc->get_ra();
m_asic.hsync_first_tick = true;
m_asic.hsync_tick_count = 0;
m_asic.h_start = m_gate_array.line_ticks; m_asic.h_start = m_gate_array.line_ticks;
if(m_asic.de_start == 0) if(m_asic.de_start == 0)
m_asic.vpos = 0; m_asic.vpos = 0;
@ -1039,8 +1054,6 @@ WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_de_changed)
m_asic.hscroll = m_asic.ram[0x2804] & 0x0f; m_asic.hscroll = m_asic.ram[0x2804] & 0x0f;
if ( m_asic.hscroll == 0 ) if ( m_asic.hscroll == 0 )
amstrad_plus_gate_array_get_video_data(); amstrad_plus_gate_array_get_video_data();
// if( m_asic.ram[0x2804] & 0x80 ) // draw border for first character if set (hides graphic mess when using softscroll)
// *m_gate_array.draw_p = m_asic.ram[0x2420] + ( m_asic.ram[0x2421] << 8 );
/* Start of screen */ /* Start of screen */
if ( m_asic.vpos == 0 ) if ( m_asic.vpos == 0 )