Skip to content

Ensure every segmented address uses a segment table lookup #62

Description

@RevoSucks

Every access of this kind will need to use the segmented_to_virtual method lookup.

This method is used in mario 64 to do the translation:

void *segmented_to_virtual(void *addr)
{
    u32 segment = (u32)addr >> 24;
    u32 offset = (u32)addr & 0x00FFFFFF;

    return (void *)((sSegmentTable[segment] + offset) | 0x80000000);
}

JP: sSegmentTable: 8033a090
US: sSegmentTable: 8033b400

Addresses such as 0x07023C38 (segmented address of a painting struct in Inside Castle level data) will need a translation to actual address via this method before reading.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions