Change the reset timing of pad_read to resolve a sort of traditional 1-frame delay problems. It still has 1-frame delay problem. However, unless you're using non-Windows port or MessagesInImage=TRUE, you shouldn't experience it anymore.

For me, it's not so easy to solve those traditional timing issues...

Add IPPU.InMainLoop for future use.
This commit is contained in:
gocha 2012-08-04 15:30:24 +09:00
parent d11b17327c
commit d5945b06de
3 changed files with 25 additions and 6 deletions

View File

@ -3320,12 +3320,6 @@ void S9xControlEOF (void)
do_polling(POLL_ALL);
S9xMovieUpdate();
if(!pad_read)
IPPU.PadIgnoredFrames++;
pad_read_last = pad_read;
pad_read = false;
}
void S9xSetControllerCrosshair (enum crosscontrols ctl, int8 idx, const char *fg, const char *bg)

View File

@ -188,11 +188,15 @@
#include "missing.h"
#endif
static inline void StartS9xMainLoop (void);
static inline void EndS9xMainLoop (void);
static inline void S9xReschedule (void);
void S9xMainLoop (void)
{
StartS9xMainLoop();
for (;;)
{
if (CPU.NMILine)
@ -308,6 +312,26 @@ void S9xMainLoop (void)
S9xSyncSpeed();
CPU.Flags &= ~SCAN_KEYS_FLAG;
}
EndS9xMainLoop();
}
static inline void StartS9xMainLoop (void)
{
extern bool8 pad_read, pad_read_last;
pad_read_last = pad_read;
pad_read = FALSE;
IPPU.InMainLoop = TRUE;
}
static inline void EndS9xMainLoop (void)
{
extern bool8 pad_read;
if(!pad_read)
IPPU.PadIgnoredFrames++;
IPPU.InMainLoop = FALSE;
}
static inline void S9xReschedule (void)

1
ppu.h
View File

@ -238,6 +238,7 @@ struct InternalPPU
uint32 SkippedFrames;
uint32 FrameSkip;
uint32 PadIgnoredFrames;
bool8 InMainLoop;
};
struct SOBJ