Support for loading TIM
This commit is contained in:
@@ -7,7 +7,7 @@ namespace JabyEngine {
|
||||
class State {
|
||||
public:
|
||||
struct Reserved {
|
||||
uint32_t reserved[4];
|
||||
uint32_t reserved[8];
|
||||
};
|
||||
|
||||
struct Configuration;
|
||||
@@ -17,6 +17,7 @@ namespace JabyEngine {
|
||||
|
||||
typedef GenericProcessRoutine<Reserved> ProcessRoutine;
|
||||
|
||||
// TODO: Better name!!!!
|
||||
struct Configuration {
|
||||
ProcessRoutine process_routine = nullptr;
|
||||
const uint8_t* data_adr = nullptr;
|
||||
@@ -52,6 +53,7 @@ namespace JabyEngine {
|
||||
// The nothing state
|
||||
State create(const uint32_t* data_adr, const Nothing& nothing);
|
||||
State create(const uint32_t* data_adr, const SimpleTIM& file);
|
||||
State create(const uint32_t* data_adr, const TIM& file);
|
||||
State create(const uint32_t* data_adr, const VAG& file);
|
||||
|
||||
State create_custom(const uint32_t* data_adr, const CDFileType_t& file_type, const CDFile::Payload& payload);
|
||||
|
@@ -10,6 +10,7 @@ namespace JabyEngine {
|
||||
enum struct CDFileType : CDFileType_t {
|
||||
CopyTo = 0,
|
||||
SimpleTIM,
|
||||
SonyTIM,
|
||||
SonyVAG,
|
||||
Custom,
|
||||
};
|
||||
@@ -20,6 +21,7 @@ namespace JabyEngine {
|
||||
RawPayload_t raw;
|
||||
CopyTo copy_to;
|
||||
SimpleTIM simple_tim;
|
||||
TIM tim;
|
||||
VAG vag;
|
||||
Overlay overlay;
|
||||
};
|
||||
@@ -49,6 +51,10 @@ namespace JabyEngine {
|
||||
return CDFile{.rel_lba_idx = rel_lba_idx, .type = CDFileType::SimpleTIM, .payload = {.simple_tim = simple_tim}};
|
||||
}
|
||||
|
||||
static constexpr CDFile sony_tim(uint8_t rel_lba_idx, TIM tim) {
|
||||
return CDFile{.rel_lba_idx = rel_lba_idx, .type = CDFileType::SonyTIM, .payload = {.tim = tim}};
|
||||
}
|
||||
|
||||
static constexpr CDFile sony_vag(uint8_t lba_idx, VAG vag) {
|
||||
return CDFile{.rel_lba_idx = lba_idx, .type = CDFileType::SonyVAG, .payload = {.vag = vag}};
|
||||
}
|
||||
|
@@ -65,6 +65,14 @@ namespace JabyEngine {
|
||||
}
|
||||
};
|
||||
|
||||
struct TIM {
|
||||
uint32_t zero;
|
||||
|
||||
static constexpr TIM create() {
|
||||
return TIM{.zero = 0};
|
||||
}
|
||||
};
|
||||
|
||||
struct VAG {
|
||||
uint8_t voice_number;
|
||||
SPU::SimpleVolume inital_stereo_vol;
|
||||
|
Reference in New Issue
Block a user