From 3cadc4f688ba4172a1e19195c4999c0265bd3f53 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 25 Aug 2021 12:31:42 +0200 Subject: kncljoe: fix off-by-1 with sprite layer clip --- src/mame/drivers/kncljoe.cpp | 9 ++++++--- src/mame/video/kncljoe.cpp | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/kncljoe.cpp b/src/mame/drivers/kncljoe.cpp index c0eed4f5049..7edfb93b483 100644 --- a/src/mame/drivers/kncljoe.cpp +++ b/src/mame/drivers/kncljoe.cpp @@ -14,10 +14,13 @@ The video hardware is pretty much like Irem games too. The only strange thing is that the screen is flipped vertically. TODO: +- sprite-sprite priorities are imperfect (simply reversing them won't fix it, + motorcycle level will get much worse) - accurate screen timing (raw params), attract mode doesn't 1:1 match PCB BTANB: - attract mode demo play stops playing and lets the timer run out +- heads of baddies clip off when you defeat them on the lowest floor - player sprite 1-scanline glitch at the lower part of motorcycle level - player sprite may briefly turn into garbage after a boss fight @@ -67,10 +70,10 @@ void kncljoe_state::m6803_port1_w(uint8_t data) void kncljoe_state::m6803_port2_w(uint8_t data) { - /* write latch */ + // write latch if ((m_port2 & 0x01) && !(data & 0x01)) { - /* control or data port? */ + // control or data port? if (m_port2 & 0x08) m_ay8910->data_address_w(m_port2 >> 2, m_port1); } @@ -96,7 +99,7 @@ void kncljoe_state::sound_irq_ack_w(uint8_t data) void kncljoe_state::unused_w(uint8_t data) { - //unused - no MSM on the pcb + // unused - no MSM on the pcb } void kncljoe_state::sound_map(address_map &map) diff --git a/src/mame/video/kncljoe.cpp b/src/mame/video/kncljoe.cpp index 8293836e2ce..1edd294cf12 100644 --- a/src/mame/video/kncljoe.cpp +++ b/src/mame/video/kncljoe.cpp @@ -171,8 +171,8 @@ void kncljoe_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec { // clip vertical strip for each layer rectangle clip = cliprect; - clip.min_y = m_flipscreen ? (192 - i * 64) : (i * 64 + 1); - clip.max_y = clip.min_y + 64; + clip.min_y = m_flipscreen ? (191 - i * 64) : (i * 64 + 1); + clip.max_y = clip.min_y + 63; clip &= cliprect; for (int j = 0x7c; j >= 0; j -= 4) @@ -191,7 +191,7 @@ void kncljoe_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec flipx = !flipx; flipy = !flipy; sx = 240 - sx; - sy = 241 - sy; + sy = 240 - sy; } if (sx >= 256-8) -- cgit v1.2.3