RENDERER_D3D_RenderWallTileWithPerspective: Stack[-0x54] is D2GfxLightStrc[3], not one colour
The inner colour loop reads MOV EDX,[EBP+EBX*4-0x50] (0x006b8d48) with EBX = 0..2, so Stack[-0x54..-0x49] is one 3-entry vertex-colour array. 0x006b8b49 stores pLightColors[i] into element 0, 0x006b8bb6 the per-byte average of colours i and i+1 into element 1 (Stack[-0x50]), and 0x006b8b69 pLightColors[i+1] into element 2 (Stack[-0x4c]). Nothing else touches the three slots separately, and Stack[-0x48] is a separate value. The DB has three 4-byte locals (aVertexColors, nMidZFixed, nMidYFixed), so the rebuild emits unrelated locals and reads (&aVertexColors)[1] and [2] out of bounds, giving wrong vertex lighting on perspective walls in Direct3D mode. The Glide twin (0x0050cf70) survives only because it is emitted as a frame group. Please delete nMidZFixed and nMidYFixed when applying.
Changes 1, applied together
Retype variable
win 0x006b8950 Stack[-0x54]typeundefined4→D2GfxLightStrc[3]