2015-06-12 13:14:38 +00:00
|
|
|
namespace hiro {
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2016-01-07 08:14:33 +00:00
|
|
|
static const uint Windows2000 = 0x0500;
|
|
|
|
static const uint WindowsXP = 0x0501;
|
|
|
|
static const uint WindowsVista = 0x0600;
|
|
|
|
static const uint Windows7 = 0x0601;
|
2012-01-15 08:29:57 +00:00
|
|
|
|
2016-01-07 08:14:33 +00:00
|
|
|
static auto Button_CustomDraw(HWND, PAINTSTRUCT&, bool, bool, bool, unsigned, const Font&, const image&, Orientation, const string&) -> void;
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
static auto OsVersion() -> uint {
|
2015-08-24 09:42:11 +00:00
|
|
|
OSVERSIONINFO versionInfo{0};
|
2012-01-15 08:29:57 +00:00
|
|
|
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
|
|
|
GetVersionEx(&versionInfo);
|
|
|
|
return (versionInfo.dwMajorVersion << 8) + (versionInfo.dwMajorVersion << 0);
|
|
|
|
}
|
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
static auto CreateBitmap(HDC hdc, uint width, uint height, uint32_t*& data) -> HBITMAP {
|
|
|
|
BITMAPINFO info{};
|
|
|
|
info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
|
|
|
info.bmiHeader.biWidth = width;
|
|
|
|
info.bmiHeader.biHeight = -(int)height; //bitmaps are stored upside down unless we negate height
|
|
|
|
info.bmiHeader.biPlanes = 1;
|
|
|
|
info.bmiHeader.biBitCount = 32;
|
|
|
|
info.bmiHeader.biCompression = BI_RGB;
|
|
|
|
info.bmiHeader.biSizeImage = width * height * sizeof(uint32_t);
|
|
|
|
void* bits = nullptr;
|
|
|
|
auto bitmap = CreateDIBSection(hdc, &info, DIB_RGB_COLORS, &bits, nullptr, 0);
|
|
|
|
data = (uint32_t*)bits;
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
static auto CreateBitmap(image icon) -> HBITMAP {
|
|
|
|
icon.alphaMultiply(); //Windows AlphaBlend() requires premultiplied image data
|
|
|
|
icon.transform();
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
uint32_t* data = nullptr;
|
|
|
|
auto hdc = GetDC(nullptr);
|
|
|
|
auto bitmap = CreateBitmap(hdc, icon.width(), icon.height(), data);
|
|
|
|
memory::copy(data, icon.data(), icon.size());
|
|
|
|
ReleaseDC(nullptr, hdc);
|
|
|
|
return bitmap;
|
2012-01-15 08:29:57 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
static auto CreateRGB(const Color& color) -> COLORREF {
|
|
|
|
return RGB(color.red(), color.green(), color.blue());
|
|
|
|
}
|
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
static auto DropPaths(WPARAM wparam) -> vector<string> {
|
2013-07-29 09:42:45 +00:00
|
|
|
auto dropList = HDROP(wparam);
|
|
|
|
auto fileCount = DragQueryFile(dropList, ~0u, nullptr, 0);
|
|
|
|
|
Update to 20180729 release.
byuu wrote:
Sigh ...
asio.hpp needs #include <nall/windows/registry.hpp>
[Since the last WIP, byuu also posted the following message. -Ed.]
ruby drivers have all been updated (but not tested outside of BSD), and
I redesigned the settings window. The driver functionality all exists on
a new "Drivers" panel, the emulator/hack settings go to a
"Configuration" panel, and the video/audio panels lose driver settings.
As does the settings menu and its synchronize options.
I want to start pushing toward a v107 release. Critically, I will need
DirectSound and ALSA to support dynamic rate control. I'd also like to
eliminate the other system manifest.bml files. I need to update the
cheat code database format, and bundle at least a few quark shaders --
although I still need to default to Direct3D on Windows.
Turbo keys would be nice, if it's not too much effort. Aside from
netplay, it's the last significant feature I'm missing.
I think for v107, higan is going to be a bit rough around the edges
compared to bsnes. And I don't think it's practical to finish the bsnes
localization support.
I'm thinking we probably want another WIP to iron out any critical
issues, but this time there should be a feature freeze with the next
WIP.
2018-07-29 13:24:38 +00:00
|
|
|
vector<string> paths;
|
2015-06-12 13:14:38 +00:00
|
|
|
for(auto n : range(fileCount)) {
|
2013-07-29 09:42:45 +00:00
|
|
|
auto length = DragQueryFile(dropList, n, nullptr, 0);
|
|
|
|
auto buffer = new wchar_t[length + 1];
|
|
|
|
|
|
|
|
if(DragQueryFile(dropList, n, buffer, length + 1)) {
|
|
|
|
string path = (const char*)utf8_t(buffer);
|
|
|
|
path.transform("\\", "/");
|
2013-12-03 10:01:59 +00:00
|
|
|
if(directory::exists(path) && !path.endsWith("/")) path.append("/");
|
2013-07-29 09:42:45 +00:00
|
|
|
paths.append(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete[] buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
return paths;
|
|
|
|
}
|
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
static auto WINAPI EnumVisibleChildWindowsProc(HWND hwnd, LPARAM lparam) -> BOOL {
|
|
|
|
auto children = (vector<HWND>*)lparam;
|
|
|
|
if(IsWindowVisible(hwnd)) children->append(hwnd);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static auto EnumVisibleChildWindows(HWND hwnd) -> vector<HWND> {
|
|
|
|
vector<HWND> children;
|
|
|
|
EnumChildWindows(hwnd, EnumVisibleChildWindowsProc, (LPARAM)&children);
|
|
|
|
return children;
|
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
static auto GetWindowZOrder(HWND hwnd) -> unsigned {
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
uint z = 0;
|
|
|
|
for(HWND next = hwnd; next != nullptr; next = GetWindow(next, GW_HWNDPREV)) z++;
|
2013-11-28 10:29:01 +00:00
|
|
|
return z;
|
|
|
|
}
|
|
|
|
|
2016-01-07 08:14:33 +00:00
|
|
|
static auto ImageList_Append(HIMAGELIST imageList, image icon, unsigned scale) -> void {
|
|
|
|
if(icon) {
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
icon.scale(scale, scale);
|
|
|
|
} else {
|
|
|
|
icon.allocate(scale, scale);
|
|
|
|
icon.fill(GetSysColor(COLOR_WINDOW));
|
2013-11-28 10:32:53 +00:00
|
|
|
}
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
HBITMAP bitmap = CreateBitmap(icon);
|
|
|
|
ImageList_Add(imageList, bitmap, nullptr);
|
2013-11-28 10:32:53 +00:00
|
|
|
DeleteObject(bitmap);
|
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
//post message only if said message is not already pending in the queue
|
|
|
|
static auto PostMessageOnce(HWND hwnd, UINT id, WPARAM wparam, LPARAM lparam) -> void {
|
|
|
|
MSG msg;
|
|
|
|
if(!PeekMessage(&msg, hwnd, id, id, PM_NOREMOVE)) {
|
|
|
|
PostMessage(hwnd, id, wparam, lparam);
|
2012-01-15 08:29:57 +00:00
|
|
|
}
|
|
|
|
}
|
2013-03-15 13:11:33 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
static auto ScrollEvent(HWND hwnd, WPARAM wparam) -> unsigned {
|
2013-11-28 10:29:01 +00:00
|
|
|
SCROLLINFO info;
|
|
|
|
memset(&info, 0, sizeof(SCROLLINFO));
|
|
|
|
info.cbSize = sizeof(SCROLLINFO);
|
|
|
|
info.fMask = SIF_ALL;
|
|
|
|
GetScrollInfo(hwnd, SB_CTL, &info);
|
|
|
|
|
|
|
|
switch(LOWORD(wparam)) {
|
|
|
|
case SB_LEFT: info.nPos = info.nMin; break;
|
|
|
|
case SB_RIGHT: info.nPos = info.nMax; break;
|
|
|
|
case SB_LINELEFT: info.nPos--; break;
|
|
|
|
case SB_LINERIGHT: info.nPos++; break;
|
|
|
|
case SB_PAGELEFT: info.nPos -= info.nMax >> 3; break;
|
|
|
|
case SB_PAGERIGHT: info.nPos += info.nMax >> 3; break;
|
|
|
|
case SB_THUMBTRACK: info.nPos = info.nTrackPos; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
info.fMask = SIF_POS;
|
|
|
|
SetScrollInfo(hwnd, SB_CTL, &info, TRUE);
|
|
|
|
|
2015-08-21 10:56:39 +00:00
|
|
|
//Windows may clamp position to scrollbar range
|
2013-11-28 10:29:01 +00:00
|
|
|
GetScrollInfo(hwnd, SB_CTL, &info);
|
|
|
|
return info.nPos;
|
|
|
|
}
|
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
static auto CALLBACK Default_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
|
|
|
return DefWindowProc(hwnd, msg, wparam, lparam);
|
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
//separate because PopupMenu HWND does not contain GWLP_USERDATA pointing at Window needed for Shared_windowProc
|
|
|
|
static auto CALLBACK Menu_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
|
|
|
switch(msg) {
|
|
|
|
case WM_MENUCOMMAND: {
|
|
|
|
MENUITEMINFO mii{sizeof(MENUITEMINFO)};
|
|
|
|
mii.fMask = MIIM_DATA;
|
|
|
|
GetMenuItemInfo((HMENU)lparam, wparam, true, &mii);
|
|
|
|
|
|
|
|
auto object = (mObject*)mii.dwItemData;
|
|
|
|
if(!object) break;
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuItem)
|
|
|
|
if(auto menuItem = dynamic_cast<mMenuItem*>(object)) {
|
|
|
|
return menuItem->self()->onActivate(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuCheckItem)
|
|
|
|
if(auto menuCheckItem = dynamic_cast<mMenuCheckItem*>(object)) {
|
|
|
|
return menuCheckItem->self()->onToggle(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_MenuRadioItem)
|
|
|
|
if(auto menuRadioItem = dynamic_cast<mMenuRadioItem*>(object)) {
|
|
|
|
return menuRadioItem->self()->onActivate(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return DefWindowProc(hwnd, msg, wparam, lparam);
|
|
|
|
}
|
|
|
|
|
|
|
|
static auto CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) -> LRESULT {
|
2018-08-05 09:00:15 +00:00
|
|
|
if(Application::state().quit) return DefWindowProc(hwnd, msg, wparam, lparam);
|
2015-06-15 22:16:43 +00:00
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto object = (mObject*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
|
|
|
if(!object) return DefWindowProc(hwnd, msg, wparam, lparam);
|
|
|
|
auto window = dynamic_cast<mWindow*>(object);
|
|
|
|
if(!window) window = object->parentWindow(true);
|
|
|
|
if(!window) return DefWindowProc(hwnd, msg, wparam, lparam);
|
2015-06-15 22:16:43 +00:00
|
|
|
auto pWindow = window->self();
|
|
|
|
if(!pWindow) return DefWindowProc(hwnd, msg, wparam, lparam);
|
Update to bsnes v107.1 release.
byuu says:
Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.
Changelog:
- GUI: added high DPI support
- GUI: fixed the state manager image preview
- Windows: added a new waveOut driver with support for dynamic rate control
- Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
- Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
- Windows: fixed XInput controller support on Windows 10
- SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
coprocessors
- SFC: fixed a slight rendering glitch in the intro to Megalomania
If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.
The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.
Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 01:16:30 +00:00
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
switch(msg) {
|
2013-11-28 10:32:53 +00:00
|
|
|
case WM_CTLCOLORBTN:
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
case WM_CTLCOLOREDIT:
|
2013-11-28 10:32:53 +00:00
|
|
|
case WM_CTLCOLORSTATIC: {
|
2015-06-12 13:14:38 +00:00
|
|
|
auto object = (mObject*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA);
|
|
|
|
if(!object) break;
|
|
|
|
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
//allow custom colors for various widgets
|
|
|
|
//note that this happens always: default colors are black text on a white background, unless overridden
|
|
|
|
//this intentionally overrides the default behavior of Windows to paint disabled controls with the window background color
|
2015-06-12 13:14:38 +00:00
|
|
|
|
|
|
|
#if defined(Hiro_Window) && defined(Hiro_TabFrame)
|
|
|
|
if(!object->parentTabFrame(true) && window->self()->hbrush) {
|
|
|
|
SetBkColor((HDC)wparam, window->self()->hbrushColor);
|
|
|
|
return (LRESULT)window->self()->hbrush;
|
2013-12-21 10:45:58 +00:00
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_HexEdit)
|
|
|
|
if(auto hexEdit = dynamic_cast<mHexEdit*>(object)) {
|
|
|
|
if(auto background = hexEdit->backgroundColor()) SetBkColor((HDC)wparam, CreateRGB(background));
|
|
|
|
if(auto foreground = hexEdit->foregroundColor()) SetTextColor((HDC)wparam, CreateRGB(foreground));
|
|
|
|
return (LRESULT)hexEdit->self()->backgroundBrush;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_LineEdit)
|
|
|
|
if(auto lineEdit = dynamic_cast<mLineEdit*>(object)) {
|
|
|
|
if(auto background = lineEdit->backgroundColor()) SetBkColor((HDC)wparam, CreateRGB(background));
|
|
|
|
if(auto foreground = lineEdit->foregroundColor()) SetTextColor((HDC)wparam, CreateRGB(foreground));
|
|
|
|
return (LRESULT)lineEdit->self()->backgroundBrush;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_TextEdit)
|
|
|
|
if(auto textEdit = dynamic_cast<mTextEdit*>(object)) {
|
|
|
|
if(auto background = textEdit->backgroundColor()) SetBkColor((HDC)wparam, CreateRGB(background));
|
|
|
|
if(auto foreground = textEdit->foregroundColor()) SetTextColor((HDC)wparam, CreateRGB(foreground));
|
|
|
|
return (LRESULT)textEdit->self()->backgroundBrush;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-28 10:32:53 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-07-16 06:16:26 +00:00
|
|
|
case WM_GETMINMAXINFO: {
|
|
|
|
auto info = (LPMINMAXINFO)lparam;
|
|
|
|
auto frameMargin = pWindow->frameMargin();
|
|
|
|
if(auto minimumSize = window->state.minimumSize) {
|
|
|
|
info->ptMinTrackSize.x = minimumSize.width() + frameMargin.width();
|
|
|
|
info->ptMinTrackSize.y = minimumSize.height() + frameMargin.height();
|
|
|
|
}
|
|
|
|
if(auto maximumSize = window->state.maximumSize) {
|
|
|
|
info->ptMaxTrackSize.x = maximumSize.width() + frameMargin.width();
|
|
|
|
info->ptMaxTrackSize.y = maximumSize.height() + frameMargin.height();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
case WM_MENUCOMMAND: {
|
|
|
|
return Menu_windowProc(hwnd, msg, wparam, lparam);
|
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
case WM_COMMAND: {
|
2015-06-12 13:14:38 +00:00
|
|
|
if(!lparam) break;
|
|
|
|
auto object = (mObject*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA);
|
|
|
|
if(!object) break;
|
|
|
|
|
|
|
|
#if defined(Hiro_Button)
|
|
|
|
if(auto button = dynamic_cast<mButton*>(object)) {
|
|
|
|
return button->self()->onActivate(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_CheckButton)
|
|
|
|
if(auto checkButton = dynamic_cast<mCheckButton*>(object)) {
|
|
|
|
return checkButton->self()->onToggle(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_CheckLabel)
|
|
|
|
if(auto checkLabel = dynamic_cast<mCheckLabel*>(object)) {
|
|
|
|
return checkLabel->self()->onToggle(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_ComboButton)
|
|
|
|
if(auto comboButton = dynamic_cast<mComboButton*>(object)) {
|
|
|
|
if(HIWORD(wparam) == CBN_SELCHANGE) {
|
|
|
|
return comboButton->self()->onChange(), false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_LineEdit)
|
|
|
|
if(auto lineEdit = dynamic_cast<mLineEdit*>(object)) {
|
|
|
|
if(HIWORD(wparam) == EN_CHANGE) {
|
|
|
|
return lineEdit->self()->onChange(), false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_RadioButton)
|
|
|
|
if(auto radioButton = dynamic_cast<mRadioButton*>(object)) {
|
|
|
|
return radioButton->self()->onActivate(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_RadioLabel)
|
|
|
|
if(auto radioLabel = dynamic_cast<mRadioLabel*>(object)) {
|
|
|
|
return radioLabel->self()->onActivate(), false;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_TextEdit)
|
|
|
|
if(auto textEdit = dynamic_cast<mTextEdit*>(object)) {
|
|
|
|
if(HIWORD(wparam) == EN_CHANGE) {
|
|
|
|
return textEdit->self()->onChange(), false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WM_NOTIFY: {
|
2015-10-03 06:25:39 +00:00
|
|
|
//Widgets inside a TabFrame must be parented to it rather than the Window.
|
|
|
|
//This is critical for proper inheritance of styles and message passing.
|
|
|
|
//However, by doing this, some WM_NOTIFY messages end up being sent to both
|
|
|
|
//the TabFrame and the Window; while others are only sent to the TabFrame.
|
|
|
|
//To save code, hiro uses a shared callback for both of these cases.
|
|
|
|
//So when a message is sent to both, we ignore the TabFrame message.
|
2015-08-24 09:42:11 +00:00
|
|
|
bool isWindowCallback = (object == window);
|
|
|
|
|
2015-06-12 13:14:38 +00:00
|
|
|
auto header = (LPNMHDR)lparam;
|
|
|
|
auto object = (mObject*)GetWindowLongPtr((HWND)header->hwndFrom, GWLP_USERDATA);
|
|
|
|
if(!object) break;
|
|
|
|
|
2016-05-04 10:07:13 +00:00
|
|
|
#if defined(Hiro_TableView)
|
|
|
|
if(auto tableView = dynamic_cast<mTableView*>(object)) {
|
2015-06-12 13:14:38 +00:00
|
|
|
if(header->code == LVN_ITEMACTIVATE) {
|
2016-05-04 10:07:13 +00:00
|
|
|
tableView->self()->onActivate(lparam);
|
2015-06-12 13:14:38 +00:00
|
|
|
break;
|
Update to bsnes v107.1 release.
byuu says:
Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.
Changelog:
- GUI: added high DPI support
- GUI: fixed the state manager image preview
- Windows: added a new waveOut driver with support for dynamic rate control
- Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
- Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
- Windows: fixed XInput controller support on Windows 10
- SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
coprocessors
- SFC: fixed a slight rendering glitch in the intro to Megalomania
If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.
The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.
Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 01:16:30 +00:00
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
if(header->code == LVN_ITEMCHANGED) {
|
2016-05-04 10:07:13 +00:00
|
|
|
tableView->self()->onChange(lparam);
|
2015-06-12 13:14:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(header->code == LVN_COLUMNCLICK) {
|
2016-05-04 10:07:13 +00:00
|
|
|
if(isWindowCallback) tableView->self()->onSort(lparam);
|
2015-06-12 13:14:38 +00:00
|
|
|
break;
|
|
|
|
}
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
if(header->code == NM_CLICK || header->code == NM_DBLCLK) {
|
2016-05-04 10:07:13 +00:00
|
|
|
//onToggle performs the test to ensure the TableViewItem clicked was checkable
|
|
|
|
if(isWindowCallback) tableView->self()->onToggle(lparam);
|
Update to v094r40 release.
byuu says:
Changelog:
- updated to newest hiro API
- SFC performance profile builds once again
- hiro: Qt port completed
Errata 1: the hiro/Qt target won't run tomoko just yet. Starts by
crashing inside InputSettings because hiro/Qt isn't forcefully selecting
the first item added to a ComboButton just yet. Even with a monkey patch
to get around that, the UI is incredibly unstable. Lots of geometry
calculation bugs, and a crash when you try and access certain folders in
the browser dialog. Lots of work left to be done there, sadly.
Errata 2: the hiro/Windows port has black backgrounds on all ListView
items. It's because I need to test for unassigned colors and grab the
default Windows brush colors in those cases.
Note: alternating row colors on multi-column ListView widgets is gone
now. Not a bug. May add it back later, but I'm not sure. It doesn't
interact nicely with per-cell background colors.
Things left to do:
First, I have to fix the Windows and Qt target bugs.
Next, I need to go through and revise the hiro API even more (nothing
too major.)
Next, I need to update icarus to use the new hiro API, and add support
for the SFC games database.
Next, I have to rewrite my TSV->BML cheat code tool.
Next, I need to post a final WIP of higan+icarus publicly and wait a few
days.
Next, I need to fix any bugs reported from the final WIP that I can.
Finally, I should be able to release v095.
2015-08-18 10:18:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
if(header->code == NM_RCLICK) {
|
2016-05-04 10:07:13 +00:00
|
|
|
if(isWindowCallback) tableView->self()->onContext(lparam);
|
2015-06-12 13:14:38 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(header->code == NM_CUSTOMDRAW) {
|
2016-05-04 10:07:13 +00:00
|
|
|
return tableView->self()->onCustomDraw(lparam);
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_TabFrame)
|
|
|
|
if(auto tabFrame = dynamic_cast<mTabFrame*>(object)) {
|
|
|
|
if(header->code == TCN_SELCHANGE) {
|
|
|
|
tabFrame->self()->onChange();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-07-08 04:58:27 +00:00
|
|
|
case WM_SIZE: {
|
|
|
|
bool maximized = IsZoomed(pWindow->hwnd);
|
|
|
|
bool minimized = IsIconic(pWindow->hwnd);
|
2015-07-02 10:22:24 +00:00
|
|
|
|
2018-07-08 04:58:27 +00:00
|
|
|
window->state.maximized = maximized;
|
|
|
|
window->state.minimized = minimized;
|
Update to v094 release.
byuu says:
This release adds support for game libraries, and substantially improves
Game Boy and Game Boy Color emulation with cycle-based renderers. Many
other changes are also present.
It's very important to note that this release now defaults to optimal
drivers rather than safe drivers. This is particularly important if you
do not have strong OpenGL 3.2 drivers. If performance is bad, go to
Settings -> Configuration -> Advanced, change the video driver, and
restart higan. In the rare case that you have trouble opening higan, you
can edit settings.bml directly and change the setting there. The Windows
safe driver is Direct3D, and the Linux safe driver is XShm.
Also note that although display emulation shaders are now supported,
they have not been included in this release as they are not ready yet.
The support has been built-in anyway, so that they can be tested by
everyone. Once refined, future releases of higan will come with built-in
shaders for each emulated system that simulates the unique display
characteristics of each.
Changelog (since v093):
- sfc: added SA-1 MDR support (fixes SD Gundam G-Next bug)
- sfc: remove random/ and config/, merge to system/ with better
randomization
- gb: improved color emulation palette contrast
- gbc: do not sort sprites by X-priority
- gbc: allow transparency on BG priority pixels
- gbc: VRAM DMA timing and register fixes
- gbc: block invalid VRAM DMA transfer source and target addresses
- gba: added LCD color emulation (without it, colors are grossly
over-saturated)
- gba: removed internal frame blending (use shaders to simulate motion
blur if desired)
- gba: added Game Boy Player support (adds joypad rumble support to
supported games)
- gba: SOUND_CTL_H is readable
- gb/gbc: PPU renderer is now cycle-based (major accuracy improvement)
- gb/gbc: OAM DMA runs in parallel with the CPU
- gb/gbc: only HRAM can be accessed during OAM DMA
- gb/gbc: fixed serialization of games with SRAM
- gb/gbc: disallow up+down or left+right at the same time
- gb/gbc: added weak hipass filter to remove DC bias
- gb/gbc: STAT OAM+Hblank IRQs only trigger during active display
- gb/gbc: fixed underflow in window clamping
- gb/gbc/gba: audio mixes internally at 2MHz now instead of 4MHz (does
not affect accuracy)
- gb/gbc/gba: audio volume reduced for consistency with other systems
- fc/sfc/gb/gbc/gba: cheat codes are now stored in universal, decrypted
format
- ethos: replaced file loader with a proper game library
- ethos: added display emulation shader support
- ethos: added color emulation option to video settings
- ethos: program icon upgraded from 48x48 to 512x512
- ethos: settings and tools windows now use tab frames (less wasted
screen space)
- ethos: default to optimal (video, audio, input) drivers instead of
safest drivers
- ethos: input mapping system completely rewritten to support
hotplugging and unique device mappings
- ruby: added fixes for OpenGL 3.2 on AMD graphics cards
- ruby: quark shaders now support user settings inside of manifest
- ruby: quark shaders can use integral textures (allows display
emulation shaders to work with raw colors)
- ruby: add joypad rumble support
- ruby: XInput (Xbox 360) controllers now support hotplugging
- ruby: added Linux udev joypad driver with hotplug support
- phoenix: fixed a rare null pointer dereference issue on Windows
- port: target -std=c++11 instead of -std=gnu++11 (do not rely on GNU
C++ extensions)
- port: added out-of-the-box compilation support for BSD/Clang 3.3+
- port: applied a few Debian upstream patches
- cheats: updated to mightymo's 2014-01-02 release; decrypted all Game
Genie codes
2014-01-20 08:55:17 +00:00
|
|
|
|
2018-07-08 04:58:27 +00:00
|
|
|
//todo: call Window::doSize() ?
|
|
|
|
break;
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
case WM_HSCROLL:
|
|
|
|
case WM_VSCROLL: {
|
2015-06-12 13:14:38 +00:00
|
|
|
if(!lparam) break;
|
|
|
|
auto object = (mObject*)GetWindowLongPtr((HWND)lparam, GWLP_USERDATA);
|
|
|
|
if(!object) break;
|
|
|
|
|
2015-08-21 10:56:39 +00:00
|
|
|
#if defined(Hiro_HorizontalScrollBar)
|
|
|
|
if(auto horizontalScrollBar = dynamic_cast<mHorizontalScrollBar*>(object)) {
|
|
|
|
return horizontalScrollBar->self()->onChange(wparam), true;
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_HorizontalSlider)
|
|
|
|
if(auto horizontalSlider = dynamic_cast<mHorizontalSlider*>(object)) {
|
|
|
|
return horizontalSlider->self()->onChange(), true;
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
2015-06-12 13:14:38 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-21 10:56:39 +00:00
|
|
|
#if defined(Hiro_VerticalScrollBar)
|
|
|
|
if(auto verticalScrollBar = dynamic_cast<mVerticalScrollBar*>(object)) {
|
|
|
|
return verticalScrollBar->self()->onChange(wparam), true;
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(Hiro_VerticalSlider)
|
|
|
|
if(auto verticalSlider = dynamic_cast<mVerticalSlider*>(object)) {
|
|
|
|
return verticalSlider->self()->onChange(), true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-28 10:29:01 +00:00
|
|
|
break;
|
|
|
|
}
|
2018-07-08 04:58:27 +00:00
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
//catch mouse events over disabled windows
|
|
|
|
case WM_MOUSEMOVE:
|
|
|
|
case WM_MOUSELEAVE:
|
|
|
|
case WM_MOUSEHOVER: {
|
|
|
|
POINT p{};
|
|
|
|
GetCursorPos(&p);
|
|
|
|
ScreenToClient(hwnd, &p);
|
|
|
|
for(auto window : EnumVisibleChildWindows(hwnd)) {
|
|
|
|
if(auto widget = (mWidget*)GetWindowLongPtr(window, GWLP_USERDATA)) {
|
|
|
|
auto geometry = widget->geometry();
|
|
|
|
if(p.x < geometry.x()) continue;
|
|
|
|
if(p.y < geometry.y()) continue;
|
|
|
|
if(p.x >= geometry.x() + geometry.width ()) continue;
|
|
|
|
if(p.y >= geometry.y() + geometry.height()) continue;
|
|
|
|
|
|
|
|
if(msg == WM_MOUSEMOVE) {
|
|
|
|
TRACKMOUSEEVENT event{sizeof(TRACKMOUSEEVENT)};
|
|
|
|
event.hwndTrack = hwnd;
|
|
|
|
event.dwFlags = TME_LEAVE | TME_HOVER;
|
Update to 20180809 release.
byuu says:
The Windows port can now run the emulation while navigating menus,
moving windows, and resizing windows. The main window also doesn't try
so hard to constantly clear itself. This may leave a bit of unwelcome
residue behind in some video drivers during resize, but under most
drivers, it lets you resize without a huge amount of flickering.
On all platforms, I now also run the emulation during MessageWindow
modal events, where I didn't before.
I'm thinking we should probably mute the audio during modal periods,
since it can generate a good deal of distortion.
The tooltip timeout was increased to ten seconds.
On Windows, the enter key can now activate buttons, so you can more
quickly dismiss MessageDialog windows. This part may not actually work
... I'm in the middle of trying to get messages out of the global
`Application_windowProc` hook and into the individual `Widget_windowProc`
hooks, so I need to do some testing.
I fixed a bug where changing the input driver wouldn't immediately
reload the input/hotkey settings lists properly.
I also went from disabling the driver "Change" button when the currently
active driver is selected in the list, to instead setting it to say
"Reload", and I also added a tool tip to the input driver reload button,
advising that if you're using DirectInput or SDL, you can hit "Reload"
to rescan for hotplugged gamepads without needing to restart the
emulator. XInput and udev have auto hotswap support. If we can ever get
that into DirectInput and SDL, then I'll remove the tooltip. But
regardless, the reload functionality is nice to have for all drivers.
I'm not sure what should happen when a user changes their driver
selection while a game is loaded, gets the warning dialog, chooses not
to change it, and then closes the emulator. Currently, it will make the
change happen the next time you start the emulator. This feels a bit
unexpected, but when you change the selection without a game loaded, it
takes immediate effect. So I'm not really sure what's best here.
2018-08-10 05:02:59 +00:00
|
|
|
event.dwHoverTime = pToolTip::Delay;
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
TrackMouseEvent(&event);
|
|
|
|
POINT p{};
|
|
|
|
GetCursorPos(&p);
|
|
|
|
widget->self()->doMouseMove(p.x, p.y);
|
|
|
|
if(auto toolTip = pApplication::state().toolTip) {
|
|
|
|
toolTip->windowProc(hwnd, msg, wparam, lparam);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(msg == WM_MOUSELEAVE) {
|
|
|
|
widget->self()->doMouseLeave();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(msg == WM_MOUSEHOVER) {
|
|
|
|
widget->self()->doMouseHover();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-07-08 04:58:27 +00:00
|
|
|
#if defined(Hiro_TableView)
|
|
|
|
case AppMessage::TableView_doPaint: {
|
|
|
|
if(auto tableView = (mTableView*)lparam) {
|
|
|
|
if(auto self = tableView->self()) InvalidateRect(self->hwnd, nullptr, true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case AppMessage::TableView_onActivate: {
|
2019-07-30 21:57:31 +00:00
|
|
|
if(auto tableView = (mTableView*)lparam) tableView->doActivate({});
|
2018-07-08 04:58:27 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case AppMessage::TableView_onChange: {
|
|
|
|
if(auto tableView = (mTableView*)lparam) tableView->doChange();
|
|
|
|
}
|
|
|
|
#endif
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
|
Update to v106r57 release.
byuu says:
I've added tool tips to hiro for Windows, GTK, and Qt. I'm unsure how to
add them for Cocoa. I wasted am embarrassing ~14 hours implementing tool
tips from scratch on Windows, because the `TOOLTIPS_CLASS` widget just
absolutely refused to show up, no matter what I tried. As such, they're
not quite 100% native, but I would really appreciate any patch
submissions to help improve my implementation.
I added tool tips to all of the confusing settings in bsnes. And of
course, for those of you who don't like them, there's a configuration
file setting to turn them off globally.
I also improved Mega Drive handling of the Game Genie a bit, and
restructured the way the Settings class works in bsnes.
Starting now, I'm feature-freezing bsnes and higan. From this point
forward:
- polishing up and fixing bugs caused by the ruby/hiro changes
- adding DRC to XAudio2, and maybe exclusive mode to WGL
- correcting FEoEZ (English) to load and work again out of the box
Once that's done, a final beta of bsnes will go out, I'll fix any
reported bugs that I'm able to, and then v107 should be ready. This time
with higan being functional, but marked as v107 beta. v108 will restore
higan to production status again, alongside bsnes.
2018-08-08 08:46:58 +00:00
|
|
|
return CallWindowProc(windowProc, hwnd, msg, wparam, lparam);
|
2013-11-28 10:29:01 +00:00
|
|
|
}
|
|
|
|
|
2013-03-15 13:11:33 +00:00
|
|
|
}
|