small bugfixes

This commit is contained in:
dborth 2009-04-01 08:02:59 +00:00
parent 0e1c0985f9
commit 47c65f5ebe
6 changed files with 20 additions and 32 deletions

View File

@ -282,7 +282,7 @@ int main(int argc, char *argv[])
LWP_SuspendThread (devicethread); LWP_SuspendThread (devicethread);
ResetVideo_Emu(); ResetVideo_Emu();
SetControllers();
setFrameTimer(); // set frametimer method before emulation setFrameTimer(); // set frametimer method before emulation
SetPalette(); SetPalette();

View File

@ -98,8 +98,6 @@ int GCMemROM(int method, int size)
FCEUI_SetSoundVolume(100); // 0-100 FCEUI_SetSoundVolume(100); // 0-100
FCEUI_SetLowPass(0); FCEUI_SetLowPass(0);
InitialisePads();
MakeFCEUFile((char *) nesrom, size); MakeFCEUFile((char *) nesrom, size);
nesGameType = 0; nesGameType = 0;

View File

@ -642,7 +642,7 @@ ResetVideo_Emu ()
GX_SetDispCopySrc (0, 0, rmode->fbWidth, rmode->efbHeight); GX_SetDispCopySrc (0, 0, rmode->fbWidth, rmode->efbHeight);
GX_SetDispCopyDst (rmode->fbWidth, rmode->xfbHeight); GX_SetDispCopyDst (rmode->fbWidth, rmode->xfbHeight);
GX_SetCopyFilter (rmode->aa, rmode->sample_pattern, (GCSettings.render == 1) ? GX_TRUE : GX_FALSE, rmode->vfilter); // deflickering filter only for filtered mode GX_SetCopyFilter (rmode->aa, rmode->sample_pattern, (GCSettings.render == 1) ? GX_TRUE : GX_FALSE, rmode->vfilter); // deflicker ON only for filtered mode
GX_SetFieldMode (rmode->field_rendering, ((rmode->viHeight == 2 * rmode->xfbHeight) ? GX_ENABLE : GX_DISABLE)); GX_SetFieldMode (rmode->field_rendering, ((rmode->viHeight == 2 * rmode->xfbHeight) ? GX_ENABLE : GX_DISABLE));
GX_SetPixelFmt (GX_PF_RGB8_Z24, GX_ZC_LINEAR); GX_SetPixelFmt (GX_PF_RGB8_Z24, GX_ZC_LINEAR);
@ -650,7 +650,7 @@ ResetVideo_Emu ()
GX_SetZMode (GX_TRUE, GX_LEQUAL, GX_TRUE); GX_SetZMode (GX_TRUE, GX_LEQUAL, GX_TRUE);
GX_SetColorUpdate (GX_TRUE); GX_SetColorUpdate (GX_TRUE);
guOrtho(p, rmode->efbHeight/2, -(rmode->efbHeight/2), -(rmode->fbWidth/2), rmode->fbWidth/2, 10, 1000); // matrix, t, b, l, r, n, f guOrtho(p, rmode->efbHeight/2, -(rmode->efbHeight/2), -(rmode->fbWidth/2), rmode->fbWidth/2, 100, 1000); // matrix, t, b, l, r, n, f
GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC); GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC);
// reinitialize texture // reinitialize texture

View File

@ -1165,7 +1165,7 @@ static int MenuGame()
GuiImage resetBtnIcon(&iconReset); GuiImage resetBtnIcon(&iconReset);
GuiButton resetBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight()); GuiButton resetBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
resetBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); resetBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
resetBtn.SetPosition(-125, 250); resetBtn.SetPosition(125, 250);
resetBtn.SetLabel(&resetBtnTxt); resetBtn.SetLabel(&resetBtnTxt);
resetBtn.SetImage(&resetBtnImg); resetBtn.SetImage(&resetBtnImg);
resetBtn.SetImageOver(&resetBtnImgOver); resetBtn.SetImageOver(&resetBtnImgOver);
@ -1180,7 +1180,7 @@ static int MenuGame()
GuiImage controllerBtnIcon(&iconController); GuiImage controllerBtnIcon(&iconController);
GuiButton controllerBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight()); GuiButton controllerBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
controllerBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); controllerBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
controllerBtn.SetPosition(125, 250); controllerBtn.SetPosition(-125, 250);
controllerBtn.SetLabel(&controllerBtnTxt); controllerBtn.SetLabel(&controllerBtnTxt);
controllerBtn.SetImage(&controllerBtnImg); controllerBtn.SetImage(&controllerBtnImg);
controllerBtn.SetImageOver(&controllerBtnImgOver); controllerBtn.SetImageOver(&controllerBtnImgOver);
@ -1632,7 +1632,7 @@ static int MenuGameSaves(int action)
} }
else // save else // save
{ {
if(ret == 0) // new SRAM if(ret == 0) // new RAM
{ {
for(i=1; i < 100; i++) for(i=1; i < 100; i++)
if(saves.files[FILE_RAM][i] == 0) if(saves.files[FILE_RAM][i] == 0)
@ -1658,7 +1658,7 @@ static int MenuGameSaves(int action)
menu = MENU_GAME_SAVE; menu = MENU_GAME_SAVE;
} }
} }
else // overwrite SRAM/Snapshot else // overwrite RAM/State
{ {
MakeFilePath(filepath, saves.type[ret-2], method, saves.filename[ret-2]); MakeFilePath(filepath, saves.type[ret-2], method, saves.filename[ret-2]);
switch(saves.type[ret-2]) switch(saves.type[ret-2])
@ -2504,7 +2504,7 @@ static int MenuSettingsMappingsMap()
GuiOptionBrowser optionBrowser(552, 248, &options); GuiOptionBrowser optionBrowser(552, 248, &options);
optionBrowser.SetPosition(0, 108); optionBrowser.SetPosition(0, 108);
optionBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); optionBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
optionBrowser.SetCol2Position(180); optionBrowser.SetCol2Position(280);
HaltGui(); HaltGui();
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
@ -3024,12 +3024,12 @@ static int MenuSettingsFile()
snprintf (options.value[4], 256, "%s", GCSettings.CheatFolder); snprintf (options.value[4], 256, "%s", GCSettings.CheatFolder);
if (GCSettings.AutoLoad == 0) sprintf (options.value[5],"Off"); if (GCSettings.AutoLoad == 0) sprintf (options.value[5],"Off");
else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"SRAM"); else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"RAM");
else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"Snapshot"); else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"State");
if (GCSettings.AutoSave == 0) sprintf (options.value[5],"Off"); if (GCSettings.AutoSave == 0) sprintf (options.value[5],"Off");
else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"SRAM"); else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"RAM");
else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"Snapshot"); else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"State");
else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both"); else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both");
sprintf (options.value[7], "%s", GCSettings.VerifySaves == true ? "On" : "Off"); sprintf (options.value[7], "%s", GCSettings.VerifySaves == true ? "On" : "Off");

View File

@ -140,6 +140,8 @@ void SetControllers()
if(!romLoaded) if(!romLoaded)
return; return;
InputDPR = &JSReturn;
if(GCSettings.Controller == CTRL_PAD4) if(GCSettings.Controller == CTRL_PAD4)
FCEUI_DisableFourScore(false); FCEUI_DisableFourScore(false);
else else
@ -158,24 +160,14 @@ void SetControllers()
if(GCSettings.Controller == CTRL_ZAPPER) if(GCSettings.Controller == CTRL_ZAPPER)
{ {
// enable Zapper int p;
int z = 1; if(nesGameType == 2) p = 0;
zapperdata[z] = FCEU_InitZapper(z); else p = 1;
FCEUI_SetInput(z, SI_ZAPPER, myzappers[z], 1); zapperdata[p] = FCEU_InitZapper(p);
FCEUI_SetInput(p, SI_ZAPPER, myzappers[p], 1);
} }
} }
/****************************************************************************
* Initialise Pads
***************************************************************************/
void InitialisePads()
{
InputDPR = &JSReturn;
FCEUI_SetInput(0, SI_GAMEPAD, InputDPR, 0);
FCEUI_SetInput(1, SI_GAMEPAD, InputDPR, 0);
SetControllers();
}
#ifdef HW_RVL #ifdef HW_RVL
/**************************************************************************** /****************************************************************************

View File

@ -64,15 +64,13 @@ extern GuiTrigger userInput[4];
extern int rumbleRequest[4]; extern int rumbleRequest[4];
extern u32 btnmap[2][4][12]; extern u32 btnmap[2][4][12];
void SetControllers();
void ResetControls(); void ResetControls();
void ShutoffRumble(); void ShutoffRumble();
void DoRumble(int i); void DoRumble(int i);
s8 WPAD_StickX(u8 chan,u8 right); s8 WPAD_StickX(u8 chan,u8 right);
s8 WPAD_StickY(u8 chan, u8 right); s8 WPAD_StickY(u8 chan, u8 right);
void InitialisePads();
void GetJoy(); void GetJoy();
void ToggleFourScore(int set);
void ToggleZapper(int set);
void DrawCursor(); void DrawCursor();
#endif #endif