summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2018-05-28 05:14:36 +0200
committer angelosa <salese_corp_ltd@email.it>2018-05-28 05:16:39 +0200
commitb8d0fba78116cbd3da035f72b839ae65b89a91e3 (patch)
tree05729a6d3140b95cc88925301a56fff5fbcd165b
parentafd8307a0aa7c233da752be448d391849398ddad (diff)
tatsumi.cpp: round up 5 bg gfxdata, needs decoding. Also cleaned up text gfx data (nw)
-rw-r--r--src/mame/drivers/tatsumi.cpp24
-rw-r--r--src/mame/includes/tatsumi.h7
-rw-r--r--src/mame/video/tatsumi.cpp49
3 files changed, 59 insertions, 21 deletions
diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp
index c8ce41f2803..12fb4478c28 100644
--- a/src/mame/drivers/tatsumi.cpp
+++ b/src/mame/drivers/tatsumi.cpp
@@ -289,7 +289,7 @@ void roundup5_state::roundup5_v30_map(address_map &map)
map(0x0f000, 0x0ffff).rw(m_palette, FUNC(palette_device::read8), FUNC(palette_device::write8)).umask16(0x00ff).share("palette");
map(0x10000, 0x1ffff).rw(this, FUNC(roundup5_state::roundup_v30_z80_r), FUNC(roundup5_state::roundup_v30_z80_w));
map(0x20000, 0x2ffff).rw(this, FUNC(roundup5_state::tatsumi_v30_68000_r), FUNC(roundup5_state::tatsumi_v30_68000_w));
- map(0x30000, 0x3ffff).rw(this, FUNC(roundup5_state::roundup5_vram_r), FUNC(roundup5_state::roundup5_vram_w));
+ map(0x30000, 0x3ffff).rw(this, FUNC(roundup5_state::gfxdata_r), FUNC(roundup5_state::gfxdata_w)).umask16(0x00ff);
map(0x80000, 0xfffff).rom();
}
@@ -842,12 +842,25 @@ static const gfx_layout spritelayout =
static const gfx_layout roundup5_vramlayout =
{
8,8,
- 4096 + 2048,
+ 4096,
3,
- { 0x30000 * 8, 0x18000 * 8, 0 },
+ { 0x10000 * 8, 0x8000 * 8, 0 },
{ STEP8(0,1) },
- { STEP8(0,8*2) },
- 8*16
+ { STEP8(0,8) },
+ 8*8
+};
+
+// TODO: wrong, just for debugging
+// color data is likely to be at 0x100 - 0x11f (same color as background during VRAM uploads)
+static const gfx_layout roundup5_bglayout =
+{
+ 8,8,
+ 4096*4,
+ 1,
+ { 0 },
+ { STEP8(0,1) },
+ { STEP8(0,8) },
+ 8*8
};
static GFXDECODE_START( gfx_apache3 )
@@ -858,6 +871,7 @@ GFXDECODE_END
static GFXDECODE_START( gfx_roundup5 )
GFXDECODE_ENTRY( "sprites", 0, spritelayout, 1024, 256)
GFXDECODE_ENTRY( nullptr, 0, roundup5_vramlayout, 0, 16)
+ GFXDECODE_ENTRY( nullptr, 0, roundup5_bglayout, 512, 1)
GFXDECODE_END
static GFXDECODE_START( gfx_cyclwarr )
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index 7a43dca4ff6..b3c4ae12a9e 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -148,8 +148,8 @@ public:
DECLARE_WRITE16_MEMBER(roundup5_control_w);
DECLARE_WRITE16_MEMBER(roundup5_d0000_w);
DECLARE_WRITE16_MEMBER(roundup5_e0000_w);
- DECLARE_READ16_MEMBER(roundup5_vram_r);
- DECLARE_WRITE16_MEMBER(roundup5_vram_w);
+ DECLARE_READ8_MEMBER(gfxdata_r);
+ DECLARE_WRITE8_MEMBER(gfxdata_w);
void init_roundup5();
DECLARE_VIDEO_START(roundup5);
@@ -172,7 +172,8 @@ private:
required_shared_ptr<uint16_t> m_roundup_p_ram;
required_shared_ptr<uint16_t> m_roundup_l_ram;
- std::unique_ptr<uint16_t[]> m_roundup5_vram;
+ std::unique_ptr<uint8_t[]> m_tx_gfxram;
+ std::unique_ptr<uint8_t[]> m_bg_gfxram;
};
class cyclwarr_state : public tatsumi_state
diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp
index 634083f3f23..156529b483b 100644
--- a/src/mame/video/tatsumi.cpp
+++ b/src/mame/video/tatsumi.cpp
@@ -34,24 +34,42 @@ WRITE8_MEMBER(apache3_state::apache3_road_x_w)
m_apache3_road_x_ram[data] = offset;
}
-READ16_MEMBER(roundup5_state::roundup5_vram_r)
+READ8_MEMBER(roundup5_state::gfxdata_r)
{
- offset+=((m_control_word&0x0c00)>>10) * 0xc000;
- return m_roundup5_vram[offset];
+ if((m_control_word & 0x200) == 0x200)
+ {
+ offset += (m_control_word & 0x6000) << 2;
+
+ return m_bg_gfxram[offset];
+ }
+
+ offset+=((m_control_word&0x0c00)>>10) * 0x8000;
+ return m_tx_gfxram[offset];
}
-WRITE16_MEMBER(roundup5_state::roundup5_vram_w)
+WRITE8_MEMBER(roundup5_state::gfxdata_w)
{
- offset+=((m_control_word&0x0c00)>>10) * 0xc000;
+ if((m_control_word & 0x200) == 0x200)
+ {
+ offset += (m_control_word & 0x6000) << 2;
+ //m_gfxdecode->gfx(2)->mark_dirty(offset/8);
+ // TODO: temp, until we get the actual decoding
+ m_gfxdecode->gfx(2)->mark_all_dirty();
+
+ m_bg_gfxram[offset] = data;
+ return;
+ }
-// if (offset>=0x30000)
-// logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,m_control_word);
+ offset+=((m_control_word&0x0c00)>>10) * 0x8000;
- COMBINE_DATA(&m_roundup5_vram[offset]);
+ if (offset>=0x18000 && data)
+ logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,m_control_word);
- offset=offset%0xc000;
+ m_tx_gfxram[offset] = data;
- m_gfxdecode->gfx(1)->mark_dirty(offset/0x10);
+ offset=offset%0x8000;
+
+ m_gfxdecode->gfx(1)->mark_dirty(offset/8);
}
WRITE16_MEMBER(tatsumi_state::text_w)
@@ -180,11 +198,16 @@ VIDEO_START_MEMBER(roundup5_state,roundup5)
{
m_tx_layer = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(tatsumi_state::get_text_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,64);
m_shadow_pen_array = make_unique_clear<uint8_t[]>(8192);
- m_roundup5_vram = std::make_unique<uint16_t[]>((0x48000 * 4)/2);
-
+ m_tx_gfxram = std::make_unique<uint8_t[]>(0x20000);
+ m_bg_gfxram = std::make_unique<uint8_t[]>(0x20000);
+
m_tx_layer->set_transparent_pen(0);
- m_gfxdecode->gfx(1)->set_source((uint8_t *)m_roundup5_vram.get());
+ m_gfxdecode->gfx(1)->set_source(m_tx_gfxram.get());
+ m_gfxdecode->gfx(2)->set_source(m_bg_gfxram.get());
+
+ save_pointer(NAME(m_tx_gfxram.get()),0x20000);
+ save_pointer(NAME(m_bg_gfxram.get()),0x20000);
}
VIDEO_START_MEMBER(cyclwarr_state,cyclwarr)