- [Psy-X] scratchPad fix (really?)

This commit is contained in:
Ilya Shurumov 2021-05-11 22:32:43 +06:00 committed by InspirationByte
parent fd5ed926ab
commit 64a224c1a7
2 changed files with 17 additions and 5 deletions

View File

@ -33,16 +33,15 @@ extern int PadIdentifier;
#define _PAD(x,y) ((y)<<((x)<<4))
#define getScratchAddr(offset) ((u_long *)(scratchData+(offset)*4))
#define getScratchAddr(offset) ((u_long *)(_scratchData+(offset)*4))
#define MODE_NTSC 0
#define MODE_PAL 1
#define MODE_PAL 1
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif
extern char scratchData[1024];
extern char* _scratchData;
extern int CheckCallback(void);
extern void PadInit(int mode);

View File

@ -5,7 +5,14 @@
#include <SDL_timer.h>
char scratchData[1024];
#ifdef DEBUG
char scratchData[4096 + 8];
char* _scratchData = scratchData + 4;
#else
char scratchData[4096];
char* _scratchData = scratchData;
#endif
void(*vsync_callback)(void) = NULL;
int StopCallback(void)
@ -50,6 +57,12 @@ int VSyncCallback(void(*f)(void))
long SetVideoMode(long mode)
{
#ifdef DEBUG
// debug marks for overflow cheks
*(uint*)&scratchData[0] = 0xdeadb33f;
*(uint*)&scratchData[4096 + 4] = 0xdeadb33f;
#endif
return PsyX_Sys_SetVMode(mode);
}