From 82e34a84fdb81bbdc172cd49832035f6edf0ac46 Mon Sep 17 00:00:00 2001 From: codefrog2002 <36536480+codefrog2002@users.noreply.github.com> Date: Sat, 2 Dec 2023 08:02:09 -0800 Subject: atari/shuuz.cpp: Implemented shadow effect. (#11799) MO color 1 offsets playfield color by 0x200 if the playfield does not have priority. --- src/mame/atari/shuuz.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/mame/atari/shuuz.cpp b/src/mame/atari/shuuz.cpp index 467c2430fa3..7cdc5a88d0e 100644 --- a/src/mame/atari/shuuz.cpp +++ b/src/mame/atari/shuuz.cpp @@ -165,6 +165,7 @@ uint32_t shuuz_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, uint16_t const *const mo = &mobitmap.pix(y); uint16_t *const pf = &bitmap.pix(y); for (int x = rect->left(); x <= rect->right(); x++) + { if (mo[x] != 0xffff) { /* verified from the GALs on the real PCB; equations follow @@ -181,18 +182,24 @@ uint32_t shuuz_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, * +PFS7*(LBD7&LBD6)*!M3*!O13 * */ - int const o13 = ((pf[x] & 0xf0) == 0xf0); - // compute the MO/PF signal - int mopf = 0; - if ((!(pf[x] & 0x80) && ((mo[x] & 0xc0) != 0xc0) && ((mo[x] & 0x0e) != 0x00) && !o13) || - ((pf[x] & 0x80) && ((mo[x] & 0xc0) == 0xc0) && ((mo[x] & 0x0e) != 0x00) && !o13)) - mopf = 1; + // This is based on observations, and not verified against schematics and GAL equations. + // TODO: + // * Locate schematics for (or trace out) video mixing section. + // * Obtain equations for video mixing GALs. + bool const o13 = (pf[x] & 0xf0) == 0xf0; + bool const mopf = ((pf[x] & 0x80) ? ((mo[x] & 0xc0) == 0xc0) : ((mo[x] & 0xc0) != 0xc0)) && !o13; - // if MO/PF is 1, we draw the MO + // if MO/PF is asserted, we draw the MO if (mopf) - pf[x] = mo[x]; + { + if (mo[x] & 0x0e) // solid colors + pf[x] = mo[x]; + else if (mo[x] & 0x01) // shadows + pf[x] |= 0x200; + } } + } } return 0; } -- cgit v1.2.3