Formatting and minor clean ups

This commit is contained in:
Maschell 2021-10-09 01:24:12 +02:00
parent 648c0d0fd7
commit 6919bdb44f
30 changed files with 57 additions and 39 deletions

View File

@ -719,7 +719,7 @@ void ApplicationState::dumpAppFiles() {
return; return;
} }
DEBUG_FUNCTION_LINE("Read DiscHeader"); DEBUG_FUNCTION_LINE("Read DiscHeader");
auto *discHeader = new WiiUDiscHeader(discReader, 0); auto *discHeader = new WiiUDiscHeader(discReader);
bool forceExit = false; bool forceExit = false;
for (auto &partition: discHeader->wiiUContentsInformation->partitions->partitions) { for (auto &partition: discHeader->wiiUContentsInformation->partitions->partitions) {
auto gmPartition = dynamic_cast<WiiUGMPartition *>(partition); auto gmPartition = dynamic_cast<WiiUGMPartition *>(partition);

View File

@ -116,6 +116,7 @@ private:
uint32_t writeBufferSize = 0; uint32_t writeBufferSize = 0;
[[nodiscard]] bool writeCached(uint32_t addr, uint32_t writeSize); [[nodiscard]] bool writeCached(uint32_t addr, uint32_t writeSize);
void clearWriteCache(); void clearWriteCache();
[[nodiscard]] bool flushWriteCache(); [[nodiscard]] bool flushWriteCache();

View File

@ -21,6 +21,7 @@
class DiscReader { class DiscReader {
public: public:
DiscReader(); DiscReader();
virtual ~DiscReader(); virtual ~DiscReader();
virtual bool IsReady() = 0; virtual bool IsReady() = 0;

View File

@ -22,8 +22,11 @@
class DiscReaderDiscDrive : public DiscReader { class DiscReaderDiscDrive : public DiscReader {
public: public:
DiscReaderDiscDrive(); DiscReaderDiscDrive();
~DiscReaderDiscDrive() override; ~DiscReaderDiscDrive() override;
bool readEncryptedSector(uint8_t *buffer, uint32_t block_cnt, uint64_t offset_in_sector) const override; bool readEncryptedSector(uint8_t *buffer, uint32_t block_cnt, uint64_t offset_in_sector) const override;
bool IsReady() override; bool IsReady() override;
bool readEncrypted(uint8_t *buf, uint64_t offset, uint32_t size) override; bool readEncrypted(uint8_t *buf, uint64_t offset, uint32_t size) override;

View File

@ -18,6 +18,7 @@
#include "WiiUContentsInformation.h" #include "WiiUContentsInformation.h"
uint32_t WiiUContentsInformation::LENGTH = 32768; uint32_t WiiUContentsInformation::LENGTH = 32768;
WiiUContentsInformation::WiiUContentsInformation(DiscReader *reader, uint32_t offset) { WiiUContentsInformation::WiiUContentsInformation(DiscReader *reader, uint32_t offset) {
uint32_t curOffset = offset; uint32_t curOffset = offset;
discContentHeader = new WiiUDiscContentsHeader(reader, curOffset); discContentHeader = new WiiUDiscContentsHeader(reader, curOffset);

View File

@ -25,6 +25,7 @@ class WiiUPartition {
public: public:
WiiUPartition(); WiiUPartition();
explicit WiiUPartition(DiscReader *reader, uint32_t offset, const DiscBlockSize &blockSize); explicit WiiUPartition(DiscReader *reader, uint32_t offset, const DiscBlockSize &blockSize);
virtual uint64_t getSectionOffsetOnDefaultPartition(); virtual uint64_t getSectionOffsetOnDefaultPartition();

View File

@ -17,6 +17,7 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
class DirectoryEntry; class DirectoryEntry;
class NodeEntryParam { class NodeEntryParam {

View File

@ -38,3 +38,7 @@ WiiUDiscHeader::~WiiUDiscHeader() {
delete discId; delete discId;
delete wiiUContentsInformation; delete wiiUContentsInformation;
} }
WiiUDiscHeader::WiiUDiscHeader(DiscReaderDiscDrive *pDrive) : WiiUDiscHeader(pDrive, 0) {
}

View File

@ -19,19 +19,22 @@
#include <cstdint> #include <cstdint>
#include <WUD/DiscReader.h> #include <WUD/DiscReader.h>
#include <WUD/content/WiiUContentsInformation.h> #include <WUD/content/WiiUContentsInformation.h>
#include <WUD/DiscReaderDiscDrive.h>
#include "WiiUManufactorDiscID.h" #include "WiiUManufactorDiscID.h"
#include "WiiUDiscID.h" #include "WiiUDiscID.h"
class WiiUDiscHeader { class WiiUDiscHeader {
public: public:
static uint32_t LENGTH; explicit WiiUDiscHeader(DiscReaderDiscDrive *pDrive);
WiiUDiscHeader(DiscReader *reader, uint32_t offset); WiiUDiscHeader(DiscReader *reader, uint32_t offset);
~WiiUDiscHeader();
WiiUManufactorDiscID *manufactorDiscID = nullptr; WiiUManufactorDiscID *manufactorDiscID = nullptr;
WiiUDiscID *discId = nullptr; WiiUDiscID *discId = nullptr;
WiiUContentsInformation *wiiUContentsInformation = nullptr; WiiUContentsInformation *wiiUContentsInformation = nullptr;
~WiiUDiscHeader(); static uint32_t LENGTH;
}; };

View File

@ -51,5 +51,6 @@ public:
private: private:
ScreenUtils() = default; ScreenUtils() = default;
~ScreenUtils() = default; ~ScreenUtils() = default;
}; };

View File

@ -23,6 +23,7 @@ class AddressInVolumeBlocks : public AddressInBlocks {
public: public:
AddressInVolumeBlocks() = default; AddressInVolumeBlocks() = default;
AddressInVolumeBlocks(const VolumeBlockSize &pBlockSize, uint32_t pValue) : AddressInBlocks(pBlockSize, pValue) { AddressInVolumeBlocks(const VolumeBlockSize &pBlockSize, uint32_t pValue) : AddressInBlocks(pBlockSize, pValue) {
} }
}; };

View File

@ -23,6 +23,7 @@ class DiscBlockSize : public BlockSize {
public: public:
DiscBlockSize() = default; DiscBlockSize() = default;
explicit DiscBlockSize(uint32_t blockSize) : BlockSize(blockSize) { explicit DiscBlockSize(uint32_t blockSize) : BlockSize(blockSize) {
} }