summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWiiCrypted.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2015-05-05 16:20:04 -0400
committercomex <comexk@gmail.com>2015-05-05 16:20:04 -0400
commit6414cdabb2ae7762f2d98427b9ff024af07bb959 (patch)
tree5362ae99777fc494d6c2b059b0bd63a6bb296b97 /Source/Core/DiscIO/VolumeWiiCrypted.cpp
parent430e8b7adeb5b3adb12ef50ce7961562463b0fa0 (diff)
parentdf8e768b77b551832ace0d552ec10c1b062c55f3 (diff)
Merge pull request #2286 from JosJuice/wii-opening-bnr
Read opening.bnr to get names from Wii discs
Diffstat (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
index 4c703fdb3f..7657c0a28d 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp
@@ -4,6 +4,7 @@
#include <cstddef>
#include <cstring>
+#include <map>
#include <string>
#include <vector>
#include <polarssl/aes.h>
@@ -15,6 +16,7 @@
#include "Common/Logging/Log.h"
#include "DiscIO/Blob.h"
#include "DiscIO/FileMonitor.h"
+#include "DiscIO/Filesystem.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeCreator.h"
#include "DiscIO/VolumeGC.h"
@@ -191,17 +193,21 @@ int CVolumeWiiCrypted::GetRevision() const
return revision;
}
-std::vector<std::string> CVolumeWiiCrypted::GetNames() const
+std::string CVolumeWiiCrypted::GetName() const
{
- std::vector<std::string> names;
+ char name_buffer[0x60];
+ if (m_pReader != nullptr && Read(0x20, 0x60, (u8*)&name_buffer, false))
+ return DecodeString(name_buffer);
- auto const string_decoder = CVolumeGC::GetStringDecoder(GetCountry());
-
- char name[0xFF] = {};
- if (m_pReader != nullptr && Read(0x20, 0x60, (u8*)&name, true))
- names.push_back(string_decoder(name));
+ return "";
+}
- return names;
+std::map<IVolume::ELanguage, std::string> CVolumeWiiCrypted::GetNames() const
+{
+ std::unique_ptr<IFileSystem> file_system(CreateFileSystem(this));
+ std::vector<u8> opening_bnr(NAMES_TOTAL_BYTES);
+ opening_bnr.resize(file_system->ReadFile("opening.bnr", opening_bnr.data(), opening_bnr.size(), 0x5C));
+ return ReadWiiNames(opening_bnr);
}
u32 CVolumeWiiCrypted::GetFSTSize() const