diff options
| author | 2015-11-22 20:59:18 +1300 | |
|---|---|---|
| committer | 2015-11-22 21:00:07 +1300 | |
| commit | 27ad7146808a89391c15dfdf1e63acd6915bdaea (patch) | |
| tree | 79998e11c99aa52f567659066417a9c847f82263 /src | |
| parent | 1d0a763128f9ed77ae90451f038cd4ea2210b6c1 (diff) | |
amstrad: added Plus left border shift function
Diffstat (limited to 'src')
| -rw-r--r-- | src/mame/includes/amstrad.h | 2 | ||||
| -rw-r--r-- | src/mame/machine/amstrad.cpp | 23 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/mame/includes/amstrad.h b/src/mame/includes/amstrad.h index 619b7dc36d0..b46afb75dc8 100644 --- a/src/mame/includes/amstrad.h +++ b/src/mame/includes/amstrad.h @@ -101,6 +101,8 @@ struct asic_t UINT8 horiz_disp; UINT8 hscroll; 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 */ UINT8 dma_status; diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index f814cfe3db1..2e6f5c4226c 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -709,9 +709,13 @@ void amstrad_state::amstrad_plus_gate_array_get_video_data() { ma += m_asic.horiz_disp; } + m_gate_array.address = ( ( ma & 0x3000 ) << 2 ) | ( ( ra & 0x07 ) << 11 ) | ( ( ma & 0x3ff ) << 1 ); 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_ticks = m_gate_array.max_colour_ticks; m_gate_array.ticks = 0; @@ -750,7 +754,10 @@ void amstrad_state::amstrad_plus_update_video() UINT16 caddr; 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_ticks = m_gate_array.max_colour_ticks; } @@ -762,7 +769,10 @@ void amstrad_state::amstrad_plus_update_video() UINT16 caddr; 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 ); } break; @@ -776,6 +786,9 @@ void amstrad_state::amstrad_plus_update_video() m_gate_array.draw_p++; cycles_passed--; 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() ) { 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.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; if(m_asic.de_start == 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; if ( m_asic.hscroll == 0 ) 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 */ if ( m_asic.vpos == 0 ) |
