Skip to content

Remove known memory types and alignments from output #2

Description

@burninrubber0

YAP is currently set up to output resources as follows. The key is the resource ID, the type is a resource type ID, and the alignment refers to the per memory type alignment after being loaded into memory.

resources:
  0xdd03acf5:
    type: 0x0
    secondaryMemoryType: 2
    alignment:
      - 0x4
      - 0x80
  0xe289d7f4:
    type: 0x21
    alignment:
      - 0x10

This system was put in place specifically to ensure that non-retail builds, including ones that aren't in our hands yet, would be supported regardless of any changes that may have been made regarding memory types and resource alignments. However, the downside is that it requires the user to have knowledge of memory types and alignments. Even if this can come from other resource metadata and the wiki, it's not ideal.

The ideal file looks like this instead (with the ID as a value rather than a key, in part to aid in #1):

resources:
  - id: 0xdd03acf5
    type: 0x0
  - id: 0xe289d7f4
    type: 0x21

Based on limited research, I believe this could be achieved while still maintaining support for the aforementioned potential differences by:

  1. Tying the (default) secondary memory type to the bundle platform (and perhaps resource type, though it'd only apply to PS3 shaders),
  2. Tying the (default) alignment(s) to the resource type (on a per-platform basis, as alignment changes between platforms), and
  3. Outputting any differing secondary memory types or alignments to distinct files.

This should result in retail files having the simpler output shown above, while any differences will be retained.

The per-platform, per-resource-type alignments will need dumping using a standalone tool to confirm they're really the same between all resources of the same type. smilingfrog conducted similar research in 2017, so I'm fairly confident this will work out favorably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions