mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
315_5124.c: Improved CRAM writes. Fixes wrong colors on sega logo for robocop3 on gamegear. [Enik Land]
This commit is contained in:
parent
a250f22d2d
commit
df21eba02c
@ -617,14 +617,7 @@ WRITE8_MEMBER( sega315_5124_device::vram_write )
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
{
|
||||
UINT16 address = m_addr & m_cram_mask;
|
||||
if (data != m_CRAM->u8(address))
|
||||
{
|
||||
m_CRAM->u8(address) = data;
|
||||
m_cram_dirty = 1;
|
||||
}
|
||||
}
|
||||
cram_write(data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1691,7 +1684,40 @@ void sega315_5378_device::update_palette()
|
||||
{
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
m_current_palette[i] = ((m_CRAM->u8(i * 2 + 1) << 8) | m_CRAM->u8(i * 2)) & 0x0fff;
|
||||
m_current_palette[i] = m_CRAM->u16(i) & 0x0fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sega315_5124_device::cram_write(UINT8 data)
|
||||
{
|
||||
UINT16 address = m_addr & m_cram_mask;
|
||||
if (data != m_CRAM->u8(address))
|
||||
{
|
||||
m_CRAM->u8(address) = data;
|
||||
m_cram_dirty = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sega315_5378_device::cram_write(UINT8 data)
|
||||
{
|
||||
if (m_sega315_5124_compatibility_mode)
|
||||
{
|
||||
sega315_5124_device::cram_write(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_addr & 1)
|
||||
{
|
||||
UINT16 address = (m_addr & m_cram_mask) >> 1;
|
||||
UINT16 dataw = (data << 8) | m_buffer;
|
||||
if (dataw != m_CRAM->u16(address))
|
||||
{
|
||||
m_CRAM->u16(address) = dataw;
|
||||
m_cram_dirty = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
protected:
|
||||
void set_display_settings();
|
||||
virtual void update_palette();
|
||||
virtual void cram_write(UINT8 data);
|
||||
virtual void draw_scanline( int pixel_offset_x, int pixel_plot_y, int line );
|
||||
virtual UINT16 get_name_table_address();
|
||||
void process_line_timer();
|
||||
@ -193,6 +194,7 @@ protected:
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
virtual void update_palette();
|
||||
virtual void cram_write(UINT8 data);
|
||||
virtual void draw_scanline( int pixel_offset_x, int pixel_plot_y, int line );
|
||||
virtual UINT16 get_name_table_address();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user