summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar cam900 <dbtlrchl@naver.com>2019-12-07 11:45:33 +0900
committerGravatarGravatar R. Belmont <rb6502@users.noreply.github.com>2019-12-06 21:45:33 -0500
commit4d9d74ef933e7ead1034cf41a13784ba8bed92bb (patch)
tree6612ecedfeb07a6a5f4e046367e101c15ac009cc
parentcec18b863511cc4e475c395c87e6551ae168c82f (diff)
namco_c355spr.cpp : Fix priority when pri 0 sprite isn't drawed first (#6011)
* namco_c355spr.cpp : Convert vblank handler into register_vblank_callback * namco_c355spr.cpp : Revert vblank related commits
-rw-r--r--src/mame/drivers/gal3.cpp10
-rw-r--r--src/mame/drivers/namcos21_c67.cpp3
-rw-r--r--src/mame/drivers/namcos21_de.cpp3
-rw-r--r--src/mame/video/namco_c355spr.cpp10
-rw-r--r--src/mame/video/namco_c355spr.h4
5 files changed, 26 insertions, 4 deletions
diff --git a/src/mame/drivers/gal3.cpp b/src/mame/drivers/gal3.cpp
index e2da6e5432a..c057abd26d1 100644
--- a/src/mame/drivers/gal3.cpp
+++ b/src/mame/drivers/gal3.cpp
@@ -208,6 +208,10 @@ void gal3_state::video_start()
uint32_t gal3_state::screen_update_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ bitmap.fill(0xff, cliprect); // TODO : actually laserdisc layer
+ screen.priority().fill(0, cliprect);
+ m_c355spr[0]->get_sprites(); // TODO : buffered?
+
int i;
char mst[18], slv[18];
static int pivot = 15;
@@ -258,6 +262,10 @@ uint32_t gal3_state::screen_update_left(screen_device &screen, bitmap_ind16 &bit
uint32_t gal3_state::screen_update_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ bitmap.fill(0xff, cliprect); // TODO : actually laserdisc layer
+ screen.priority().fill(0, cliprect);
+ m_c355spr[1]->get_sprites(); // TODO : buffered?
+
static int pivot = 15;
int pri;
@@ -629,6 +637,7 @@ void gal3_state::gal3(machine_config &config)
m_c355spr[0]->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
m_c355spr[0]->set_palxor(0xf); // reverse mapping
m_c355spr[0]->set_color_base(0x1000); // TODO : verify palette offset
+ m_c355spr[0]->set_external_prifill(true);
NAMCOS21_3D(config, m_namcos21_3d[0], 0);
m_namcos21_3d[0]->set_zz_shift_mult(11, 0x200);
@@ -658,6 +667,7 @@ void gal3_state::gal3(machine_config &config)
m_c355spr[1]->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
m_c355spr[1]->set_palxor(0xf); // reverse mapping
m_c355spr[1]->set_color_base(0x1000); // TODO : verify palette offset
+ m_c355spr[1]->set_external_prifill(true);
NAMCOS21_3D(config, m_namcos21_3d[1], 0);
m_namcos21_3d[1]->set_zz_shift_mult(11, 0x200);
diff --git a/src/mame/drivers/namcos21_c67.cpp b/src/mame/drivers/namcos21_c67.cpp
index 4b05303a602..81dd5def0dc 100644
--- a/src/mame/drivers/namcos21_c67.cpp
+++ b/src/mame/drivers/namcos21_c67.cpp
@@ -369,6 +369,8 @@ uint32_t namcos21_c67_state::screen_update(screen_device &screen, bitmap_ind16 &
int pivot = 3;
int pri;
bitmap.fill(0xff, cliprect );
+ screen.priority().fill(0, cliprect);
+ m_c355spr->get_sprites(); // TODO : buffered?
m_c355spr->draw(screen, bitmap, cliprect, 2 );
@@ -823,6 +825,7 @@ void namcos21_c67_state::namcos21(machine_config &config)
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
m_c355spr->set_palxor(0xf); // reverse mapping
m_c355spr->set_color_base(0x1000);
+ m_c355spr->set_external_prifill(true);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/drivers/namcos21_de.cpp b/src/mame/drivers/namcos21_de.cpp
index cb0f209acb8..8914cdcc97c 100644
--- a/src/mame/drivers/namcos21_de.cpp
+++ b/src/mame/drivers/namcos21_de.cpp
@@ -198,6 +198,7 @@ void namco_de_pcbstack_device::device_add_mconfig(machine_config &config)
m_c355spr->set_tile_callback(namco_c355spr_device::c355_obj_code2tile_delegate());
m_c355spr->set_palxor(0xf); // reverse mapping
m_c355spr->set_color_base(0x1000);
+ m_c355spr->set_external_prifill(true);
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
@@ -218,6 +219,8 @@ uint32_t namco_de_pcbstack_device::screen_update(screen_device &screen, bitmap_i
int pivot = 3;
int pri;
bitmap.fill(0xff, cliprect );
+ screen.priority().fill(0, cliprect);
+ m_c355spr->get_sprites(); // TODO : buffered?
m_c355spr->draw(screen, bitmap, cliprect, 2 );
m_c355spr->draw(screen, bitmap, cliprect, 14 ); //driver's eyes
diff --git a/src/mame/video/namco_c355spr.cpp b/src/mame/video/namco_c355spr.cpp
index 7a484d86973..42944cebafd 100644
--- a/src/mame/video/namco_c355spr.cpp
+++ b/src/mame/video/namco_c355spr.cpp
@@ -25,6 +25,7 @@ namco_c355spr_device::namco_c355spr_device(const machine_config &mconfig, const
device_video_interface(mconfig, *this),
m_palxor(0),
m_buffer(0),
+ m_external_prifill(false),
m_gfx_region(*this, DEVICE_SELF),
m_colbase(0)
{
@@ -452,9 +453,12 @@ void namco_c355spr_device::draw_sprites(screen_device &screen, BitmapClass &bitm
// int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
if (pri == 0)
{
- screen.priority().fill(0, cliprect);
- if (m_buffer == 0) // not buffered sprites
- get_sprites();
+ if (!m_external_prifill)
+ {
+ screen.priority().fill(0, cliprect);
+ if (m_buffer == 0) // not buffered sprites
+ get_sprites();
+ }
}
for (int no = 0; no < 2; no++)
diff --git a/src/mame/video/namco_c355spr.h b/src/mame/video/namco_c355spr.h
index 1de6e07f4af..0a5bb554780 100644
--- a/src/mame/video/namco_c355spr.h
+++ b/src/mame/video/namco_c355spr.h
@@ -19,6 +19,7 @@ public:
//void set_ram_words(u32 size) { m_ramsize = size; }
void set_palxor(int palxor) { m_palxor = palxor; }
void set_buffer(int buffer) { m_buffer = buffer; }
+ void set_external_prifill(bool external) { m_external_prifill = external; }
u16 spriteram_r(offs_t offset);
void spriteram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
@@ -37,6 +38,7 @@ public:
void draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
void draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri);
+ void get_sprites();
protected:
@@ -71,7 +73,6 @@ private:
// C355 Motion Object internals
void get_single_sprite(const u16 *pSource, c355_sprite *sprite_ptr);
void get_list(int no, const u16 *pSpriteList16, const u16 *pSpriteTable);
- void get_sprites();
template<class BitmapClass> void draw_sprites(screen_device &screen, BitmapClass &bitmap, const rectangle &cliprect, int pri);
std::unique_ptr<c355_sprite []> m_spritelist[2];
@@ -84,6 +85,7 @@ private:
int m_scrolloffs[2];
//u32 m_ramsize;
int m_buffer;
+ bool m_external_prifill;
required_memory_region m_gfx_region;
u16 m_colbase;