summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author r09 <rzero9@gmail.com>2020-09-05 23:51:18 +0200
committer GitHub <noreply@github.com>2020-09-05 17:51:18 -0400
commite3b086c9547a70afd60c68c023538f9acab4a1e1 (patch)
tree8493f16f835e7f7cd007e8b643c64ca1a2a46e40
parent52b1750a7f647e50d44a86da41cd811b12870f35 (diff)
fmtowns: changes to 15-bit layer/sprite drawing, fixes niko2 (#7190)
- Sprite color values are masked to their 15 least significant bits before they are rendered to VRAM. - Pixels on the bottom layer (or in single-layer mode) are always drawn, even if the transparency bit is set to 1.
-rw-r--r--hash/fmtowns_cd.xml3
-rw-r--r--src/mame/video/fmtowns.cpp6
2 files changed, 4 insertions, 5 deletions
diff --git a/hash/fmtowns_cd.xml b/hash/fmtowns_cd.xml
index 0675c53952e..f67bd5a1e98 100644
--- a/hash/fmtowns_cd.xml
+++ b/hash/fmtowns_cd.xml
@@ -11638,8 +11638,7 @@ User/save disks that can be created from the game itself are not included.
</part>
</software>
- <!-- Wrong colors and other graphical glitches -->
- <software name="niko2" supported="partial">
+ <software name="niko2">
<!--
Origin: redump.org
<rom name="Niko^2 (Japan).bin" size="10231200" crc="a0d255b9" sha1="16924ba91862c909730502cadec7eefb94150521"/>
diff --git a/src/mame/video/fmtowns.cpp b/src/mame/video/fmtowns.cpp
index cc16d9c6201..d60da80b198 100644
--- a/src/mame/video/fmtowns.cpp
+++ b/src/mame/video/fmtowns.cpp
@@ -830,7 +830,7 @@ void towns_state::render_sprite_4(uint32_t poffset, uint32_t coffset, uint16_t x
voffset = 0;
pixel = (m_towns_txtvram[poffset] & 0xf0) >> 4;
- col = m_towns_txtvram[coffset+(pixel*2)] | (m_towns_txtvram[coffset+(pixel*2)+1] << 8);
+ col = (m_towns_txtvram[coffset+(pixel*2)] | (m_towns_txtvram[coffset+(pixel*2)+1] << 8)) & 0x7fff;
if (rotation)
{
voffset += linesize * (xpos & 0x1ff); // scanline size in bytes * y pos
@@ -861,7 +861,7 @@ void towns_state::render_sprite_4(uint32_t poffset, uint32_t coffset, uint16_t x
voffset-=2;
pixel = m_towns_txtvram[poffset] & 0x0f;
- col = m_towns_txtvram[coffset+(pixel*2)] | (m_towns_txtvram[coffset+(pixel*2)+1] << 8);
+ col = (m_towns_txtvram[coffset+(pixel*2)] | (m_towns_txtvram[coffset+(pixel*2)+1] << 8)) & 0x7fff;
if(voffset < 0x20000 && xpos < width && ypos < height && pixel != 0 && voffset > linesize)
{
m_towns_gfxvram[0x40000+voffset+vbase+1] = (col & 0xff00) >> 8;
@@ -1126,7 +1126,7 @@ void towns_state::towns_crtc_draw_scan_layer_hicolour(bitmap_rgb32 &bitmap,const
curoff = ((off & 0x7fff8) >> 1) | (off & 3);
}
colour = (m_towns_gfxvram[curoff+(offpage*0x40000)+1] << 8) | m_towns_gfxvram[curoff+(offpage*0x40000)];
- if(colour < 0x8000)
+ if(!(m_video.towns_video_reg[0] & 0x10) || (m_video.towns_video_reg[1] & 0x01) != layer || colour < 0x8000)
{
for (pixel = 0; pixel < hzoom; pixel++)
bitmap.pix32(scanline, x+pixel) =