Skip to content

Commit

Permalink
Mystique: Make sure dxdiag on D3D 9.0b doesn't crash the emulator on
Browse files Browse the repository at this point in the history
Win98SE
  • Loading branch information
Cacodemon345 committed Dec 27, 2023
1 parent acdc2c7 commit c597a44
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/video/vid_mga.c
Original file line number Diff line number Diff line change
Expand Up @@ -2511,6 +2511,16 @@ mystique_ctrl_write_l(uint32_t addr, uint32_t val, void *priv)
//mystique->dma.pri_state = 0;
wake_fifo_thread(mystique);
}
/* HACK: For DirectX 9.0b Direct3D testing on Windows 98 SE.
The 4.12.013 drivers give an out-of-bounds busmastering range when dxdiag enumerates Direct3D, with exactly 16384 bytes of difference.
Don't attempt busmastering in such cases. This isn't ideal, but there are no more crashes faced in this case. */
if ((mystique->dma.primend & DMA_ADDR_MASK) < (mystique->dma.primaddress & DMA_ADDR_MASK) && ((mystique->dma.primaddress & DMA_ADDR_MASK) - (mystique->dma.primend & DMA_ADDR_MASK)) == 0x4000)
{
mystique->dma.primaddress = mystique->dma.primend;
mystique->endprdmasts_pending = 1;
mystique->dma.state = DMA_STATE_IDLE;
}
thread_release_mutex(mystique->dma.lock);
break;

Expand Down

0 comments on commit c597a44

Please sign in to comment.