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;
}
DEBUG_FUNCTION_LINE("Read DiscHeader");
auto *discHeader = new WiiUDiscHeader(discReader, 0);
auto *discHeader = new WiiUDiscHeader(discReader);
bool forceExit = false;
for (auto &partition: discHeader->wiiUContentsInformation->partitions->partitions) {
auto gmPartition = dynamic_cast<WiiUGMPartition *>(partition);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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