ReC98/th01
nmlgc 7b3b6fd4e7 [Separate translation units] [th01] ptn_copy_8_0_to_1()
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.
2021-04-21 17:35:39 +02:00
..
core [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
end [Maintenance] Make decomp.h exclusive to C++ 2021-03-20 02:17:08 +01:00
formats [Separate translation units] [th01] ptn_copy_8_0_to_1() 2021-04-21 17:35:39 +02:00
hardware [Maintenance] Make decomp.h exclusive to C++ 2021-03-20 02:17:08 +01:00
hiscore [Reverse-engineering] Assign names to all graph_putsa_fx() effects 2020-11-02 22:33:50 +01:00
main [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
math [Maintenance] Move the polar coordinate conversion functions to their own file 2021-04-03 22:31:00 +02:00
snd [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
sprites [Decompilation] [th01] HUD: HP rendering 2020-12-18 01:38:48 +01:00
common.h [Decompilation] [th01] Stage objects: VRAM page 0 → 1 copies 2020-12-01 00:34:21 +01:00
frmdely.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
fuuin_01.cpp [Maintenance] master.hpp transition: Resident data 2020-11-15 21:28:55 +01:00
fuuin_02.cpp [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
fuuin_04.cpp [Maintenance] Complete the master.hpp transition 2021-01-30 19:22:29 +01:00
fuuin_10.cpp [Build] [th01] Move the -Z and -3 options onto the command line 2020-10-06 13:27:33 +02:00
fuuin_11.cpp [Maintenance] Avoid MK_FP() where possible 2021-02-20 15:47:00 +01:00
fuuin_12.cpp [Maintenance] [th01] Get rid of th01.h 2020-11-15 21:27:41 +01:00
graph.cpp [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
grpinv32.cpp [Maintenance] Prefer the -zC and -zP options over `#pragma codeseg` 2021-04-03 20:12:09 +02:00
grppffx.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
grz.cpp [Separate translation units] [th01] .PTN, .GRP, and .GRZ formats 2021-01-30 19:17:16 +01:00
initexit.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
main_01.cpp [Maintenance] master.hpp transition: Keyboard functions 2021-01-30 18:34:14 +01:00
main_01_.cpp [Maintenance] Prefer the -zC and -zP options over `#pragma codeseg` 2021-04-03 20:12:09 +02:00
main_07.cpp [Separate translation units] [th01] ptn_copy_8_0_to_1() 2021-04-21 17:35:39 +02:00
main_08.cpp [Separate translation units] [th01] .PTN, .GRP, and .GRZ formats 2021-01-30 19:17:16 +01:00
main_09.cpp [Maintenance] Decide on a consistent place for file-wide `#pragma`s 2020-10-01 16:35:56 +02:00
main_13.cpp [Maintenance] Make decomp.h exclusive to C++ 2021-03-20 02:17:08 +01:00
main_13_.cpp [Maintenance] Prefer the -zC and -zP options over `#pragma codeseg` 2021-04-03 20:12:09 +02:00
main_14.cpp [Maintenance] Fix vector creation function declarations and calls 2020-07-12 15:22:50 +02:00
main_15.cpp [Decompilation] [th01] Shootout lasers: Spawn function 2020-10-06 14:16:40 +02:00
main_19.cpp [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
main_20.cpp [Decompilation] [th01] Reimu's animations: .BOS load function 2020-10-13 21:15:19 +02:00
main_21.cpp [Build] [th01] Move the -Z and -3 options onto the command line 2020-10-06 13:27:33 +02:00
main_23.cpp [Maintenance] Move the polar coordinate conversion functions to their own file 2021-04-03 22:31:00 +02:00
main_25.cpp [Maintenance] [th01] Get rid of th01.h 2020-11-15 21:27:41 +01:00
main_27.cpp [Build] [th01] Move the -Z and -3 options onto the command line 2020-10-06 13:27:33 +02:00
main_29.cpp [Decompilation] [th01] Difficulty-based value selection 2020-12-18 00:59:41 +01:00
main_30.cpp [Decompilation] [th01] 16-bit integer to string conversion 2020-07-27 17:22:16 +02:00
main_31.cpp [Decompilation] [th01] Stage objects: Background allocation and blitting 2020-12-01 00:34:18 +01:00
main_32.cpp [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
main_33.cpp [Decompilation] [th01] Difficulty-based value selection 2020-12-18 00:59:41 +01:00
main_34.cpp [Decompilation] [th01] Retrieving and setting the default boss palette 2020-12-18 00:55:21 +01:00
main_35.cpp [Decompilation] [th01] Difficulty-based value selection 2020-12-18 00:59:41 +01:00
main_36.cpp [Decompilation] [th01] Difficulty-based value selection 2020-12-18 00:59:41 +01:00
main_37.cpp [Decompilation] [th01] Difficulty-based value selection 2020-12-18 00:59:41 +01:00
main_38.cpp [Maintenance] Move the polar coordinate conversion functions to their own file 2021-04-03 22:31:00 +02:00
mdrv2.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
op_01.cpp [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file 2021-02-20 23:49:45 +01:00
op_07.cpp [Separate translation units] [th01] ptn_copy_8_0_to_1() 2021-04-21 17:35:39 +02:00
op_09.cpp [Separate translation units] [th01] .PTN, .GRP, and .GRZ formats 2021-01-30 19:17:16 +01:00
op_12.cpp [Maintenance] [th01] Correctly declare the packfile functions in C land 2020-03-18 20:33:53 +01:00
ptn.cpp [Separate translation units] [th01] .PTN, .GRP, and .GRZ formats 2021-01-30 19:17:16 +01:00
ptn_0to1.cpp [Separate translation units] [th01] ptn_copy_8_0_to_1() 2021-04-21 17:35:39 +02:00
ranks.h [Reverse-engineering] [th04/th05] Resident structure 2020-01-03 21:43:43 +01:00
resident.hpp [Decompilation] [th01] Stage objects: STAGE?.DAT loading 2020-12-01 00:34:20 +01:00
resstuff.cpp [Maintenance] master.hpp transition: Resident data 2020-11-15 21:28:55 +01:00
score.h [Maintenance] Define the number of score digits in a consistent place 2020-07-27 17:09:07 +02:00
th01.inc [Decompilation] [th01] FUUIN.EXE resident structure data retrieval 2020-05-25 15:22:53 +02:00
vsync.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
ztext.c [Build] [th01] Only compile shared single-file translation units a single time 2020-11-04 14:47:52 +01:00
zunsoft.cpp [Maintenance] Move the polar coordinate conversion functions to their own file 2021-04-03 22:31:00 +02:00