Bundle (original): Difference between revisions

m
Memory address comments
(Updated with new information.)
m (Memory address comments)
 
(2 intermediate revisions by 2 users not shown)
Line 8:
Separate data chunks are used to define what memory type resources are loaded into. These chunks are platform specific (see [[#Base resource types|base resource types]]). Keep these in mind when viewing the structures.
 
Resources always have data in Main Memory. If the resource is split, headers are loaded into Main Memory, while the other portion is typically loaded into into Graphics Local on PS3 and Physical on Xbox 360. '''In resource documentation, these will be simplified to a "secondary" type.''' Resources only ever have primary and secondary portions. On PS3, some resources' secondary portion may be loaded into Graphics System; in that case, it will be listed separately.
 
Keep these in mind when viewing the structures.
 
= Structures =
Line 26 ⟶ 24:
| 0xC || 0x30 || [[#rw::ResourceDescriptor|ResourceDescriptor]][6] || mBundleResourceDescriptor || Size and alignment of each chunk ||
|-
| 0x3C || 0x18 || [[#rw::Resource|Resource]][6] || mAllocatedResource || Memory address of each chunk || Set at runtime
|-
| 0x54 || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset || List of [[Resource ID|resource IDs]]
|-
| 0x58 || 0x4 || uint32_t || mResourceEntriesOffset || Resource entries offset || See [[#CgsResource::Bundle::ResourceEntry|ResourceEntry]]
Line 51 ⟶ 49:
| 0xC || 0x28 || [[#rw::ResourceDescriptor|ResourceDescriptor]][5] || mBundleResourceDescriptor || Size and alignment of each chunk ||
|-
| 0x34 || 0x14 || [[#rw::Resource|Resource]][5] || mAllocatedResource || Memory address of each chunk || Set at runtime
|-
| 0x48 || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset || List of [[Resource ID|resource IDs]]
|-
| 0x4C || 0x4 || uint32_t || mResourceEntriesOffset || Resource entries offset || See [[#CgsResource::Bundle::ResourceEntry|ResourceEntry]]
Line 76 ⟶ 74:
| 0xC || 0x20 || [[#rw::ResourceDescriptor|ResourceDescriptor]][4] || mBundleResourceDescriptor || Size and alignment of each chunk ||
|-
| 0x2C || 0x10 || [[#rw::Resource|Resource]][4] || mAllocatedResource || Memory address of each chunk || Set at runtime
|-
| 0x3C || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset || List of [[Resource ID|resource IDs]]
|-
| 0x40 || 0x4 || uint32_t || mResourceEntriesOffset || Resource entries offset || See [[#CgsResource::Bundle::ResourceEntry|ResourceEntry]]
Line 168 ⟶ 166:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || mpResource || Resource data memory address || Set at runtime
|-
| 0x4 || 0x4 || [[#CgsResource::Bundle::ImportTable|ImportTable]]* || mpImportTable || Bundle imports offset ||
Line 178 ⟶ 176:
| 0x3C || 0x30 || [[#rw::ResourceDescriptor|ResourceDescriptor]][6] || mSerialisedOffsetResourceDescriptor || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x6C || 0x18 || [[#rw::Resource|Resource]][6] || mSerialisedResource || Memory addresses || SwappedSet endianat runtime
|}
 
Line 185 ⟶ 183:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || mpResource || Resource data memory address || Set at runtime
|-
| 0x4 || 0x4 || [[#CgsResource::Bundle::ImportTable|ImportTable]]* || mpImportTable || Bundle imports offset ||
Line 195 ⟶ 193:
| 0x34 || 0x28 || [[#rw::ResourceDescriptor|ResourceDescriptor]][5] || mSerialisedOffsetResourceDescriptor || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x5C || 0x14 || [[#rw::Resource|Resource]][5] || mSerialisedResource || Memory addresses || SwappedSet endianat runtime
|}
 
Line 202 ⟶ 200:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || mpResource || Resource data memory address || Set at runtime
|-
| 0x4 || 0x4 || [[#CgsResource::Bundle::ImportTable|ImportTable]]* || mpImportTable || Bundle imports offset ||
Line 212 ⟶ 210:
| 0x2C || 0x20 || [[#rw::ResourceDescriptor|ResourceDescriptor]][4] || mSerialisedOffsetResourceDescriptor || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x4C || 0x10 || [[#rw::Resource|Resource]][4] || mSerialisedResource || Memory addresses || SwappedSet endianat runtime
|}