Blitter REG_ZZ_COPYRECT not working correct in MNTVA_COLOR_15BIT mode, due to broken REG_ZZ_COLORMODE logic.
Blitter REG_ZZ_COPYRECT not working correct in MNTVA_COLOR_15BIT mode, due to broken REG_ZZ_COLORMODE logic.
Reason is REG_ZZ_COLORMODE is omitting mask/minterm in high-byte when color mode is set to MNTVA_COLOR_15BIT. The internal logic sets it to MNTVA_COLOR_16BIT565 but omits the mask/minterm in that case. REG_ZZ_COPYRECT expects to get a mask/minterm in high-byte and color mode in low-byte, but in case of MNTVA_COLOR_15BIT the high-byte will be zero, and the blit operation will not work as expected.
Here the broken source code section:
Code:
(Source: zz9000-firmware/ZZ9000_proto.sdk/ZZ9000OS/src/main.c)
(Line 346)
case REG_ZZ_COLORMODE:
blitter_colormode = zdata;
// hack
if (blitter_colormode == MNTVA_COLOR_15BIT) blitter_colormode = MNTVA_COLOR_16BIT565;
break;
...
(Line 507)
case REG_ZZ_COPYRECT
...
mask = (blitter_colormode >> 8);
...
break;
I recommend to extract the mask/minterm already in REG_ZZ_COLORMODE and keep it separately alongside with blitter_colormode and not to keep it encoded in it's high-byte.