mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-17 22:25:37 +00:00
GPU: Prevent emulator locking up when switching between PAL/NTSC mode
This commit is contained in:
parent
bad5b30a61
commit
d67bcd654c
|
@ -321,13 +321,17 @@ void GPU::UpdateCRTCConfig()
|
||||||
|
|
||||||
if (m_GPUSTAT.pal_mode)
|
if (m_GPUSTAT.pal_mode)
|
||||||
{
|
{
|
||||||
cs.vertical_total = 314;
|
cs.vertical_total = PAL_TOTAL_LINES;
|
||||||
cs.horizontal_total = 3406;
|
cs.current_scanline %= PAL_TOTAL_LINES;
|
||||||
|
cs.horizontal_total = PAL_TICKS_PER_LINE;
|
||||||
|
cs.current_tick_in_scanline %= PAL_TICKS_PER_LINE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cs.vertical_total = 263;
|
cs.vertical_total = NTSC_TOTAL_LINES;
|
||||||
cs.horizontal_total = 3413;
|
cs.current_scanline %= NTSC_TOTAL_LINES;
|
||||||
|
cs.horizontal_total = NTSC_TICKS_PER_LINE;
|
||||||
|
cs.current_tick_in_scanline %= NTSC_TICKS_PER_LINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const TickCount ticks_per_frame = cs.horizontal_total * cs.vertical_total;
|
const TickCount ticks_per_frame = cs.horizontal_total * cs.vertical_total;
|
||||||
|
|
|
@ -94,7 +94,11 @@ public:
|
||||||
MAX_PRIMITIVE_HEIGHT = 512,
|
MAX_PRIMITIVE_HEIGHT = 512,
|
||||||
DOT_TIMER_INDEX = 0,
|
DOT_TIMER_INDEX = 0,
|
||||||
HBLANK_TIMER_INDEX = 1,
|
HBLANK_TIMER_INDEX = 1,
|
||||||
MAX_RESOLUTION_SCALE = 16
|
MAX_RESOLUTION_SCALE = 16,
|
||||||
|
NTSC_TICKS_PER_LINE = 3413,
|
||||||
|
NTSC_TOTAL_LINES = 263,
|
||||||
|
PAL_TICKS_PER_LINE = 3406,
|
||||||
|
PAL_TOTAL_LINES = 314,
|
||||||
};
|
};
|
||||||
|
|
||||||
// 4x4 dither matrix.
|
// 4x4 dither matrix.
|
||||||
|
|
Loading…
Reference in a new issue