From 416dba821bd6e9c9f588d1aa21a19d8aef2cc003 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Wed, 30 Sep 2026 11:37:58 +0000 Subject: [PATCH] KPAD data 7712/8032; odh, BS2Mach closer (worker 3e273fb5) --- README.md | 2 +- libs/RVL_SDK/src/kpad/KPAD.c | 618 +++++++++--------- src/BS2/BS2Mach.c | 18 +- src/system/odh.cpp | 241 ++++--- .../decomp-assist/sol-high-round2.attempts.md | 299 +++++++++ 5 files changed, 731 insertions(+), 447 deletions(-) create mode 100644 tools/decomp-assist/sol-high-round2.attempts.md diff --git a/README.md b/README.md index e435a2b0..b4ff464a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Progress | Decompiled | Matched | Linked | Data | |:---:|:---:|:---:|:---:| -| 96.63% | 83.04% | 58.19% | 89.47% | +| 96.64% | 83.04% | 58.19% | 89.89% | units 777/1027 complete, functions 11993/12563 matched. diff --git a/libs/RVL_SDK/src/kpad/KPAD.c b/libs/RVL_SDK/src/kpad/KPAD.c index 26f8c0bd..52341e71 100644 --- a/libs/RVL_SDK/src/kpad/KPAD.c +++ b/libs/RVL_SDK/src/kpad/KPAD.c @@ -170,6 +170,23 @@ static void KPADiSamplingCallback(s32 chan); static void KPADiControlDpdCallback(s32 chan, s32 result); static void calc_dpd_variable(KPADInside* kpad, s8 valid); +static void* get_ring_buffer_by_kpad1_style(s32 chan, void* buffer, s32 style); + +void* KPADGetWPADRingBuffer(s32 chan) { + static u8 status[0x2A0]; + return get_ring_buffer_by_kpad1_style(chan, status, 0); +} + +void* KPADGetWPADFSRingBuffer(s32 chan) { + static u8 status[0x320]; + return get_ring_buffer_by_kpad1_style(chan, status, 1); +} + +void* KPADGetWPADCLRingBuffer(s32 chan) { + static u8 status[0x360]; + return get_ring_buffer_by_kpad1_style(chan, status, 2); +} + static void* get_ring_buffer_by_kpad1_style(s32 chan, void* buffer, s32 style) { KPADInside* kpad = &inside_kpads[chan]; u32 i; @@ -233,21 +250,6 @@ process: return buffer; } -void* KPADGetWPADRingBuffer(s32 chan) { - static u8 status[0x2A0]; - return get_ring_buffer_by_kpad1_style(chan, status, 0); -} - -void* KPADGetWPADFSRingBuffer(s32 chan) { - static u8 status[0x320]; - return get_ring_buffer_by_kpad1_style(chan, status, 1); -} - -void* KPADGetWPADCLRingBuffer(s32 chan) { - static u8 status[0x360]; - return get_ring_buffer_by_kpad1_style(chan, status, 2); -} - void KPADSetBtnRepeat(s32 chan, f32 delay, f32 pulse) { KPADInside* kpad = &inside_kpads[chan]; if (pulse) { @@ -269,6 +271,126 @@ void KPADSetPosParam(s32 chan, f32 x, f32 y) { kpad->posParamY = y; } +static void reset_kpad(KPADInside* kpad) { + f32 distanceValue; + f32 sensorDistance; + Vec acceleration; + KPADDPDObject* object; + sensorDistance = kpad->referenceDistance; + kpad->flag51D = 0; + kpad->value4F4 = -1.0f + kp_err_outside_frame; + kpad->value4FC = 1.0f - kp_err_outside_frame; + kpad->value4F8 = -0.75f + kp_err_outside_frame; + kpad->value500 = 0.75f - kp_err_outside_frame; + kpad->value504 = 1.0f / kp_err_dist_speed; + kpad->value508 = -1.0f / kp_err_dist_speed; + kpad->value50C = kp_ah_circle_radius * kp_ah_circle_radius; + kpad->value514 = kp_err_dist_min; + distanceValue = kp_dist_vv1 / sensorDistance; + kpad->value510 = kp_dist_vv1; + kpad->status.release = 0; + kpad->status.trig = 0; + kpad->status.hold = 0; + kpad->repeatCount = 0; + kpad->repeatCount2 = kpad->repeatDelay; + kpad->status.dpd_valid_fg = 0; + kpad->value4CA = 0; + kpad->horizonAxisX = 1.0f; + kpad->horizonAxisY = 0.0f; + kpad->status.vec = Vec2_0; + kpad->status.pos = Vec2_0; + kpad->status.speed = 0.0f; + kpad->dpdAxisX = 1.0f; + kpad->status.horizon.x = 1.0f; + kpad->dpdAxisY = 0.0f; + kpad->status.horizon.y = 0.0f; + kpad->status.hori_speed = 0.0f; + kpad->status.acc.z = 0.0f; + kpad->status.acc.x = 0.0f; + + kpad->status.acc.y = -1.0f; + kpad->status.hori_vec = Vec2_0; + kpad->status.dist_speed = 0.0f; + kpad->status.acc_vertical.x = 1.0f; + kpad->status.acc_vertical.y = 0.0f; + kpad->status.dist = sensorDistance; + kpad->status.dist_vec = 0.0f; + kpad->dpdReferenceDistance = sensorDistance; + kpad->dpdObjectScale = distanceValue; + kpad->dpdObjectDistance = distanceValue; + kpad->dpdObjectDirectionX = kpad->horizonTangentX; + kpad->dpdObjectDirectionY = kpad->horizonTangentY; + kpad->status.acc_value = 1.0f; + kpad->status.acc_speed = 0.0f; + acceleration = kpad->status.acc; + memcpy(&kpad->accelerationX, &acceleration, sizeof(acceleration)); + *(u32*)&kpad->horizonCircleX = *(u32*)&kpad->horizonAxisX; + *(u32*)&kpad->horizonCircleY = *(u32*)&kpad->horizonAxisY; + kpad->horizonCircleCount = kp_ah_circle_ct; + kpad->dpdCount = 0; + object = &kpad->dpdState.objects[4]; + do { + --object; + object->metadata.bytes.flags = 0xFF; + } while (object != kpad->dpdState.objects); + object = &kpad->dpdState.candidates[2]; + do { + --object; + object->metadata.bytes.flags = 0xFF; + } while (object != kpad->dpdState.candidates); + kpad->ringCount = 0; + kpad->flag51E = 1; +} + +void KPADGetProjectionPos(Vec2* dest, Vec2* src, const Rect* rect, f32 scale) { + f64 scaled; + f32 height = rect->bottom - rect->top; + f32 halfHeight = height * 0.5f; + f32 x = src->x * halfHeight; + f32 y = src->y * halfHeight; + x *= 1.2f; + y *= 1.2f; + scaled = 0.908 * scale; + dest->y = y; + dest->x = (f32)(x * scaled); +} + +void KPADSetSensorHeight(s32 chan, f32 sensorHeight) { + KPADInside* kpad; + f32 halfHeight; + f32 barOffsetX; + f32 barDiagonal; + f32 halfWidthSquared; + f32 halfWidth; + f32 negativeSensorHeight; + f32 barDiagonalSquared; + f32 halfHeightSquared; + halfWidth = 1.0f; + kpad = &inside_kpads[chan]; + halfHeight = 0.75f; + negativeSensorHeight = -sensorHeight; + halfWidthSquared = halfWidth * halfWidth; + halfHeightSquared = halfHeight * halfHeight; + kpad->sensorBarCenterX = 0.0f; + kpad->sensorBarCenterY = negativeSensorHeight; + barDiagonalSquared = halfWidthSquared + halfHeightSquared; + barDiagonal = (f32)sqrt(barDiagonalSquared); + barOffsetX = kpad->sensorBarCenterX; + if (barOffsetX < 0.0f) { + halfWidth += barOffsetX; + } else { + halfWidth -= barOffsetX; + } + negativeSensorHeight = kpad->sensorBarCenterY; + if (negativeSensorHeight < 0.0f) { + halfHeight += negativeSensorHeight; + } else { + halfHeight -= negativeSensorHeight; + } + halfWidth = halfWidth < halfHeight ? halfWidth : halfHeight; + kpad->sensorBarScale = barDiagonal / halfWidth; +} + static void calc_button_repeat(KPADInside* kpad, u8 extension, s32 elapsed) { u16 count; u16 threshold; @@ -456,9 +578,7 @@ static void read_kpad_acc(KPADInside* kpad, KPADSample* status) { f32 delta; f32 magnitude; f32 blend; - f32 currentX; - f32 currentY; - f32 currentZ; + Vec current; f32 limit; limit = kp_rm_acc_max; target = (f32)-(s32)status->accX * kpad->value4DC; @@ -532,14 +652,14 @@ static void read_kpad_acc(KPADInside* kpad, KPADSample* status) { blend *= blend; } kpad->status.acc.z = previous.z + blend * kpad->valueA0 * delta; - currentX = kpad->status.acc.x; - currentY = kpad->status.acc.y; - currentZ = kpad->status.acc.z; - kpad->status.acc_value = (f32)sqrt(currentX * currentX + (currentY * currentY + currentZ * currentZ)); - delta = currentX - previous.x; - currentX = currentY - previous.y; - currentY = currentZ - previous.z; - kpad->status.acc_speed = (f32)sqrt(delta * delta + (currentX * currentX + currentY * currentY)); + current.x = kpad->status.acc.x; + current.y = kpad->status.acc.y; + current.z = kpad->status.acc.z; + kpad->status.acc_value = (f32)sqrt(current.x * current.x + (current.y * current.y + current.z * current.z)); + delta = current.x - previous.x; + current.x = current.y - previous.y; + current.y = current.z - previous.z; + kpad->status.acc_speed = (f32)sqrt(delta * delta + (current.x * current.x + current.y * current.y)); calc_acc_horizon(kpad); calc_acc_vertical(kpad); } @@ -556,9 +676,7 @@ static void read_kpad_acc(KPADInside* kpad, KPADSample* status) { f32 delta; f32 magnitude; f32 blend; - f32 currentX; - f32 currentY; - f32 currentZ; + Vec current; f32 limit; values[0] = (f32)-(s32)status->extension.fs.accX * kpad->value4E8; limit = kp_fs_acc_max; @@ -627,14 +745,14 @@ static void read_kpad_acc(KPADInside* kpad, KPADSample* status) { blend *= blend; } kpad->status.ex_status.fs.acc.z = previous.z + blend * kpad->valueA0 * delta; - currentX = kpad->status.ex_status.fs.acc.x; - currentY = kpad->status.ex_status.fs.acc.y; - currentZ = kpad->status.ex_status.fs.acc.z; - kpad->status.ex_status.fs.acc_value = (f32)sqrt(currentX * currentX + (currentY * currentY + currentZ * currentZ)); - delta = currentX - previous.x; - currentX = currentY - previous.y; - currentY = currentZ - previous.z; - kpad->status.ex_status.fs.acc_speed = (f32)sqrt(delta * delta + (currentX * currentX + currentY * currentY)); + current.x = kpad->status.ex_status.fs.acc.x; + current.y = kpad->status.ex_status.fs.acc.y; + current.z = kpad->status.ex_status.fs.acc.z; + kpad->status.ex_status.fs.acc_value = (f32)sqrt(current.x * current.x + (current.y * current.y + current.z * current.z)); + delta = current.x - previous.x; + current.x = current.y - previous.y; + current.y = current.z - previous.z; + kpad->status.ex_status.fs.acc_speed = (f32)sqrt(delta * delta + (current.x * current.x + current.y * current.y)); } } @@ -768,12 +886,8 @@ static s8 select_2obj_continue(KPADInside* kpad) { if (best == 2.0f) { return 0; } - ((u32*)&kpad->dpdState.candidates[0].x)[0] = ((u32*)first)[0]; - ((u32*)&kpad->dpdState.candidates[0].x)[1] = ((u32*)first)[1]; - ((u32*)&kpad->dpdState.candidates[0].x)[2] = ((u32*)first)[2]; - ((u32*)&kpad->dpdState.candidates[1].x)[0] = ((u32*)second)[0]; - ((u32*)&kpad->dpdState.candidates[1].x)[1] = ((u32*)second)[1]; - ((u32*)&kpad->dpdState.candidates[1].x)[2] = ((u32*)second)[2]; + kpad->dpdState.candidates[0] = *first; + kpad->dpdState.candidates[1] = *second; return 2; } @@ -793,36 +907,32 @@ static s8 select_1obj_first(KPADInside* kpad) { if ((s8)object->metadata.bytes.flags == 0) { f32 x = object->x; f32 y = object->y; - f32 left = x - offsetX; - f32 bottom = y - offsetY; - f32 right = x + offsetX; - f32 top = y + offsetY; - f32 leftBound = kpad->value4F4; - f32 rightBound = kpad->value4FC; - f32 topBound = kpad->value4F8; - f32 bottomBound = kpad->value500; - if (left <= leftBound || left >= rightBound || bottom <= topBound || bottom >= bottomBound) { - if (right > leftBound && right < rightBound && top > topBound && top < bottomBound) { + Vec2 leftPosition; + Vec2 rightPosition; + leftPosition.x = x - offsetX; + leftPosition.y = y - offsetY; + rightPosition.x = x + offsetX; + rightPosition.y = y + offsetY; + if (leftPosition.x <= kpad->value4F4 || leftPosition.x >= kpad->value4FC || leftPosition.y <= kpad->value4F8 || leftPosition.y >= kpad->value500) { + if (rightPosition.x > kpad->value4F4 && rightPosition.x < kpad->value4FC && rightPosition.y > kpad->value4F8 && rightPosition.y < kpad->value500) { u32* objectWords = (u32*)object; u32* statusWords = (u32*)&kpad->dpdState.candidates[1].x; statusWords[0] = objectWords[0]; statusWords[1] = objectWords[1]; statusWords[2] = objectWords[2]; - kpad->dpdState.candidates[0].x = left; - kpad->dpdState.candidates[0].y = bottom; - *(u32*)&kpad->dpdState.candidates[0].metadata.value = 0; + memcpy(&kpad->dpdState.candidates[0].x, &leftPosition, sizeof(leftPosition)); + kpad->dpdState.candidates[0].metadata.bytes.flags = 0; kpad->dpdState.candidates[0].metadata.bytes.status = 0xFF; return -1; } - } else if (right <= leftBound || right >= rightBound || top <= topBound || top >= bottomBound) { + } else if (rightPosition.x <= kpad->value4F4 || rightPosition.x >= kpad->value4FC || rightPosition.y <= kpad->value4F8 || rightPosition.y >= kpad->value500) { u32* objectWords = (u32*)object; u32* statusWords = (u32*)&kpad->dpdState.candidates[0]; statusWords[0] = objectWords[0]; statusWords[1] = objectWords[1]; statusWords[2] = objectWords[2]; - kpad->dpdState.candidates[1].x = right; - kpad->dpdState.candidates[1].y = top; - *(u32*)&kpad->dpdState.candidates[1].metadata.value = 0; + memcpy(&kpad->dpdState.candidates[1].x, &rightPosition, sizeof(rightPosition)); + kpad->dpdState.candidates[1].metadata.bytes.flags = 0; kpad->dpdState.candidates[1].metadata.bytes.status = 0xFF; return -1; } @@ -872,8 +982,12 @@ static s8 select_1obj_continue(KPADInside* kpad) { f32 directionX; f32 directionY; f32 offsetY; - directionX = horizontal + axisY * normY; - directionY = vertical - axisX * normY; + f32 tangentY; + f32 tangentX; + tangentY = axisY * normY; + tangentX = axisX * normY; + directionX = horizontal + tangentY; + directionY = vertical - tangentX; offsetX = distance * directionX; kpad->dpdObjectDirectionX = directionX; offsetY = distance * directionY; @@ -896,6 +1010,112 @@ static s8 select_1obj_continue(KPADInside* kpad) { return 1; } +static void calc_dpd_variable(KPADInside* kpad, s8 valid) { + if (valid == 0) { + kpad->status.dpd_valid_fg = 0; + return; + } + { + f32 x = kpad->horizonTangentX * kpad->dpdObjectDirectionX + kpad->horizonTangentY * kpad->dpdObjectDirectionY; + f32 y = kpad->horizonTangentY * kpad->dpdObjectDirectionX - kpad->horizonTangentX * kpad->dpdObjectDirectionY; + if (kpad->status.dpd_valid_fg == 0) { + kpad->status.horizon.x = x; + kpad->status.horizon.y = y; + kpad->status.hori_vec = Vec2_0; + kpad->status.hori_speed = 0.0f; + } else { + f32 dx = x - kpad->status.horizon.x; + f32 dy = y - kpad->status.horizon.y; + f32 length = (f32)sqrt(dx * dx + dy * dy); + f32 amount; + if (length >= kpad->value8C) { + amount = 1.0f; + } else { + amount = length / kpad->value8C; + amount *= amount; + amount *= amount; + } + amount *= kpad->value90; + x = kpad->status.horizon.x + amount * dx; + y = kpad->status.horizon.y + amount * dy; + length = (f32)sqrt(x * x + y * y); + x /= length; + y /= length; + kpad->status.hori_vec.x = x - kpad->status.horizon.x; + kpad->status.hori_vec.y = y - kpad->status.horizon.y; + kpad->status.horizon.x = x; + kpad->status.horizon.y = y; + kpad->status.hori_speed = (f32)sqrt(kpad->status.hori_vec.x * kpad->status.hori_vec.x + kpad->status.hori_vec.y * kpad->status.hori_vec.y); + } + } + { + f32 value = kpad->value510 / kpad->dpdObjectDistance; + if (kpad->status.dpd_valid_fg == 0) { + kpad->status.dist = value; + kpad->status.dist_vec = 0.0f; + kpad->status.dist_speed = 0.0f; + } else { + f32 dx = value - kpad->status.dist; + f32 magnitude = dx; + f32 amount; + f32 next; + if (magnitude < 0.0f) { + magnitude = -magnitude; + } + if (magnitude >= kpad->value94) { + amount = 1.0f; + } else { + amount = magnitude / kpad->value94; + amount *= amount; + amount *= amount; + } + next = amount * kpad->value98 * dx; + kpad->status.dist_vec = next; + if (next < 0.0f) { + kpad->status.dist_speed = -next; + } else { + kpad->status.dist_speed = next; + } + kpad->status.dist += kpad->status.dist_vec; + } + } + { + f32 rotatedX = kpad->dpdObjectDirectionX * kpad->horizonTangentX + kpad->dpdObjectDirectionY * kpad->horizonTangentY; + f32 rotatedY = -kpad->dpdObjectDirectionY * kpad->horizonTangentX + kpad->dpdObjectDirectionX * kpad->horizonTangentY; + f32 scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); + f32 scaleY = 0.5f * (kpad->dpdState.candidates[0].y + kpad->dpdState.candidates[1].y); + f32 pointX = kpad->sensorBarScale * (kpad->sensorBarCenterX - (rotatedX * scaleX - rotatedY * scaleY)); + f32 pointY = kpad->sensorBarScale * (kpad->sensorBarCenterY - (rotatedY * scaleX + rotatedX * scaleY)); + Vec2 point; + point.x = -kpad->accelNormalY * pointX + kpad->accelNormalX * pointY; + point.y = -kpad->accelNormalX * pointX - kpad->accelNormalY * pointY; + if (kpad->status.dpd_valid_fg == 0) { + kpad->status.pos = point; + kpad->status.vec = Vec2_0; + kpad->status.speed = 0.0f; + } else { + f32 dx = point.x - kpad->status.pos.x; + f32 dy = point.y - kpad->status.pos.y; + f32 length = (f32)sqrt(dx * dx + dy * dy); + f32 amount; + if (length >= kpad->posParamX) { + amount = 1.0f; + } else { + amount = length / kpad->posParamX; + amount *= amount; + amount *= amount; + } + amount *= kpad->posParamY; + kpad->status.vec.x = amount * dx; + kpad->status.vec.y = amount * dy; + kpad->status.speed = (f32)sqrt(kpad->status.vec.x * kpad->status.vec.x + kpad->status.vec.y * kpad->status.vec.y); + kpad->status.pos.x += kpad->status.vec.x; + kpad->status.pos.y += kpad->status.vec.y; + } + } + kpad->status.dpd_valid_fg = valid; +} + static void read_kpad_dpd(KPADInside* kpad, KPADSample* status) { KPADDPDObject* objects = kpad->dpdState.objects; u8 format = status->dataFormat; @@ -913,11 +1133,11 @@ static void read_kpad_dpd(KPADInside* kpad, KPADSample* status) { } else { object->metadata.bytes.flags = 0xFF; } - if (object == objects) { + source--; + object--; + if (object < objects) { break; } - object--; - source--; } } else { object = objects + 3; @@ -1160,250 +1380,6 @@ static void read_kpad_stick(KPADInside* kpad, KPADSample* status) { } } -static void reset_kpad(KPADInside* kpad) { - f32 distanceValue; - f32 sensorDistance; - u32* words; - KPADDPDObject* object; - sensorDistance = kpad->referenceDistance; - kpad->flag51D = 0; - kpad->value4F4 = -1.0f + kp_err_outside_frame; - kpad->value4FC = 1.0f - kp_err_outside_frame; - kpad->value4F8 = -0.75f + kp_err_outside_frame; - kpad->value500 = 0.75f - kp_err_outside_frame; - kpad->value504 = 1.0f / kp_err_dist_speed; - kpad->value508 = -1.0f / kp_err_dist_speed; - kpad->value50C = kp_ah_circle_radius * kp_ah_circle_radius; - kpad->value514 = kp_err_dist_min; - distanceValue = kp_dist_vv1 / sensorDistance; - kpad->value510 = kp_dist_vv1; - kpad->status.release = 0; - kpad->status.trig = 0; - kpad->status.hold = 0; - kpad->repeatCount = 0; - kpad->repeatCount2 = kpad->repeatDelay; - kpad->status.dpd_valid_fg = 0; - kpad->value4CA = 0; - kpad->horizonAxisX = 1.0f; - kpad->horizonAxisY = 0.0f; - kpad->status.vec = Vec2_0; - kpad->status.pos = Vec2_0; - kpad->status.speed = 0.0f; - kpad->dpdAxisX = 1.0f; - kpad->status.horizon.x = 1.0f; - kpad->dpdAxisY = 0.0f; - kpad->status.horizon.y = 0.0f; - kpad->status.hori_speed = 0.0f; - kpad->status.acc.z = 0.0f; - kpad->status.acc.x = 0.0f; - words = (u32*)&kpad->status.acc; - kpad->status.acc.y = -1.0f; - kpad->status.hori_vec = Vec2_0; - kpad->status.dist_speed = 0.0f; - kpad->status.acc_vertical.x = 1.0f; - kpad->status.acc_vertical.y = 0.0f; - kpad->status.dist = sensorDistance; - kpad->status.dist_vec = 0.0f; - kpad->dpdReferenceDistance = sensorDistance; - kpad->dpdObjectScale = distanceValue; - kpad->dpdObjectDistance = distanceValue; - kpad->dpdObjectDirectionX = kpad->horizonTangentX; - kpad->dpdObjectDirectionY = kpad->horizonTangentY; - kpad->status.acc_value = 1.0f; - kpad->status.acc_speed = 0.0f; - *(u32*)&kpad->accelerationX = words[0]; - *(u32*)&kpad->accelerationY = words[1]; - *(u32*)&kpad->accelerationZ = words[2]; - *(u32*)&kpad->horizonCircleX = *(u32*)&kpad->horizonAxisX; - *(u32*)&kpad->horizonCircleY = *(u32*)&kpad->horizonAxisY; - kpad->horizonCircleCount = kp_ah_circle_ct; - kpad->dpdCount = 0; - object = &kpad->dpdState.objects[4]; - do { - --object; - object->metadata.bytes.flags = 0xFF; - } while (object != kpad->dpdState.objects); - object = &kpad->dpdState.candidates[2]; - do { - --object; - object->metadata.bytes.flags = 0xFF; - } while (object != kpad->dpdState.candidates); - kpad->ringCount = 0; - kpad->flag51E = 1; -} - -void KPADGetProjectionPos(Vec2* dest, Vec2* src, const Rect* rect, f32 scale) { - f64 scaled; - f32 height = rect->bottom - rect->top; - f32 halfHeight = height * 0.5f; - f32 x = src->x * halfHeight; - f32 y = src->y * halfHeight; - x *= 1.2f; - y *= 1.2f; - scaled = 0.908 * scale; - dest->y = y; - dest->x = (f32)(x * scaled); -} - -void KPADSetSensorHeight(s32 chan, f32 sensorHeight) { - KPADInside* kpad; - f32 halfHeight; - f32 halfWidth; - f32 negativeSensorHeight; - f32 halfWidthSquared; - f32 halfHeightSquared; - f32 barDiagonalSquared; - f32 barOffsetX; - f32 barDiagonal; - halfWidth = 1.0f; - kpad = &inside_kpads[chan]; - halfHeight = 0.75f; - negativeSensorHeight = -sensorHeight; - halfWidthSquared = halfWidth * halfWidth; - halfHeightSquared = halfHeight * halfHeight; - kpad->sensorBarCenterX = 0.0f; - kpad->sensorBarCenterY = negativeSensorHeight; - barDiagonalSquared = halfWidthSquared + halfHeightSquared; - barDiagonal = (f32)sqrt(barDiagonalSquared); - barOffsetX = kpad->sensorBarCenterX; - if (barOffsetX < 0.0f) { - halfWidth = halfWidth + barOffsetX; - } else { - halfWidth = halfWidth - barOffsetX; - } - negativeSensorHeight = kpad->sensorBarCenterY; - if (negativeSensorHeight < 0.0f) { - halfHeight = halfHeight + negativeSensorHeight; - } else { - halfHeight = halfHeight - negativeSensorHeight; - } - if (halfWidth >= halfHeight) { - halfWidth = halfHeight; - } - kpad->sensorBarScale = barDiagonal / halfWidth; -} - -static void calc_dpd_variable(KPADInside* kpad, s8 valid) { - if (valid == 0) { - kpad->status.dpd_valid_fg = 0; - return; - } - { - f32 x = kpad->horizonTangentX * kpad->dpdObjectDirectionX + kpad->horizonTangentY * kpad->dpdObjectDirectionY; - f32 y = kpad->horizonTangentY * kpad->dpdObjectDirectionX - kpad->horizonTangentX * kpad->dpdObjectDirectionY; - if (kpad->status.dpd_valid_fg == 0) { - kpad->status.horizon.x = x; - kpad->status.horizon.y = y; - kpad->status.hori_vec = Vec2_0; - kpad->status.hori_speed = 0.0f; - } else { - f32 dx = x - kpad->status.horizon.x; - f32 dy = y - kpad->status.horizon.y; - f32 length = (f32)sqrt(dx * dx + dy * dy); - f32 amount; - if (length >= kpad->value8C) { - amount = 1.0f; - } else { - amount = length / kpad->value8C; - amount *= amount; - amount *= amount; - } - amount *= kpad->value90; - x = kpad->status.horizon.x + amount * dx; - y = kpad->status.horizon.y + amount * dy; - length = (f32)sqrt(x * x + y * y); - x /= length; - y /= length; - kpad->status.hori_vec.x = x - kpad->status.horizon.x; - kpad->status.hori_vec.y = y - kpad->status.horizon.y; - kpad->status.horizon.x = x; - kpad->status.horizon.y = y; - kpad->status.hori_speed = (f32)sqrt(kpad->status.hori_vec.x * kpad->status.hori_vec.x + kpad->status.hori_vec.y * kpad->status.hori_vec.y); - } - } - { - f32 value = kpad->value510 / kpad->dpdObjectDistance; - if (kpad->status.dpd_valid_fg == 0) { - kpad->status.dist = value; - kpad->status.dist_vec = 0.0f; - kpad->status.dist_speed = 0.0f; - } else { - f32 dx = value - kpad->status.dist; - f32 magnitude = dx; - f32 amount; - f32 next; - if (magnitude < 0.0f) { - magnitude = -magnitude; - } - if (magnitude >= kpad->value94) { - amount = 1.0f; - } else { - amount = magnitude / kpad->value94; - amount *= amount; - amount *= amount; - } - next = amount * kpad->value98 * dx; - kpad->status.dist_vec = next; - if (next < 0.0f) { - kpad->status.dist_speed = -next; - } else { - kpad->status.dist_speed = next; - } - kpad->status.dist += kpad->status.dist_vec; - } - } - { - f32 rotatedX = kpad->dpdObjectDirectionX * kpad->horizonTangentX + kpad->dpdObjectDirectionY * kpad->horizonTangentY; - f32 rotatedY = -kpad->dpdObjectDirectionY * kpad->horizonTangentX + kpad->dpdObjectDirectionX * kpad->horizonTangentY; - f32 scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x); - f32 scaleY = 0.5f * (kpad->dpdState.candidates[0].y + kpad->dpdState.candidates[1].y); - f32 pointX = kpad->sensorBarScale * (kpad->sensorBarCenterX - (rotatedX * scaleX - rotatedY * scaleY)); - f32 pointY = kpad->sensorBarScale * (kpad->sensorBarCenterY - (rotatedY * scaleX + rotatedX * scaleY)); - f32 x = -kpad->accelNormalY * pointX + kpad->accelNormalX * pointY; - f32 y = -kpad->accelNormalX * pointX - kpad->accelNormalY * pointY; - if (kpad->status.dpd_valid_fg == 0) { - kpad->status.pos.x = x; - kpad->status.pos.y = y; - kpad->status.vec = Vec2_0; - kpad->status.speed = 0.0f; - } else { - f32 dx = x - kpad->status.pos.x; - f32 dy = y - kpad->status.pos.y; - f32 length = (f32)sqrt(dx * dx + dy * dy); - f32 amount; - if (length >= kpad->posParamX) { - amount = 1.0f; - } else { - amount = length / kpad->posParamX; - amount *= amount; - amount *= amount; - } - amount *= kpad->posParamY; - kpad->status.vec.x = amount * dx; - kpad->status.vec.y = amount * dy; - kpad->status.speed = (f32)sqrt(kpad->status.vec.x * kpad->status.vec.x + kpad->status.vec.y * kpad->status.vec.y); - kpad->status.pos.x += kpad->status.vec.x; - kpad->status.pos.y += kpad->status.vec.y; - } - } - kpad->status.dpd_valid_fg = valid; -} - -void KPADDisableDPD(s32 chan) { - inside_kpads[chan].dpdEnable = 0; -} - -void KPADEnableDPD(s32 chan) { - inside_kpads[chan].dpdEnable = 1; -} - -void KPADSetControlDpdCallback(s32 chan, KPADCallback* callback) { - BOOL enabled; - enabled = OSDisableInterrupts(); - inside_kpads[chan].dpdCallback = (KPADCallback)callback; - OSRestoreInterrupts(enabled); -} - s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) { KPADInside* kpad = &inside_kpads[chan]; s32 probe; @@ -1436,7 +1412,7 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) { kpad->samplingInProgress = 1; probe = WPADProbe(chan, 0); if (probe == -1 && kpad->dpdCallback != 0 && kpad->dpdCallbackFired != 0 && kpad->dpdCallbackPending == 0) { - if (kpad->dpdCallback == 0) { + if (kpad->dpdCallback != 0 && kpad->dpdCallbackPending == 0) { kpad->dpdCallbackPending = 1; kpad->dpdCallback(chan, 1); kpad->dpdCallbackFired = 0; @@ -1606,12 +1582,12 @@ void KPADInit(void) { BOOL enabled; WPADInit(); memset(inside_kpads, 0, 0x14A0); - matrix = initial_rotation_matrix; chan = 0; one = 1.0f; zero = 0.0f; degreesToRadians = 0.017453292f; kp_err_dist_max = one + (f32)WPADGetDpdSensitivity(); + matrix = initial_rotation_matrix; kpad = inside_kpads; do { kpad->dpdEnable = 1; @@ -1640,10 +1616,7 @@ void KPADInit(void) { } else { adjustedHeight = referenceHeight - distanceValue; } - if (adjustedWidth < adjustedHeight) { - } else { - adjustedWidth = adjustedHeight; - } + adjustedWidth = adjustedWidth < adjustedHeight ? adjustedWidth : adjustedHeight; matrix[0] = one; matrix[1] = zero; matrix[2] = zero; @@ -1710,6 +1683,21 @@ void KPADInit(void) { OSRegisterVersion(__KPADVersion); } +void KPADDisableDPD(s32 chan) { + inside_kpads[chan].dpdEnable = 0; +} + +void KPADEnableDPD(s32 chan) { + inside_kpads[chan].dpdEnable = 1; +} + +void KPADSetControlDpdCallback(s32 chan, KPADCallback* callback) { + BOOL enabled; + enabled = OSDisableInterrupts(); + inside_kpads[chan].dpdCallback = (KPADCallback)callback; + OSRestoreInterrupts(enabled); +} + static void KPADiSamplingCallback(s32 chan) { KPADInside* kpad = &inside_kpads[chan]; u32 device; diff --git a/src/BS2/BS2Mach.c b/src/BS2/BS2Mach.c index 02b1b400..10109158 100644 --- a/src/BS2/BS2Mach.c +++ b/src/BS2/BS2Mach.c @@ -894,7 +894,7 @@ void BS2StartGCGame() { counterBias = SCGetCounterBias(); seconds = rtc + counterBias; timerFrequency = OS_BUS_CLOCK >> 2; - time = (OSTime)timerFrequency * seconds; + time = (OSTime)seconds * timerFrequency; __OSSetTime(time); sram = __OSLockSram(); @@ -1076,12 +1076,12 @@ void BS2NANDDivideCallback(s32 result, NANDCommandBlock *block) { } void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) { - NandFile = info; - NandBuffer = (u8 *)buffer; - NandLength = length; - NandTransferred = 0; NandCompletion = callback; NandOperation = 2; + NandLength = length; + NandTransferred = 0; + NandFile = info; + NandBuffer = (u8 *)buffer; if (NandLength > 0x40000) { BS2Report("NANDReadAsync buf:0x%08X, length:0x%08X\n", NandBuffer, 0x40000); NANDReadAsync(NandFile, (void *)NandBuffer, 0x40000, BS2NANDDivideCallback, block); @@ -1092,12 +1092,12 @@ void BS2NANDDivideReadAsync(NANDFileInfo *info, void *buffer, u32 length, NANDCa } void BS2NANDDivideWriteAsync(NANDFileInfo *info, const void *buffer, u32 length, NANDCallback callback, NANDCommandBlock *block) { - NandFile = info; - NandBuffer = (u8 *)buffer; - NandLength = length; - NandTransferred = 0; NandCompletion = callback; NandOperation = 1; + NandLength = length; + NandTransferred = 0; + NandFile = info; + NandBuffer = (u8 *)buffer; if (NandLength > 0x40000) { BS2Report("NANDWriteAsync buf:0x%08X, length:0x%08X\n", NandBuffer, 0x40000); NANDWriteAsync(NandFile, (void *)NandBuffer, 0x40000, BS2NANDDivideCallback, block); diff --git a/src/system/odh.cpp b/src/system/odh.cpp index 94f4a743..ce7b2688 100644 --- a/src/system/odh.cpp +++ b/src/system/odh.cpp @@ -895,7 +895,7 @@ s32 CArGBAOdh::cdj_c_flashBuffer(SArCDJ_OdhMaster* master) { void CArGBAOdh::cdj_c_setQuantizationTable(SArCDJ_OdhMaster* master, u32 qualityScale) { u8 scaledQuantization[128]; u32 tablePass = 0; - int tableOffset = 0; + u32 tableOffset = 0; do { for (int i = 0; i < 0x40; i++) { @@ -918,14 +918,12 @@ void CArGBAOdh::cdj_c_setQuantizationTable(SArCDJ_OdhMaster* master, u32 quality const u16* scales = (const u16*)gArAANScales; do { int scaleIndex = 0; - u32* destination = master->quantizationTables + tableOffset / 4; u8* quantizationRow = scaledQuantization + scaledTableOffset; for (int i = 0; i < 0x40; i++) { u32 scale = scales[scaleIndex]; u8 coefficient = quantizationRow[i]; - *destination = 0x4000000 / (scale * (u32)coefficient); + master->quantizationTables[tablePass * 64 + i] = 0x4000000 / (scale * (u32)coefficient); scaleIndex++; - destination++; } tablePass = tablePass + 1; tableOffset = tableOffset + 0x100; @@ -933,6 +931,16 @@ void CArGBAOdh::cdj_c_setQuantizationTable(SArCDJ_OdhMaster* master, u32 quality } while (tablePass < 2); } +void CArGBAOdh::cdj_c_makeHeader(SArCDJ_OdhMaster* master, u32 size) { + master->data[0] = 'A'; + master->data[1] = 'J'; + master->data[2] = 'P'; + master->data[3] = 'G'; + *(u32*)&master->data[4] = master->width | (u32)master->height << 11 | (u32)master->quality << 24; + *(u32*)&master->data[8] = size; + *(u32*)&master->data[12] = 0; +} + s32 CArGBAOdh::cdj_c_colorConv(SArCDJ_OdhMaster* master, u8* sourceData, int format) { u16* dimensions = (u16*)&master->width; u16 width = *dimensions; @@ -1363,7 +1371,7 @@ s32 CArGBAOdh::cdj_d_initializeDecompressOdh(SArCDJ_OdhMaster* master, u8* workB } s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int workSize) { - int sourceLimit = srcSize; + u32 sourceLimit = srcSize; int workBufferSize = workSize; u8 xSampling; @@ -1372,14 +1380,12 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w int blockRowStride; int rowStride; int blockStride; - u32 decoderAddress; int statusOrOffset; u16 blockX; int planeOffset; int blockRowSize; int naturalIndex; - decoderAddress = (u32)this; blockWidth = master->blocksWide; blockRowSize = (u32)blockWidth * 0x38; rowStride = (u32)blockWidth << 3; @@ -1388,8 +1394,8 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w do { xSampling = master->xSampling; if ((xSampling == 1U) && (master->ySampling == 1U)) { - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); master->chrominanceRequest.bitstream = master->luminanceRequest.bitstream; master->chrominanceRequest.bytesConsumed = master->luminanceRequest.bytesConsumed; if (statusOrOffset != 0) return statusOrOffset; @@ -1402,13 +1408,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w (u32)master->blockX * 8; if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + statusOrOffset, rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],1,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 1, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1420,13 +1426,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w (u32)master->blockX * 8); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],2,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 2, sourceLimit); master->luminanceRequest.bitstream = master->chrominanceRequest.bitstream; master->luminanceRequest.bytesConsumed = master->chrominanceRequest.bytesConsumed; if (statusOrOffset != 0) return statusOrOffset; @@ -1440,15 +1446,15 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); } else if ((xSampling == 2U) && (master->ySampling == 1U)) { - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1459,13 +1465,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide * 2; if (planeOffset + blockRowStride + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + planeOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + planeOffset ,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); master->chrominanceRequest.bitstream = master->luminanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1475,13 +1481,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w } if (planeOffset + blockRowStride + 0x10 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients, - planeOffset + (int)master->workBuffer + 8,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],1,sourceLimit); + idct_fast + (range_limit,master->quantizationTables,master->coefficients, + planeOffset + master->workBuffer + 8,blockStride); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 1, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1493,13 +1499,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w (u32)master->blocksHigh * ((u32)master->blocksWide << 7); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],2,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 2, sourceLimit); master->luminanceRequest.bitstream = master->chrominanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1512,15 +1518,15 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); } else if ((xSampling == 1U) && (master->ySampling == 2U)) { - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1531,13 +1537,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide * 2; if (planeOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + planeOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + planeOffset ,rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); master->chrominanceRequest.bitstream = master->luminanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1548,13 +1554,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w planeOffset = planeOffset + (u32)master->blocksWide * 0x40; if (planeOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + planeOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + planeOffset ,rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],1,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 1, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1566,13 +1572,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],2,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 2, sourceLimit); master->luminanceRequest.bitstream = master->chrominanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1585,15 +1591,15 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); } else if ((xSampling == 2U) && (master->ySampling == 2U)) { - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1604,13 +1610,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide * 4; if (planeOffset + blockRowStride + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + planeOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + planeOffset ,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1621,13 +1627,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w planeOffset = nextOffset; if (nextOffset + blockRowStride + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + nextOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + nextOffset ,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1637,13 +1643,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w planeOffset = planeOffset + (u32)master->blocksWide * 0x80 + -8; if (planeOffset + blockRowStride + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients,(int)master->workBuffer + planeOffset + idct_fast + (range_limit,master->quantizationTables,master->coefficients,master->workBuffer + planeOffset ,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->luminanceRequest,(u32)&hufftreePtr,0,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->luminanceRequest, (u16**)hufftreePtr.tables, 0, sourceLimit); master->chrominanceRequest.bitstream = master->luminanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1653,13 +1659,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w } if (planeOffset + blockRowStride + 0x10 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)master->quantizationTables,(u32)master->coefficients, - planeOffset + (int)master->workBuffer + 8,blockStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],1,sourceLimit); + idct_fast + (range_limit,master->quantizationTables,master->coefficients, + planeOffset + master->workBuffer + 8,blockStride); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 1, sourceLimit); if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; for (naturalIndex = 0; naturalIndex < 0x40; naturalIndex++) { @@ -1671,13 +1677,13 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); - statusOrOffset = huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl - (decoderAddress,(u32)master->dcCoefficients,(u32)&master->chrominanceRequest,(u32)(u32)&hufftreePtr.tables[2],2,sourceLimit); + statusOrOffset = huffmanDecoder + (master->dcCoefficients, &master->chrominanceRequest, (u16**)(hufftreePtr.tables + 2), 2, sourceLimit); master->luminanceRequest.bitstream = master->chrominanceRequest.bitstream; if (statusOrOffset != 0) return statusOrOffset; statusOrOffset = 0; @@ -1690,10 +1696,10 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w ((u32)master->blockY << 6) * (u32)master->blocksWide); if (statusOrOffset + blockRowSize + 8 > workBufferSize) { statusOrOffset = -0x7ffffffa; - goto LAB_0001239c; + goto finishBlock; } - idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl - (decoderAddress,(u32)range_limit,(u32)(master->quantizationTables + 64),(u32)master->coefficients,(int)master->workBuffer + statusOrOffset, + idct_fast + (range_limit,master->quantizationTables + 64,master->coefficients,master->workBuffer + statusOrOffset, rowStride); } blockX = master->blockX + 1; @@ -1704,7 +1710,7 @@ s32 CArGBAOdh::cdj_d_decompressLoop(SArCDJ_OdhMaster* master, int srcSize, int w } } while (master->blockY < master->blocksHigh); statusOrOffset = 0; -LAB_0001239c: +finishBlock: return statusOrOffset; } @@ -1737,7 +1743,7 @@ void CArGBAOdh::cdj_d_setDequantizationTable(SArCDJ_OdhMaster* master, u32 quali scaleIndex = tableIndex; u32 scale = scales[scaleIndex]; u32 value = (boundedCoefficient * scale + 2048) >> 0xC; - u32* destination = master->quantizationTables + tableByteOffset / 4; + u32* destination = master->quantizationTables + tablePass * 64; destination[tableIndex] = value; tableIndex++; standardTable++; @@ -1748,27 +1754,9 @@ void CArGBAOdh::cdj_d_setDequantizationTable(SArCDJ_OdhMaster* master, u32 quali } while (tablePass < 2); } -void CArGBAOdh::cdj_c_makeHeader(SArCDJ_OdhMaster* master, u32 size) { - master->data[0] = 'A'; - master->data[1] = 'J'; - master->data[2] = 'P'; - master->data[3] = 'G'; - *(u32*)&master->data[4] = master->width | (u32)master->height << 11 | (u32)master->quality << 24; - *(u32*)&master->data[8] = size; - *(u32*)&master->data[12] = 0; -} -s32 CArGBAOdh::ScaleLimit(s32 scale) { - s32 newScale = scale; - if (newScale < 0) { - newScale = 0; - } else if (scale > 255) { - newScale = 255; - } - return newScale; -} s32 CArGBAOdh::cdj_d_colorDeconv(SArCDJ_OdhMaster* master, u8* destination, int outputFormat) { u16 width = master->width; @@ -1893,11 +1881,20 @@ void CArGBAOdh::LineDeconv11(u8* dest, u8* y, u8* cb, u8* cr, u16 width, u16 hei } } +s32 CArGBAOdh::ScaleLimit(s32 scale) { + s32 newScale = scale; + + if (newScale < 0) { + newScale = 0; + } else if (scale > 255) { + newScale = 255; + } + + return newScale; +} + void CArGBAOdh::LineDeconv21(u8* dest, u8* y, u8* cb, u8* cr, u16 width, u16 height, const SArDeconvTbl* table, int format) { - u8 crValue; - u8 lumaValue; - u8 cbValue; s32 redValue; u32 greenValue; s32 blueValue; @@ -1907,9 +1904,9 @@ void CArGBAOdh::LineDeconv21(u8* dest, u8* y, u8* cb, u8* cr, u16 width, u16 hei u8* destinationCb = dest + (s32)width * height; u8* destinationCr = dest + (s32)width * height * 2; for (pixelIndex = 0; (s32)pixelIndex < (s32)(width & 0xFFFF); pixelIndex += 2) { - crValue = *cr; - lumaValue = *y; - cbValue = *cb; + u8 crValue = *cr; + u8 lumaValue = *y; + u8 cbValue = *cb; redValue = ScaleLimit((u32)lumaValue + table->luma[crValue]); greenValue = ScaleLimit((u32)lumaValue + (table->cbGreen[cbValue] + table->crGreen[crValue] >> 16)); blueValue = ScaleLimit((u32)lumaValue + table->blue[cbValue]); @@ -1990,7 +1987,7 @@ void CArGBAOdh::LineDeconv12(u8* dest, u8* y, u8* cb, u8* cr, u16 width, u16 hei if (format == 0) { outputOffset = (pixelIndex & 0x1FFFFFFC) * 8 + (pixelIndex & 3) * 2; - redValue = blueValue >> 3 | (redValue & 0xF8) << 8 | (greenValue & 0xFC) << 3; + redValue = ((redValue & 0xF8) << 8 | (greenValue & 0xFC) << 3) | (blueValue >> 3); pixelOutput = dest + outputOffset; *pixelOutput = redValue >> 8; pixelOutput[1] = redValue; @@ -2014,7 +2011,7 @@ void CArGBAOdh::LineDeconv12(u8* dest, u8* y, u8* cb, u8* cr, u16 width, u16 hei nextBlueValue = ScaleLimit((u32)lumaValue + table->blue[cbValue]); if (format == 0) { - redValue = nextBlueValue >> 3 | (redValue & 0xF8) << 8 | (greenValue & 0xFC) << 3; + redValue = ((redValue & 0xF8) << 8 | (greenValue & 0xFC) << 3) | (nextBlueValue >> 3); pixelOutput[8] = redValue >> 8; pixelOutput[9] = redValue; } else if (format == 1) { diff --git a/tools/decomp-assist/sol-high-round2.attempts.md b/tools/decomp-assist/sol-high-round2.attempts.md new file mode 100644 index 00000000..fcc61747 --- /dev/null +++ b/tools/decomp-assist/sol-high-round2.attempts.md @@ -0,0 +1,299 @@ +Round 2; base f9bd6755; candidates measured independently from the current function body. +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: reuse channel argument for unsigned sample loop; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.958336, 15, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: scope device selector within loop; (99.583336, 7, 96, 96, 13, 2020, 32) -> BUILD FAIL 3U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d +### mwcceppc.exe Compiler: +# File: libs\RVL_SDK\src\kpad\KPAD.c +# ------------------------------------- +# 204: u32 type = kpad->ringData[index].device; +# Error: ^^^ +# (10141) expression syntax error +# Too many errors printed, aborting program + +User break, cancelled... +ninja: build stopped: subcommand failed. + +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declare interrupt token before indices after size; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.010414, 17, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: reverse scale and coordinate multiplication operands; (96.57895, 9, 19, 19, 13, 2020, 32) -> (95.52631, 10, 19, 19, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: define projection factor after y temporary; (96.57895, 9, 19, 19, 13, 2020, 32) -> BUILD FAIL pad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d +### mwcceppc.exe Compiler: +# File: libs\RVL_SDK\src\kpad\KPAD.c +# ------------------------------------- +# 1242: f64 scaled = 0.908 * scale; +# Error: ^^^ +# (10141) expression syntax error +# Too many errors printed, aborting program + +User break, cancelled... +ninja: build stopped: subcommand failed. + +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: project vector using shared height and early double factor; (96.57895, 9, 19, 19, 13, 2020, 32) -> (95.52631, 11, 19, 19, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon: reuse normalized vector components after projection; (95.89109, 87, 100, 101, 13, 2020, 32) -> (88.0, 87, 100, 101, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon: keep horizon state as a vector copy; (95.89109, 87, 100, 101, 13, 2020, 32) -> (93.77228, 95, 102, 101, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon: reuse magnitude for final vector length; (95.89109, 87, 100, 101, 13, 2020, 32) -> (95.89109, 87, 100, 101, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declare sample ordinal after device with scoped device local; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.583336, 7, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: put destination width after loop ordinal and pointer last; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: declare all single precision coordinates before double scaling; (96.57895, 9, 19, 19, 13, 2020, 32) -> (96.57895, 10, 19, 19, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: calculate projection using a temporary vector; (96.57895, 9, 19, 19, 13, 2020, 32) -> (59.105263, 20, 23, 19, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_stick: retain clamp selector after extension pointer; (95.3481, 108, 157, 158, 13, 2020, 32) -> (93.00633, 123, 157, 158, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_stick: declare device and format before clamp and extension; (95.3481, 108, 157, 158, 13, 2020, 32) -> (95.3481, 108, 157, 158, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_stick: use local trigger range once for both trigger divisions; (95.3481, 108, 157, 158, 13, 2020, 32) -> (91.025314, 98, 156, 158, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: select minimum extent with a conditional expression; (93.55769, 21, 52, 52, 13, 2020, 32) -> (97.59615, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: divide along separate width and height branches; (93.55769, 21, 52, 52, 13, 2020, 32) -> (91.59615, 31, 53, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: compute width squared before assigning height; (93.55769, 21, 52, 52, 13, 2020, 32) -> (93.55769, 21, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADiSamplingCallback: keep ring slot pointer before slot ordinal; (88.14835, 108, 182, 182, 13, 2020, 32) -> (88.14835, 108, 182, 182, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADiSamplingCallback: scope sensor extent scalars before angle and offset; (88.14835, 108, 182, 182, 13, 2020, 32) -> (87.79121, 108, 182, 182, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADiSamplingCallback: scale mode table index before querying DPD hardware; (88.14835, 108, 182, 182, 13, 2020, 32) -> (81.62637, 175, 178, 182, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_continue: copy whole typed candidate objects; (83.37681, 124, 141, 138, 13, 2020, 32) -> (86.347824, 124, 141, 138, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_continue: derive normalized direction before inverse distance; (83.37681, 124, 141, 138, 13, 2020, 32) -> (83.37681, 124, 141, 138, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_continue: split reversed and forward best candidates into signed dot branches; (83.37681, 124, 141, 138, 13, 2020, 32) -> (79.615944, 112, 140, 138, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADRead: retain conditional callback with pending flag test; (83.10022, 459, 470, 459, 13, 2020, 32) -> (83.57952, 458, 471, 459, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADRead: signed circular sample index following target cmpwi; (83.10022, 459, 470, 459, 13, 2020, 32) -> (83.05665, 459, 470, 459, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADRead: keep copied sample after gravity workspace to influence live frame; (83.10022, 459, 470, 459, 13, 2020, 32) -> (83.10022, 459, 470, 459, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_continue: walk second candidate with saved end pointer; (79.80645, 92, 95, 93, 13, 2020, 32) -> (79.37634, 93, 95, 93, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_continue: compute both tangent products before direction sums; (79.80645, 92, 95, 93, 13, 2020, 32) -> (80.07527, 92, 95, 93, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_continue: scale direction on right of products; (79.80645, 92, 95, 93, 13, 2020, 32) -> (79.860214, 92, 95, 93, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_first: cache first pointer for each inner pair scan; (72.86066, 110, 127, 122, 13, 2020, 32) -> (72.86066, 110, 127, 122, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_first: compute distance before direction normalization; (72.86066, 110, 127, 122, 13, 2020, 32) -> (72.86066, 110, 127, 122, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_2obj_first: copy absolute orientation into score after distance validation; (72.86066, 110, 127, 122, 13, 2020, 32) -> (72.86066, 110, 127, 122, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_dpd: use postdecrement pointer comparisons in DPD sample loop; (72.39209, 271, 281, 278, 13, 2020, 32) -> (73.54317, 271, 281, 278, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_dpd: scope pair normalization as vector delta; (72.39209, 271, 281, 278, 13, 2020, 32) -> BUILD FAIL D.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d +### mwcceppc.exe Compiler: +# File: libs\RVL_SDK\src\kpad\KPAD.c +# ------------------------------------- +# 1005: f32 scale = 1.0f / length; +# Error: ^^^ +# (10141) expression syntax error +# Too many errors printed, aborting program + +User break, cancelled... +ninja: build stopped: subcommand failed. + +libs/RVL_SDK/src/kpad/KPAD read_kpad_dpd: iterate duplicate objects with a counted inner loop; (72.39209, 271, 281, 278, 13, 2020, 32) -> (72.28058, 271, 281, 278, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADInit: separate reference extents from adjusted extents by reusing scalars; (71.85946, 198, 201, 185, 13, 2020, 32) -> (71.72433, 198, 201, 185, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADInit: introduce explicit squared reference extents before center reads; (71.85946, 198, 201, 185, 13, 2020, 32) -> (71.61622, 198, 201, 185, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADInit: normalize extent selection with conditional expression and late matrix pointer; (71.85946, 198, 201, 185, 13, 2020, 32) -> (72.46487, 197, 200, 185, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable: round horizontal rotation through local vector copy; (71.404, 241, 231, 250, 13, 2020, 32) -> (73.028, 247, 237, 250, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable: use vector for blended final position; (71.404, 241, 231, 250, 13, 2020, 32) -> (73.56, 241, 235, 250, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable: separate distance blend product before delta multiplication; (71.404, 241, 231, 250, 13, 2020, 32) -> (71.384, 241, 231, 250, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_first: construct missing endpoint vectors and typed coordinate copies; (70.220184, 109, 93, 109, 13, 2020, 32) -> (62.183487, 99, 112, 109, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_first: construct endpoint vectors and defer bounds to individual tests; (70.220184, 109, 93, 109, 13, 2020, 32) -> (73.02752, 114, 116, 109, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD select_1obj_first: copy both candidate and endpoint as typed objects; (70.220184, 109, 93, 109, 13, 2020, 32) -> (62.201836, 99, 112, 109, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD reset_kpad: walk pointers downward through inclusive beginning; (65.17094, 101, 115, 117, 13, 2020, 32) -> (0, 264, 264, 117, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD reset_kpad: copy the stored acceleration as a typed vector; (65.17094, 101, 115, 117, 13, 2020, 32) -> (69.37607, 121, 126, 117, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD reset_kpad: compute scaled reference after all bounds then resets; (65.17094, 101, 115, 117, 13, 2020, 32) -> (61.76923, 117, 116, 117, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_acc: represent core acceleration as local vector for length and speed; (63.5625, 386, 396, 400, 13, 2020, 32) -> (65.735, 383, 400, 400, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_acc: retain raw freestyle axes as named fields instead of array alias; (63.5625, 386, 396, 400, 13, 2020, 32) -> (63.5625, 386, 396, 400, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_acc: perform format selection with a switch over supported formats; (63.5625, 386, 396, 400, 13, 2020, 32) -> (64.3, 388, 398, 400, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: update half extents with compound assignments; (97.59615, 19, 52, 52, 13, 2020, 32) -> (98.84615, 10, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: initialize extents and squared lengths in separate scope; (97.59615, 19, 52, 52, 13, 2020, 32) -> (98.17308, 11, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: keep adjusted extents in original variables with goto join; (97.59615, 19, 52, 52, 13, 2020, 32) -> (91.63461, 32, 53, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD read_kpad_dpd: keep candidate delta as a Vec2 after correct C89 declarations; (73.54317, 271, 281, 278, 13, 2020, 32) -> (65.89568, 274, 277, 278, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,kpad,enabled,i,size,type,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes size,i,type,index,latest,enabled,kpad; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.114586, 16, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,index,type,latest,kpad,size,enabled; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes size,latest,i,kpad,enabled,index,type; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,i,type,size,enabled,index,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.697914, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,i,type,enabled,latest,size,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.010414, 17, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,latest,size,type,i,enabled,kpad; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,type,index,enabled,i,latest,size; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.0625, 15, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,index,size,enabled,type,i,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.90625, 18, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes latest,i,enabled,kpad,size,type,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,index,enabled,type,size,i,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.90625, 18, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,enabled,size,index,type,latest,kpad; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.697914, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,latest,i,enabled,kpad,type,size; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.75, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes latest,enabled,index,type,i,kpad,size; (99.583336, 7, 96, 96, 13, 2020, 32) -> (99.166664, 14, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes enabled,size,kpad,type,latest,index,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.802086, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,latest,kpad,type,i,enabled,size; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.75, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,latest,type,size,enabled,kpad,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes type,latest,enabled,kpad,size,i,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.802086, 20, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,kpad,type,enabled,i,size,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes type,size,latest,enabled,i,index,kpad; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.59375, 23, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes size,i,kpad,type,enabled,latest,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes type,index,enabled,kpad,latest,size,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.90625, 19, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes kpad,type,size,latest,i,enabled,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.697914, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes enabled,type,index,latest,kpad,size,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes index,latest,type,size,enabled,kpad,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,type,size,kpad,latest,enabled,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.802086, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes enabled,kpad,size,latest,type,index,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.802086, 21, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,size,latest,enabled,kpad,index,type; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes type,latest,i,kpad,size,enabled,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes size,enabled,i,index,kpad,type,latest; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.59375, 23, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes i,size,enabled,kpad,index,latest,type; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes enabled,index,size,i,latest,kpad,type; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.59375, 23, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes size,type,latest,index,kpad,enabled,i; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.802086, 20, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes enabled,index,size,i,kpad,latest,type; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: declaration lifetimes type,i,size,enabled,kpad,latest,index; (99.583336, 7, 96, 96, 13, 2020, 32) -> (98.489586, 25, 96, 96, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 0; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 1; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.21154, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 2; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 3; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.65385, 13, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 4; (98.84615, 10, 52, 52, 13, 2020, 32) -> (99.03846, 8, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 5; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 6; (98.84615, 10, 52, 52, 13, 2020, 32) -> (96.44231, 22, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 7; (98.84615, 10, 52, 52, 13, 2020, 32) -> (96.63461, 22, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 8; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.21154, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 9; (98.84615, 10, 52, 52, 13, 2020, 32) -> (99.23077, 7, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 10; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 11; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.65385, 13, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 12; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.84615, 10, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 13; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 14; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.84615, 10, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 15; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 16; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.65385, 13, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 17; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.46154, 15, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 18; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.84615, 10, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 19; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.46154, 14, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 20; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 21; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.84615, 10, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 22; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 23; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 24; (98.84615, 10, 52, 52, 13, 2020, 32) -> (96.44231, 22, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 25; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 26; (98.84615, 10, 52, 52, 13, 2020, 32) -> (96.82692, 20, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 27; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.46154, 15, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 28; (98.84615, 10, 52, 52, 13, 2020, 32) -> (99.03846, 8, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 29; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.46154, 15, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 30; (98.84615, 10, 52, 52, 13, 2020, 32) -> (96.44231, 22, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 31; (98.84615, 10, 52, 52, 13, 2020, 32) -> (97.01923, 19, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 32; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 33; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: extent scalar order 34; (98.84615, 10, 52, 52, 13, 2020, 32) -> (98.26923, 16, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: initialize channel pointer in declaration; (99.23077, 7, 52, 52, 13, 2020, 32) -> (99.23077, 7, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: load zero as a named local before squared extents; (99.23077, 7, 52, 52, 13, 2020, 32) -> (99.03846, 8, 52, 52, 13, 2020, 32) +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: square height within combined diagonal calculation; (99.23077, 7, 52, 52, 13, 2020, 32) -> (99.03846, 9, 52, 52, 13, 2020, 32) +src/system/odh cdj_d_decompressLoop: restore typed member Huffman calls; (97.67297, 383, 899, 899, 16, 4092, 6360) -> BUILD FAIL Error: ^ +# (10248) function call '[CArGBAOdh].huffmanDecoder({lval} unsigned +# long[64], SArCDJ_HuffmanRequest *, {lval} const unsigned long *[4], int, +# {lval} int)' does not match +# 'CArGBAOdh::huffmanDecoder(unsigned long *, SArCDJ_HuffmanRequest *, +# unsigned short **, int, unsigned long)' (non-static) +# Too many errors printed, aborting program + +User break, cancelled... +ninja: build stopped: subcommand failed. + +src/system/odh cdj_d_decompressLoop: restore typed member inverse transform calls; (97.67297, 383, 899, 899, 16, 4092, 6360) -> (97.65073, 385, 899, 899, 16, 4092, 6360) +src/system/odh cdj_d_decompressLoop: restore all typed member decoder and transform calls; (97.67297, 383, 899, 899, 16, 4092, 6360) -> BUILD FAIL Error: ^ +# (10248) function call '[CArGBAOdh].huffmanDecoder({lval} unsigned +# long[64], SArCDJ_HuffmanRequest *, {lval} const unsigned long *[4], int, +# {lval} int)' does not match +# 'CArGBAOdh::huffmanDecoder(unsigned long *, SArCDJ_HuffmanRequest *, +# unsigned short **, int, unsigned long)' (non-static) +# Too many errors printed, aborting program + +User break, cancelled... +ninja: build stopped: subcommand failed. + +src/system/odh cdj_c_colorConv: declare persistent plane pointers before dimension processing; (97.402596, 30, 77, 77, 16, 4092, 6360) -> (97.402596, 30, 77, 77, 16, 4092, 6360) +src/system/odh cdj_c_colorConv: keep height before width test and iterate with signed row; (97.402596, 30, 77, 77, 16, 4092, 6360) -> (92.207794, 32, 77, 77, 16, 4092, 6360) +src/system/odh cdj_c_colorConv: keep plane size as shared unsigned scalar; (97.402596, 30, 77, 77, 16, 4092, 6360) -> (97.402596, 30, 77, 77, 16, 4092, 6360) +src/system/odh LineDeconv22: keep output and planar destinations before pixel count; (96.434425, 115, 244, 244, 16, 4092, 6360) -> (96.065575, 127, 244, 244, 16, 4092, 6360) +src/system/odh LineDeconv22: use signed raster index with unsigned texture masks; (96.434425, 115, 244, 244, 16, 4092, 6360) -> (96.434425, 115, 244, 244, 16, 4092, 6360) +src/system/odh LineDeconv22: reuse packed red scalar instead of fresh pixel temporaries; (96.434425, 115, 244, 244, 16, 4092, 6360) -> (95.45082, 119, 244, 244, 16, 4092, 6360) +src/system/odh LineDeconv21: use packed pixel scalar separate from red channel; (92.578575, 125, 145, 140, 16, 4092, 6360) -> (92.578575, 125, 145, 140, 16, 4092, 6360) +src/system/odh LineDeconv21: calculate texture stride in unsigned plane arithmetic; (92.578575, 125, 145, 140, 16, 4092, 6360) -> (92.578575, 125, 145, 140, 16, 4092, 6360) +src/system/odh LineDeconv21: keep channel samples and output pointer in inner loop scope; (92.578575, 125, 145, 140, 16, 4092, 6360) -> (92.61429, 124, 145, 140, 16, 4092, 6360) +src/system/odh cdj_d_decompressLoop: typed decoder and inverse calls with actual table pointer casts; (97.67297, 383, 899, 899, 16, 4092, 6360) -> (97.65073, 385, 899, 899, 16, 4092, 6360) +src/system/odh cdj_d_decompressLoop: typed calls with unsigned source limit parameter copy; (97.67297, 383, 899, 899, 16, 4092, 6360) -> (97.68409, 379, 899, 899, 16, 4092, 6360) +src/system/odh cdj_d_decompressLoop: typed calls with natural permutation index inside each reorder loop; (97.67297, 383, 899, 899, 16, 4092, 6360) -> (97.65073, 385, 899, 899, 16, 4092, 6360) +src/system/odh huffmanCoder: read signed coefficients with sign extension instead of shifts; (91.96319, 155, 166, 163, 16, 4092, 6360) -> (90.29448, 78, 163, 163, 16, 4092, 6360) +src/system/odh huffmanCoder: traverse signed halfword coefficient pointers consistently; (91.96319, 155, 166, 163, 16, 4092, 6360) -> (90.171776, 78, 163, 163, 16, 4092, 6360) +src/system/odh huffmanCoder: reuse next coefficient cursor with postincrement pair stepping; (91.96319, 155, 166, 163, 16, 4092, 6360) -> (91.96319, 155, 166, 163, 16, 4092, 6360) +src/system/odh huffmanDecoder: advance bitstream with a remaining-byte loop; (91.04902, 277, 308, 306, 16, 4092, 6360) -> (89.117645, 216, 306, 306, 16, 4092, 6360) +src/system/odh huffmanDecoder: use unsigned maximum Huffman bit length throughout; (91.04902, 277, 308, 306, 16, 4092, 6360) -> (90.166664, 277, 308, 306, 16, 4092, 6360) +src/system/odh huffmanDecoder: use signed table symbol category local with explicit pointer predictor; (91.04902, 277, 308, 306, 16, 4092, 6360) -> (91.04902, 277, 308, 306, 16, 4092, 6360) +src/system/odh cdj_d_setDequantizationTable: unsigned byte offset and direct field indexing; (88.27451, 46, 54, 51, 16, 4092, 6360) -> (92.98039, 44, 52, 51, 16, 4092, 6360) +src/system/odh cdj_d_setDequantizationTable: unsigned table offset with explicit row and scale indices; (88.27451, 46, 54, 51, 16, 4092, 6360) -> (92.98039, 44, 52, 51, 16, 4092, 6360) +src/system/odh cdj_d_setDequantizationTable: table pass as destination row index; (88.27451, 46, 54, 51, 16, 4092, 6360) -> (94.60784, 30, 51, 51, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: unsigned byte offset with field-indexed quantization output; (81.671425, 58, 72, 70, 16, 4092, 6360) -> (92.42857, 58, 71, 70, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: unsigned byte offset with separate scale and destination indices; (81.671425, 58, 72, 70, 16, 4092, 6360) -> (92.42857, 58, 71, 70, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: use coefficient row index for destination pointer; (81.671425, 58, 72, 70, 16, 4092, 6360) -> (86.51428, 49, 70, 70, 16, 4092, 6360) +src/system/odh LineConv11: derive color planes from named pixel count and typed source indexing; (80.746574, 102, 146, 146, 16, 4092, 6360) -> (80.60959, 102, 146, 146, 16, 4092, 6360) +src/system/odh LineConv11: declare floating chroma intermediates before luma conversion; (80.746574, 102, 146, 146, 16, 4092, 6360) -> (69.83562, 105, 146, 146, 16, 4092, 6360) +src/system/odh LineConv11: use one raster ordinal in place of duplicate counter; (80.746574, 102, 146, 146, 16, 4092, 6360) -> (80.30137, 103, 146, 146, 16, 4092, 6360) +src/system/odh fdct_fast: store butterflies in ascending even coefficient order; (78.30769, 118, 169, 169, 16, 4092, 6360) -> (73.02959, 111, 169, 169, 16, 4092, 6360) +src/system/odh fdct_fast: use signed coefficient pointer for initial centered samples; (78.30769, 118, 169, 169, 16, 4092, 6360) -> (78.30769, 118, 169, 169, 16, 4092, 6360) +src/system/odh fdct_fast: advance initial sample column by pointer rather than index; (78.30769, 118, 169, 169, 16, 4092, 6360) -> (76.87574, 131, 169, 169, 16, 4092, 6360) +src/system/odh LineDeconv12: share blue channel temporary across rows; (78.095894, 142, 148, 146, 16, 4092, 6360) -> (78.095894, 142, 148, 146, 16, 4092, 6360) +src/system/odh LineDeconv12: keep planar output pointers beside next-row pointer; (78.095894, 142, 148, 146, 16, 4092, 6360) -> (78.095894, 142, 148, 146, 16, 4092, 6360) +src/system/odh LineDeconv12: compute RGB565 channels before shifting packed pixel; (78.095894, 142, 148, 146, 16, 4092, 6360) -> (83.4726, 124, 146, 146, 16, 4092, 6360) +src/system/odh idct_fast: advance coefficient and quantization pointers at common column exit; (70.49789, 174, 236, 237, 16, 4092, 6360) -> (69.12236, 210, 233, 237, 16, 4092, 6360) +src/system/odh idct_fast: use signed workspace coefficients throughout butterfly rows; (70.49789, 174, 236, 237, 16, 4092, 6360) -> (70.49789, 174, 236, 237, 16, 4092, 6360) +src/system/odh idct_fast: calculate output row address before first workspace load; (70.49789, 174, 236, 237, 16, 4092, 6360) -> (70.49789, 174, 236, 237, 16, 4092, 6360) +src/system/odh cdj_d_setDequantizationTable: initialize destination row before standard table row; (94.60784, 30, 51, 51, 16, 4092, 6360) -> (81.01961, 38, 51, 51, 16, 4092, 6360) +src/system/odh cdj_d_setDequantizationTable: name normalization divisor at outer scope; (94.60784, 30, 51, 51, 16, 4092, 6360) -> (94.60784, 30, 51, 51, 16, 4092, 6320) +src/system/odh cdj_d_setDequantizationTable: set destination by whole row index without row pointer; (94.60784, 30, 51, 51, 16, 4092, 6360) -> (94.60784, 30, 51, 51, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: use pass and coefficient indices for direct destination field; (92.42857, 58, 71, 70, 16, 4092, 6360) -> (93.97143, 48, 70, 70, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: separate outer pass variable for scale application; (92.42857, 58, 71, 70, 16, 4092, 6360) -> (93.97143, 48, 70, 70, 16, 4092, 6360) +src/system/odh cdj_c_setQuantizationTable: keep explicit scale and output ordinal with row multiplication; (92.42857, 58, 71, 70, 16, 4092, 6360) -> (93.97143, 48, 70, 70, 16, 4092, 6360) +src/BS2/BS2Mach BS2StartGCGame: multiply RTC sum before timer frequency; (98.11404, 97, 227, 228, 21, 4052, 155504) -> (98.24561, 93, 227, 228, 21, 4052, 155504) +src/BS2/BS2Mach BS2StartGCGame: poll DVD command state directly as original load loop; (98.11404, 97, 227, 228, 21, 4052, 155504) -> (95.4386, 103, 227, 228, 21, 4052, 155504) +src/BS2/BS2Mach BS2StartGCGame: reuse SRAM counter bias for time sum temporary; (98.11404, 97, 227, 228, 21, 4052, 155504) -> (98.13596, 97, 227, 228, 21, 4052, 155504) +src/BS2/BS2Mach BS2StartGame: declare boot state flags near read and write scope; (95.496185, 173, 401, 393, 21, 4052, 155504) -> (95.496185, 173, 401, 393, 21, 4052, 155504) +src/BS2/BS2Mach BS2StartGame: poll DVD state directly before boot transition; (95.496185, 173, 401, 393, 21, 4052, 155504) -> (93.94402, 179, 401, 393, 21, 4052, 155504) +src/BS2/BS2Mach BS2StartGame: declare IOS title halves adjacent to ticket count and views; (95.496185, 173, 401, 393, 21, 4052, 155504) -> (95.2799, 189, 401, 393, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideCallback: compute remaining amount from updated total before advancing buffer; (85.03906, 107, 119, 128, 21, 4052, 155504) -> (85.03906, 107, 119, 128, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideCallback: share read and write completion test after size branches; (85.03906, 107, 119, 128, 21, 4052, 155504) -> (68.984375, 106, 128, 128, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideCallback: split cancellation and failure as early exits; (85.03906, 107, 119, 128, 21, 4052, 155504) -> (85.03906, 107, 119, 128, 21, 4052, 155504) +src/BS2/BS2Mach CheckBS2CommandStatus: combine cache-disabled conditions in one branch; (80.133, 321, 387, 406, 21, 4052, 155504) -> (80.133, 321, 387, 406, 21, 4052, 155504) +src/BS2/BS2Mach CheckBS2CommandStatus: carry transfer length through a single local before overflow check; (80.133, 321, 387, 406, 21, 4052, 155504) -> (80.133, 321, 387, 406, 21, 4052, 155504) +src/BS2/BS2Mach CheckBS2CommandStatus: compute partition rounded length after completing command flag; (80.133, 321, 387, 406, 21, 4052, 155504) -> (80.12069, 321, 387, 406, 21, 4052, 155504) +src/BS2/BS2Mach BS2Tick: use dedicated unsigned ticket byte counter; (74.78608, 1765, 1905, 1940, 21, 4052, 155504) -> (74.78608, 1765, 1905, 1940, 21, 4052, 155504) +src/BS2/BS2Mach BS2Tick: use signed OS time type for delay arithmetic; (74.78608, 1765, 1905, 1940, 21, 4052, 155504) -> (74.78608, 1765, 1905, 1940, 21, 4052, 155504) +src/BS2/BS2Mach BS2Tick: perform IOS title half extraction in named title identifier; (74.78608, 1765, 1905, 1940, 21, 4052, 155504) -> (74.77577, 1765, 1905, 1940, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideReadAsync: assign completion operation and transfer counters before pointers; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (60.31915, 44, 45, 47, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideReadAsync: choose a bounded first transfer size before reporting and issuing; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (28.382978, 45, 37, 47, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideReadAsync: place file pointer before length and buffer after branch comparison; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (59.87234, 43, 46, 47, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideWriteAsync: assign completion operation and transfer counters before pointers; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (60.31915, 44, 45, 47, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideWriteAsync: choose a bounded first transfer size before reporting and issuing; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (28.382978, 45, 37, 47, 21, 4052, 155504) +src/BS2/BS2Mach BS2NANDDivideWriteAsync: place file pointer before length and buffer after branch comparison; (60.29787, 45, 45, 47, 21, 4052, 155504) -> (59.87234, 43, 46, 47, 21, 4052, 155504) +src/BS2/BS2Mach Run: iterate cache blocks with explicit ordinal instead of predecrement; (0, 43, 28, 43, 21, 4052, 155504) -> (0, 43, 31, 43, 21, 4052, 155504) +src/BS2/BS2Mach Run: clear and flush entire cache extent as a range; (0, 43, 28, 43, 21, 4052, 155504) -> (0, 43, 25, 43, 21, 4052, 155504) +src/BS2/BS2Mach Run: transfer to application without a fourth argument value; (0, 43, 28, 43, 21, 4052, 155504) -> (0, 43, 26, 43, 21, 4052, 155504) +All four units: audited target st_value order; corrected KPAD definition order and odh header/ScaleLimit order; no missing functions. +src/BS2/BS2Update UpdateThread: walk update and seat entries by pointers with a separate flag index; (84.05586, 867, 863, 913, 8, 112, 0) -> (83.423874, 865, 860, 913, 8, 112, 0) +src/BS2/BS2Update UpdateThread: keep available bytes as a local before budget checks; (84.05586, 867, 863, 913, 8, 112, 0) -> (84.05586, 867, 863, 913, 8, 112, 0) +src/BS2/BS2Update UpdateThread: keep stack workspaces in original product title and DVD order; (84.05586, 867, 863, 913, 8, 112, 0) -> (84.05586, 867, 863, 913, 8, 112, 0) +src/BS2/BS2Update BS2UpdateInit: retain thread pointer from entry through create and resume; (79.875, 65, 71, 72, 8, 112, 0) -> (79.875, 65, 71, 72, 8, 112, 0) +src/BS2/BS2Update BS2UpdateInit: derive stack end from stack pointer kept with flag pointer; (79.875, 65, 71, 72, 8, 112, 0) -> (79.875, 65, 71, 72, 8, 112, 0) +src/BS2/BS2Update BS2UpdateInit: store allocator before issuing version report calls; (79.875, 65, 71, 72, 8, 112, 0) -> (71.611115, 64, 71, 72, 8, 112, 0) + +Final remaining-function evidence; counts include only compiled candidates, not failed builds. +libs/RVL_SDK/src/kpad/KPAD get_ring_buffer_by_kpad1_style: 39 compiled attempts; 99.583336%; instructions 96/96, positional differences 7; register allocation and instruction scheduling. +libs/RVL_SDK/src/kpad/KPAD reset_kpad: 3 compiled attempts; 69.37607%; instructions 126/117, positional differences 121; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos: 4 compiled attempts; 96.57895%; instructions 19/19, positional differences 9; register allocation and instruction scheduling. +libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight: 44 compiled attempts; 99.23077%; instructions 52/52, positional differences 7; register allocation and instruction scheduling. +libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon: 3 compiled attempts; 95.89109%; instructions 100/101, positional differences 87; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD read_kpad_acc: 3 compiled attempts; 65.735%; instructions 400/400, positional differences 383; register allocation and instruction scheduling. +libs/RVL_SDK/src/kpad/KPAD select_2obj_first: 3 compiled attempts; 72.86066%; instructions 127/122, positional differences 110; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD select_2obj_continue: 3 compiled attempts; 86.347824%; instructions 141/138, positional differences 124; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD select_1obj_first: 3 compiled attempts; 73.02752%; instructions 116/109, positional differences 114; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD select_1obj_continue: 3 compiled attempts; 80.07527%; instructions 95/93, positional differences 92; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable: 3 compiled attempts; 73.56%; instructions 235/250, positional differences 241; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD read_kpad_dpd: 3 compiled attempts; 73.54317%; instructions 281/278, positional differences 271; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD read_kpad_stick: 3 compiled attempts; 95.3481%; instructions 157/158, positional differences 108; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD KPADRead: 3 compiled attempts; 83.57952%; instructions 471/459, positional differences 458; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD KPADInit: 3 compiled attempts; 72.46487%; instructions 200/185, positional differences 197; remaining control flow, reloads, or temporary storage differ. +libs/RVL_SDK/src/kpad/KPAD KPADiSamplingCallback: 3 compiled attempts; 88.14835%; instructions 182/182, positional differences 108; register allocation and instruction scheduling. +src/system/odh cdj_c_setQuantizationTable__9CArGBAOdhFP16SArCDJ_OdhMasterUl: 6 compiled attempts; 93.97143%; instructions 70/70, positional differences 48; register allocation and instruction scheduling. +src/system/odh cdj_c_colorConv__9CArGBAOdhFP16SArCDJ_OdhMasterPUci: 3 compiled attempts; 97.402596%; instructions 77/77, positional differences 30; register allocation and instruction scheduling. +src/system/odh LineConv11__9CArGBAOdhFPUcPUcPUcPUcUsUsPCli: 3 compiled attempts; 80.746574%; instructions 146/146, positional differences 102; register allocation and instruction scheduling. +src/system/odh fdct_fast__9CArGBAOdhFPUlPUcUlPUl: 3 compiled attempts; 78.30769%; instructions 169/169, positional differences 118; register allocation and instruction scheduling. +src/system/odh huffmanCoder__9CArGBAOdhFPUsP21SArCDJ_HuffmanRequest: 3 compiled attempts; 91.96319%; instructions 166/163, positional differences 155; remaining control flow, reloads, or temporary storage differ. +src/system/odh cdj_d_decompressLoop__9CArGBAOdhFP16SArCDJ_OdhMasterii: 4 compiled attempts; 97.68409%; instructions 899/899, positional differences 379; register allocation and instruction scheduling. +src/system/odh cdj_d_setDequantizationTable__9CArGBAOdhFP16SArCDJ_OdhMasterUl: 6 compiled attempts; 94.60784%; instructions 51/51, positional differences 30; register allocation and instruction scheduling. +src/system/odh LineDeconv21__9CArGBAOdhFPUcPUcPUcPUcUsUsPC12SArDeconvTbli: 3 compiled attempts; 92.61429%; instructions 145/140, positional differences 124; remaining control flow, reloads, or temporary storage differ. +src/system/odh LineDeconv12__9CArGBAOdhFPUcPUcPUcPUcUsUsPC12SArDeconvTbli: 3 compiled attempts; 83.4726%; instructions 146/146, positional differences 124; register allocation and instruction scheduling. +src/system/odh LineDeconv22__9CArGBAOdhFPUcPUcPUcPUcUsUsPC12SArDeconvTbli: 3 compiled attempts; 96.434425%; instructions 244/244, positional differences 115; register allocation and instruction scheduling. +src/system/odh huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl: 3 compiled attempts; 91.04902%; instructions 308/306, positional differences 277; remaining control flow, reloads, or temporary storage differ. +src/system/odh idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl: 3 compiled attempts; 70.49789%; instructions 236/237, positional differences 174; remaining control flow, reloads, or temporary storage differ. +src/BS2/BS2Mach Run: 3 compiled attempts; None%; instructions 28/43, positional differences 43; original clears architectural registers and replaces stack before branch; cannot express that faithfully with the permitted C changes. +src/BS2/BS2Mach BS2StartGame: 3 compiled attempts; 95.496185%; instructions 401/393, positional differences 173; DVD status poll and MMIO loads plus live register allocation differ. +src/BS2/BS2Mach BS2StartGCGame: 3 compiled attempts; 98.24561%; instructions 227/228, positional differences 93; DVD status poll and MMIO loads plus live register allocation differ. +src/BS2/BS2Mach BS2NANDDivideCallback: 3 compiled attempts; 85.03906%; instructions 119/128, positional differences 107; target retains asynchronous global reloads that current nonvolatile C definitions eliminate. +src/BS2/BS2Mach BS2NANDDivideReadAsync: 3 compiled attempts; 60.31915%; instructions 45/47, positional differences 44; target retains asynchronous global reloads that current nonvolatile C definitions eliminate. +src/BS2/BS2Mach BS2NANDDivideWriteAsync: 3 compiled attempts; 60.31915%; instructions 45/47, positional differences 44; target retains asynchronous global reloads that current nonvolatile C definitions eliminate. +src/BS2/BS2Mach CheckBS2CommandStatus: 3 compiled attempts; 80.133%; instructions 387/406, positional differences 321; target retains asynchronous global reloads that current nonvolatile C definitions eliminate. +src/BS2/BS2Mach BS2Tick: 3 compiled attempts; 74.78608%; instructions 1905/1940, positional differences 1765; remaining control flow, reloads, or temporary storage differ. +src/BS2/BS2Update BS2UpdateInit: 3 compiled attempts; 79.875%; instructions 71/72, positional differences 65; target retains shared BSS base across flags and thread setup; source uses separate symbol addressing. +src/BS2/BS2Update UpdateThread: 3 compiled attempts; 84.05586%; instructions 863/913, positional differences 867; remaining control flow, reloads, or temporary storage differ. -- 2.49.1