32 bit usecode support

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

32 bit usecode support

Post by artaxerxes »

Exult Dev Team:

I was wondering if the 32 bit usecode support was integrated in the rc1 or if I have to go to the CVS tarball.

I've tried running wuc against 02C1.uc (the one with tons of books) and there are no error messages appearing at all (it should say according to wjp, "Error: code/data size > 64Kb and not in ext32 mode!" but nothing appears.

I am running Exult rc1 on Linux.

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

I think I only implemented it a week after RC1, so you'll have to get a recent CVS version.

Only the new wuc will give these error messages. The old one doesn't even notice it's outputting broken usecode :-)

-Willem Jan
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

thanks a lot.

I'll update my tree asap.

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

Ok, let me know how/if it works.

-Willem Jan
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

Sure.

I am compiling the source right now.

Btw, I've had the hardest time compiling exult since you guys 'forced' the presence of libglade on the system. I've had to d/l all the stuff to install libglade for no reason since I don't plan on playing with Exult Studio soon.
Maybe you want to look at the configure script or the source code.

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

The easiest way to remove that dependency is just to remove the 'mapedit' directory from the top-level Makefile.am, I think. (If you don't need exult studio, that is)

And, yes, we should really fix it...


/me mumbles something unpleasant about autoconf and automake
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by drcode »

That's my fault, and I'll try to fix it soon.
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

ok,
I compiled Exult and modified 02C1 so that it shows addsi32 at the right spots.

Consequence, no more error messages when running wuc. That's the good news.

The bad news is that when I run Exult, start a new game, teleport to where some books can be found and dclick on them, I get a SDL parachute deployed.

At least, the game doesn't crash at the very begining.... there is thus some progress... :)

Btw, it's very exciting to see the CVS version is tagged 0.99... :)

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

Hmm, a fixed 02C1 function did work for me.

Could you send me the usecode file that crashes and the fixed disassembly of function 02C1?

Thanks,
Willem Jan
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

Willem:

never mind. My mistake. I put addsi32 to every single addsi and launched Exult and it worked!

Thanks for the help.
Just FYI wuc did not report any error even though it was needing the addsi32 code. Maybe you want to look at wuc.

Again thx for your help. We are on our way to get something solid!

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

I'd still really like to see the crashing usecode file, though, since wuc indicated exactly the right places for me.

-Willem Jan
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

now what about that????
The very same usecode file works on my home machine (Exult 0.99CVS from yesterday) and crashed on my work machine (Exult 0.99CVS from yesterday too)!!
The only difference is that I am running Mandrake 8.0 at work and 8.1 at home...

Artaxerxes

ps: wjp, I'll send all you asked for at your email address
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

another problem:

I cannot run wud on a 32 bit encoded usecode function. This is what it gives:

$ ../wud -s 02C1.uco >02C1.uc
$ more 02C1.uc
Function #0 (02C1H), offset = 00000000, size = 10b4e, data = 101c1
Functions: 1
$


(I prepared 02C1.uco from a 32 bit enabled 02C1.uc, that is by adding .ext32 and addsi32 to the uc file).

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

You need to run wud -s 02C1.uco -a to dissassemble it.
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

oups... sorry... new option I didn't see before..

Artaxerxes
Klown Killer

Re: 32 bit usecode support

Post by Klown Killer »

I understand nothing of what you're saying guys.... =D
(maybe my english ?...) by the way, I'm glad to see that you help us..
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

*grin*
That's why I am the programmer and you are the webmaster!

:)

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

Do you have gdb on your work machine? If so, could you give me a stacktrace of the crash? ('bt' in gdb)
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

#0 0x08149690 in Font::get_text_width (this=0x84acb18, text=0x81f37c0 " ",
textlen=1) at vgafile.h:140
#1 0x08148a7a in Font::paint_text_box (this=0x84acb18, win=0x82581b8,
text=0x86e1b62 "LES GRANDS HI\022ROPHANTES", x=42, y=40, w=122, h=126,
vert_lead=1, pbreak=0) at font.cc:94
#2 0x080d0fab in Game_window::paint_text_box (this=0x8256b08, fontnum=8,
text=0x86e1b62 "LES GRANDS HI\022ROPHANTES", x=42, y=40, w=122, h=126,
vert_lead=1, pbreak=0, shading=-1) at shapes/fontvga.h:45
#3 0x08188b8d in Text_gump::paint_page (this=0x86e0080, gwin=0x8256b08, box=
{x = 36, y = 10, w = 122, h = 130}, start=0) at Text_gump.cc:95
#4 0x0818211c in Book_gump::paint (this=0x8256b08, gwin=0x8256b08)
at ../rect.h:38
#5 0x08188c24 in Text_gump::show_next_page (this=0x86e0080, gwin=0x8256b08)
at Text_gump.cc:129
#6 0x081215d5 in Usecode_internal::show_pending_text (this=0x8282080)
at ucinternal.cc:312
#7 0x0812bc7c in Usecode_internal::run (this=0x8282080, fun=0x82c2fc0,
event=1, stack_elems=0) at ucinternal.cc:1898
#8 0x0812e1bb in Usecode_internal::call_usecode (this=0x8282080, id=705,
obj=0x861ef38, event=double_click) at ucinternal.cc:2254
#9 0x08177232 in Game_object::activate (this=0x861ef38, umachine=0x8282080,
event=1) at objs.cc:825
#10 0x080cfac3 in Game_window::double_clicked (this=0x8256b08, x=210, y=91)
at gamewin.cc:2389
#11 0x080a12a4 in Handle_event (event=@0xbffff4a0) at exult.cc:845
#12 0x080a0b2f in Handle_events () at exult.cc:670
#13 0x080a071f in Play () at exult.cc:574
#14 0x0809eb2d in exult_main (runpath=0xbffff9b5 "/usr/local/bin/exult")
at exult.cc:423
#15 0x0809cd22 in main (argc=1, argv=0xbffff84c) at exult.cc:260
#16 0x401490de in __libc_start_main () from /lib/libc.so.6
artaxerxes
Site Admin
Posts: 1310
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by artaxerxes »

I would like to add that the effect of running exult through gdb is _FREAKING COOL_!!!

Neon fluo type Ankh and so forth.... AWESOME!

Artaxerxes
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

Just a quick note: this has been solved; it was caused by a broken fonts.vga
Valliant Dragon

Re: 32 bit usecode support

Post by Valliant Dragon »

Hey,

Anyone mind mailing me some documentation on the 32 bit usecode functions so I can work them into Usecode Studio?

Thanks,
Valliant Dragon
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by drcode »

You're probably going to have to get by like the rest of us: Download the source code and look at it. I'd guess it's in 'usecode/ucinternal.cc'.
wjp
Site Admin
Posts: 1708
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by wjp »

The 32 bit stuff is actually documented :-)

docs/usecode32.txt
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: 32 bit usecode support

Post by drcode »

Oops. Sorry.
Locked