diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2023-01-31 03:02:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-31 03:02:39 +0100 |
| commit | 2843cd10a8b3fddc4d545ad1afc0986a5db02bde (patch) | |
| tree | 23e3634df44bc1f35a488eb6b9af045401566e13 /Source/Core | |
| parent | c63eb7543574f092bb327cc888f5f99472813e52 (diff) | |
| parent | c8a91abadc9203d8700f5e49c8e81f5e04ad1d6b (diff) | |
Merge pull request #11492 from mandar1jn/file-improvements
Improve the data in the first data block of the skylanders figures
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/IOS/USB/Emulated/Skylander.cpp | 18 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp b/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp index c799c3477e..3d90112157 100644 --- a/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp +++ b/Source/Core/Core/IOS/USB/Emulated/Skylander.cpp @@ -8,6 +8,7 @@ #include <vector> #include "Common/Logging/Log.h" +#include "Common/Random.h" #include "Common/StringUtil.h" #include "Common/Timer.h" #include "Core/Core.h" @@ -747,11 +748,24 @@ bool SkylanderPortal::CreateSkylander(const std::string& file_path, u16 sky_id, { memcpy(&file_data[(index * 0x40) + 0x36], &other_blocks, sizeof(other_blocks)); } + + // Set the NUID of the figure + Common::Random::Generate(&file_data[0], 4); + + // The BCC (Block Check Character) + file_data[4] = file_data[0] ^ file_data[1] ^ file_data[2] ^ file_data[3]; + + // ATQA + file_data[5] = 0x81; + file_data[6] = 0x01; + + // SAK + file_data[7] = 0x0F; + // Set the skylander info - u16 sky_info = (sky_id | sky_var) + 1; - memcpy(&file_data[0], &sky_info, sizeof(sky_info)); memcpy(&file_data[0x10], &sky_id, sizeof(sky_id)); memcpy(&file_data[0x1C], &sky_var, sizeof(sky_var)); + // Set checksum u16 checksum = SkylanderCRC16(0xFFFF, file_data, 0x1E); memcpy(&file_data[0x1E], &checksum, sizeof(checksum)); diff --git a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp index 7f4f9994fd..157fa4771d 100644 --- a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp +++ b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp @@ -29,6 +29,7 @@ #include "Core/System.h" #include "DolphinQt/QtUtils/DolphinFileDialog.h" +#include "DolphinQt/Resources.h" #include "DolphinQt/Settings.h" // Qt is not guaranteed to keep track of file paths using native file pickers, so we use this @@ -521,6 +522,7 @@ const std::map<const std::pair<const u16, const u16>, const char*> list_skylande SkylanderPortalWindow::SkylanderPortalWindow(QWidget* parent) : QWidget(parent) { setWindowTitle(tr("Skylanders Manager")); + setWindowIcon(Resources::GetAppIcon()); setObjectName(QString::fromStdString("skylanders_manager")); setMinimumSize(QSize(700, 200)); |
