From 2802e67b843332bb17b6c412b7aa910751f8d581 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 25 Mar 2016 21:06:48 +0100 Subject: [PATCH] Rewritten Toypop/Namco Universal System 16 driver due of relicensing [Angelo Salese] --- src/mame/drivers/toypop.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/mame/drivers/toypop.cpp b/src/mame/drivers/toypop.cpp index 37b9a2d863a..cc8632aaa75 100644 --- a/src/mame/drivers/toypop.cpp +++ b/src/mame/drivers/toypop.cpp @@ -8,6 +8,8 @@ - PAL is presumably inverted with address bit 11 (0x800) for 0x6000-0x7fff area between Libble Rabble and Toy Pop. - Proper sprite DMA. + - Flip Screen; + - Remaining outputs; Notes: ------ @@ -82,6 +84,7 @@ public: DECLARE_READ8_MEMBER(dipB_h); //DECLARE_WRITE8_MEMBER(out_coin0); //DECLARE_WRITE8_MEMBER(out_coin1); + DECLARE_WRITE8_MEMBER(pal_bank_w); DECLARE_WRITE8_MEMBER(flip); DECLARE_WRITE8_MEMBER(slave_halt_ctrl_w); DECLARE_READ8_MEMBER(slave_shared_r); @@ -99,6 +102,7 @@ protected: private: bool m_master_irq_enable; bool m_slave_irq_enable; + UINT8 m_pal_bank; void legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); void legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect); @@ -157,7 +161,7 @@ PALETTE_INIT_MEMBER(namcos16_state, toypop) void namcos16_state::legacy_bg_draw(bitmap_ind16 &bitmap,const rectangle &cliprect) { int x, y; - const UINT16 pal_base = 0x300; + const UINT16 pal_base = 0x300 + (m_pal_bank << 4); const UINT32 src_base = 0x200/2; const UINT16 src_pitch = 288 / 2; @@ -202,7 +206,7 @@ void namcos16_state::legacy_fg_draw(bitmap_ind16 &bitmap,const rectangle &clipre } UINT16 tile = m_fgvram[count]; - UINT8 color = (m_fgattr[count] & 0x3f) + 0x40; + UINT8 color = (m_fgattr[count] & 0x3f) + (m_pal_bank<<6); gfx_0->transpen(bitmap,cliprect,tile,color,0,0,x*8,y*8,0); } @@ -240,8 +244,8 @@ void namcos16_state::legacy_obj_draw(bitmap_ind16 &bitmap,const rectangle &clipr UINT8 width = ((base_spriteram[count+bank2] & 4) >> 2) + 1; UINT8 height = ((base_spriteram[count+bank2] & 8) >> 3) + 1; - if(width == 2) - x -=16; + if(height == 2) + y -=16; for(int yi=0;yi