mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-25 02:31:49 +01:00
fixed weird exception occuring
This commit is contained in:
parent
3ee65ad74b
commit
e822832b99
@ -1139,7 +1139,6 @@ void MainMenu ()
|
|||||||
{
|
{
|
||||||
crccheck = crc32 (0, &sram.sram[0], 0x10000);
|
crccheck = crc32 (0, &sram.sram[0], 0x10000);
|
||||||
if (genromsize && (crccheck != sram.crc)) strcpy (menutitle, "*** SRAM has been modified ***");
|
if (genromsize && (crccheck != sram.crc)) strcpy (menutitle, "*** SRAM has been modified ***");
|
||||||
else sprintf(menutitle, "%d FPS", FramesPerSecond);
|
|
||||||
|
|
||||||
ret = domenu (&items[0], count, 0);
|
ret = domenu (&items[0], count, 0);
|
||||||
switch (ret)
|
switch (ret)
|
||||||
|
@ -119,7 +119,6 @@ void reloadrom ()
|
|||||||
* M A I N
|
* M A I N
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int FramesPerSecond = 0;
|
|
||||||
int frameticker = 0;
|
int frameticker = 0;
|
||||||
bool fat_enabled = 0;
|
bool fat_enabled = 0;
|
||||||
|
|
||||||
@ -131,10 +130,6 @@ int main (int argc, char *argv[])
|
|||||||
DI_Init();
|
DI_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
long long now, prev;
|
|
||||||
int RenderedFrameCount = 0;
|
|
||||||
int FrameCount = 0;
|
|
||||||
|
|
||||||
/* initialize OGC subsystems */
|
/* initialize OGC subsystems */
|
||||||
ogc_video__init();
|
ogc_video__init();
|
||||||
ogc_input__init();
|
ogc_input__init();
|
||||||
@ -183,32 +178,31 @@ int main (int argc, char *argv[])
|
|||||||
reloadrom ();
|
reloadrom ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show Menu */
|
/* Show Menu first */
|
||||||
MainMenu();
|
ConfigRequested = 1;
|
||||||
ConfigRequested = 0;
|
|
||||||
|
|
||||||
/* Reset frame sync */
|
|
||||||
frameticker = 0;
|
|
||||||
FrameCount = 0;
|
|
||||||
RenderedFrameCount = 0;
|
|
||||||
|
|
||||||
/* Start Audio & Video */
|
|
||||||
ogc_audio__start();
|
|
||||||
ogc_video__start();
|
|
||||||
|
|
||||||
/* Emulation Loop */
|
/* Emulation Loop */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (gc_pal < 0)
|
/* Check for Menu request */
|
||||||
|
if (ConfigRequested)
|
||||||
{
|
{
|
||||||
/* this code is NEVER executed */
|
/* stop Audio & Video */
|
||||||
/* strangely, when removing it, this makes the program crashing (why ?) */
|
ogc_audio__stop();
|
||||||
prev = now = gettime();
|
ogc_video__stop();
|
||||||
while (diff_usec(prev, now) < 1) now = gettime();
|
|
||||||
prev = now;
|
/* go to menu */
|
||||||
|
MainMenu ();
|
||||||
|
ConfigRequested = 0;
|
||||||
|
|
||||||
|
/* reset frame sync */
|
||||||
|
frameticker = 0;
|
||||||
|
|
||||||
|
/* start Audio & Video */
|
||||||
|
ogc_audio__start();
|
||||||
|
ogc_video__start();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (frameticker > 1)
|
if (frameticker > 1)
|
||||||
{
|
{
|
||||||
/* frameskipping */
|
/* frameskipping */
|
||||||
@ -225,7 +219,6 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
/* frame rendering */
|
/* frame rendering */
|
||||||
system_frame (0);
|
system_frame (0);
|
||||||
RenderedFrameCount++;
|
|
||||||
|
|
||||||
/* update video & audio */
|
/* update video & audio */
|
||||||
ogc_audio__update();
|
ogc_audio__update();
|
||||||
@ -235,36 +228,5 @@ int main (int argc, char *argv[])
|
|||||||
frameticker--;
|
frameticker--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check rendered frames (FPS) */
|
|
||||||
FrameCount++;
|
|
||||||
if (FrameCount == vdp_rate)
|
|
||||||
{
|
|
||||||
FramesPerSecond = RenderedFrameCount;
|
|
||||||
RenderedFrameCount = 0;
|
|
||||||
FrameCount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for Menu request */
|
|
||||||
if (ConfigRequested)
|
|
||||||
{
|
|
||||||
/* stop Audio & Video */
|
|
||||||
ogc_audio__stop();
|
|
||||||
ogc_video__stop();
|
|
||||||
|
|
||||||
/* go to menu */
|
|
||||||
MainMenu ();
|
|
||||||
ConfigRequested = 0;
|
|
||||||
|
|
||||||
/* reset frame sync */
|
|
||||||
frameticker = 0;
|
|
||||||
FrameCount = 0;
|
|
||||||
RenderedFrameCount = 0;
|
|
||||||
|
|
||||||
/* restart Audio & Video */
|
|
||||||
ogc_audio__start();
|
|
||||||
ogc_video__start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ extern u8 soundbuffer[2][3840];
|
|||||||
extern int mixbuffer;
|
extern int mixbuffer;
|
||||||
|
|
||||||
extern void ogc_audio__init(void);
|
extern void ogc_audio__init(void);
|
||||||
extern void ogc_audio__stop(void);
|
|
||||||
extern void ogc_audio__start(void);
|
extern void ogc_audio__start(void);
|
||||||
|
extern void ogc_audio__stop(void);
|
||||||
extern void ogc_audio__update(void);
|
extern void ogc_audio__update(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -536,7 +536,6 @@ static void gxReset(void)
|
|||||||
|
|
||||||
/* resynchronize field & restore VSYNC handler */
|
/* resynchronize field & restore VSYNC handler */
|
||||||
whichfb = odd_frame;
|
whichfb = odd_frame;
|
||||||
VIDEO_SetNextFramebuffer (xfb[whichfb]);
|
|
||||||
VIDEO_SetPreRetraceCallback(xfb_swap);
|
VIDEO_SetPreRetraceCallback(xfb_swap);
|
||||||
VIDEO_Flush();
|
VIDEO_Flush();
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
@ -655,9 +654,18 @@ void ogc_video__update()
|
|||||||
draw_square ();
|
draw_square ();
|
||||||
GX_DrawDone ();
|
GX_DrawDone ();
|
||||||
|
|
||||||
|
/* special case: interlaced display */
|
||||||
|
if (interlaced && !config.render && (odd_frame == whichfb))
|
||||||
|
{
|
||||||
|
/* resynchronize frame emulation */
|
||||||
|
odd_frame = whichfb ^1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* copy EFB to current XFB */
|
/* copy EFB to current XFB */
|
||||||
GX_CopyDisp (xfb[odd_frame], GX_TRUE);
|
GX_CopyDisp (xfb[whichfb], GX_TRUE);
|
||||||
GX_Flush ();
|
GX_Flush ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize VIDEO subsystem */
|
/* Initialize VIDEO subsystem */
|
||||||
|
@ -24,15 +24,16 @@
|
|||||||
#ifndef _GC_VIDEO_H_
|
#ifndef _GC_VIDEO_H_
|
||||||
#define _GC_VIDEO_H_
|
#define _GC_VIDEO_H_
|
||||||
|
|
||||||
|
extern unsigned int *xfb[2];
|
||||||
|
extern int whichfb;
|
||||||
|
extern int gc_pal;
|
||||||
|
extern GXRModeObj *tvmodes[6];
|
||||||
|
extern GXRModeObj *vmode;
|
||||||
|
extern u8 *texturemem;
|
||||||
|
|
||||||
extern void ogc_video__init(void);
|
extern void ogc_video__init(void);
|
||||||
extern void ogc_video__start(void);
|
extern void ogc_video__start(void);
|
||||||
extern void ogc_video__stop(void);
|
extern void ogc_video__stop(void);
|
||||||
extern void ogc_video__update(void);
|
extern void ogc_video__update(void);
|
||||||
|
|
||||||
extern int gc_pal;
|
|
||||||
extern unsigned int *xfb[2];
|
|
||||||
extern int whichfb;
|
|
||||||
extern GXRModeObj *tvmodes[6];
|
|
||||||
extern GXRModeObj *vmode;
|
|
||||||
extern u8 *texturemem;
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,6 @@ extern void memfile_autoload();
|
|||||||
|
|
||||||
extern int peripherals;
|
extern int peripherals;
|
||||||
extern int frameticker;
|
extern int frameticker;
|
||||||
extern int FramesPerSecond;
|
|
||||||
extern int Shutdown;
|
extern int Shutdown;
|
||||||
extern bool fat_enabled;
|
extern bool fat_enabled;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user