summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-08-25 12:31:42 +0200
committer hap <happppp@users.noreply.github.com>2021-08-25 12:31:42 +0200
commit3cadc4f688ba4172a1e19195c4999c0265bd3f53 (patch)
treeac50897a771de0fea957d0d3cb4a160c5e6f6ca9
parent2ec9b81c46d256d2c157620c61837828bc5cda8a (diff)
kncljoe: fix off-by-1 with sprite layer clip
-rw-r--r--src/mame/drivers/kncljoe.cpp9
-rw-r--r--src/mame/video/kncljoe.cpp6
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)