Closed madebr closed 2 months ago
If someone sends me the IDA database and the executable, I am willing to look at it.
I think the issue is missing/broken functionality around BrPixelmapMatch
(in brender code, and the renderer).
Uncommenting the mirror code in RenderAFrame
does not fix the issue.
When I implement BrPixelmapMatch
, the depth buffer starts to create artifacts (asan crashes immediately),
and when going in cockpit mode (when pressing C) the game crashes.
Indeed I see strange things in _M_br_device_pixelmap_mem_match()... unfinished reversing?
Message ID: @.***>
We did not reverse the BRender software renderer. jeff wrote a opengl based one. Its interface is not 100% correct, which might be causing an issue here.
Okay, I understand. I saw IDA prototypes in front of each of these functions, and stack addresses as comments of local variables, that’s why I thought it was reversing job. I suppose that was just a template and you filled the blanks.
Where did you take the specification for the BRender APIs ?
I’m stumped. The commented block in BRSRC13/CORE/PIXELMAP/pmmem.c lines 282-310 is typical Hex-Rays reconstruction. Why say it wasn’t reversed ? I offer to look at it and possibly fix the implementation if you send me the executable and the database file.
Also, I’ve read that the source code of BRender was made public some time ago. It might be worth a look.
BRender-1997/pixelmap/pmmem.c at main · foone/BRender-1997github.comLine 330 is probably what you want.
Sorry bad formatting.
https://github.com/foone/BRender-1997/blob/main/pixelmap/pmmem.c
Line 330 is probably what you want.
pmmem.c
is for in-memory pixelmaps. I think the memory pixelmaps are not very sofisticated for getting matching buffers.
In BRender, every screen buffer is a br_pixelmap
, including the screen.
For an OpenGL driver, we should do magic things to get the depth buffer.
I learned recently that jeff is working on this and will release something when he's finished.
For information, I merged the relevant parts of the official BRender code to the dethrace brender (the concerned functions are: templateResolveNames, templateMakeMap, ValueSet, BrTokenValueSetMany, BrPixelmapMatch, _M_br_device_pixelmap_mem_match) and the result was identical. Line artefacts on the rear view mirror, leaks and crash under a few seconds on a SIGSEGV.
It seems to tell that dethrace's emulation of BrPixelmapMatch is enough for the job and that the problem is elsewhere.
(on another side, I wonder how using the official BRender code to re-create the blocky software renderer and filtering it in post-processing with hq2x would look like? Unfortunately I don't have time anymore to toy with dethrace at the moment. Back to work...)
Message ID: @.***>
The rear view mirror is currently disabled. Uncommenting it is not enough to get it working.