aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit cfee95ade0a1df3440b1f51b6e36248a22c8210a
parent 187f01d3d9afb8aa1471b4707ea4de7a2cc99761
Author: anon <anon@example.com>
Date:   Thu, 15 Oct 2026 14:56:54 +0000

Validate the native texture pipeline as one pass

Diffstat:
Mdecompiled/runtime/linux_graphics.c | 13+++++++++++++
Mdecompiled/tests/devices.c | 4++++
2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/decompiled/runtime/linux_graphics.c b/decompiled/runtime/linux_graphics.c @@ -1875,6 +1875,18 @@ static void device_set_texture(void) g_eax = 0; } +static void device_validate(void) +{ + find_device(MEM32(g_esp + 4)); + uint32_t output = MEM32(g_esp + 8); + g_esp += 12; + g_eax = 0x80070057u; + if (!output) return; + /* Setters reject unsupported states; the accepted pipeline uses one pass. */ + MEM32(output) = 1; + g_eax = 0; +} + static void device_get_texture(void) { struct device_object *device = find_device(MEM32(g_esp + 4)); @@ -2183,6 +2195,7 @@ recomp_func_t linux_graphics_virtual(uint32_t address) if (current_slot == 25) return device_draw_primitive; if (current_slot == 34) return device_get_texture; if (current_slot == 35) return device_set_texture; + if (current_slot == 38) return device_validate; if (current_slot == 31 || current_slot == 32) return device_draw_vertex_buffer; if (current_slot == 36) return device_get_texture_state; if (current_slot == 37) return device_set_texture_state; diff --git a/decompiled/tests/devices.c b/decompiled/tests/devices.c @@ -1062,6 +1062,10 @@ static void two_texture_stages_combine_independent_samples(uint32_t draw, uint32 assert(!invoke(device, 10, 7, 0u, 0u, 3u, 0xff102030u, 0x3f800000u, 0u)); assert(!invoke(device, 5, 1)); + *memory(workspace()) = 0xa5a5a5a5; + *memory(workspace() + 4) = 0xcccccccc; + assert(!invoke(device, 38, 2, workspace())); + assert(*memory(workspace()) == 1 && *memory(workspace() + 4) == 0xcccccccc); assert(!invoke(device, 25, 6, 4u, sample & 32 ? 0x242u : 0x244u, input, 3u, 0u)); assert(!invoke(device, 6, 1));