Skip to content

Commit

Permalink
pc9801: save the egc pattern regs when set on write
Browse files Browse the repository at this point in the history
  • Loading branch information
cracyc committed Nov 12, 2024
1 parent 6b774ce commit 7195c63
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/mame/nec/pc9801_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@ void pc9801vm_state::egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mas
{
if(BIT(m_egc.regs[2], 10))
{
m_egc.leftover[0] = 0;
egc_shift(0, data);
// leftover[0] is inited above, set others to same
m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = m_egc.leftover[0];
Expand All @@ -742,8 +741,6 @@ void pc9801vm_state::egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mas
if(m_egc.first)
{
mask &= dir ? ~((1 << dst_off) - 1) : ((1 << (16 - dst_off)) - 1);
if(BIT(m_egc.regs[2], 10) && !m_egc.init)
m_egc.leftover[0] = m_egc.leftover[1] = m_egc.leftover[2] = m_egc.leftover[3] = 0;
m_egc.init = true;
}

Expand All @@ -762,6 +759,15 @@ void pc9801vm_state::egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mas
mask &= end_mask;
}

// load all the plane pattern regs
if((m_egc.regs[2] & 0x300) == 0x200)
{
m_egc.pat[0] = m_video_ram[1][offset + 0x4000];
m_egc.pat[1] = m_video_ram[1][offset + (0x4000 * 2)];
m_egc.pat[2] = m_video_ram[1][offset + (0x4000 * 3)];
m_egc.pat[3] = m_video_ram[1][offset];
}

for(int i = 0; i < 4; i++)
{
if(!BIT(m_egc.regs[0], i))
Expand All @@ -770,9 +776,6 @@ void pc9801vm_state::egc_blit_w(uint32_t offset, uint16_t data, uint16_t mem_mas
if(BIT(m_egc.regs[2], 10))
src = egc_shift(i, data);

if((m_egc.regs[2] & 0x300) == 0x200)
pat = m_video_ram[1][offset + (((i + 1) & 3) * 0x4000)];

switch((m_egc.regs[2] >> 11) & 3)
{
case 0:
Expand Down

0 comments on commit 7195c63

Please sign in to comment.