mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
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
This commit is contained in:
parent
cec18b8635
commit
4d9d74ef93
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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++)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user