Fix compilation
This commit is contained in:
@@ -971,46 +971,46 @@ static uint8_t riva128_pextdev_read(uint32_t addr, void *p)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rivatnt_pgraph_ctx_switch(uint32_t addr, uint32_t val, void *p)
|
static void rivatnt_pgraph_ctx_switch(void *p)
|
||||||
{
|
{
|
||||||
riva128_t *riva128 = (riva128_t *)p;
|
riva128_t *riva128 = (riva128_t *)p;
|
||||||
svga_t *svga = &riva128->svga;
|
svga_t *svga = &riva128->svga;
|
||||||
|
|
||||||
if(!(riva128->fifo_st2_addr & 1)) return;
|
if(!(riva128->pgraph.fifo_st2_addr & 1)) return;
|
||||||
|
|
||||||
unsigned old_subc = (riva128->ctx_user >> 13) & 7;
|
unsigned old_subc = (riva128->pgraph.ctx_user >> 13) & 7;
|
||||||
unsigned new_subc = (riva128->fifo_st2_addr >> 12) & 7;
|
unsigned new_subc = (riva128->pgraph.fifo_st2_addr >> 12) & 7;
|
||||||
unsigned mthd = (riva128->fifo_st2_addr >> 1) & 0x7ff;
|
unsigned mthd = (riva128->pgraph.fifo_st2_addr >> 1) & 0x7ff;
|
||||||
riva128->fifo_st2_addr &= ~1;
|
riva128->pgraph.fifo_st2_addr &= ~1;
|
||||||
unsigned do_ctx_switch = mthd == 0;
|
unsigned do_ctx_switch = mthd == 0;
|
||||||
|
|
||||||
if(old_subc != new_subc || do_ctx_switch)
|
if(old_subc != new_subc || do_ctx_switch)
|
||||||
{
|
{
|
||||||
if(do_ctx_switch) riva128->ctx_cache[new_subc][3] = riva128->fifo_st2_data & 0xffff;
|
if(do_ctx_switch) riva128->pgraph.ctx_cache[new_subc][3] = riva128->pgraph.fifo_st2_data & 0xffff;
|
||||||
|
|
||||||
uint32_t ctx_mask = 0x0303f0ff;
|
uint32_t ctx_mask = 0x0303f0ff;
|
||||||
|
|
||||||
unsigned reload = (riva128->debug[1] >> 15) & 1;
|
unsigned reload = (riva128->pgraph.debug[1] >> 15) & 1;
|
||||||
if(reload || do_ctx_switch)
|
if(reload || do_ctx_switch)
|
||||||
{
|
{
|
||||||
uint32_t instance = riva128_ramht_lookup(val, riva128);
|
uint32_t instance = riva128_ramht_lookup(riva128->pgraph.fifo_st2_data, riva128);
|
||||||
riva128->ctx_cache[new_subc][0] = riva128->pramin[(instance >> 2)] & ctx_mask;
|
riva128->pgraph.ctx_cache[new_subc][0] = riva128->pramin[(instance >> 2)] & ctx_mask;
|
||||||
riva128->ctx_cache[new_subc][1] = riva128->pramin[(instance >> 2) + 1] & 0xffff3f03;
|
riva128->pgraph.ctx_cache[new_subc][1] = riva128->pramin[(instance >> 2) + 1] & 0xffff3f03;
|
||||||
riva128->ctx_cache[new_subc][2] = riva128->pramin[(instance >> 2) + 2];
|
riva128->pgraph.ctx_cache[new_subc][2] = riva128->pramin[(instance >> 2) + 2];
|
||||||
riva128->ctx_cache[new_subc][4] = riva128->pramin[(instance >> 2) + 3];
|
riva128->pgraph.ctx_cache[new_subc][4] = riva128->pramin[(instance >> 2) + 3];
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned reset = (riva128->debug[2] >> 28) & 1;
|
unsigned reset = (riva128->pgraph.debug[2] >> 28) & 1;
|
||||||
if(reset)
|
if(reset)
|
||||||
{
|
{
|
||||||
riva128->debug[1] |= 1;
|
riva128->pgraph.debug[1] |= 1;
|
||||||
riva128_pgraph_volatile_reset(riva128);
|
riva128_pgraph_volatile_reset(riva128);
|
||||||
}
|
}
|
||||||
else riva128->debug[1] &= ~1;
|
else riva128->pgraph.debug[1] &= ~1;
|
||||||
|
|
||||||
if(riva128->debug[1] & 0x100000)
|
if(riva128->pgraph.debug[1] & 0x100000)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < 5; i++) riva128->ctx_switch[i] = riva128->ctx_cache[new_subc][i];
|
for(int i = 0; i < 5; i++) riva128->pgraph.ctx_switch[i] = riva128->pgraph.ctx_cache[new_subc][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user