diff --git a/src/mame/drivers/tatsumi.cpp b/src/mame/drivers/tatsumi.cpp index f79db9dd28b..025c9f397b6 100644 --- a/src/mame/drivers/tatsumi.cpp +++ b/src/mame/drivers/tatsumi.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders:Bryan McPhail, Angelo Salese /*************************************************************************** Apache 3 ATF-011 @@ -195,12 +195,6 @@ WRITE16_MEMBER(cyclwarr_state::bigfight_a40000_w) COMBINE_DATA(&m_bigfight_a40000[offset]); } -WRITE16_MEMBER(cyclwarr_state::bigfight_a60000_w) -{ - COMBINE_DATA(&m_bigfight_a60000[offset]); -// popmessage("%04x",m_bigfight_a60000[offset]); -} - template READ16_MEMBER(cyclwarr_state::cyclwarr_videoram_r) { @@ -341,7 +335,7 @@ void cyclwarr_state::common_map(address_map &map) map(0x0a2000, 0x0a2007).w(this, FUNC(cyclwarr_state::video_config_w)); map(0x0a4000, 0x0a4001).w(this, FUNC(cyclwarr_state::bigfight_a40000_w)); - map(0x0a6000, 0x0a6001).w(this, FUNC(cyclwarr_state::bigfight_a60000_w)); + map(0x0a6000, 0x0a6001).w(this, FUNC(cyclwarr_state::mixing_control_w)); map(0x0ac000, 0x0ac003).w(this, FUNC(tatsumi_state::hd6445_crt_w)).umask16(0x00ff); map(0x0b8000, 0x0b8001).w(this, FUNC(cyclwarr_state::cyclwarr_sound_w)).umask16(0xff00); diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h index 163d07ebb98..ce8d1cd7cdb 100644 --- a/src/mame/includes/tatsumi.h +++ b/src/mame/includes/tatsumi.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders:Bryan McPhail, Angelo Salese #include "sound/okim6295.h" #include "sound/ym2151.h" @@ -68,7 +68,7 @@ public: protected: uint8_t m_hd6445_reg[64]; - void apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap); + void apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap, uint8_t xor_output); private: uint8_t m_hd6445_address; }; @@ -197,7 +197,7 @@ public: DECLARE_WRITE16_MEMBER(cyclwarr_sprite_w); DECLARE_WRITE16_MEMBER(video_config_w); DECLARE_WRITE16_MEMBER(bigfight_a40000_w); - DECLARE_WRITE16_MEMBER(bigfight_a60000_w); + DECLARE_WRITE16_MEMBER(mixing_control_w); DECLARE_WRITE8_MEMBER(cyclwarr_control_w); DECLARE_WRITE8_MEMBER(cyclwarr_sound_w); DECLARE_WRITE16_MEMBER(output_w); @@ -235,7 +235,7 @@ private: tilemap_t *m_layer[4]; uint16_t m_video_config[4]; - uint16_t m_bigfight_a60000[2]; + uint16_t m_mixing_control; uint16_t m_bigfight_a40000[2]; uint16_t m_bigfight_bank; uint16_t m_bigfight_last_bank; @@ -246,5 +246,6 @@ private: void tile_expand(); void draw_bg(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *src, const uint16_t* scrollx, const uint16_t* scrolly, const uint16_t layer_page_size, bool is_road, int hi_priority); void draw_bg_layers(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int hi_priority); + void apply_highlight_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &highlight_bitmap); }; diff --git a/src/mame/machine/tatsumi.cpp b/src/mame/machine/tatsumi.cpp index 5e2d582248c..5588dd688ee 100644 --- a/src/mame/machine/tatsumi.cpp +++ b/src/mame/machine/tatsumi.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders:Bryan McPhail, Angelo Salese #include "emu.h" #include "includes/tatsumi.h" #include "sound/okim6295.h" diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index f5cfa2a20a9..52cfde7c30e 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Bryan McPhail +// copyright-holders:Bryan McPhail, Angelo Salese #include "emu.h" #include "includes/tatsumi.h" #include "screen.h" @@ -56,15 +56,18 @@ WRITE16_MEMBER(tatsumi_state::tatsumi_sprite_control_w) } // apply shadowing to underlying layers -// TODO: it might mix up with the lower palette bank instead -void tatsumi_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap) +// TODO: it might mix up with the lower palette bank instead (color bank 0x1400?) +void tatsumi_state::apply_shadow_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &shadow_bitmap, uint8_t xor_output) { for(int y=cliprect.min_y;y> 1,shadow_pen.g() >> 1, shadow_pen.b() >> 1); @@ -702,7 +705,7 @@ uint32_t apache3_state::screen_update_apache3(screen_device &screen, bitmap_rgb3 screen.priority().fill(0, cliprect); draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only draw_sky(bitmap, cliprect, 256, m_apache3_rotate_ctrl[1]); - apply_shadow_bitmap(bitmap,cliprect,screen.priority()); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); // draw_ground(bitmap, cliprect); draw_sprites(bitmap,cliprect,0, (m_sprite_control_ram[0x20]&0x1000) ? 0x1000 : 0); m_tx_layer->draw(screen, bitmap, cliprect, 0,0); @@ -1038,7 +1041,7 @@ uint32_t roundup5_state::screen_update_roundup5(screen_device &screen, bitmap_rg draw_landscape(bitmap,cliprect,0); draw_landscape(bitmap,cliprect,1); draw_road(bitmap,cliprect); - apply_shadow_bitmap(bitmap,cliprect,screen.priority()); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), 0); if(m_control_word & 0x80) // enabled on map screen after a play { m_tx_layer->draw(screen, bitmap, cliprect, 0,0); @@ -1078,7 +1081,16 @@ WRITE16_MEMBER(cyclwarr_state::video_config_w) { COMBINE_DATA(&m_video_config[offset]); } - + +// mixing control (seems to be available only for Big Fight and Cycle Warriors) +// --x- ---- enabled in Big Fight, disabled in Cycle Warriors (unknown purpose) +// ---- -x-- enable shadow mixing +// ---- ---x if 1 invert shadows, i.e. shadows are drawn with original pen while non shadows are halved (Chen stage in Big Fight) +WRITE16_MEMBER(cyclwarr_state::mixing_control_w) +{ + COMBINE_DATA(&m_mixing_control); +} + template TILE_GET_INFO_MEMBER(cyclwarr_state::get_tile_info_bigfight) { @@ -1309,7 +1321,7 @@ uint32_t cyclwarr_state::screen_update_cyclwarr(screen_device &screen, bitmap_rg screen.priority().fill(0, cliprect); draw_sprites(screen.priority(),cliprect,1,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); // Alpha pass only draw_bg_layers(screen, bitmap, cliprect, 0); - apply_shadow_bitmap(bitmap,cliprect,screen.priority()); + apply_shadow_bitmap(bitmap,cliprect,screen.priority(), m_mixing_control & 1); draw_sprites(bitmap,cliprect,0,(m_sprite_control_ram[0xe0]&0x1000) ? 0x1000 : 0); draw_bg_layers(screen, bitmap, cliprect, 1); return 0;