forked from tsuki/openroller
350 lines
6.3 KiB
Plaintext
350 lines
6.3 KiB
Plaintext
// Common
|
|
using string8 = std::string::SizedString<u8> [[format("string_formatter8")]];
|
|
using string16 = std::string::SizedString<u16> [[format("string_formatter16")]];
|
|
fn string_formatter8(ref string8 s) {
|
|
return std::format("\"{:s}\"", s);
|
|
};
|
|
fn string_formatter16(ref string16 s) {
|
|
return std::format("\"{:s}\"", s);
|
|
};
|
|
struct color {
|
|
u8 r;
|
|
u8 g;
|
|
u8 b;
|
|
u8 a;
|
|
} [[format("color_formatter")]];
|
|
fn color_formatter(ref color c) {
|
|
return std::format("#{:02x}{:02x}{:02x}{:02x}", c.r, c.g, c.b, c.a);
|
|
};
|
|
struct fcolor {
|
|
float r;
|
|
float g;
|
|
float b;
|
|
float a;
|
|
};
|
|
|
|
// Header
|
|
struct Header {
|
|
u32 stageCfg;
|
|
u32 trackDrawDist;
|
|
u32 track;
|
|
u32 notes;
|
|
u32 camera;
|
|
u32 particles;
|
|
u32 visualizer;
|
|
u32 unk1;
|
|
u32 colors;
|
|
u32 objects;
|
|
u32 unk2;
|
|
u32 colors2;
|
|
u32 unk3;
|
|
};
|
|
|
|
// Stage Config
|
|
struct BpmChange {
|
|
u32 timeMs;
|
|
u32 bpm;
|
|
} [[single_color]];
|
|
struct NoteTimingEntry {
|
|
u32 timeMs;
|
|
u32 mode;
|
|
float value;
|
|
} [[single_color]];
|
|
struct NoteTimingList {
|
|
u16 size;
|
|
NoteTimingEntry entries[size];
|
|
} [[single_color]];
|
|
struct StageConfig {
|
|
float endTime1;
|
|
float endTime2;
|
|
float outroTime;
|
|
u16 bpmChangeSz [[hidden]];
|
|
BpmChange bpmChanges[bpmChangeSz];
|
|
NoteTimingList noteTimings[4];
|
|
|
|
string16 chartName;
|
|
string16 chartName2;
|
|
string16 bgmName;
|
|
string16 shotName;
|
|
|
|
float backwardsDrawDist;
|
|
float forwardDrawDist;
|
|
color trackAheadColor;
|
|
color trackBehindColor;
|
|
u8 audioOffset;
|
|
float visualOffset;
|
|
color unk;
|
|
};
|
|
|
|
// Track Draw Distance
|
|
struct DrawDistance {
|
|
u32 timeMs;
|
|
float distance;
|
|
} [[single_color]];
|
|
struct TrackDrawDist {
|
|
u32 sz;
|
|
DrawDistance points[sz];
|
|
};
|
|
|
|
// Track
|
|
struct TrackPiece {
|
|
u32 timeMs;
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} [[single_color]];
|
|
struct TrackPieceArray {
|
|
u32 sz;
|
|
TrackPiece pieces[sz];
|
|
};
|
|
|
|
// Notes
|
|
enum NoteType : u8 {
|
|
NONE = 0,
|
|
NORMAL = 1,
|
|
FLICK = 2,
|
|
HOLD = 3,
|
|
SCRATCH = 4,
|
|
BEAT = 5,
|
|
MERRY_GO_ROUND = 6,
|
|
HIDDEN = 7,
|
|
HIDDEN2 = 8,
|
|
CRITICAL = 9,
|
|
SLIDE_HOLD = 10,
|
|
SLIDE_COUNTER = 11,
|
|
TURN = 12,
|
|
SPIN = 13,
|
|
FINISH = 14,
|
|
DUAL_HOLD = 15,
|
|
};
|
|
struct Note {
|
|
u32 timeMs;
|
|
NoteType type;
|
|
u8 typeOverride;
|
|
s16 params16[9];
|
|
u8 flag24;
|
|
float params25[3];
|
|
u8 flag37;
|
|
u8 flag38;
|
|
float params39[4];
|
|
u32 params55[3];
|
|
float param67;
|
|
u32 param71;
|
|
float params75[5];
|
|
u32 param95;
|
|
} [[single_color]];
|
|
struct NoteArray {
|
|
u32 namesSz;
|
|
string8 names[namesSz];
|
|
u32 sz;
|
|
Note entries[sz];
|
|
};
|
|
|
|
// Camera
|
|
struct Camera {
|
|
u32 timeMs;
|
|
u8 aMode;
|
|
u8 fMode;
|
|
float dist;
|
|
float rotationA[2];
|
|
float originOff[3];
|
|
u8 projType;
|
|
float fieldFar[3];
|
|
float fieldNear[3];
|
|
float rotationB[1];
|
|
} [[single_color]];
|
|
struct CameraArray {
|
|
u32 sz;
|
|
Camera points[sz];
|
|
};
|
|
|
|
// Particles
|
|
struct Particle {
|
|
u32 timeMs;
|
|
u32 unk;
|
|
u32 shape;
|
|
u32 texture;
|
|
color color;
|
|
float velocity[3];
|
|
float repeatMeasure;
|
|
float lifespanMeasure;
|
|
u32 groupShapeSize;
|
|
} [[single_color]];
|
|
struct ParticleArray {
|
|
u32 sz;
|
|
Particle particles[sz];
|
|
};
|
|
|
|
// Visualizer
|
|
struct Visualizer {
|
|
u32 timeMs;
|
|
u32 type;
|
|
color color;
|
|
} [[same_color]];
|
|
struct VisualizerArray {
|
|
u32 sz;
|
|
Visualizer entries[sz];
|
|
};
|
|
|
|
// Background Images
|
|
struct BackgroundImage {
|
|
u32 timeMs;
|
|
u32 mode;
|
|
u32 atlasIndex;
|
|
s32 textureIndex;
|
|
color color;
|
|
} [[same_color]];
|
|
struct BackgroundImageArray {
|
|
u32 textureCount;
|
|
string8 textureNames[textureCount];
|
|
u32 sz;
|
|
BackgroundImage entries[sz];
|
|
};
|
|
|
|
// Color Table 1
|
|
struct ColorTable {
|
|
u32 timeMs;
|
|
color topRight;
|
|
color topLeft;
|
|
color bottomRight;
|
|
color bottomLeft;
|
|
bool fadeOut;
|
|
bool fadeIn;
|
|
} [[same_color]];
|
|
struct ColorTableArray {
|
|
u32 sz;
|
|
ColorTable entries[sz];
|
|
};
|
|
|
|
// Objects
|
|
struct Visibility {
|
|
u32 timeMs;
|
|
bool fadeOut;
|
|
bool fadeIn;
|
|
bool visible;
|
|
};
|
|
struct VisibilityArray {
|
|
u32 sz;
|
|
Visibility entries[sz];
|
|
};
|
|
struct Movement {
|
|
u32 timeMs;
|
|
bool tweenTowards;
|
|
bool tweenAway;
|
|
float pos[3];
|
|
};
|
|
struct MovementArray {
|
|
u32 sz;
|
|
Movement entries[sz];
|
|
};
|
|
struct Scaling {
|
|
u32 timeMs;
|
|
bool tweenTowards;
|
|
bool tweenAway;
|
|
float scale[3];
|
|
};
|
|
struct ScalingArray {
|
|
u32 sz;
|
|
Scaling entries[sz];
|
|
};
|
|
struct Rotation {
|
|
u32 timeMs;
|
|
bool tweenTowards;
|
|
bool tweenAway;
|
|
float rotation[3];
|
|
};
|
|
struct RotationArray {
|
|
u32 sz;
|
|
Rotation entries[sz];
|
|
};
|
|
struct ColorChange {
|
|
u32 timeMs;
|
|
bool tweenTowards;
|
|
bool tweenAway;
|
|
color new;
|
|
};
|
|
struct ColorChangeArray {
|
|
u32 sz;
|
|
ColorChange entries[sz];
|
|
};
|
|
struct Object {
|
|
u32 model;
|
|
u32 fs;
|
|
bool wireframe;
|
|
bool flashing;
|
|
bool unk;
|
|
float position[3];
|
|
float scale[3];
|
|
float rotation[3];
|
|
fcolor color;
|
|
float unk2[3];
|
|
|
|
VisibilityArray vis;
|
|
MovementArray mov;
|
|
ScalingArray scaling;
|
|
RotationArray rotations;
|
|
ColorChangeArray colorChanges;
|
|
} [[same_color]];
|
|
struct ObjectArray {
|
|
u32 namesSz;
|
|
string8 names[namesSz];
|
|
u32 names2Sz;
|
|
string8 names2[names2Sz];
|
|
u32 sz;
|
|
Object entries[sz];
|
|
};
|
|
|
|
// Color Table 2
|
|
struct ColorTable2Entry1 {
|
|
color color;
|
|
u8 unk;
|
|
};
|
|
struct ColorTable2Entry2 {
|
|
bool visible;
|
|
color center;
|
|
color top;
|
|
color bottom;
|
|
color left;
|
|
color right;
|
|
};
|
|
struct ColorTable2Entry4 {
|
|
u8 unk;
|
|
color color;
|
|
float unk2;
|
|
u8 unk3;
|
|
u8 unk4;
|
|
};
|
|
struct ColorTable2Array {
|
|
u32 off1; // after offsets
|
|
u32 off2; // after arr1
|
|
u32 off3; // after arr2
|
|
u32 off4; // after arr3
|
|
u32 off5; // after arr4
|
|
|
|
u32 sz1;
|
|
ColorTable2Entry1 arr1[sz1];
|
|
|
|
u32 sz2;
|
|
ColorTable2Entry2 arr2[sz2];
|
|
|
|
u32 sz3;
|
|
u16 arr3[sz3];
|
|
|
|
u32 sz4;
|
|
ColorTable2Entry4 arr4[sz4];
|
|
};
|
|
|
|
Header hdr @ 0x00;
|
|
StageConfig cfg @ hdr.stageCfg;
|
|
TrackDrawDist trackDrawDist @ hdr.trackDrawDist;
|
|
TrackPieceArray track @ hdr.track;
|
|
NoteArray notes @ hdr.notes;
|
|
CameraArray camera @ hdr.camera;
|
|
ParticleArray particles @ hdr.particles;
|
|
VisualizerArray visualizer @ hdr.visualizer;
|
|
BackgroundImageArray backgroundImages @ hdr.unk1;
|
|
ColorTableArray colorTable @ hdr.colors;
|
|
ObjectArray objects @ hdr.objects;
|
|
// Header word 11 points to offset slot 2, one word into this table.
|
|
ColorTable2Array colorTable2 @ hdr.colors2 - 4;
|