mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
core gfx, fix sprite problem in savestate load screen
This commit is contained in:
parent
f8395445e3
commit
4496577e40
3 changed files with 11 additions and 6 deletions
|
@ -905,7 +905,7 @@ int PicoVideoFIFOWrite(int count, int byte_p, unsigned sr_mask, unsigned sr_flag
|
|||
void PicoVideoInit(void);
|
||||
void PicoVideoSave(void);
|
||||
void PicoVideoLoad(void);
|
||||
void PicoVideoCacheSAT(void);
|
||||
void PicoVideoCacheSAT(int load);
|
||||
|
||||
// misc.c
|
||||
PICO_INTERNAL_ASM void memcpy16bswap(unsigned short *dest, void *src, int count);
|
||||
|
|
|
@ -602,7 +602,7 @@ static int state_load_gfx(void *file)
|
|||
char buff[8];
|
||||
|
||||
if (PicoIn.AHW & PAHW_32X)
|
||||
to_find += 2;
|
||||
to_find += 3;
|
||||
|
||||
g_read_offs = 0;
|
||||
CHECKED_READ(8, buff);
|
||||
|
@ -629,16 +629,19 @@ static int state_load_gfx(void *file)
|
|||
case CHUNK_DRAM:
|
||||
if (Pico32xMem != NULL)
|
||||
CHECKED_READ_BUFF(Pico32xMem->dram);
|
||||
found++;
|
||||
break;
|
||||
|
||||
case CHUNK_32XPAL:
|
||||
if (Pico32xMem != NULL)
|
||||
CHECKED_READ_BUFF(Pico32xMem->pal);
|
||||
found++;
|
||||
Pico32x.dirty_pal = 1;
|
||||
break;
|
||||
|
||||
case CHUNK_32XSYS:
|
||||
CHECKED_READ_BUFF(Pico32x);
|
||||
found++;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -712,7 +715,8 @@ int PicoStateLoadGfx(const char *fname)
|
|||
}
|
||||
areaClose(afile);
|
||||
|
||||
PicoVideoCacheSAT();
|
||||
PicoVideoCacheSAT(1);
|
||||
Pico.est.rendstatus = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -771,6 +775,7 @@ void PicoTmpStateRestore(void *data)
|
|||
memcpy(VdpSATCache, t->satcache, sizeof(VdpSATCache));
|
||||
memcpy(&Pico.video, &t->video, sizeof(Pico.video));
|
||||
Pico.m.dirtyPal = 1;
|
||||
PicoVideoCacheSAT(0);
|
||||
|
||||
#ifndef NO_32X
|
||||
if (PicoIn.AHW & PAHW_32X) {
|
||||
|
|
|
@ -1104,7 +1104,7 @@ unsigned char PicoVideoRead8HV_L(int is_from_z80)
|
|||
return d;
|
||||
}
|
||||
|
||||
void PicoVideoCacheSAT(void)
|
||||
void PicoVideoCacheSAT(int load)
|
||||
{
|
||||
struct PicoVideo *pv = &Pico.video;
|
||||
int l;
|
||||
|
@ -1115,7 +1115,7 @@ void PicoVideoCacheSAT(void)
|
|||
SATaddr &= ~0x200, SATmask &= ~0x200; // H40, zero lowest SAT bit
|
||||
|
||||
// rebuild SAT cache XXX wrong since cache and memory can differ
|
||||
for (l = 0; l < 80; l++) {
|
||||
for (l = 0; load && l < 80; l++) {
|
||||
((u16 *)VdpSATCache)[l*2 ] = PicoMem.vram[(SATaddr>>1) + l*4 ];
|
||||
((u16 *)VdpSATCache)[l*2 + 1] = PicoMem.vram[(SATaddr>>1) + l*4 + 1];
|
||||
}
|
||||
|
@ -1170,6 +1170,6 @@ void PicoVideoLoad(void)
|
|||
}
|
||||
if (vf->fifo_ql)
|
||||
pv->status |= SR_DMA;
|
||||
PicoVideoCacheSAT();
|
||||
PicoVideoCacheSAT(1);
|
||||
}
|
||||
// vim:shiftwidth=2:ts=2:expandtab
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue