Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uint32 BASE_SIZE = 0x2000;
- local uint32 gfx_ofs = 0;
- void CSeek(uint32 offset) {
- FSeek((offset & 0xFFFFFFF) + 0x10);
- }
- void CSeekElem(uint32 offset, uint32 stride, uint32 elem) {
- FSeek((offset & 0xFFFFFFF) + 0x10 + (stride * elem));
- }
- void GSeek(uint32 offset) {
- FSeek((offset & 0xFFFFFFF) + gfx_ofs + 0x10);
- }
- void GSeekElem(uint32 offset, uint32 stride, uint32 elem) {
- FSeek((offset & 0xFFFFFFF) + gfx_ofs + 0x10 + (stride * elem));
- }
- uint32 get_part_size(uint32 flags) {
- local uint32 new_base_size = BASE_SIZE << (int)(flags & 0xf);
- local int size = (int)((((flags >> 17) & 0x7f) + (((flags >> 11) & 0x3f) << 1) + (((flags >> 7) & 0xf) << 2) + (((flags >> 5) & 0x3) << 3) + (((flags >> 4) & 0x1) << 4)) * new_base_size);
- local int i = 0;
- for (i = 0; i < 4; ++i) {
- size += (((flags >> (24 + i)) & 1) == 1) ? (new_base_size >> (1 + i)) : 0;
- }
- return size;
- }
- BigEndian();
- struct {
- uint32 magic;
- uint32 version;
- uint32 sys_flags;
- uint32 gfx_flags;
- gfx_ofs = get_part_size(sys_flags);
- local int CPUBLOCKSTART = 0x10;
- struct {
- struct {
- uint32 VTable;
- uint32 cpu_addr;
- uint32 unknown[2];
- struct {
- uint32 addr;
- uint32 flag;
- } unk_ptr_tbl[7]; // I've only looked at the [4]th entry in here - section table
- uint32 unknown2[7];
- } header;
- struct {
- struct {
- CSeek(header.unk_ptr_tbl[4].addr);
- struct {
- uint32 type; // 0xCE501483 = INST
- uint32 size;
- uint32 offset;
- uint32 null; // always 0x11113333
- } sections[3];
- } sec_hdr;
- CSeek(sec_hdr.sections[0].offset);
- struct {
- struct {
- uint32 unk[8];
- struct {
- float x,y,z;
- // Below seems to be a flag of some kind. 0x7FC00001 in the samples I looked at.
- // This value is also repeated in the unknown 92 bytes of section 1.
- uint32 flag;
- } loc[4];
- } unk;
- } sec0;
- CSeek(sec_hdr.sections[1].offset); // Static objects
- struct {
- local int i = 0;
- local uint32 num_entries = sec_hdr.sections[1].size / 0x70;
- CSeekElem(sec_hdr.sections[1].offset, 0x70, i);
- struct {
- uint32 null;
- uint32 hash;
- float x, y, z;
- char unknown[92]; // Potentially useful stuff in here
- } obj_inst[num_entries];
- } sec1;
- CSeek(sec_hdr.sections[2].offset); // Whats this?
- struct {
- struct {
- uint32 unk[8];
- } obj;
- } sec2;
- } sec;
- } xmap;
- } RSC7;
Advertisement
Add Comment
Please, Sign In to add comment