mirror of
https://github.com/holub/mame
synced 2025-06-30 16:00:01 +03:00
fix non-super22 cmode/bn for direct_poly (eg. raveracw minimap and attractmode hiscore table)
This commit is contained in:
parent
4f3fbef885
commit
628f6efc95
@ -2559,7 +2559,7 @@ static ADDRESS_MAP_START( namcos22s_am, AS_PROGRAM, 32 )
|
|||||||
AM_RANGE(0x820000, 0x8202ff) AM_RAM /* unknown (air combat) */
|
AM_RANGE(0x820000, 0x8202ff) AM_RAM /* unknown (air combat) */
|
||||||
AM_RANGE(0x824000, 0x8243ff) AM_READWRITE(namcos22_gamma_r, namcos22_gamma_w) AM_BASE_MEMBER(namcos22_state, m_gamma)
|
AM_RANGE(0x824000, 0x8243ff) AM_READWRITE(namcos22_gamma_r, namcos22_gamma_w) AM_BASE_MEMBER(namcos22_state, m_gamma)
|
||||||
AM_RANGE(0x828000, 0x83ffff) AM_READWRITE(namcos22_paletteram_r, namcos22_paletteram_w) AM_BASE_GENERIC(paletteram)
|
AM_RANGE(0x828000, 0x83ffff) AM_READWRITE(namcos22_paletteram_r, namcos22_paletteram_w) AM_BASE_GENERIC(paletteram)
|
||||||
AM_RANGE(0x860000, 0x860007) AM_READ(spotram_r) AM_WRITE(spotram_w)
|
AM_RANGE(0x860000, 0x860007) AM_READWRITE(spotram_r, spotram_w)
|
||||||
AM_RANGE(0x880000, 0x89dfff) AM_READWRITE(namcos22_cgram_r, namcos22_cgram_w) AM_BASE_MEMBER(namcos22_state, m_cgram)
|
AM_RANGE(0x880000, 0x89dfff) AM_READWRITE(namcos22_cgram_r, namcos22_cgram_w) AM_BASE_MEMBER(namcos22_state, m_cgram)
|
||||||
AM_RANGE(0x89e000, 0x89ffff) AM_READWRITE(namcos22_textram_r, namcos22_textram_w) AM_BASE_MEMBER(namcos22_state, m_textram)
|
AM_RANGE(0x89e000, 0x89ffff) AM_READWRITE(namcos22_textram_r, namcos22_textram_w) AM_BASE_MEMBER(namcos22_state, m_textram)
|
||||||
AM_RANGE(0x8a0000, 0x8a000f) AM_READWRITE(namcos22_tilemapattr_r, namcos22_tilemapattr_w) AM_BASE_MEMBER(namcos22_state, m_tilemapattr)
|
AM_RANGE(0x8a0000, 0x8a000f) AM_READWRITE(namcos22_tilemapattr_r, namcos22_tilemapattr_w) AM_BASE_MEMBER(namcos22_state, m_tilemapattr)
|
||||||
@ -3001,6 +3001,7 @@ static MACHINE_CONFIG_START( namcos22s, namcos22_state )
|
|||||||
MCFG_CPU_VBLANK_INT_HACK(mcu_interrupt, 3)
|
MCFG_CPU_VBLANK_INT_HACK(mcu_interrupt, 3)
|
||||||
|
|
||||||
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
|
||||||
|
// MCFG_QUANTUM_PERFECT_CPU("maincpu")
|
||||||
// MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
// MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
|
|
||||||
MCFG_NVRAM_HANDLER(namcos22)
|
MCFG_NVRAM_HANDLER(namcos22)
|
||||||
|
@ -1159,25 +1159,32 @@ namcos22_draw_direct_poly( running_machine &machine, const UINT16 *pSource )
|
|||||||
struct SceneNode *node = NewSceneNode(machine, zsortvalue24,eSCENENODE_QUAD3D);
|
struct SceneNode *node = NewSceneNode(machine, zsortvalue24,eSCENENODE_QUAD3D);
|
||||||
int i;
|
int i;
|
||||||
node->data.quad3d.flags = ((pSource[3]&0x7f00)*2)|(pSource[3]&3);
|
node->data.quad3d.flags = ((pSource[3]&0x7f00)*2)|(pSource[3]&3);
|
||||||
node->data.quad3d.cmode = (pSource[2]&0x00f0)>>4;
|
|
||||||
node->data.quad3d.textureBank = pSource[2]&0xf;
|
|
||||||
node->data.quad3d.color = (pSource[2]&0xff00)>>8;
|
node->data.quad3d.color = (pSource[2]&0xff00)>>8;
|
||||||
|
if( state->m_mbSuperSystem22 )
|
||||||
|
{
|
||||||
|
node->data.quad3d.cmode = (pSource[2]&0x00f0)>>4;
|
||||||
|
node->data.quad3d.textureBank = (pSource[2]&0x000f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node->data.quad3d.cmode = (pSource[0+4]&0xf000)>>12;
|
||||||
|
node->data.quad3d.textureBank = (pSource[1+4]&0xf000)>>12;
|
||||||
|
}
|
||||||
pSource += 4;
|
pSource += 4;
|
||||||
for( i=0; i<4; i++ )
|
for( i=0; i<4; i++ )
|
||||||
{
|
{
|
||||||
Poly3dVertex *p = &node->data.quad3d.v[i];
|
Poly3dVertex *p = &node->data.quad3d.v[i];
|
||||||
|
|
||||||
p->u = pSource[0];
|
|
||||||
p->v = pSource[1];
|
|
||||||
if( state->m_mbSuperSystem22 )
|
if( state->m_mbSuperSystem22 )
|
||||||
{
|
{
|
||||||
p->u >>= 4;
|
p->u = pSource[0] >> 4;
|
||||||
p->v >>= 4;
|
p->v = pSource[1] >> 4;
|
||||||
}
|
}
|
||||||
p->u &= 0xfff;
|
else
|
||||||
p->v &= 0xfff;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
p->u = pSource[0] & 0x0fff;
|
||||||
|
p->v = pSource[1] & 0x0fff;
|
||||||
|
}
|
||||||
|
|
||||||
int mantissa = (INT16)pSource[5];
|
int mantissa = (INT16)pSource[5];
|
||||||
float zf = (float)mantissa;
|
float zf = (float)mantissa;
|
||||||
int exponent = (pSource[4])&0xff;
|
int exponent = (pSource[4])&0xff;
|
||||||
@ -1204,7 +1211,6 @@ namcos22_draw_direct_poly( running_machine &machine, const UINT16 *pSource )
|
|||||||
}
|
}
|
||||||
p->z = 1.0f/zf;
|
p->z = 1.0f/zf;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
p->x = ((INT16)pSource[2]);
|
p->x = ((INT16)pSource[2]);
|
||||||
p->y = (-(INT16)pSource[3]);
|
p->y = (-(INT16)pSource[3]);
|
||||||
@ -1324,9 +1330,6 @@ DrawSpritesHelper(
|
|||||||
{
|
{
|
||||||
struct SceneNode *node = NewSceneNode(machine, zcoord, eSCENENODE_SPRITE);
|
struct SceneNode *node = NewSceneNode(machine, zcoord, eSCENENODE_SPRITE);
|
||||||
|
|
||||||
//printf("[%02d]: tile %x pri %x color %x flipX %d flipY %d cols %d rows %d link %d X %d Y %d sX %d sY %d trans %d cz %d\n",
|
|
||||||
//i, tile, cz&0x80, color&0x7f, flipx, flipy, numcols, numrows, linkType, xpos, ypos, sizex, sizey, translucency, cz);
|
|
||||||
|
|
||||||
node->data.sprite.tile = tile;
|
node->data.sprite.tile = tile;
|
||||||
node->data.sprite.flipx = flipx;
|
node->data.sprite.flipx = flipx;
|
||||||
node->data.sprite.flipy = flipy;
|
node->data.sprite.flipy = flipy;
|
||||||
@ -1660,7 +1663,7 @@ static void namcos22_mix_textlayer( running_machine &machine, bitmap_t *bitmap,
|
|||||||
pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
|
pri = BITMAP_ADDR8(machine.priority_bitmap, y, 0);
|
||||||
for (x=0;x<640;x++)
|
for (x=0;x<640;x++)
|
||||||
{
|
{
|
||||||
// skip if transparent or under poly/sprite
|
// skip if transparent or under poly
|
||||||
if (pri[x] == 2)
|
if (pri[x] == 2)
|
||||||
{
|
{
|
||||||
// apply shadow
|
// apply shadow
|
||||||
|
Loading…
Reference in New Issue
Block a user