summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/mame/drivers/namcos2.cpp6
-rw-r--r--src/mame/video/namcos2_sprite.cpp19
-rw-r--r--src/mame/video/namcos2_sprite.h3
3 files changed, 23 insertions, 5 deletions
diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp
index 7f4f54382b4..3b7b1eb93cd 100644
--- a/src/mame/drivers/namcos2.cpp
+++ b/src/mame/drivers/namcos2.cpp
@@ -1929,6 +1929,8 @@ void namcos2_state::finallap_noio(machine_config &config)
configure_c123tmap_standard(config);
configure_c45road_standard(config);
+ m_ns2sprite->force_32x32_sprites(true);
+
m_c140->add_route(0, "lspeaker", 0.75);
m_c140->add_route(1, "rspeaker", 0.75);
@@ -1954,6 +1956,8 @@ void namcos2_state::finalap2(machine_config &config)
finallap(config);
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcos2_state::TilemapCB_finalap2, this));
+
+ m_ns2sprite->force_32x32_sprites(false);
}
void namcos2_state::finalap3(machine_config &config)
@@ -1961,6 +1965,8 @@ void namcos2_state::finalap3(machine_config &config)
finallap_c68(config);
m_c123tmap->set_tile_callback(namco_c123tmap_device::c123_tilemap_delegate(&namcos2_state::TilemapCB_finalap2, this));
+
+ m_ns2sprite->force_32x32_sprites(false);
}
diff --git a/src/mame/video/namcos2_sprite.cpp b/src/mame/video/namcos2_sprite.cpp
index a6047f05add..5467195af3c 100644
--- a/src/mame/video/namcos2_sprite.cpp
+++ b/src/mame/video/namcos2_sprite.cpp
@@ -26,7 +26,8 @@ DEFINE_DEVICE_TYPE(NAMCOS2_SPRITE, namcos2_sprite_device, "namcos2_sprite", "Nam
namcos2_sprite_device::namcos2_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
device_t(mconfig, NAMCOS2_SPRITE, tag, owner, clock),
m_gfxdecode(*this, finder_base::DUMMY_TAG),
- m_spriteram(*this, finder_base::DUMMY_TAG)
+ m_spriteram(*this, finder_base::DUMMY_TAG),
+ m_force_32x32(false)
{
}
@@ -229,8 +230,16 @@ void namcos2_sprite_device::draw_sprites(screen_device &screen, bitmap_ind16 &bi
const int sizey = ((word0 >> 10) & 0x003f) + 1;
int sizex = (word3 >> 10) & 0x003f;
+ int is_32 = (word0 >> 9) & 0x0001;
- if ((word0 & 0x0200) == 0) sizex >>= 1;
+ // The finallap title screen needs 32x32 sprites, but doesn't set the expected bit
+ // other games (eg. mirninja) do correctly set it.
+ //
+ // can the 16x16 support be disabled globally with a register, or via a pin on the chip?
+ if (m_force_32x32)
+ is_32 = 1;
+
+ if (!is_32) sizex >>= 1;
if ((sizey - 1) && sizex)
{
@@ -240,13 +249,13 @@ void namcos2_sprite_device::draw_sprites(screen_device &screen, bitmap_ind16 &bi
const int xpos = (offset4 & 0x03ff) - 0x50 + 0x07;
const bool flipy = word1 & 0x8000;
const bool flipx = word1 & 0x4000;
- const int scalex = (sizex << 16) / ((word0 & 0x0200) ? 0x20 : 0x10);
- const int scaley = (sizey << 16) / ((word0 & 0x0200) ? 0x20 : 0x10);
+ const int scalex = (sizex << 16) / (is_32 ? 0x20 : 0x10);
+ const int scaley = (sizey << 16) / (is_32 ? 0x20 : 0x10);
if (scalex && scaley)
{
gfx_element *gfx = m_gfxdecode->gfx(0);
- if ((word0 & 0x0200) == 0)
+ if (!is_32)
gfx->set_source_clip((word1 & 0x0001) ? 16 : 0, 16, (word1 & 0x0002) ? 16 : 0, 16);
else
gfx->set_source_clip(0, 32, 0, 32);
diff --git a/src/mame/video/namcos2_sprite.h b/src/mame/video/namcos2_sprite.h
index ffc479b50a1..9e824273c71 100644
--- a/src/mame/video/namcos2_sprite.h
+++ b/src/mame/video/namcos2_sprite.h
@@ -21,6 +21,8 @@ public:
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int control );
void draw_sprites_metalhawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
+ void force_32x32_sprites(bool force) { m_force_32x32 = force; }
+
protected:
// device-level overrides
virtual void device_start() override;
@@ -33,6 +35,7 @@ private:
required_device<gfxdecode_device> m_gfxdecode;
required_shared_ptr<u16> m_spriteram;
+ bool m_force_32x32;
};
// device type definition