voodoo.c, vooddefs.h: Added support for writes to trexInit1 register, to return TMU configuration data. [Peter Ferrie]
This commit is contained in:
parent
de2259e591
commit
b906c7d7f4
@ -1346,6 +1346,7 @@ static const UINT8 dither_matrix_2x2[16] =
|
||||
#define TEXDETAIL_ALPHA_MAG_FILTER(val) (((val) >> 20) & 1) /* Voodoo 2 only */
|
||||
#define TEXDETAIL_SEPARATE_RGBA_FILTER(val) (((val) >> 21) & 1) /* Voodoo 2 only */
|
||||
|
||||
#define TREXINIT_SEND_TMU_CONFIG(val) (((val) >> 18) & 1)
|
||||
|
||||
|
||||
/*************************************
|
||||
@ -1724,6 +1725,9 @@ struct voodoo_state
|
||||
int next_rasterizer; /* next rasterizer index */
|
||||
raster_info rasterizer[MAX_RASTERIZERS]; /* array of rasterizers */
|
||||
raster_info * raster_hash[RASTER_HASH_SIZE]; /* hash table of rasterizers */
|
||||
|
||||
bool send_config;
|
||||
UINT32 tmu_config;
|
||||
};
|
||||
|
||||
|
||||
@ -3642,9 +3646,18 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co
|
||||
/* result in texel */ \
|
||||
/* note that they set LOD min to 8 to "disable" a TMU */ \
|
||||
if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \
|
||||
TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \
|
||||
v->tmu[0].lookup, extra->lodbase0, \
|
||||
iters0, itert0, iterw0, texel); \
|
||||
{ \
|
||||
if (!v->send_config) \
|
||||
{ \
|
||||
TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \
|
||||
v->tmu[0].lookup, extra->lodbase0, \
|
||||
iters0, itert0, iterw0, texel); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
texel.u=v->tmu_config; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* colorpath pipeline selects source colors and does blending */ \
|
||||
CLAMPED_ARGB(iterr, iterg, iterb, itera, FBZCOLORPATH, iterargb); \
|
||||
|
@ -2885,6 +2885,12 @@ static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data)
|
||||
}
|
||||
break;
|
||||
|
||||
case trexInit1:
|
||||
/* send tmu config data to the frame buffer */
|
||||
v->send_config = (TREXINIT_SEND_TMU_CONFIG(data) > 0);
|
||||
goto default_case;
|
||||
break;
|
||||
|
||||
/* these registers are referenced in the renderer; we must wait for pending work before changing */
|
||||
case chromaRange:
|
||||
case chromaKey:
|
||||
@ -2901,6 +2907,7 @@ static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data)
|
||||
|
||||
/* by default, just feed the data to the chips */
|
||||
default:
|
||||
default_case:
|
||||
if (chips & 1) v->reg[0x000 + regnum].u = data;
|
||||
if (chips & 2) v->reg[0x100 + regnum].u = data;
|
||||
if (chips & 4) v->reg[0x200 + regnum].u = data;
|
||||
@ -4913,6 +4920,8 @@ void voodoo_device::common_start_voodoo(UINT8 type)
|
||||
}
|
||||
}
|
||||
|
||||
v->tmu_config = 0x11; // revision 1
|
||||
|
||||
/* configure type-specific values */
|
||||
switch (v->type)
|
||||
{
|
||||
@ -4928,6 +4937,7 @@ void voodoo_device::common_start_voodoo(UINT8 type)
|
||||
v->regnames = voodoo_reg_name;
|
||||
v->alt_regmap = 0;
|
||||
v->fbi.lfb_stride = 10;
|
||||
v->tmu_config |= 0x800;
|
||||
break;
|
||||
|
||||
case TYPE_VOODOO_BANSHEE:
|
||||
@ -4963,6 +4973,10 @@ void voodoo_device::common_start_voodoo(UINT8 type)
|
||||
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
|
||||
v->cpu = machine().device(m_cputag);
|
||||
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
|
||||
|
||||
if (m_tmumem1 != 0)
|
||||
v->tmu_config |= 0xc0; // two TMUs
|
||||
|
||||
v->chipmask = 0x01;
|
||||
v->attoseconds_per_cycle = ATTOSECONDS_PER_SECOND / v->freq;
|
||||
v->trigger = 51324 + v->index;
|
||||
@ -5007,6 +5021,7 @@ void voodoo_device::common_start_voodoo(UINT8 type)
|
||||
{
|
||||
init_tmu(v, &v->tmu[1], &v->reg[0x200], tmumem[1], m_tmumem1 << 20);
|
||||
v->chipmask |= 0x04;
|
||||
v->tmu_config |= 0x40;
|
||||
}
|
||||
|
||||
/* initialize some registers */
|
||||
|
Loading…
Reference in New Issue
Block a user