bbsan2k/Flash1M_Repro_SRAM_Patcher

adding support, also compiler problems

Closed this issue · 7 comments

specifically this one https://flashcartdb.com/index.php/M36L0T8060T
if so could you guide me in adding support?
also i can't get this program to compile, here is the log

-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/development/Desktop/Flash1M_Repro_SRAM_Patcher
Scanning dependencies of target SaveIdentifier
[ 11%] Building CXX object CMakeFiles/SaveIdentifier.dir/SaveIdentifier.cpp.o
/home/development/Desktop/Flash1M_Repro_SRAM_Patcher/SaveIdentifier.cpp: In function ‘int main(int, char**)’:
/home/development/Desktop/Flash1M_Repro_SRAM_Patcher/SaveIdentifier.cpp:64:28: error: ‘search’ is not a member of ‘std’
64 | auto it = std::search(std::begin(file_buffer), std::end(file_buffer), std::begin(pattern), std::end(pattern));
| ^~~~~~
make[2]: *** [CMakeFiles/SaveIdentifier.dir/build.make:63: CMakeFiles/SaveIdentifier.dir/SaveIdentifier.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/SaveIdentifier.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I‘ll check on this compilation issue this weekend and come back to you.
In case the Patch will still not work after this is fixed:
Can you try removing the bridge at DAN? The best way to try whether it is already supported or not is using gbxcart CLI tool or FlashGBX. If they show 1MBit SRAM, the patcher already supports this cart.
If not, the batteryless patch/rom needs to be checked for the offsets that are used for bank switching.

Jamming #include <algorithm> into the header fixes it.

Jamming #include <algorithm> into the header fixes it.

Did you try on Windows or Linux? IIRC there was an issue with Windows regarding the filesystem - but maybe that's resolved now.

@simplyargyll Can you give it a try now?

ubuntu in a vm on windows, still having issues,
development@development-VirtualBox:/Desktop$ git clone https://github.com/bbsan2k/Flash1M_Repro_SRAM_Patcher.git
Cloning into 'Flash1M_Repro_SRAM_Patcher'...
remote: Enumerating objects: 69, done.
remote: Counting objects: 100% (69/69), done.
remote: Compressing objects: 100% (50/50), done.
remote: Total 69 (delta 37), reused 45 (delta 19), pack-reused 0
Unpacking objects: 100% (69/69), 20.87 KiB | 147.00 KiB/s, done.
development@development-VirtualBox:
/Desktop$ cd Flash1M_Repro_SRAM_Patcher/
development@development-VirtualBox:/Desktop/Flash1M_Repro_SRAM_Patcher$ cmake .
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/development/Desktop/Flash1M_Repro_SRAM_Patcher
development@development-VirtualBox:
/Desktop/Flash1M_Repro_SRAM_Patcher$ camke --build .

Command 'camke' not found, did you mean:

command 'cmake' from snap cmake (3.19.5)
command 'cake' from deb cakephp-scripts (2.10.11-2)
command 'cmake' from deb cmake (3.16.3-1ubuntu1)

See 'snap info ' for additional versions.

development@development-VirtualBox:~/Desktop/Flash1M_Repro_SRAM_Patcher$ cmake --build .
Scanning dependencies of target SaveIdentifier
[ 11%] Building CXX object CMakeFiles/SaveIdentifier.dir/SaveIdentifier.cpp.o
[ 22%] Linking CXX executable SaveIdentifier
[ 22%] Built target SaveIdentifier
Scanning dependencies of target Flash1M_Repro_SRAM_Patcher
[ 33%] Building CXX object CMakeFiles/Flash1M_Repro_SRAM_Patcher.dir/main.cpp.o
[ 44%] Building CXX object CMakeFiles/Flash1M_Repro_SRAM_Patcher.dir/patchset.cpp.o
/home/development/Desktop/Flash1M_Repro_SRAM_Patcher/patchset.cpp: In member function ‘bool PatchSet::isApplicable(std::vector&, std::string*)’:
/home/development/Desktop/Flash1M_Repro_SRAM_Patcher/patchset.cpp:25:24: error: ‘search’ is not a member of ‘std’
25 | auto it = std::search(std::begin(data), std::end(data), std::begin(pattern), std::end(pattern));
| ^~~~~~
make[2]: *** [CMakeFiles/Flash1M_Repro_SRAM_Patcher.dir/build.make:76: CMakeFiles/Flash1M_Repro_SRAM_Patcher.dir/patchset.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/Flash1M_Repro_SRAM_Patcher.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Could you please try one more time?

This is where I lazily put code in there at 2am last night.

[dinsfire@hyrule Flash1M_Repro_SRAM_Patcher]$ git diff
diff --git a/SaveIdentifier.cpp b/SaveIdentifier.cpp
index 3cef79d..4accc45 100644
--- a/SaveIdentifier.cpp
+++ b/SaveIdentifier.cpp
@@ -1,3 +1,4 @@
+#include <algorithm>
 #include <filesystem>
 #include <vector>
 #include <fstream>
diff --git a/patchset.cpp b/patchset.cpp
index eb34c4a..cb90a38 100644
--- a/patchset.cpp
+++ b/patchset.cpp
@@ -1,3 +1,4 @@
+#include <algorithm>
 #include "patchset.h"

issue is fixed on my end