summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2015-10-27 17:29:24 +1100
committer Vas Crabb <vas@vastheman.com>2015-10-27 17:29:39 +1100
commit384fdb4f1de267cf61fdada7107605df2d236619 (patch)
tree2869a2f03f1678c338477e21c544d31ea4d25592
parentc57130f22f93152224dceec0065909a9130b9952 (diff)
Improve Osborne 1 scroll behaviour based on reading schematic
-rw-r--r--src/mame/includes/osborne1.h1
-rw-r--r--src/mame/machine/osborne1.c23
2 files changed, 13 insertions, 11 deletions
diff --git a/src/mame/includes/osborne1.h b/src/mame/includes/osborne1.h
index 8134e0ccbe7..1c0564b9dbb 100644
--- a/src/mame/includes/osborne1.h
+++ b/src/mame/includes/osborne1.h
@@ -96,6 +96,7 @@ public:
/* video related */
UINT8 m_screen_pac;
UINT8 m_resolution;
+ UINT8 m_hc_left;
UINT8 m_new_start_x;
UINT8 m_new_start_y;
emu_timer *m_video_timer;
diff --git a/src/mame/machine/osborne1.c b/src/mame/machine/osborne1.c
index 1fa93b6567a..c1473410fda 100644
--- a/src/mame/machine/osborne1.c
+++ b/src/mame/machine/osborne1.c
@@ -113,6 +113,7 @@ WRITE8_MEMBER( osborne1_state::osborne1_2000_w )
break;
case 0x400: /* SCREEN-PAC */
m_resolution = data & 0x01;
+ m_hc_left = (data >> 1) & 0x01;
break;
case 0x900: /* IEEE488 PIA */
m_pia0->write(space, offset & 0x03, data );
@@ -342,9 +343,8 @@ void osborne1_state::device_timer(emu_timer &timer, device_timer_id id, int para
TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback)
{
- int y = machine().first_screen()->vpos();
- UINT8 ra=0,chr,gfx,dim;
- UINT16 x,ma;
+ int const y = machine().first_screen()->vpos();
+ UINT8 ra=0;
/* Check for start of frame */
if ( y == 0 )
@@ -361,18 +361,18 @@ TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback)
{
ra = y % 10;
/* Draw a line of the display */
- ma = (m_new_start_y + (y/10)) * 128 + m_new_start_x;
+ bool const hires = m_screen_pac & m_resolution;
+ UINT16 const row = (m_new_start_y + (y/10)) * 128 & 0xF80;
+ UINT16 const col = (m_new_start_x & (hires ? 0x60 : 0x7F));
UINT16 *p = &m_bitmap.pix16(y);
- for ( x = 0; x < ((m_screen_pac && m_resolution) ? 104 : 52); x++ )
+ for ( UINT16 x = 0; x < ((m_screen_pac && m_resolution) ? 104 : 52); x++ )
{
- chr = m_ram->pointer()[ 0xF000 + ( (ma+x) & 0xFFF ) ];
- dim = m_ram->pointer()[ 0x10000 + ( (ma+x) & 0xFFF ) ] & 0x80;
+ UINT16 offs = row | ((col + x) & 0x7F);
+ UINT8 const chr = m_ram->pointer()[ 0xF000 + offs ];
+ UINT8 const dim = m_ram->pointer()[ 0x10000 + offs ] & 0x80;
- if ( (chr & 0x80) && (ra == 9) )
- gfx = 0xFF;
- else
- gfx = m_p_chargen[ (ra << 7) | ( chr & 0x7F ) ];
+ UINT8 const gfx = ((chr & 0x80) && (ra == 9)) ? 0xFF : m_p_chargen[ (ra << 7) | (chr & 0x7F) ];
/* Display a scanline of a character */
*p++ = BIT(gfx, 7) ? ( dim ? 2 : 1 ) : 0;
@@ -425,6 +425,7 @@ void osborne1_state::machine_reset()
m_screen_pac = 0 != (m_cnf->read() & 0x01);
m_resolution = 0;
+ m_hc_left = 0;
m_p_chargen = memregion( "chargen" )->base();
memset( m_ram->pointer() + 0x10000, 0xFF, 0x1000 );