Skip to content

[Feature] DaedalusSymbol: Expose OffsetAsMember and ClassSize for instance addressing #24

Description

@JaXt0r

When Ikarus scripts allocate a struct with MEM_Alloc and access its fields through a transient instance, each field's byte position within the allocation must be computed. This requires two symbol metadata values that are available in the C++ API but not yet exposed in the C# wrapper.

Reference OpenGothic (directmemory.cpp):

void memory_instance::set_int(const zenkit::DaedalusSymbol& sym, uint16_t index, int32_t value) {
    ptr32_t addr = address
                 + ptr32_t(sym.offset_as_member()) // 1.
                 + ptr32_t(index * sym.class_size());  // 2.
    owner.mem32.writeInt(addr, value);
}

Requested C# API:

  • DaedalusSymbol.OffsetAsMember
  • DaedalusSymbol.ClassSize

Activity

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

Metadata

Metadata

Assignees

Labels

awaiting verificationThe problem has been fixed, though external verification of this fix is requiredenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions