about Exult tools

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

about Exult tools

Post by artaxerxes »

Hi all,

is there any tools to convert the usecode file from 16 bits to 32 bits?

thx
Artaxerxes
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by marzo »

Not directly, no; but if I am not mistaken, one could dump all with rip/wud, edit the header to be 32-bit and reassemble with wuc/rip. Or someone could write a program to do that directly.

I assume this is for SI French? (maybe even for the book function?) If you are interested only in larger amounts of text, it would be a lot easier.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by artaxerxes »

do you mean it would be a lot easier..... to be in 32 bit? or something else?

Anyways, yes, it would be for translation. The english text just fits in 16 bits for the book function. Other languages tend to use more space than English, so it fails hard.

We did a 32 bit usecode conversation for SI-french using rip/wud and rip/wuc but it is not very clean (jump offset were an issue for some functions). So I was thinking, why not just start from 32 bit usecode. It would be the creating of patches easier and we could automate from translation too. All of that is resting on having 32 bit usecode.

Artaxerxes
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by marzo »

do you mean it would be a lot easier..... to be in 32 bit?
Yes, that is what I meant. But on further reflection, there would actually be little difference between the two cases (32-bit due to text size vs 32-bit due to code size) because the size of offsets for addsv/addsi opcodes would change, and this would change the values of jump offsets; the difference would be that jump offsets are less likely to become 32-bit if the function size is mostly due to text.

In either case, the program would have to recalculate jump size offsets. Given that UCC has been recently modified to do just that, it wouldn't be too hard to write a separate utility for translation which recalculates string/jump offsets and outputs corrected opcodes and offsets.

Or UCC could be used to translate, by having the text in a separate, easily modified file, which declares the string constants and the book/dialog function making reference to the strings in that earlier file. But this would be just as tricky as it would require an adaptation of the tools that no doubt exist for translation.

Which brings me to the point: is there any specific tool that is being used in translations? If the source is available, I could modify it to handle the 32-bit conversion.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by artaxerxes »

The Italian team have made such a tool I believe. It may have been used for other translations as well.

thx
Artaxerxes
The Ancient One

Re: about Exult tools

Post by The Ancient One »

Hallo,

I’m The Ancient One, one of the Italian translator of BG (now working on SI).

I’m quite sure that our tool, written by DK, already does what you’re asking for.
We added this feature at least two years ago in order to translate the books from SI.

Right now I’m not sure if this needs a “custom patch” for Exult, but I don’t think so.

Hope this helps.
-diego


PS
This is my first post on the Phorum.
So… thank you very much for your wonderful work on Exult. I love Exult so much that I come here almost daily in search of news! :-)
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by marzo »

Right now I’m not sure if this needs a “custom patch” for Exult, but I don’t think so.
If it converts to 32-bit usecode, complete with correctly updated 32-bit string and jump offsets, then no patch should be needed (in fact, the original games would choke with 32-bit usecode).
I love Exult so much that I come here almost daily in search of news!
Yes, I can tell :-p (from here, for those who are wondering).
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by Malignant Manor »

You could do like Marzo recommended to me quite awhile ago and separate the usecode into two or more functions. (If I am understanding correctly). It's really easy and a quickly copy-pasted and edited example will follow this sentence.


extern BG_BOOK_QUALITY_101_OR_MORE object#()();
extern BG_BOOK_QUALITY_100_OR_LESS object#()();

BG_BOOK shape#(1301) ()
{
book_mode();
UI_play_sound_effect2(0x005E, item);
var quality = get_item_quality();

if (get_item_quality() > 100)
item->BG_BOOK_QUALITY_101_OR_MORE ();

else if (get_item_quality() BG_BOOK_QUALITY_100_OR_LESS ();
}


BG_BOOK_QUALITY_101_OR_MORE object#()()
{
var quality = get_item_quality();

if (quality == 101)
say("Book 101");

else
say("Qualities 149 and up are unwritten.");

return;
}



Second file has this:



BG_BOOK_QUALITY_100_OR_LESS object#()()
{
var quality = get_item_quality();

if (quality == 0)
say("Book 0");
return;
}
DK

Re: about Exult tools

Post by DK »

Greetings,
yes, the U7Ed (the editor for Ultima7 fan translation) can automatically convert, if needed, the jump opcode from 16 to 32 bit.
Just ask me for the source, but I think can be more useful a little discussion, because the algo it's... mmm... how can I say that? A little "complicated" :D
Well, isn't written very well... but works ;)
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: about Exult tools

Post by marzo »

Just ask me for the source
Can you mail it to me? I'd like to take a look (and compare to the way I've done it in UCC).
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
DK

Re: about Exult tools

Post by DK »

Of course, just the time to find some little docs I've written for it...
Locked