Modding/Burnout Paradise/Memory map: Difference between revisions

Remove BaseEventReceiverQueue (always nullptr in executable, not documented here)
(Created page.)
 
(Remove BaseEventReceiverQueue (always nullptr in executable, not documented here))
 
(4 intermediate revisions by the same user not shown)
Line 1:
[[File:Burnout Paradise Resource Memory Debug crop.png|thumb|400px|Memory usage by collision resources in the OpenWorldPhy pool. Displayed using a debug menu in [[Burnout Paradise (2008-01-3130 build)]].]]
Burnout Paradise uses the constant <code>KAC_BINARY_MEMORY_MAP</code> for memory management. When modding, it may be necessary to increase the size of the memory pools listed in the memory map. This has been the case in the past when repairing partially corrupt development builds and was necessary when the Canary Island mod's development was stalled due to the collision resources exceeding the size of the OpenWorldPhy/OWPhysics pool.
 
Line 9:
The memory map is located in the game's executable. Searching for "Root Bank" and subtracting 0x40 from its start offset will place the cursor at the beginning of the [[#CgsMemory::MemoryMap|memory map structure]]. From here, go to the pools offset (all offsets are relative to the start of the map), find the [[#CgsMemory::MemoryMapPool|pool structure]] with the name "OpenWorldPhy", and change the main memory base resource size to the minimum amount that will satisfy your needs for the foreseeable future. Note the difference between the new and old sizes.
 
Because the OpenWorldPhy bank is a child of the OpenWorld bank, the OpenWorld bank needs to be edited as well. Go to the banks offset and find the [[#CgsMemory::MemoryMapBank|bank structure]] with the name "OpenWorld". Take the size difference you noted earlier, align it to 0x20000, and add it to the main memory base resource size. Divide this size by 0x20000 and replace the number of banksblocks with the result. Save and run the game. '''Note: Sizes must be a multiple of the number of banks.'''
 
= Structures =
Line 156:
| 0x34 || 0x4 || uint32_t || muMaxImports || Max number of imports that can be held ||
|-
| 0x38 || 0x18 || [[#CgsResource::Entry::ResourceDescriptor|ResourceDescriptor]] || mDescriptor || Pool descriptor || See [[#Small resource typesCgsResource::ESmallResourceMemType|small resource typesESmallResourceMemType]]
|-
| 0x50 || 0xC || uint32_t[3] || mauMaxResources || Max number of resources per small resource type || See [[#Small resource typesCgsResource::ESmallResourceMemType|small resource typesESmallResourceMemType]]
|-
| 0x5C || 0x4 || int32_t || miNumDependencies || Number of dependencies ||
Line 175:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || [[#CgsModule::BaseEventReceiverQueue|BaseEventReceiverQueue]]* || mpUser || User requesting|| theNot event ||documented here
|-
| 0x4 || 0x4 || int32_t || miEventId || ID ||
|-
| 0x8 || 0x4 || int32_t || miPoolId || Pool ID ||
|}
 
=== CgsModule::BaseEventReceiverQueue ===
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || RwChar* || mpcData || ||
|-
| 0x4 || 0x4 || int32_t || miBufferWritePos || ||
|-
| 0x8 || 0x4 || int32_t || miLength || ||
|-
| 0xc || 0x4 || int32_t || miFirstEventOffset || ||
|-
| 0x10 || 0x4 || int32_t || miBufferSize || ||
|-
| 0x14 || 0x4 || int32_t || miAlignment || ||
|}
 
Line 260 ⟶ 243:
|}
 
==== PC, PC (Remastered) ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
Line 286 ⟶ 269:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || [[#CgsModule::BaseEventReceiverQueue|BaseEventReceiverQueue]]* || mpUser || User requesting|| theNot event ||documented here
|-
| 0x4 || 0x4 || int32_t || mnEventId || Event ID ||
Line 378 ⟶ 361:
|}
 
=== CgsResource::ESmallResourceMemType ===
= Base resource types =
==== PlayStation 3 ====
{| class="wikitable"
! Name !! IndexValue !! Comments
|-
| main memoryE_MEMTYPE_MAINMEMORY || 0 ||
|-
| E_MEMTYPE_GRAPHICS_SYSTEM || 1 ||
| disposable || 1
|-
| E_MEMTYPE_GRAPHICS_LOCAL || 2 ||
| uninitialized || 2
|-
| E_MEMTYPE_NUMTYPES || 3 ||
| disposable uninitialized || 3
|}
 
==== Xbox 360 ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| graphicsE_MEMTYPE_MAINMEMORY system|| 0 || 4
|-
| graphics? local|| 1 || 5PHYSICAL
|-
| ? || 2 || DUMMY
|-
| E_MEMTYPE_NUMTYPES || 3 ||
|}
 
==== XboxPC, 360Remastered ====
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_MEMTYPE_MAINMEMORY || 0
|-
| ? || 1 || DISPOSABLE
|-
| ? || 2 || DUMMY
|-
| E_MEMTYPE_NUMTYPES || 3 ||
|}
 
= Base resource types =
==== PlayStation 3 ====
{| class="wikitable"
! Name !! Index
Line 413 ⟶ 419:
|}
 
==== PC,Xbox Remastered360 ====
{| class="wikitable"
! Name !! Index
Line 428 ⟶ 434:
|}
 
==== PC, Remastered ====
= Small resource types =
==== PlayStation 3 ====
{| class="wikitable"
! Name !! Index
|-
| MAINmain memory || 0
|-
| GRAPHICS_SYSTEMdisposable || 1
|-
| GRAPHICS_LOCALuninitialized || 2
|}
 
==== Xbox 360 ====
{| class="wikitable"
! Name !! Index
|-
| disposable uninitialized || 13
| MAIN || 0
|-
| PHYSICAL || 1
|-
| DUMMY || 2
|}
 
==== PC, Remastered ====
{| class="wikitable"
! Name !! Index
|-
| MAIN || 0
|-
| DISPOSABLE || 1
|-
| DUMMY || 2
|}