original mode corrections

This commit is contained in:
dborth 2009-04-02 05:14:18 +00:00
parent dc94f29f4d
commit ea88db00e2
4 changed files with 40 additions and 18 deletions

View File

@ -14,6 +14,7 @@
#include <stdlib.h>
#include <string.h>
#include <wiiuse/wpad.h>
#include <sys/stat.h>
#ifdef HW_RVL
extern "C" {

View File

@ -204,6 +204,8 @@ void setFrameTimerMethod()
extern void S9xInitSync();
bool CheckVideo = 0; // for forcing video reset in video.cpp
extern uint32 prevRenderedFrameCount;
static int videoReset;
static int currentMode;
void
emulate ()
@ -238,7 +240,6 @@ emulate ()
// since we're starting emulation again
LWP_SuspendThread (devicethread);
ResetVideo_Emu();
AudioStart ();
FrameTimer = 0;
@ -247,6 +248,9 @@ emulate ()
CheckVideo = 1; // force video update
prevRenderedFrameCount = IPPU.RenderedFramesCount;
videoReset = -1;
currentMode = GCSettings.render;
while(1) // emulation loop
{
S9xMainLoop ();
@ -259,11 +263,22 @@ emulate ()
}
if (ConfigRequested)
{
FreeGfxMem();
TakeScreenshot();
ResetVideo_Menu ();
ConfigRequested = 0;
break; // leave emulation loop
if((GCSettings.render != 0 && videoReset == -1) || videoReset == 0)
{
FreeGfxMem();
TakeScreenshot();
ResetVideo_Menu();
ConfigRequested = 0;
GCSettings.render = currentMode;
break; // leave emulation loop
}
else if(videoReset == -1)
{
GCSettings.render = 2;
CheckVideo = 1;
videoReset = 2;
}
videoReset--;
}
} // emulation loop
} // main loop

View File

@ -19,8 +19,6 @@
#include <unistd.h>
#include <wiiuse/wpad.h>
#include <ogc/texconv.h>
#include <mp3player.h>
#include <asndlib.h>
#include "snes9x.h"
#include "memmap.h"
@ -632,17 +630,25 @@ InitGCVideo ()
void
ResetVideo_Emu ()
{
GXRModeObj *rmode;
GXRModeObj *rmode = vmode;
Mtx44 p;
int i = -1;
if (GCSettings.render == 0) // original render mode
// original render mode or hq2x
if (GCSettings.render == 0 || GCSettings.FilterMethod != FILTER_NONE)
{
for (i=0; i<4; i++)
for (int j=0; j<4; j++)
{
if (tvmodes[i]->efbHeight == vheight)
if (tvmodes[j]->efbHeight == vheight)
{
i = j;
break;
}
}
}
if(i >= 0) // we found a matching original mode
{
rmode = tvmodes[i];
// hack to fix video output for hq2x
@ -660,7 +666,7 @@ ResetVideo_Emu ()
}
else
{
rmode = vmode; // same mode as menu
rmode = vmode; // same mode as menu
}
VIDEO_Configure (rmode);

View File

@ -20,15 +20,15 @@ void AllocGfxMem();
void FreeGfxMem();
void InitGCVideo ();
void StopGX();
void ResetVideo_Emu ();
void setGFX ();
void ResetVideo_Emu();
void setGFX();
void update_video (int width, int height);
void zoom (float speed);
void zoom_reset ();
void ResetVideo_Menu ();
void ResetVideo_Menu();
void TakeScreenshot();
void Menu_Render ();
void Menu_Render();
void Menu_DrawImg(f32 xpos, f32 ypos, u16 width, u16 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY, u8 alphaF );
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);