summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2017-09-11 16:30:51 +0200
committer angelosa <salese_corp_ltd@email.it>2017-09-11 16:31:26 +0200
commitc43f509a4c0ed6ded64fa001c4209ea3696e2864 (patch)
tree87d72a5c4b00bb731a0ce3c24c19ad87968e41ac
parent64c117bb504873add7603778ed7942535ba0877c (diff)
mb_vcu.cpp: improved Mazer Blazer collision furthermore (nw)
-rw-r--r--src/devices/video/mb_vcu.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/devices/video/mb_vcu.cpp b/src/devices/video/mb_vcu.cpp
index 8cfc556521f..832a81e205e 100644
--- a/src/devices/video/mb_vcu.cpp
+++ b/src/devices/video/mb_vcu.cpp
@@ -19,6 +19,7 @@ TODO:
- Understand how transparent pens are handled aka is 0x0f always transparent or
there's some clut gimmick? Great Guns title screen makes me think of the
latter option;
+- Mazer Blazer collision detection parameters are a complete guesswork
***************************************************************************/
@@ -405,7 +406,7 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
//int16_t srcy = m_ram[m_param_offset_latch + 3];
//uint16_t src_xsize = m_ram[m_param_offset_latch + 18] + 1;
//uint16_t src_ysize = m_ram[m_param_offset_latch + 19] + 1;
- bool collision_flag = false;
+ int collision_flag = 0;
for (yi = 0; yi < m_pix_ysize; yi++)
{
@@ -423,7 +424,10 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
// TODO: how it calculates the pen? Might use the commented out stuff and/or the offset somehow
if(res == 5)
- collision_flag = true;
+ {
+ collision_flag++;
+// test++;
+ }
}
//srcx++;
@@ -431,8 +435,12 @@ READ8_MEMBER( mb_vcu_device::load_set_clr )
//srcy++;
}
-
- if(collision_flag == true)
+ // threshold for collision, necessary to avoid bogus collision hits
+ // the typical test scenario is to shoot near the top left hatch for stage 1 then keep shooting,
+ // at some point the top right hatch will bogusly detect a collision without this.
+ // It's also unlikely that game tests 1x1 targets anyway, as the faster moving targets are quite too easy to hit that way.
+ // TODO: likely it works differently (checks area?)
+ if(collision_flag > 5)
m_ram[m_param_offset_latch] |= 8;
else
m_ram[m_param_offset_latch] &= ~8;