Skip to content

Commit 8653a44

Browse files
committed
namcos22: do disabled textures pen a bit differently
1 parent b0a8018 commit 8653a44

1 file changed

Lines changed: 34 additions & 31 deletions

File tree

src/mame/namco/namcos22_v.cpp

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -425,33 +425,35 @@ void namcos22_renderer::poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bit
425425
}
426426

427427
// disable textures, shading (and maybe more)
428-
if (objectflags & 0xc00000)
428+
if (objectflags)
429429
{
430-
extra.shade_enabled = false;
431430
extra.texture_enabled = false;
432-
}
431+
extra.cmode = 0;
433432

434-
if (objectflags & 0x200000)
435-
{
436-
// disable textures?
437-
if ((cz_adjust & 0x7f0000) == 0x3a0000)
438-
extra.texture_enabled = false;
433+
// pen is from cz_adjust
434+
const u8 shift = (objectflags & 4) ? 0 : (objectflags & 2) ? 8 : 16;
435+
u8 pen = cz_adjust >> shift;
436+
437+
if (objectflags & 6)
438+
{
439+
// absolute pen, and shading is disabled
440+
extra.pens = &m_state.m_palette->pen(pen);
441+
extra.shade_enabled = false;
442+
}
443+
else
444+
{
445+
// unknown masking? timecris sets pen to 0x3a at the helicopter when it definitely wants 0x1a
446+
extra.pens += pen & 0x7f & (color | 0x1f);
447+
}
439448
}
440449

441450
// disable poly fog
442-
if (cz_adjust & 0x800000)
451+
if (BIT(cz_adjust, 23))
443452
{
444453
extra.zfog_enabled = false;
445454
extra.fogfactor = 0;
446455
}
447456

448-
// for disabled textures, pen is from lower bits of cz_adjust
449-
if (!extra.texture_enabled)
450-
{
451-
extra.cmode = 0;
452-
extra.pens = &m_state.m_palette->pen(cz_adjust & 0xff);
453-
}
454-
455457
if (m_state.m_is_ss22)
456458
render_triangle_fan<4>(m_cliprect, render_delegate(&namcos22_renderer::renderscanline_poly_ss22, this), clipverts, clipv);
457459
else
@@ -1259,7 +1261,7 @@ void namcos22_state::blit_polyobject(int code, float m[4][4])
12591261
}
12601262

12611263
// flag applies to single object (see timecris stage 1-3 car)
1262-
m_objectflags &= ~0x400000;
1264+
m_objectflags &= ~2;
12631265
}
12641266

12651267

@@ -1334,7 +1336,7 @@ void namcos22_state::slavesim_handle_bb0003(const s32 *src)
13341336
// clear model rendering options (see acedrive name entry screen)
13351337
m_cz_adjust = 0;
13361338
m_objectshift = 0;
1337-
m_objectflags = 0x1fffff;
1339+
m_objectflags = 0;
13381340

13391341
}
13401342

@@ -1411,27 +1413,28 @@ void namcos22_state::slavesim_handle_233002(const s32 *src)
14111413
14121414
cz_adjust:
14131415
00000000: common
1414-
00020000: adillor arrows on level select screen (no effect?)
1415-
00310000: propcycl attract mode particles when Solitar rises (unknown effect)
1416-
00390000: "
1417-
003d0000: "
1418-
003a0000: timecris shoot helicopter (white, but shading enabled)
14191416
00800000: alpinr2b cancel fogging on selection screen
14201417
00800000: raverace cancel fogging on sky in attract mode
1421-
------xx: pen when texture is disabled (eg. acedrive name entry screen)
1418+
--xx----: pen when textures are disabled with objectflags 003fffff
1419+
----xx--: pen when textures are disabled with objectflags 005fffff?
1420+
------xx: pen when textures are disabled with objectflags 009fffff
1421+
1422+
objectshift:
1423+
00800000: set at same time as objectflags 009fffff
1424+
--xxxxxx: low 22 bits: object z bias adjust (see blit_single_quad)
14221425
14231426
objectflags:
14241427
001fffff: common
1425-
003fffff: adillor arrows on level select screen
1426-
003fffff: propcycl attract mode particles when Solitar rises
1427-
003fffff: timecris shoot helicopter
1428+
003fffff: adillor arrows on level select screen (no effect?)
1429+
003fffff: propcycl attract mode particles when Solitar rises (unknown effect)
1430+
003fffff: timecris shoot helicopter (white, but shading enabled)
14281431
005fffff: timecris shoot other destructible object (opaque white, 1 object)
14291432
009fffff: cybrcomm shoot enemy with machine gun (opaque white)
1430-
009fffff: acedrive name entry screen (color from cz_adjust lower bits)
1433+
009fffff: acedrive name entry screen (opaque color from cz_adjust lower bits)
14311434
*/
1432-
m_cz_adjust = src[1];
1433-
m_objectshift = src[2];
1434-
m_objectflags = src[3];
1435+
m_cz_adjust = src[1] & 0xffffff;
1436+
m_objectshift = src[2] & 0xffffff;
1437+
m_objectflags = src[3] >> 21 & 7;
14351438
}
14361439

14371440
void namcos22_state::simulate_slavedsp()

0 commit comments

Comments
 (0)