mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
core, fix some bugs reported by ASAN
This commit is contained in:
parent
b5d8374c6a
commit
b38c0ea6f9
2 changed files with 6 additions and 7 deletions
11
pico/draw.c
11
pico/draw.c
|
@ -2095,17 +2095,16 @@ static void PicoLine(int line, int offs, int sh, int bgc, int off, int on)
|
|||
void PicoDrawSync(int to, int off, int on)
|
||||
{
|
||||
struct PicoEState *est = &Pico.est;
|
||||
int line, offs = 0;
|
||||
int line, offs;
|
||||
int sh = (est->Pico->video.reg[0xC] & 8) >> 3; // shadow/hilight?
|
||||
int bgc = est->Pico->video.reg[7] & 0x3f;
|
||||
|
||||
pprof_start(draw);
|
||||
|
||||
if (rendlines != 240) {
|
||||
offs = 8;
|
||||
if (to > 223)
|
||||
to = 223;
|
||||
}
|
||||
offs = (240-rendlines) >> 1;
|
||||
if (to >= rendlines)
|
||||
to = rendlines-1;
|
||||
|
||||
if (est->DrawScanline <= to &&
|
||||
(est->rendstatus & (PDRAW_DIRTY_SPRITES|PDRAW_PARSE_SPRITES)))
|
||||
ParseSprites(to + 1, on);
|
||||
|
|
|
@ -397,7 +397,7 @@ int PicoVideoFIFOHint(void)
|
|||
// reset slot to start of scanline
|
||||
vf->fifo_slot = 0;
|
||||
// only need to refresh sprite position if we are synced
|
||||
if (Pico.est.DrawScanline == Pico.m.scanline)
|
||||
if (Pico.est.DrawScanline == Pico.m.scanline && !(pv->status & SR_VB))
|
||||
PicoDrawRefreshSprites();
|
||||
|
||||
// if CPU is waiting for the bus, advance CPU and FIFO until bus is free
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue