From 47c65f5ebe047db3f6d99322ec3ede074133889e Mon Sep 17 00:00:00 2001 From: dborth Date: Wed, 1 Apr 2009 08:02:59 +0000 Subject: [PATCH] small bugfixes --- source/ngc/fceugx.cpp | 2 +- source/ngc/fceuload.cpp | 2 -- source/ngc/gcvideo.cpp | 4 ++-- source/ngc/menu.cpp | 18 +++++++++--------- source/ngc/pad.cpp | 22 +++++++--------------- source/ngc/pad.h | 4 +--- 6 files changed, 20 insertions(+), 32 deletions(-) diff --git a/source/ngc/fceugx.cpp b/source/ngc/fceugx.cpp index 797c8ab..5c4ad80 100644 --- a/source/ngc/fceugx.cpp +++ b/source/ngc/fceugx.cpp @@ -282,7 +282,7 @@ int main(int argc, char *argv[]) LWP_SuspendThread (devicethread); ResetVideo_Emu(); - + SetControllers(); setFrameTimer(); // set frametimer method before emulation SetPalette(); diff --git a/source/ngc/fceuload.cpp b/source/ngc/fceuload.cpp index c022bb2..1817509 100644 --- a/source/ngc/fceuload.cpp +++ b/source/ngc/fceuload.cpp @@ -98,8 +98,6 @@ int GCMemROM(int method, int size) FCEUI_SetSoundVolume(100); // 0-100 FCEUI_SetLowPass(0); - InitialisePads(); - MakeFCEUFile((char *) nesrom, size); nesGameType = 0; diff --git a/source/ngc/gcvideo.cpp b/source/ngc/gcvideo.cpp index 58bae70..2713170 100644 --- a/source/ngc/gcvideo.cpp +++ b/source/ngc/gcvideo.cpp @@ -642,7 +642,7 @@ ResetVideo_Emu () GX_SetDispCopySrc (0, 0, rmode->fbWidth, rmode->efbHeight); 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_SetPixelFmt (GX_PF_RGB8_Z24, GX_ZC_LINEAR); @@ -650,7 +650,7 @@ ResetVideo_Emu () GX_SetZMode (GX_TRUE, GX_LEQUAL, 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); // reinitialize texture diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 8288360..adfe893 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -1165,7 +1165,7 @@ static int MenuGame() GuiImage resetBtnIcon(&iconReset); GuiButton resetBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight()); resetBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - resetBtn.SetPosition(-125, 250); + resetBtn.SetPosition(125, 250); resetBtn.SetLabel(&resetBtnTxt); resetBtn.SetImage(&resetBtnImg); resetBtn.SetImageOver(&resetBtnImgOver); @@ -1180,7 +1180,7 @@ static int MenuGame() GuiImage controllerBtnIcon(&iconController); GuiButton controllerBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight()); controllerBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - controllerBtn.SetPosition(125, 250); + controllerBtn.SetPosition(-125, 250); controllerBtn.SetLabel(&controllerBtnTxt); controllerBtn.SetImage(&controllerBtnImg); controllerBtn.SetImageOver(&controllerBtnImgOver); @@ -1632,7 +1632,7 @@ static int MenuGameSaves(int action) } else // save { - if(ret == 0) // new SRAM + if(ret == 0) // new RAM { for(i=1; i < 100; i++) if(saves.files[FILE_RAM][i] == 0) @@ -1658,7 +1658,7 @@ static int MenuGameSaves(int action) menu = MENU_GAME_SAVE; } } - else // overwrite SRAM/Snapshot + else // overwrite RAM/State { MakeFilePath(filepath, saves.type[ret-2], method, saves.filename[ret-2]); switch(saves.type[ret-2]) @@ -2504,7 +2504,7 @@ static int MenuSettingsMappingsMap() GuiOptionBrowser optionBrowser(552, 248, &options); optionBrowser.SetPosition(0, 108); optionBrowser.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); - optionBrowser.SetCol2Position(180); + optionBrowser.SetCol2Position(280); HaltGui(); GuiWindow w(screenwidth, screenheight); @@ -3024,12 +3024,12 @@ static int MenuSettingsFile() snprintf (options.value[4], 256, "%s", GCSettings.CheatFolder); if (GCSettings.AutoLoad == 0) sprintf (options.value[5],"Off"); - else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"SRAM"); - else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"Snapshot"); + else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"RAM"); + else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"State"); if (GCSettings.AutoSave == 0) sprintf (options.value[5],"Off"); - else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"SRAM"); - else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"Snapshot"); + else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"RAM"); + else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"State"); else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both"); sprintf (options.value[7], "%s", GCSettings.VerifySaves == true ? "On" : "Off"); diff --git a/source/ngc/pad.cpp b/source/ngc/pad.cpp index 41a0579..21f2613 100644 --- a/source/ngc/pad.cpp +++ b/source/ngc/pad.cpp @@ -140,6 +140,8 @@ void SetControllers() if(!romLoaded) return; + InputDPR = &JSReturn; + if(GCSettings.Controller == CTRL_PAD4) FCEUI_DisableFourScore(false); else @@ -158,24 +160,14 @@ void SetControllers() if(GCSettings.Controller == CTRL_ZAPPER) { - // enable Zapper - int z = 1; - zapperdata[z] = FCEU_InitZapper(z); - FCEUI_SetInput(z, SI_ZAPPER, myzappers[z], 1); + int p; + if(nesGameType == 2) p = 0; + else p = 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 /**************************************************************************** diff --git a/source/ngc/pad.h b/source/ngc/pad.h index ce3b00b..52addb2 100644 --- a/source/ngc/pad.h +++ b/source/ngc/pad.h @@ -64,15 +64,13 @@ extern GuiTrigger userInput[4]; extern int rumbleRequest[4]; extern u32 btnmap[2][4][12]; +void SetControllers(); void ResetControls(); void ShutoffRumble(); void DoRumble(int i); s8 WPAD_StickX(u8 chan,u8 right); s8 WPAD_StickY(u8 chan, u8 right); -void InitialisePads(); void GetJoy(); -void ToggleFourScore(int set); -void ToggleZapper(int set); void DrawCursor(); #endif