diff options
Diffstat (limited to 'src/mame/video/gp9001.cpp')
-rw-r--r-- | src/mame/video/gp9001.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp index 43ed591639e..338cb6a52ee 100644 --- a/src/mame/video/gp9001.cpp +++ b/src/mame/video/gp9001.cpp @@ -34,6 +34,7 @@ in from the left) - Teki Paki tests video RAM from address 0 past SpriteRAM to $37ff. This seems to be a bug in Teki Paki's vram test routine ! + - Measure cycle usage / max usable cycle for sprite drawing @@ -153,9 +154,6 @@ Pipi & Bibis | Fix Eight | V-Five | Snow Bros. 2 | */ static constexpr unsigned GP9001_PRIMASK = 0x000f; static constexpr unsigned GP9001_PRIMASK_TMAPS = 0x000e; -// TODO : Wrong; It's possibly lower than 256 at real hardware -// Most noticeable at some boss explosion scene in bgaregga -static constexpr unsigned MAX_SPRITES = 256; template<int Layer> void gp9001vdp_device::tmap_w(offs_t offset, u16 data, u16 mem_mask) @@ -628,6 +626,8 @@ READ_LINE_MEMBER(gp9001vdp_device::fblank_r) void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const u8* primap ) { + int clk = 0; + int clk_max = 432 * 262; // TODO : related to size of whole screen? const u16 *source = (m_sp.use_sprite_buffer) ? m_spriteram->buffer() : m_spriteram->live(); const u32 total_elements = gfx(1)->elements(); @@ -636,8 +636,12 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip int old_x = (-(m_sp.scrollx)) & 0x1ff; int old_y = (-(m_sp.scrolly)) & 0x1ff; - for (int offs = 0; offs < (MAX_SPRITES * 4); offs += 4) + for (int offs = 0; offs < (m_spriteram->bytes() / 2); offs += 4) { + clk += 8; // 8 cycle per each sprite + if (clk > clk_max) + return; + int sx, sy; int sx_base, sy_base; @@ -715,6 +719,10 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip else sy = sy_base + dim_y; for (int dim_x = 0; dim_x < sprite_sizex; dim_x += 8) { + clk += 64; // 64? cycle per each tile + if (clk > clk_max) + return; + if (flipx) sx = sx_base - dim_x; else sx = sx_base + dim_x; |