benilla-re systems structs docs

LcdTreeInsert

function · ui · primitive

Address
0x72b9a0 · 412 bytes, up to 0x72bb3b
Signature
uint32_t __thiscall (void *this, int32_t key, void **slot)
Meaning
Inserts a key into the element tree, rebalancing, and answers whether the height grew
Confidence
inferred
Finding
ui/lcd#the-element-tree

Finding: The element tree in ui: the keyboard LCD

The element tree at 0xcf0638 is an AVL tree of nodes with the key at +0x0, the children at +0x4 and +0x8 and the balance at +0xc. 0x72b9a0(key, slot) inserts a node, recursing to a child slot, rebalancing on the way back and answering whether the height grew; 0x72bd20 erases one, and 0x72c030(slot, side) and 0x72c0a0(slot, side) are its single and double rotations. 0x72bb40(n) resizes the array of 0x50-byte records at 0xcf063c (the notice ring and its neighbours) to n, reallocating with SMemReAlloc under the tag 0x874074. 0x72b8d0 initialises an object pool (block size 0x10, an empty list) and 0x72b8f0 takes a record from it, clearing its fields when the pool is not flagged.

The derivation is in the doc.

Callers 2

Callees 3

Calls and jumps by a bare address, from tables/calls.tsv.