From bc5ad4a1cdcc7aa40e9f0e0cbc7a613d9af91325 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Sat, 3 Oct 2015 16:25:39 +1000 Subject: [PATCH] Update to icarus_20151002. byuu says: - fixes checkboxes (-again- again [*again*]) - won't check folders with select all / unselect all - won't crash anymore if the SNES ROM image is too small (Saturday Night Slam Masters was crashing it before due to DB size error) - corrected heuristics for Sufami Turbo base cart (mirrors the absurdities of the real cart precisely, since it's one of a kind) - corrected a few DB issues (BS-X name + PSRAM (again [*again*]), SNSM, LAH) (_again_) - these are temporary. Monkey patched in the generated .hpp source rather than the actual DB - not going to fix the SFT sizes because I want to verify what happened there first --- hiro/windows/utility.cpp | 24 +++++++++--------------- icarus/core/super-famicom.cpp | 1 + icarus/database/super-famicom.hpp | 11 ++++++----- icarus/heuristics/super-famicom.hpp | 14 +++++++------- icarus/ui/scan-dialog.cpp | 8 ++++++-- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/hiro/windows/utility.cpp b/hiro/windows/utility.cpp index 21700816..e02a9ade 100644 --- a/hiro/windows/utility.cpp +++ b/hiro/windows/utility.cpp @@ -316,18 +316,12 @@ static auto CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT ms } case WM_NOTIFY: { - //WC_TABCONTROL requires parenting widgets to it; rather than the WINDOW - //without doing this; backgrounds on transparent controls (eg STATIC) are painted wrong - //this causes some WC_LISTVIEW WM_NOTIFY messages to only go to the WC_TABCONTROL WNDPROC - //all other controls also send their messages to the WC_TABCONTROL WNDPROC - //to avoid duplicating all message logic, hiro shares a WNDPROC with Window and TabFrame - //LVN_ITEM(ACTIVATE,CHANGED) are only sent to the TabFrame, as expected - //yet for unknown reasons, LVN_COLUMNCLICK and NM_(CLICK,DBLCLK,RCLICK) are - //sent to both the TabFrame, and then again to the Window's WNDPROC - //this causes on(Sort,Toggle,Context) to trigger callbacks twice - //if we try to block propagation to the Window (via return instead of break); then - //this will result in the LVN_ITEM(ACTIVATE,CHANGED) never being invoked (unsure why) - //as a workaround; we must detect these message to the Windows' WNDPROC, and block them + //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. bool isWindowCallback = (object == window); auto header = (LPNMHDR)lparam; @@ -345,16 +339,16 @@ static auto CALLBACK Shared_windowProc(WindowProc windowProc, HWND hwnd, UINT ms break; } if(header->code == LVN_COLUMNCLICK) { - if(!isWindowCallback) listView->self()->onSort(lparam); + if(isWindowCallback) listView->self()->onSort(lparam); break; } if(header->code == NM_CLICK || header->code == NM_DBLCLK) { //onToggle performs the test to ensure the ListViewItem clicked was checkable - if(!isWindowCallback) listView->self()->onToggle(lparam); + if(isWindowCallback) listView->self()->onToggle(lparam); break; } if(header->code == NM_RCLICK) { - if(!isWindowCallback) listView->self()->onContext(lparam); + if(isWindowCallback) listView->self()->onContext(lparam); break; } if(header->code == NM_CUSTOMDRAW) { diff --git a/icarus/core/super-famicom.cpp b/icarus/core/super-famicom.cpp index fac315b3..60f084a1 100644 --- a/icarus/core/super-famicom.cpp +++ b/icarus/core/super-famicom.cpp @@ -73,6 +73,7 @@ auto Icarus::superFamicomImport(vector& buffer, const string& location) auto name = rom["name"].text(); auto size = rom["size"].decimal(); if(name == "program.rom" || name == "data.rom" || firmwareAppended) { + if(size > buffer.size() - offset) return failure("ROM image is missing data"); file::write({target, name}, buffer.data() + offset, size); offset += size; } else { diff --git a/icarus/database/super-famicom.hpp b/icarus/database/super-famicom.hpp index 188360ac..311e8ac7 100644 --- a/icarus/database/super-famicom.hpp +++ b/icarus/database/super-famicom.hpp @@ -1,6 +1,6 @@ string SuperFamicom = R"( -database revision=2015-09-28 +database revision=2015-10-02 release cartridge region=NTSC @@ -8,7 +8,7 @@ release mcc rom name=program.rom size=0x100000 ram name=save.ram size=0x8000 - ram name=download.ram size=0x40000 + ram name=download.ram size=0x80000 map id=io address=00-3f,80-bf:5000-5fff map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-5f,c0-ff:0000-ffff @@ -16,7 +16,7 @@ release map id=ram address=20-3f:6000-7fff mask=0xe000 map id=ram address=70-77:0000-ffff information - title: BS-X それは名前を盗まれた待の物語 + title: BS-X それは名前を盗まれた街の物語 name: BS-X - Sore wa Namae o Nusumareta Machi no Monogatari region: JP revision: 1.1 @@ -5410,6 +5410,7 @@ release information title: Last Action Hero name: Last Action Hero + region: NA revision: 1.0 board: SHVC-1A0N-10 serial: SNS-L5-USA @@ -9030,7 +9031,7 @@ release release cartridge region=NTSC board type=BJ0N revision=01,20 - rom name=program.rom size=0x400000 + rom name=program.rom size=0x300000 map id=rom address=00-3f,80-bf:8000-ffff map id=rom address=40-7d,c0-ff:0000-ffff information @@ -9042,7 +9043,7 @@ release serial: SNS-ZW-USA sha256: 34e1af0642c85148c5a3dc3c7ab4bcbda13a9fea190934b5526c555fff035651 configuration - rom name=program.rom size=0x400000 + rom name=program.rom size=0x300000 release cartridge region=NTSC diff --git a/icarus/heuristics/super-famicom.hpp b/icarus/heuristics/super-famicom.hpp index a2542c00..75661b63 100644 --- a/icarus/heuristics/super-famicom.hpp +++ b/icarus/heuristics/super-famicom.hpp @@ -401,14 +401,14 @@ SuperFamicomCartridge::SuperFamicomCartridge(const uint8_t *data, unsigned size) else if(mapper == STROM) { markup.append( " rom name=program.rom size=0x", hex(rom_size), "\n" - " map id=rom address='00-1f,80-9f:8000-ffff mask=0x8000\n" + " map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000\n" " sufamiturbo\n" - " slot id=A\n" - " map id=rom address=20-3f,a0-bf:8000-ffff mask=0x8000\n" - " map id=ram address=60-63,e0-e3:8000-ffff\n" - " slot id=B\n" - " map id=rom address=40-5f,c0-df:8000-ffff mask=0x8000\n" - " map id=ram address=70-73,f0-f3:8000-ffff\n" + " map id=rom address=20-3f,a0-bf:8000-ffff mask=0x8000\n" + " map id=ram address=60-6f,e0-ef:0000-ffff\n" + " sufamiturbo\n" + " map id=rom address=40-5f,c0-df:0000-7fff mask=0x8000\n" + " map id=rom address=40-5f,c0-df:8000-ffff mask=0x8000\n" + " map id=ram address=70-7f,f0-ff:0000-ffff\n" ); } diff --git a/icarus/ui/scan-dialog.cpp b/icarus/ui/scan-dialog.cpp index b4fb03f4..6d6b0cdf 100644 --- a/icarus/ui/scan-dialog.cpp +++ b/icarus/ui/scan-dialog.cpp @@ -18,10 +18,14 @@ ScanDialog::ScanDialog() { }); scanList.onActivate([&] { activate(); }); selectAllButton.setText("Select All").onActivate([&] { - for(auto& item : scanList.items()) item.cell(0).setChecked(true); + for(auto& item : scanList.items()) { + if(item.cell(0).checkable()) item.cell(0).setChecked(true); + } }); unselectAllButton.setText("Unselect All").onActivate([&] { - for(auto& item : scanList.items()) item.cell(0).setChecked(false); + for(auto& item : scanList.items()) { + if(item.cell(0).checkable()) item.cell(0).setChecked(false); + } }); createManifestsLabel.setChecked(settings.createManifests).setText("Create Manifests").onToggle([&] { settings.createManifests = createManifestsLabel.checked();