mirror of
https://github.com/AxioDL/kabufuda.git
synced 2025-12-08 13:14:57 +00:00
Checksum and Card copy fixes
This commit is contained in:
@@ -30,7 +30,7 @@ class BlockAllocationTable
|
||||
public:
|
||||
explicit BlockAllocationTable(uint32_t blockCount = (uint32_t(ECardSize::Card2043Mb) * MbitToBlocks));
|
||||
BlockAllocationTable(uint8_t data[BlockSize]);
|
||||
~BlockAllocationTable();
|
||||
~BlockAllocationTable() = default;
|
||||
|
||||
uint16_t getNextBlock(uint16_t block) const;
|
||||
uint16_t nextFreeBlock(uint16_t maxBlock, uint16_t startingBlock) const;
|
||||
|
||||
@@ -124,14 +124,10 @@ class Card
|
||||
|
||||
SystemString m_filename;
|
||||
FILE* m_fileHandle = nullptr;
|
||||
Directory m_dir;
|
||||
Directory m_dirBackup;
|
||||
Directory* m_currentDir;
|
||||
Directory* m_previousDir;
|
||||
BlockAllocationTable m_bat;
|
||||
BlockAllocationTable m_batBackup;
|
||||
BlockAllocationTable* m_currentBat;
|
||||
BlockAllocationTable* m_previousBat;
|
||||
Directory m_dirs[2];
|
||||
BlockAllocationTable m_bats[2];
|
||||
uint8_t m_currentDir;
|
||||
uint8_t m_currentBat;
|
||||
|
||||
uint16_t m_maxBlock;
|
||||
char m_game[5] = {'\0'};
|
||||
@@ -149,7 +145,11 @@ public:
|
||||
* @brief Card
|
||||
* @param other
|
||||
*/
|
||||
Card(const Card& other);
|
||||
Card(const Card& other) = delete;
|
||||
Card& operator=(const Card& other) = delete;
|
||||
Card(Card&& other) = default;
|
||||
Card& operator=(Card&& other) = default;
|
||||
|
||||
/**
|
||||
* @brief Card
|
||||
* @param filepath
|
||||
|
||||
@@ -29,9 +29,7 @@ class Directory
|
||||
public:
|
||||
Directory();
|
||||
Directory(uint8_t data[BlockSize]);
|
||||
Directory(const Directory& other);
|
||||
void operator=(const Directory& other);
|
||||
~Directory();
|
||||
~Directory() = default;
|
||||
|
||||
bool hasFreeFile() const;
|
||||
int32_t numFreeFiles() const;
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
File();
|
||||
File(char data[0x40]);
|
||||
File(const char* filename);
|
||||
~File() {}
|
||||
~File() = default;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -358,6 +358,7 @@ static inline int Stat(const SystemChar* path, Sstat* statOut)
|
||||
* @param checksumInv
|
||||
*/
|
||||
void calculateChecksumBE(const uint16_t* data, size_t len, uint16_t* checksum, uint16_t* checksumInv);
|
||||
void calculateChecksumLE(const uint16_t* data, size_t len, uint16_t* checksum, uint16_t* checksumInv);
|
||||
}
|
||||
|
||||
#endif // __KABU_UTIL_HPP__
|
||||
|
||||
Reference in New Issue
Block a user