diff --git a/src/core/apu/Blip_Buffer.cpp b/src/core/apu/Blip_Buffer.cpp index fb7e7984..05603464 100644 --- a/src/core/apu/Blip_Buffer.cpp +++ b/src/core/apu/Blip_Buffer.cpp @@ -445,7 +445,9 @@ void Blip_Buffer::mix_samples( blip_sample_t const* in, long count ) *out -= prev; } +#if 0 blip_ulong const subsample_mask = (1L << BLIP_BUFFER_ACCURACY) - 1; +#endif void Blip_Buffer::save_state( blip_buffer_state_t* out ) { diff --git a/src/core/apu/Multi_Buffer.h b/src/core/apu/Multi_Buffer.h index 6f5efebf..b8ff776c 100644 --- a/src/core/apu/Multi_Buffer.h +++ b/src/core/apu/Multi_Buffer.h @@ -228,7 +228,10 @@ class Stereo_Buffer : public Multi_Buffer buf_t bufs[bufs_size]; Stereo_Mixer mixer; channel_t chan; + +#if 0 long samples_avail_; +#endif }; // Silent_Buffer generates no samples, useful where no sound is wanted diff --git a/src/core/fex/fex/File_Extractor.cpp b/src/core/fex/fex/File_Extractor.cpp index 86b46e47..50cef125 100644 --- a/src/core/fex/fex/File_Extractor.cpp +++ b/src/core/fex/fex/File_Extractor.cpp @@ -63,9 +63,11 @@ static void make_unbuffered( Std_File_Reader* r ) r->make_unbuffered(); } +#if 0 inline static void make_unbuffered( void* ) { } +#endif blargg_err_t File_Extractor::open_arc_file( bool unbuffered ) { diff --git a/src/core/gba/gbaGfx.h b/src/core/gba/gbaGfx.h index a017a100..12fbf655 100644 --- a/src/core/gba/gbaGfx.h +++ b/src/core/gba/gbaGfx.h @@ -376,12 +376,14 @@ static inline void gfxDrawRotScreen16Bit(uint16_t control, uint16_t x_l, uint16_ int sizeX = 240; int sizeY = 160; +#if 0 int startX = (x_l) | ((x_h & 0x07FF) << 16); if (x_h & 0x0800) startX |= 0xF8000000; int startY = (y_l) | ((y_h & 0x07FF) << 16); if (y_h & 0x0800) startY |= 0xF8000000; +#endif int dx = pa & 0x7FFF; if (pa & 0x8000) diff --git a/src/core/gba/gbaLink.cpp b/src/core/gba/gbaLink.cpp index c35f1855..de873a97 100644 --- a/src/core/gba/gbaLink.cpp +++ b/src/core/gba/gbaLink.cpp @@ -142,6 +142,7 @@ int WaitForSingleObject(sem_t* s, int t) #include static void alrmhand(int sig) { + (void)sig; } #endif int WaitForSingleObject(sem_t* s, int t) diff --git a/src/libretro/Makefile b/src/libretro/Makefile index b02febf8..e624d55b 100644 --- a/src/libretro/Makefile +++ b/src/libretro/Makefile @@ -534,12 +534,12 @@ else ifneq (,$(findstring windows_msvc2022,$(platform))) ifneq (,$(findstring desktop,$(PlatformSuffix))) WinPartition = desktop MSVC2022CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -FS - LDFLAGS += -MANIFEST -LTCG:incremental -NXCOMPAT -DYNAMICBASE -DEBUG -OPT:REF -INCREMENTAL:NO -SUBSYSTEM:WINDOWS -MANIFESTUAC:"level='asInvoker' uiAccess='false'" -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 + LDFLAGS += -LIBPATH:"$(LIB)" -MANIFEST -LTCG:incremental -NXCOMPAT -DYNAMICBASE -DEBUG -OPT:REF -INCREMENTAL:NO -SUBSYSTEM:WINDOWS -MANIFESTUAC:"level='asInvoker' uiAccess='false'" -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 LIBS := kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib else ifneq (,$(findstring uwp,$(PlatformSuffix))) WinPartition = uwp MSVC2022CompileFlags = -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WINDLL -D_UNICODE -DUNICODE -D__WRL_NO_DEFAULT_LIB__ -EHsc -FS - LDFLAGS += -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO + LDFLAGS += -LIBPATH:"$(LIB)" -APPCONTAINER -NXCOMPAT -DYNAMICBASE -MANIFEST:NO -LTCG -OPT:REF -SUBSYSTEM:CONSOLE -MANIFESTUAC:NO -OPT:ICF -ERRORREPORT:PROMPT -NOLOGO -TLBID:1 -DEBUG:FULL -WINMD:NO LIBS := WindowsApp.lib endif @@ -681,11 +681,11 @@ else LD = link.exe ifeq ($(DEBUG), 1) - CFLAGS += -MDd - CXXFLAGS += -MDd + CFLAGS += -MTd + CXXFLAGS += -MTd else - CFLAGS += -MD - CXXFLAGS += -MD + CFLAGS += -MT + CXXFLAGS += -MT endif endif else diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index 91589234..253413de 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -146,6 +146,8 @@ EVT_HANDLER(wxID_OPEN, "Open ROM...") pats, wxFD_OPEN | wxFD_FILE_MUST_EXIST); + SetGenericPath(dlg, gba_rom_dir); + dlg.SetFilterIndex(open_ft); if (ShowModal(&dlg) == wxID_OK) @@ -175,6 +177,8 @@ EVT_HANDLER(OpenGB, "Open GB...") wxFD_OPEN | wxFD_FILE_MUST_EXIST); dlg.SetFilterIndex(open_ft); + SetGenericPath(dlg, gb_rom_dir); + if (ShowModal(&dlg) == wxID_OK) wxGetApp().pending_load = dlg.GetPath(); @@ -202,6 +206,8 @@ EVT_HANDLER(OpenGBC, "Open GBC...") wxFD_OPEN | wxFD_FILE_MUST_EXIST); dlg.SetFilterIndex(open_ft); + SetGenericPath(dlg, gbc_rom_dir); + if (ShowModal(&dlg) == wxID_OK) wxGetApp().pending_load = dlg.GetPath(); @@ -367,6 +373,9 @@ EVT_HANDLER_MASK(SetLoadingDotCodeFile, "Load e-Reader Dot Code...", CMDEN_GBA) "E-Reader Dot Code (*.bin;*.raw)|" "*.bin;*.raw"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, loaddotcodefile_path); + int ret = ShowModal(&dlg); if (ret != wxID_OK) @@ -389,6 +398,9 @@ EVT_HANDLER_MASK(SetSavingDotCodeFile, "Save e-Reader Dot Code...", CMDEN_GBA) "E-Reader Dot Code (*.bin;*.raw)|" "*.bin;*.raw"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, savedotcodefile_path); + int ret = ShowModal(&dlg); if (ret != wxID_OK) @@ -407,6 +419,9 @@ EVT_HANDLER_MASK(ImportBatteryFile, "Import battery file...", CMDEN_GB | CMDEN_G wxFileDialog dlg(this, _("Select battery file"), batimp_path, wxEmptyString, _("Battery file (*.sav)|*.sav|Flash save (*.dat)|*.dat"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, batimp_path); + int ret = ShowModal(&dlg); batimp_path = dlg.GetDirectory(); @@ -435,6 +450,9 @@ EVT_HANDLER_MASK(ImportGamesharkCodeFile, "Import Game Shark code file...", CMDE wxFileDialog dlg(this, _("Select code file"), path, wxEmptyString, panel->game_type() == IMAGE_GBA ? _("Game Shark Code File (*.spc;*.xpc)|*.spc;*.xpc") : _("Game Shark Code File (*.gcf)|*.gcf"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, path); + int ret = ShowModal(&dlg); path = dlg.GetDirectory(); @@ -555,6 +573,9 @@ EVT_HANDLER_MASK(ImportGamesharkActionReplaySnapshot, wxFileDialog dlg(this, _("Select snapshot file"), gss_path, wxEmptyString, panel->game_type() == IMAGE_GBA ? _("Game Shark & PAC Snapshots (*.sps;*.xps)|*.sps;*.xps|Game Shark SP Snapshots (*.gsv)|*.gsv") : _("Game Boy Snapshot (*.gbs)|*.gbs"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, gss_path); + int ret = ShowModal(&dlg); gss_path = dlg.GetDirectory(); @@ -602,6 +623,9 @@ EVT_HANDLER_MASK(ExportBatteryFile, "Export battery file...", CMDEN_GB | CMDEN_G wxFileDialog dlg(this, _("Select battery file"), batimp_path, wxEmptyString, _("Battery file (*.sav)|*.sav|Flash save (*.dat)|*.dat"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, batimp_path); + int ret = ShowModal(&dlg); batimp_path = dlg.GetDirectory(); @@ -630,6 +654,9 @@ EVT_HANDLER_MASK(ExportGamesharkSnapshot, "Export GameShark snapshot...", CMDEN_ def_name.append(wxT(".sps")); wxFileDialog dlg(this, _("Select snapshot file"), gss_path, def_name, _("Game Shark Snapshot (*.sps)|*.sps"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, gss_path); + int ret = ShowModal(&dlg); gss_path = dlg.GetDirectory(); @@ -675,6 +702,9 @@ EVT_HANDLER_MASK(ScreenCapture, "Screen capture...", CMDEN_GB | CMDEN_GBA) wxFileDialog dlg(this, _("Select output file"), scap_path, def_name, _("PNG images|*.png|BMP images|*.bmp"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, scap_path); + dlg.SetFilterIndex(capture_format); int ret = ShowModal(&dlg); scap_path = dlg.GetDirectory(); @@ -753,6 +783,9 @@ EVT_HANDLER_MASK(RecordSoundStartRecording, "Start sound recording...", CMDEN_NS def_name += extoff.Left(wxStrcspn(extoff, wxT(";|"))); wxFileDialog dlg(this, _("Select output file"), sound_path, def_name, sound_exts, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, sound_path); + dlg.SetFilterIndex(sound_extno); int ret = ShowModal(&dlg); sound_extno = dlg.GetFilterIndex(); @@ -823,6 +856,9 @@ EVT_HANDLER_MASK(RecordAVIStartRecording, "Start video recording...", CMDEN_NVRE def_name += extoff.Left(wxStrcspn(extoff, wxT(";|"))); wxFileDialog dlg(this, _("Select output file"), vid_path, def_name, vid_exts, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, vid_path); + dlg.SetFilterIndex(vid_extno); int ret = ShowModal(&dlg); vid_extno = dlg.GetFilterIndex(); @@ -892,6 +928,9 @@ EVT_HANDLER_MASK(RecordMovieStartRecording, "Start game recording...", CMDEN_NGR def_name += extoff.Left(wxStrcspn(extoff, wxT(";|"))); wxFileDialog dlg(this, _("Select output file"), mov_path, def_name, mov_exts, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, mov_path); + dlg.SetFilterIndex(mov_extno); int ret = ShowModal(&dlg); mov_extno = dlg.GetFilterIndex(); @@ -959,6 +998,9 @@ EVT_HANDLER_MASK(PlayMovieStartPlaying, "Start playing movie...", CMDEN_NGREC | def_name += extoff.Left(wxStrcspn(extoff, wxT(";|"))); wxFileDialog dlg(this, _("Select file"), mov_path, def_name, mov_exts, wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, mov_path); + dlg.SetFilterIndex(mov_extno); int ret = ShowModal(&dlg); mov_extno = dlg.GetFilterIndex(); @@ -1263,6 +1305,9 @@ EVT_HANDLER_MASK(Load, "Load state...", CMDEN_GB | CMDEN_GBA) wxFileDialog dlg(this, _("Select state file"), st_dir, wxEmptyString, _("Visual Boy Advance saved game files|*.sgm"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, st_dir); + int ret = ShowModal(&dlg); st_dir = dlg.GetDirectory(); @@ -1356,6 +1401,9 @@ EVT_HANDLER_MASK(Save, "Save state as...", CMDEN_GB | CMDEN_GBA) wxFileDialog dlg(this, _("Select state file"), st_dir, wxEmptyString, _("Visual Boy Advance saved game files|*.sgm"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, st_dir); + int ret = ShowModal(&dlg); st_dir = dlg.GetDirectory(); diff --git a/src/wx/compat_generic_file_dialog.h b/src/wx/compat_generic_file_dialog.h index cee6bd2a..a1aec368 100644 --- a/src/wx/compat_generic_file_dialog.h +++ b/src/wx/compat_generic_file_dialog.h @@ -3,4 +3,8 @@ #undef wxFileDialog #define wxFileDialog wxGenericFileDialog + +#define SetGenericPath(X,Y) X.SetDirectory(Y); X.SetPath(Y) +#else +#define SetGenericPath(X,Y) #endif diff --git a/src/wx/gfxviewers.cpp b/src/wx/gfxviewers.cpp index 698fdc66..211fa20b 100644 --- a/src/wx/gfxviewers.cpp +++ b/src/wx/gfxviewers.cpp @@ -1229,6 +1229,9 @@ void savepal(wxWindow* parent, const uint8_t* data, int ncols, const wxString ty wxFileDialog dlg(parent, _("Select output file and type"), pdir, def_name, _("Windows Palette (*.pal)|*.pal|PaintShop Palette (*.pal)|*.pal|Adobe Color Table (*.act)|*.act"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, pdir); + dlg.SetFilterIndex(ptype); int ret = dlg.ShowModal(); ptype = dlg.GetFilterIndex(); @@ -1688,6 +1691,9 @@ public: wxFileDialog dlg(GetGrandParent(), _("Select output file"), bmp_save_dir, def_name, _("PNG images|*.png|BMP images|*.bmp"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, bmp_save_dir); + dlg.SetFilterIndex(capture_format); int ret = dlg.ShowModal(); bmp_save_dir = dlg.GetDirectory(); @@ -1833,6 +1839,9 @@ public: wxFileDialog dlg(GetGrandParent(), _("Select output file"), bmp_save_dir, def_name, _("PNG images|*.png|BMP images|*.bmp"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, bmp_save_dir); + dlg.SetFilterIndex(capture_format); int ret = dlg.ShowModal(); bmp_save_dir = dlg.GetDirectory(); diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index 25e5b7b1..3744e223 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -257,6 +257,9 @@ public: wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir, cheatfn, _("VBA cheat lists (*.clt)|*.clt|CHT cheat lists (*.cht)|*.cht"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(subdlg, cheatdir); + int ret = subdlg.ShowModal(); cheatdir = subdlg.GetDirectory(); cheatfn = subdlg.GetPath(); @@ -310,6 +313,9 @@ public: wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir, cheatfn, _("VBA cheat lists (*.clt)|*.clt"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(subdlg, cheatdir); + int ret = subdlg.ShowModal(); cheatdir = subdlg.GetDirectory(); cheatfn = subdlg.GetPath(); diff --git a/src/wx/sys.cpp b/src/wx/sys.cpp index 23ae664a..cbeff0bf 100644 --- a/src/wx/sys.cpp +++ b/src/wx/sys.cpp @@ -947,6 +947,9 @@ void PrintDialog::DoSave(wxCommandEvent&) wxFileDialog fdlg(dlg, _("Save printer image to"), prsav_path, dn, pats, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(fdlg, prsav_path); + int ret = fdlg.ShowModal(); prsav_path = fdlg.GetDirectory(); diff --git a/src/wx/viewers.cpp b/src/wx/viewers.cpp index 0d121f90..0aecf375 100644 --- a/src/wx/viewers.cpp +++ b/src/wx/viewers.cpp @@ -587,6 +587,9 @@ void LogDialog::Save(wxCommandEvent& ev) pats.append(wxALL_FILES); wxFileDialog dlg(this, _("Select output file"), logdir, def_name, pats, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, logdir); + int ret = dlg.ShowModal(); def_name = dlg.GetPath(); logdir = dlg.GetDirectory(); @@ -729,6 +732,9 @@ public: pats.append(wxALL_FILES); wxFileDialog dlg(this, _("Select memory dump file"), memsave_dir, memsave_fn, pats, wxFD_OPEN | wxFD_FILE_MUST_EXIST); + + SetGenericPath(dlg, memsave_dir); + int ret = dlg.ShowModal(); memsave_fn = dlg.GetPath(); memsave_dir = dlg.GetDirectory(); @@ -801,6 +807,9 @@ public: pats.append(wxALL_FILES); wxFileDialog dlg(this, _("Select output file"), memsave_dir, memsave_fn, pats, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, memsave_dir); + int ret = dlg.ShowModal(); memsave_dir = dlg.GetDirectory(); memsave_fn = dlg.GetPath(); diff --git a/src/wx/viewsupt.cpp b/src/wx/viewsupt.cpp index 6f767ccf..e5ec8ddf 100644 --- a/src/wx/viewsupt.cpp +++ b/src/wx/viewsupt.cpp @@ -1198,6 +1198,9 @@ void GfxViewer::SaveBMP(wxCommandEvent& ev) wxFileDialog dlg(GetGrandParent(), _("Select output file"), bmp_save_dir_, def_name, _("PNG images|*.png|BMP images|*.bmp"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + + SetGenericPath(dlg, bmp_save_dir_); + dlg.SetFilterIndex(capture_format); int ret = dlg.ShowModal(); bmp_save_dir_ = dlg.GetDirectory();