k057714: found yet another fifo (nw)

This commit is contained in:
Ville Linde 2015-08-20 16:54:53 +03:00
parent 4a8f446595
commit 29b35bb6a1
3 changed files with 57 additions and 1 deletions

View File

@ -152,6 +152,7 @@ static ADDRESS_MAP_START( konendev_map, AS_PROGRAM, 32, konendev_state )
// AM_RANGE(0x78000000, 0x78000003) AM_READNOP
// AM_RANGE(0x78100000, 0x7810001b) AM_RAM
// AM_RANGE(0x78a00014, 0x78a00017) AM_WRITENOP
AM_RANGE(0x79000000, 0x79000003) AM_DEVWRITE("gcu", k057714_device, fifo_w)
AM_RANGE(0x79800000, 0x798000ff) AM_DEVREADWRITE("gcu", k057714_device, read, write)
AM_RANGE(0x7a000000, 0x7a01ffff) AM_RAM AM_SHARE("nvram0")
AM_RANGE(0x7a100000, 0x7a11ffff) AM_RAM AM_SHARE("nvram1")

View File

@ -116,6 +116,14 @@ WRITE32_MEMBER(k057714_device::write)
case 0x18: // ?
break;
case 0x1c: // set to 1 on "media bus" access
if ((data >> 16) == 1)
{
m_ext_fifo_count = 0;
m_ext_fifo_line = 0;
}
break;
case 0x20: // Framebuffer 0 Origin(?)
break;
@ -184,6 +192,17 @@ WRITE32_MEMBER(k057714_device::write)
#endif
break;
case 0x54:
if (ACCESSING_BITS_16_31)
m_ext_fifo_num_lines = data >> 16;
if (ACCESSING_BITS_0_15)
m_ext_fifo_width = data & 0xffff;
break;
case 0x58:
m_ext_fifo_addr = (data & 0xffffff);
break;
case 0x5c: // VRAM Read Address
m_vram_read_addr = (data & 0xffffff) / 2;
break;
@ -250,11 +269,41 @@ WRITE32_MEMBER(k057714_device::write)
break;
default:
//printf("%s_w: %02X, %08X, %08X\n", basetag(), reg, data, mem_mask);
//printf("%s_w: %02X, %08X, %08X at %08X\n", basetag(), reg, data, mem_mask, space.device().safe_pc());
break;
}
}
WRITE32_MEMBER(k057714_device::fifo_w)
{
if (ACCESSING_BITS_16_31)
{
if (m_ext_fifo_count != 0) // first access is a dummy write
{
int count = m_ext_fifo_count - 1;
UINT32 addr = (((m_ext_fifo_addr >> 10) + m_ext_fifo_line) * 1024) + count;
if ((count & 1) == 0)
{
m_vram[addr >> 1] &= 0x0000ffff;
m_vram[addr >> 1] |= (data & 0xffff0000);
}
else
{
m_vram[addr >> 1] &= 0xffff0000;
m_vram[addr >> 1] |= (data >> 16);
}
}
m_ext_fifo_count++;
if (m_ext_fifo_count > m_ext_fifo_width+1)
{
m_ext_fifo_line++;
m_ext_fifo_count = 0;
}
}
}
int k057714_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
UINT16 *vram16 = (UINT16*)m_vram;

View File

@ -15,6 +15,7 @@ public:
DECLARE_READ32_MEMBER(read);
DECLARE_WRITE32_MEMBER(write);
DECLARE_WRITE32_MEMBER(fifo_w);
struct framebuffer
{
@ -46,6 +47,11 @@ private:
UINT32 m_command_fifo0_ptr;
UINT32 m_command_fifo1[4];
UINT32 m_command_fifo1_ptr;
UINT32 m_ext_fifo_addr;
UINT32 m_ext_fifo_count;
UINT32 m_ext_fifo_line;
UINT32 m_ext_fifo_num_lines;
UINT32 m_ext_fifo_width;
framebuffer m_frame[4];
UINT32 m_fb_origin_x;