notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drc: fix CCREG loading
[pcsx_rearmed.git]
/
libpcsxcore
/
misc.c
diff --git
a/libpcsxcore/misc.c
b/libpcsxcore/misc.c
index
1b38e28
..
02d1761
100644
(file)
--- a/
libpcsxcore/misc.c
+++ b/
libpcsxcore/misc.c
@@
-21,6
+21,7
@@
* Miscellaneous functions, including savestates and CD-ROM loading.
*/
* Miscellaneous functions, including savestates and CD-ROM loading.
*/
+#include <stddef.h>
#include "misc.h"
#include "cdrom.h"
#include "mdec.h"
#include "misc.h"
#include "cdrom.h"
#include "mdec.h"
@@
-244,6
+245,7
@@
int LoadCdrom() {
tmpHead.t_addr = SWAP32(tmpHead.t_addr);
psxCpu->Clear(tmpHead.t_addr, tmpHead.t_size / 4);
tmpHead.t_addr = SWAP32(tmpHead.t_addr);
psxCpu->Clear(tmpHead.t_addr, tmpHead.t_size / 4);
+ psxCpu->Reset();
// Read the rest of the main executable
while (tmpHead.t_size & ~2047) {
// Read the rest of the main executable
while (tmpHead.t_size & ~2047) {
@@
-291,6
+293,7
@@
int LoadCdromFile(const char *filename, EXE_HEADER *head) {
addr = head->t_addr;
psxCpu->Clear(addr, size / 4);
addr = head->t_addr;
psxCpu->Clear(addr, size / 4);
+ psxCpu->Reset();
while (size & ~2047) {
incTime();
while (size & ~2047) {
incTime();
@@
-600,7
+603,8
@@
int SaveState(const char *file) {
SaveFuncs.write(f, psxM, 0x00200000);
SaveFuncs.write(f, psxR, 0x00080000);
SaveFuncs.write(f, psxH, 0x00010000);
SaveFuncs.write(f, psxM, 0x00200000);
SaveFuncs.write(f, psxR, 0x00080000);
SaveFuncs.write(f, psxH, 0x00010000);
- SaveFuncs.write(f, (void *)&psxRegs, sizeof(psxRegs));
+ // only partial save of psxRegisters to maintain savestate compat
+ SaveFuncs.write(f, &psxRegs, offsetof(psxRegisters, gteBusyCycle));
// gpu
gpufP = (GPUFreeze_t *)malloc(sizeof(GPUFreeze_t));
// gpu
gpufP = (GPUFreeze_t *)malloc(sizeof(GPUFreeze_t));
@@
-664,7
+668,8
@@
int LoadState(const char *file) {
SaveFuncs.read(f, psxM, 0x00200000);
SaveFuncs.read(f, psxR, 0x00080000);
SaveFuncs.read(f, psxH, 0x00010000);
SaveFuncs.read(f, psxM, 0x00200000);
SaveFuncs.read(f, psxR, 0x00080000);
SaveFuncs.read(f, psxH, 0x00010000);
- SaveFuncs.read(f, (void *)&psxRegs, sizeof(psxRegs));
+ SaveFuncs.read(f, &psxRegs, offsetof(psxRegisters, gteBusyCycle));
+ psxRegs.gteBusyCycle = psxRegs.cycle;
if (Config.HLE)
psxBiosFreeze(0);
if (Config.HLE)
psxBiosFreeze(0);