as mentioned in http://exult.info/forum/viewtopic.php?p=332697#p332697 I need some help to setup something for the translation.
Here is the issue: the books contain so much text, that some functions *just* fits the 16 bit usecode (in particular the 0x02C1 function). Translated to French (which takes about 30% more space), it blows over. That's why Exult has supported 32 bit usecode for a while, using the '.ext32' header.
The problem is, in order to use this header, you have to rip, decompile, add the header, translate, recompile and glue the functions. It works but it's a pain. It would be so much better if using a tool, one could convert the usecode to use phrase numbers instead of string offsets, so the translation could almost be done directly on the usecode file (no need to blow it up) and have the revert function too (which recalculates the correct offsets), so that Exult could run the resulting usecode.
For instance, the code part of the 02C1 function starts with (from wud for clarity):
Code: Select all
.code
.argc 0001H
.localc 0002H
.externsize 0000H
0000: 48 push eventid
0001: 1F 01 00 pushi 0001H ; 1
0004: 22 cmpeq
0005: 05 BA 06 jne 06C2
0008: 3E push itemref
0009: 1F 5E 00 pushi 005EH ; 94
000C: 39 A1 00 02 calli _play_sound_effect2@2 (00A1)
0010: 3E push itemref
0011: 39 6A 00 01 calli _book_mode@1 (006A)
0015: 3E push itemref
0016: 38 1C 00 01 callis _get_item_quality@1 (001C)
001A: 12 00 00 pop [0000]
001D: 21 00 00 push [0000]
0020: 1F 00 00 pushi 0000H ; 0
0023: 22 cmpeq
0024: 05 0F 00 jne 0036
0027: 1C 00 00 addsi32 L0000 ; ~~PHILIPHUS'S WIS...
002A: 33 say
002B: 1C 29 00 addsi32 L0029 ; ~~An enlightening...
002E: 33 say
002F: 1C 63 00 addsi32 L0063 ; ~Beginning with t...
0032: 33 say
0033: 06 8C 06 jmp 06C2
0027: 1C 00 00 addsi32 L0000 // first translated phrase
...
002B: 1C 00 00 addsi32 L0001 // second translated phrase
...
002F: 1C 00 00 addsi32 L0002 // third translated phrase
Then using the revert function, all the offsets would be updated in-situ.
Would anyone feel like tackling this? I've tried, but I failed.
Artaxerxes