Files
aurora/lib/card/File.hpp
CraftyBoss a801671643 Card gci folder update (#135)
* add ability to set path of card image before CARDInit

* begin work on updating card class to support gci folders

a lot of work will just be directly reading from whatever folder is supplied, instead of relying on an always open FileIO handle

* swap to interface system for easier code seperation, begin actually planning out logic for gci loading

* fix wrong name for func, add modified time to new gci file entry

* get gci folder working

tp seems to be happy with everything ive done, the only funcs im worried about are getSerial and getChecksum as those dont do anything atm.

* fix createFile not assigning file index to output FileHandle, CARDSetLoadType now takes an enum

* make probeCardFile a virtual func so GciFolder and RawFile can both implement their own, bit of cleanup
2026-04-23 22:39:42 -07:00

49 lines
1.0 KiB
C++

#pragma once
#include <array>
#include <cstdint>
#include "Constants.hpp"
namespace aurora::card {
class File {
friend class IFileHandle;
friend class Directory;
friend class CardRawFile;
friend class CardGciFolder;
#pragma pack(push, 4)
using RawData = std::array<uint8_t, 0x40>;
union {
struct {
uint8_t m_game[4];
uint8_t m_maker[2];
uint8_t m_reserved;
uint8_t m_bannerFlags;
#if __GNUC__ && !__clang__
__attribute__((nonstring))
#endif
char m_filename[0x20];
uint32_t m_modifiedTime;
uint32_t m_iconAddress;
uint16_t m_iconFmt;
uint16_t m_animSpeed;
EPermissions m_permissions;
int8_t m_copyCounter;
uint16_t m_firstBlock;
uint16_t m_blockCount;
uint16_t m_reserved2;
uint32_t m_commentAddr;
};
RawData raw;
};
#pragma pack(pop)
void swapEndian();
public:
File();
explicit File(const RawData& rawData);
explicit File(const char* filename);
~File() = default;
};
} // namespace aurora::card