mirror of
https://github.com/nmlgc/ReC98.git
synced 2025-02-26 20:55:09 +00:00

So, we have a problem. The ridiculously optimized graph_putsa_fx() used in TH04 and TH05 swaps out the target of two CALL instructions at run-time… because there *really* wasn't any free register left for an indirect CALL, eh? Therefore, the necessary relative addresses have to be calculated at assembly time, by subtracting the target function label from the call site label. Unfortunately, the resulting values are stored in the .DATA segment, which we can't move out right now. Declaring the labels as EXTERN wouldn't work either, since the linker can't do fancy arithmetic and is limited to simply replacing address placeholders with one single address. This is explained pretty well at: http://computer-programming-forum.com/46-asm/48f3d4a463bb38d1.htm Which means we're stuck, and can't separate out this function for the foreseeable future. So, time to approach the SHARED segment from the top instead, to at least get everything around graph_putsa_fx() done now. 🤷 vram_planes_set() is the first common function there. But since it was introduced in TH01, we've got some maintenance to do for that game first… Part of P0138, funded by [Anonymous] and Blue Bolt.
2 lines
37 B
C++
2 lines
37 B
C++
#include "th01/formats/ptn_0to1.cpp"
|