Bundle 2/Need for Speed Most Wanted: Difference between revisions

Updated descriptions, added game changer info, and corrected memory types (added per-platform types)
(Remove UniqueId (moved to common data types))
(Updated descriptions, added game changer info, and corrected memory types (added per-platform types))
(3 intermediate revisions by 2 users not shown)
Line 2:
 
= Memory types =
Across all Bundle versions, a common theme is the use of separateSeparate data chunks are used to define what memory type resources are loaded into. These chunks are asplatform follows:specific (see [[#EMemoryType|EMemoryType]]). Keep these in mind when viewing the structures.
# Main Memory
# Graphics System
# Graphics Local
# Disposable
 
Keep these in mind when viewing the specs below.
 
= Structures =
Line 15 ⟶ 9:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || char[4] || macMagicNumber || MagicBundle magic || bnd2
|-
| 0x4 || 0x2 || uint16_t || muVersion || FormatBundle version || 5
|-
| 0x6 || 0x2 || uint16_t || muPlatform || Platform the bundle is built for || See [[#Platform|Platform]]
|-
| 0x8 || 0x4 || uint32_t || muDebugDataOffset || ResourceStringTableBundle debug data offset || ResourceStringTable XML
|-
| 0xC || 0x4 || uint32_t || muResourceEntriesCount || Number of entriesresources in the bundle ||
|-
| 0x10 || 0x4 || uint32_t || muResourceEntriesOffset || Resource entries offset || Sorted by stream index first, resource ID second.
|-
| 0x14 || 0x10 || uint32_t[4] || mauResourceDataOffset || OffsetsPer-memory fortype chunksresource 1-4data offsets ||
|-
| 0x24 || 0x4 || uint32_t || muFlags || Bundle flags || See [[#CgsResource::BundleV2::eBundleFlags|eBundleFlags]]
Line 39 ⟶ 33:
 
=== CgsResource::BundleV2::ResourceEntry ===
Entries are sorted sequentially by, from highest to lowest level:
# Stream offset
# Index from ID (if Game Changer)
# Resource type from ID (if Game Changer)
# ID type
# Resource ID (lower 32 bits)
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x8 || [[#CgsResource::ID|ID]] || mResourceId || UniqueIdResource or name CRC32ID || If UniqueId, starts with 01. Hashed names are all lowercase.
|-
| 0x8 || 0x10 || uint32_t[4] || mauUncompressedSizeAndAlignment || FilePer-memory sizestype (uncompressed)resource for chunks 1-4sizes || Has high nibble for alignment; changes between platforms<br>1 << [nibble] equals the memory alignment value"
|-
| 0x18 || 0x10 || uint32_t[4] || mauSizeAndAlignmentOnDisk || FilePer-memory sizestype (compressed) forresource chunks 1-4sizes ||
|-
| 0x28 || 0x10 || uint32_t[4] || mauDiskOffset || FilePer-memory offsetstype forresource chunks 1-4offsets || Relative to the start of the respective memory type's data offset
|-
| 0x38 || 0x4 || uint32_t || muImportOffset || Imports offset ||
|-
| 0x3C || 0x4 || uint32_t || muResourceTypeId || FileResource type || See [[Resource Types (Need for Speed)|resource types]]
|-
| 0x40 || 0x2 || uint16_t || muImportCount || Number of imports ||
|-
| 0x42 || 0x1 || uint8_t || muFlags || FlagsResource flags || Unused?
|-
| 0x43 || 0x1 || uint8_t || muStreamOffset || Stream index || Per-filebundle. Refer to macStreamName
|-
| 0x44 || 0x4 || || || paddingPadding ||
|}
 
=== CgsResource::BundleV2::ImportEntry ===
Import entries are appended to the resource data.
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x8 || [[#CgsResource::ID|ID]] || mResourceId || UniqueIdImported orresource name CRC32ID || ImportEntries are appended to the end of internal files.
|-
| 0x8 || 0x4 || uint32_t || muImportTypeAndOffset || Offset of the pointer to be set at runtime || See [[#CgsResource::BundleV2::eImportType|import type]]
|-
| 0xC || 0x4 || || || paddingPadding ||
|}
 
Line 78 ⟶ 81:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x8 || [[#CgsResource::ID::CHash|CHash]] || mHash || Resource ID || TypeID type stored in highest at8 0x0bits, ID atin 0x4lowest 32 bits. See [[#CgsResource::ID::EIdType|ID type]] for type info
|}
 
=== Game Changer ID ===
This is a specific type of ID which is not an explicitly defined structure, but stores extra information in the high bits of the ID.
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x1 || [[#CgsResource::ID::EIdType|EIdType]] || || ID type || See [[#CgsResource::ID::EIdType|ID type]]
|-
| 0x1 || 0x1 || uint8_t || || Index ||
|-
| 0x2 || 0x2 || uint16_t || || Resource type ID || See [[Resource Types (Need for Speed)|resource types]]<br>Does not always match the entry's muResourceTypeId field
|-
| 0x4 || 0x4 || uint32_t || || Resource ID/Game changer ID || ID tracked by the game database. See [[UniqueId]]
|}
 
Line 94 ⟶ 112:
! Name !! Value !! Comments
|-
| ?KU_BUNDLE_PLATFORM_PC || 1 || PC
|-
| ?KU_BUNDLE_PLATFORM_PS3 || 2 || PlayStation 3
|-
| ?KU_BUNDLE_PLATFORM_X360 || 3 || Xbox 360
|-
| ? || 4 || PlayStation Vita
|-
| ? || 5 || Wii U
|}
 
Line 113 ⟶ 135:
| E_FLAGS_NON_ASYNCH_FIXUP_REQUIRED || 0x4 ||
|-
| E_FLAGS_MULTISTREAM_BUNDLE || 0x8 || More than one stream is used (graphics, sound, etc)
|-
| E_FLAGS_DELTA_BUNDLE || 0x10 || Contains additions to a base bundle
Line 130 ⟶ 152:
 
=== CgsResource::ID::EIdType ===
{{todo|These are from Most Wanted's symbols and need to be verified in Hot Pursuit.}}
{| class="wikitable"
! Name !! Value !! Comments
Line 136 ⟶ 157:
| E_ID_TYPE_NORMAL || 0x0 || Lowercase resource name CRC32 hash
|-
| E_ID_TYPE_GAMECHANGER || 0x1 || See [[UniqueId#Game Changer ID|Game Changer ID]]
|-
| E_ID_TYPE_RESOURCE_LIST || 0x80 ||
|-
| E_ID_TYPE_DELTA_BUNDLE || 0xC0 || Additions to a base bundleresource
|}
 
=== EMemoryType ===
==== PlayStation 3, PlayStation Vita ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_MEMTYPE_MAIN || 0 ||
|-
| E_MEMTYPE_GRAPHICS_SYSTEM || 1 ||
|-
| E_MEMTYPE_GRAPHICS_LOCAL || 2 ||
|-
| E_MEMTYPE_DISPOSABLE || 3 ||
|-
| E_MEMTYPE_NUMTYPES || 4 ||
|}
 
==== Xbox 360 ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_MEMTYPE_MAIN || 0 ||
|-
| E_MEMTYPE_PHYSICAL? || 1 || PHYSICAL
|-
| E_MEMTYPE_DISPOSABLE || 2 ||
|-
| ? || 3 || DUMMY
|-
| E_MEMTYPE_NUMTYPES || 4 ||
|}
 
==== PC ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_MEMTYPE_MAIN || 0 ||
|-
| E_MEMTYPE_DISPOSABLE || 1 ||
|-
| ? || 2 || DUMMY
|-
| ? || 3 || DUMMY
|-
| E_MEMTYPE_NUMTYPES || 4 ||
|}
 
==== Wii U ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_MEMTYPE_MAIN || 0 ||
|-
| ? || 1 || MEM1
|-
| ? || 2 || GRAPHICS_MEM2
|-
| E_MEMTYPE_DISPOSABLE || 3 ||
|-
| E_MEMTYPE_NUMTYPES || 4 ||
|}