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 <stdlib.h>
#include <string.h> #include <string.h>
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include <sys/stat.h>
#ifdef HW_RVL #ifdef HW_RVL
extern "C" { extern "C" {

View File

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

View File

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

View File

@ -20,15 +20,15 @@ void AllocGfxMem();
void FreeGfxMem(); void FreeGfxMem();
void InitGCVideo (); void InitGCVideo ();
void StopGX(); void StopGX();
void ResetVideo_Emu (); void ResetVideo_Emu();
void setGFX (); void setGFX();
void update_video (int width, int height); void update_video (int width, int height);
void zoom (float speed); void zoom (float speed);
void zoom_reset (); void zoom_reset ();
void ResetVideo_Menu (); void ResetVideo_Menu();
void TakeScreenshot(); 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_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); void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled);