diff --git a/readme.txt b/readme.txt index 93af60bb..2243f5d4 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ bsnes -Version: 0.032 +Version: 0.032a Author: byuu -------- diff --git a/src/base.h b/src/base.h index 68caa0e8..8dfc5801 100644 --- a/src/base.h +++ b/src/base.h @@ -1,4 +1,4 @@ -#define BSNES_VERSION "0.032" +#define BSNES_VERSION "0.032a" #define BSNES_TITLE "bsnes v" BSNES_VERSION #define BUSCORE sBus diff --git a/src/lib/hiro/hiro.h b/src/lib/hiro/hiro.h index 2cc16268..c52b5937 100644 --- a/src/lib/hiro/hiro.h +++ b/src/lib/hiro/hiro.h @@ -1,6 +1,6 @@ /* hiro - version: 0.004 (2008-05-14) + version: 0.005 (2008-05-25) author: byuu license: public domain */ diff --git a/src/lib/hiro/win/hiro.cpp b/src/lib/hiro/win/hiro.cpp index 594a8ba6..d0c18cf0 100644 --- a/src/lib/hiro/win/hiro.cpp +++ b/src/lib/hiro/win/hiro.cpp @@ -111,35 +111,36 @@ bool pHiro::file_open(Window *focus, char *filename, const char *path, const cha lstring type, part; strcpy(f, ""); - split(type, "|", filter); + split(type, "\n", filter); for(int i = 0; i < count(type); i++) { - split(part, ";", type[i]); - if(count(part) != 2)continue; + split(part, "\t", type[i]); + if(count(part) != 2) continue; strcat(f, part[0]); strcat(f, " ("); strcat(f, part[1]); - strcat(f, ")|"); + strcat(f, ")\t"); replace(part[1], ",", ";"); strcat(f, part[1]); - strcat(f, "|"); + strcat(f, "\t"); } - char *pf = f(); - for(int i = strlen(pf) - 1; i >= 0; i--) { - if(pf[i] == '|') pf[i] = '\0'; - } - - utf16 wpf(pf); + utf16 wfilter(f); utf16 wdir(dir); wchar_t wfilename[_MAX_PATH] = L""; + wchar_t *p = wfilter; + while(*p != L'\0') { + if(*p == L'\t') *p = L'\0'; + p++; + } + OPENFILENAME ofn; strcpy(filename, ""); memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = focus ? focus->p.hwnd : 0; - ofn.lpstrFilter = wpf; + ofn.lpstrFilter = wfilter; ofn.lpstrInitialDir = wdir; ofn.lpstrFile = wfilename; ofn.nMaxFile = MAX_PATH; @@ -158,35 +159,36 @@ bool pHiro::file_save(Window *focus, char *filename, const char *path, const cha lstring type, part; strcpy(f, ""); - split(type, "|", filter); + split(type, "\n", filter); for(int i = 0; i < count(type); i++) { - split(part, ";", type[i]); - if(count(part) != 2)continue; + split(part, "\t", type[i]); + if(count(part) != 2) continue; strcat(f, part[0]); strcat(f, " ("); strcat(f, part[1]); - strcat(f, ")|"); + strcat(f, ")\t"); replace(part[1], ",", ";"); strcat(f, part[1]); - strcat(f, "|"); + strcat(f, "\t"); } - char *pf = f(); - for(int i = strlen(pf) - 1; i >= 0; i--) { - if(pf[i] == '|') pf[i] = '\0'; - } - - utf16 wpf(pf); + utf16 wfilter(f); utf16 wdir(dir); wchar_t wfilename[_MAX_PATH] = L""; + wchar_t *p = wfilter; + while(*p != L'\0') { + if(*p == L'\t') *p = L'\0'; + p++; + } + OPENFILENAME ofn; strcpy(filename, ""); memset(&ofn, 0, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = focus ? focus->p.hwnd : 0; - ofn.lpstrFilter = wpf; + ofn.lpstrFilter = wfilter; ofn.lpstrInitialDir = wdir; ofn.lpstrFile = wfilename; ofn.nMaxFile = MAX_PATH; diff --git a/src/ui/event.cpp b/src/ui/event.cpp index 9581f8be..effab6f8 100644 --- a/src/ui/event.cpp +++ b/src/ui/event.cpp @@ -287,14 +287,17 @@ bool load_rom(char *fn) { return hiro().file_open(0, fn, dir[0], - "SNES images;*.smc,*.sfc,*.swc,*.fig,*.bs,*.st" + "SNES images\t" + "*.smc,*.sfc,*.swc,*.fig,*.bs,*.st" #if defined(GZIP_SUPPORT) ",*.gz,*.z,*.zip" #endif #if defined(JMA_SUPPORT) ",*.jma" #endif - "|All files;*.*" + "\n" + "All files\t" + "*.*" ); } diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 6deb005f..dc635b8d 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -1,55 +1,55 @@ #include "resource.cpp" -#include "base/main.cpp" -#include "base/about.cpp" -#include "base/message.cpp" - -#include "loader/bsxloader.cpp" -#include "loader/stloader.cpp" - -#include "settings/settings.cpp" -#include "settings/videosettings.cpp" +#include "base/main.cpp" +#include "base/about.cpp" +#include "base/message.cpp" + +#include "loader/bsxloader.cpp" +#include "loader/stloader.cpp" + +#include "settings/settings.cpp" +#include "settings/videosettings.cpp" #include "settings/inputconfig.cpp" -#include "settings/pathsettings.cpp" -#include "settings/cheateditor.cpp" -#include "settings/advanced.cpp" - +#include "settings/pathsettings.cpp" +#include "settings/cheateditor.cpp" +#include "settings/advanced.cpp" + void ui_init() { hiro().disable_screensaver(); resource::init(); - - window_main.setup(); - window_about.setup(); - window_message.setup(); - - window_bsxloader.setup(); - window_stloader.setup(); - - window_video_settings.setup(); - window_input_config.setup(); - window_path_settings.setup(); - window_cheat_editor.setup(); - window_advanced.setup(); - window_settings.setup(); - event::update_opacity(); - event::update_video_settings(); //call first time to resize main window and update menubar - window_main.show(); - while(hiro().pending()) hiro().run(); - + window_main.setup(); + window_about.setup(); + window_message.setup(); + + window_bsxloader.setup(); + window_stloader.setup(); + + window_video_settings.setup(); + window_input_config.setup(); + window_path_settings.setup(); + window_cheat_editor.setup(); + window_advanced.setup(); + window_settings.setup(); + + event::update_opacity(); + event::update_video_settings(); //call first time to resize main window and update menubar + window_main.show(); + while(hiro().pending()) hiro().run(); + video.driver(config::system.video); audio.driver(config::system.audio); - input.driver(config::system.input); - - video.set(Video::Handle, window_main.view.handle()); + input.driver(config::system.input); + + video.set(Video::Handle, window_main.view.handle()); video.set(Video::Synchronize, false); audio.set(Audio::Handle, window_main.handle()); - audio.set(Audio::Synchronize, config::system.emulation_speed != 0); - audio.set(Audio::Frequency, 32000); input.set(Input::Handle, window_main.handle()); - - video.init(); - audio.init(); + //sets Audio::Synchronize and Audio::Frequency + event::update_emulation_speed(config::system.emulation_speed); + + video.init(); + audio.init(); input.init(); event::update_video_settings(); //call second time to update uiVideo->settings @@ -57,13 +57,13 @@ void ui_init() { //UI setup complete, hook keyboard callbacks snesinterface.input_ready = bind(&MainWindow::input_ready, &window_main); input_manager.on_keydown = bind(&event::keydown); - input_manager.on_keyup = bind(&event::keyup); -} - -void ui_term() { - window_main.hide(); + input_manager.on_keyup = bind(&event::keyup); +} - video.term(); - audio.term(); - input.term(); -} +void ui_term() { + window_main.hide(); + + video.term(); + audio.term(); + input.term(); +}