Fix some bugs
This commit is contained in:
@@ -301,14 +301,6 @@ static uint32_t riva128_pgraph_do_blend(uint32_t factor, uint32_t dst, uint32_t
|
||||
return ((dst * (0x100 - factor)) + (src * factor)) >> 6;
|
||||
}
|
||||
|
||||
static uint8_t riva128_pgraph_draw_point(int offset, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
svga_t *svga = &riva128->svga;
|
||||
|
||||
svga->vram[(riva128->pgraph.speedhack.point_y[offset] * riva128->pfb.width) + riva128->pgraph.speedhack.point_x[offset]] = riva128->pgraph.speedhack.point_color;
|
||||
}
|
||||
|
||||
static uint8_t riva128_pmc_read(uint32_t addr, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
@@ -1091,101 +1083,6 @@ static uint32_t riva128_ramht_lookup(uint32_t handle, void *p)
|
||||
return riva128->pramin[ramht_base + (hash * 8)];
|
||||
}
|
||||
|
||||
/*static void riva128_pgraph_point_exec_method_speedhack(int offset, uint32_t val, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
svga_t *svga = &riva128->svga;
|
||||
|
||||
switch(offset)
|
||||
{
|
||||
case 0x0104:
|
||||
{
|
||||
//NOTIFY
|
||||
if(!(riva128->pgraph.invalid & 0x10000))
|
||||
{
|
||||
if(riva128->pgraph.notify & 0x10000)
|
||||
{
|
||||
riva128_pgraph_invalid_interrupt(12, riva128);
|
||||
riva128->pgraph.fifo_enable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!(riva128->pgraph.invalid & 0x10000) && !(riva128->pgraph.invalid & 0x10))
|
||||
{
|
||||
riva128->pgraph.notify |= 1 << 16;
|
||||
riva128->pgraph.notify |= (val & 0xf) << 20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x0304:
|
||||
{
|
||||
//COLOR
|
||||
riva128->pgraph.speedhack.point_color = val;
|
||||
break;
|
||||
}
|
||||
case 0x0400 ... 0x47c:
|
||||
{
|
||||
riva128->pgraph.speedhack.point_x[(offset & 0x7c) >> 2] = val & 0xffff;
|
||||
riva128->pgraph.speedhack.point_y[(offset & 0x7c) >> 2] = val >> 16;
|
||||
riva128_pgraph_draw_point((offset & 0x7c) >> 2, riva128);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void riva128_pgraph_gdi_exec_method_speedhack(int offset, uint32_t val, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
svga_t *svga = &riva128->svga;
|
||||
|
||||
switch(offset)
|
||||
{
|
||||
case 0x0104:
|
||||
{
|
||||
//NOTIFY
|
||||
if(!(riva128->pgraph.invalid & 0x10000))
|
||||
{
|
||||
if(riva128->pgraph.notify & 0x10000)
|
||||
{
|
||||
riva128_pgraph_invalid_interrupt(12, riva128);
|
||||
riva128->pgraph.fifo_enable = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(!(riva128->pgraph.invalid & 0x10000) && !(riva128->pgraph.invalid & 0x10))
|
||||
{
|
||||
riva128->pgraph.notify |= 1 << 16;
|
||||
riva128->pgraph.notify |= (val & 0xf) << 20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void riva128_pgraph_exec_method_speedhack(int subchanid, int offset, uint32_t val, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
svga_t *svga = &riva128->svga;
|
||||
pclog("RIVA 128 PGRAPH executing method %04X with object class on subchannel %01X %04X:%08X\n", offset, riva128->pgraph.obj_class[subchanid], subchanid, val, CS, cpu_state.pc);
|
||||
|
||||
switch(riva128->pgraph.obj_class[subchanid])
|
||||
{
|
||||
case 0x08:
|
||||
{
|
||||
//NV1_POINT
|
||||
riva128_pgraph_point_exec_method_speedhack(offset, val, riva128);
|
||||
break;
|
||||
}
|
||||
case 0x0c:
|
||||
{
|
||||
//NV3_GDI
|
||||
riva128_pgraph_gdi_exec_method_speedhack(offset, val, riva128);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
static void riva128_puller_exec_method(int chanid, int subchanid, int offset, uint32_t val, void *p)
|
||||
{
|
||||
riva128_t *riva128 = (riva128_t *)p;
|
||||
@@ -1338,6 +1235,9 @@ static uint8_t riva128_mmio_read(uint32_t addr, void *p)
|
||||
case 0x300000 ... 0x30ffff:
|
||||
if(riva128->card_id >= 0x04) ret = riva128->bios_rom.rom[addr & riva128->bios_rom.mask];
|
||||
break;
|
||||
case 0x400000 ... 0x401fff:
|
||||
ret = riva128_pgraph_read(addr, riva128);
|
||||
break;
|
||||
case 0x6013b4 ... 0x6013b5: case 0x6013d4 ... 0x6013d5: case 0x0c03c2 ... 0x0c03c5: case 0x0c03cc ... 0x0c03cf:
|
||||
ret = riva128_in(addr & 0xfff, riva128);
|
||||
break;
|
||||
@@ -1409,9 +1309,15 @@ static void riva128_mmio_write_l(uint32_t addr, uint32_t val, void *p)
|
||||
case 0x002000 ... 0x002fff:
|
||||
riva128_pfifo_write(addr, val, riva128);
|
||||
break;
|
||||
case 0x009000 ... 0x009fff:
|
||||
riva128_ptimer_write(addr, val, riva128);
|
||||
break;
|
||||
case 0x100000 ... 0x100fff:
|
||||
riva128_pfb_write(addr, val, riva128);
|
||||
break;
|
||||
case 0x400000 ... 0x401fff:
|
||||
riva128_pgraph_write(addr, val, riva128);
|
||||
break;
|
||||
case 0x680000 ... 0x680fff:
|
||||
riva128_pramdac_write(addr, val, riva128);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user