mirror of
https://github.com/holub/mame
synced 2025-10-05 08:41:31 +03:00
Improve Osborne 1 scroll behaviour based on reading schematic
This commit is contained in:
parent
c57130f22f
commit
384fdb4f1d
@ -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;
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user