IRC logs for #opendune on OFTC at 2009-10-09
⏴ go to previous day
02:19:28 *** Xaroth_ has joined #openDune
08:00:12 <TrueBrain> argh, it is fucking annoying to add something that analyzes a while function, without redoing most of the work :(
08:00:23 <TrueBrain> (in the decompiler)
08:01:52 <Xaroth_> think the smaller things, like automatically parsed if's also go quite far :)
08:01:59 <Xaroth_> seeing there's a gazillion of em
08:09:55 <TrueBrain> they are easy to resolve by humans :p
08:10:04 <TrueBrain> either way ... they require exactly the thing I just named :)
08:12:27 <TrueBrain> but I now have all those small functions which might or might not overlap
08:12:38 <TrueBrain> and I have no idea how to reconstruct that in a good and simple way
08:12:47 <Xaroth_> My brain is still fried from yesterday, was at a customer all day for a 'training' .. aka getting more information about their systems and their vision
08:35:22 *** Xaroth has joined #openDune
08:35:22 *** ChanServ sets mode: +o Xaroth
08:40:52 <Xaroth> I'm still pissed off at my connection...
08:44:00 <TrueBrain> at least I can fabricate that :p
08:46:19 <TrueBrain> no, I cannot in all cases
08:46:28 <TrueBrain> only if it is not followed by a jump-condition
08:46:35 <TrueBrain> and even that doesn't have to be directly ..
08:46:50 <TrueBrain> why do I keep on forgetting that :p
08:47:42 <TrueBrain> assigns, that I can do :)
08:50:44 <TrueBrain> I just realised Dune2 doesn't use retf with a value to remove the params from the stack
08:50:48 <TrueBrain> it lets the caller do that ..
08:55:03 <TrueBrain> k, 3 things I want to do: functions, if-statements (to do: if (ax < 0x100) instead of the current constructs), and local variables and stuff
09:33:14 <TrueBrain> emu_cmpw(&emu_ax, emu_cx);
09:33:15 <TrueBrain> if (emu_ax <= emu_cx) { f__01E7_0210_0021_252B(); return; }
09:33:18 <TrueBrain> how you like me now biatch!
09:37:28 <Xaroth> oooooOOOoo new laptop for the datacenter
09:38:12 <TrueBrain> hmm .. signed comparing is tricky
09:50:42 <Xaroth> oh, loving the ifs TrueBrain :o
09:50:54 <Xaroth> muuuuch more readable now
09:53:01 <Xaroth> plus it saves us both typing :)
09:56:46 <TrueBrain> it skips all cases it can't be 100% sure about the if
09:56:48 <TrueBrain> so that is good too :)
09:57:14 <Xaroth> how does ASM do if > ?
09:57:59 <Xaroth> er, minus X , if above 0
09:58:05 <Xaroth> or something more.. dodgy?
09:58:06 <TrueBrain> you make no sense to me
09:58:23 <TrueBrain> you can also take an effort to explain better what you try to say ;)
09:59:22 <Xaroth> instead of if ( emu_ax > XXX ) does it do a cmpw on -XXX followed by an if positive number?
09:59:39 <TrueBrain> assembly doesn't do ifs with numbers
09:59:53 <TrueBrain> it does cmp(emu_ax, XXX); if (flags.zf) or something of the like
10:01:19 <TrueBrain> (you should have noticed that by now :p :p)
10:01:43 <TrueBrain> that makes it also a bit tricky to recover the ifs with values
10:05:12 <TrueBrain> emu_testb(&emu_get_memory8(emu_ds, emu_si, 0x2AE), 0x8);
10:05:13 <TrueBrain> if ((emu_get_memory8(emu_ds, emu_si, 0x2AE) & 0x8) == 0) { f__01E7_03DA_0036_0570(); return; }
10:05:16 <TrueBrain> that seems to work too :p
10:06:13 <Xaroth> isn't that a bit double tho?
10:06:37 <TrueBrain> something below can depend on the flags of testb
10:06:41 <TrueBrain> so I can't remove it
10:18:50 <TrueBrain> emu_orw(&emu_ax, emu_ax);
10:18:53 <TrueBrain> if (emu_ax != 0) { f__01E7_0554_0022_E0F1(); return; }
10:25:18 <Xaroth> something tells me that didn't work as planned :P
10:25:41 <TrueBrain> even worse, there is no logic C construct to do that
10:26:08 <TrueBrain> in C you can't do delayed if-statements
10:26:16 <TrueBrain> (for obvious reasons :p)
10:28:14 <Xaroth> cuz if this originates from C++ there has to be _something_ C++-like that made that
10:28:28 <TrueBrain> no, this is a completely different application :p
10:28:32 <TrueBrain> much smaller, so easier to test on
10:28:47 <TrueBrain> but that is besides the point
10:28:53 <TrueBrain> possible that C code does generate this in assembly
10:29:03 <TrueBrain> but you can't make a logic C construct which puts it back :p
10:30:52 <TrueBrain> but the most worse is, that my app tried to optimize the C wrong :p
10:31:12 <TrueBrain> and I don't know a simple way to detect this, besides making it so that a move invalidates this optimization :p
10:44:03 <TrueBrain> if (emu_ax <= 0xFFFF) { /* Unresolved jump */ emu_ip = 0x1B19; emu_last_cs = 0x01F7; emu_last_ip = 0x1B0F; emu_last_length = 0x0021; emu_last_crc = 0x2D85; emu_call(); return; }
10:45:18 <TrueBrain> emu_cmpw(&emu_ax, 0xFFFF);
10:45:20 <TrueBrain> - if ((emu_flags.cf || emu_flags.zf))
10:45:42 <TrueBrain> it indeed does exactly that ..
10:50:45 <TrueBrain> another: if (var < 0) {} ... lol
10:54:11 <TrueBrain> i wonder if it is a bug on my side of the interpertation of the data, or that it is the program being silly
10:59:20 <TrueBrain> nsz: yes: do a compare, run code, use the compare
11:00:03 <nsz> what if the flags are modified while the code runs
11:00:03 <TrueBrain> like: cmp; pushf; <code>; popf; use result
11:00:25 <TrueBrain> well, in this case it is an assign, which doesn't require push/pop
11:00:29 <nsz> then you can put the reult in a variable
11:02:30 <TrueBrain> but that still is a bit tricky ..
11:02:39 <TrueBrain> (to automate, that is :p)
11:02:48 <TrueBrain> but okay, it happens rarely, so a human can do that :)
11:03:05 <TrueBrain> I do wonder about above 0xFFFF problem ... if it is my mistake, or a real sillyness of Dune2
11:05:00 <nsz> well a compiler should be able to catch useless conditionals
11:05:49 <nsz> but with an old c++ compiler you cannot be sure..
11:07:04 <TrueBrain> so I need to confirm if it is a compiler failure to remove, or a real problem :p
11:13:16 <TrueBrain> or at least make it compile :p (as with -pedantic, it doesn't compile :p)
11:14:16 <nsz> does not compile? the <= ffff?
11:14:39 <TrueBrain> oh, because of the -Werror btw :p
11:14:53 <TrueBrain> it triggers a warning (as it should) which is errored ;)
11:22:14 <TrueBrain> I still need to find a way to combine functions to get the original function back :) Can't move myself to do so much rewriting to make that happen :p
11:22:20 <TrueBrain> oh well .. tomorrow maybe :p
13:17:02 <Xaroth> tomorrow finally some time to spend on opendune
16:06:58 *** Alberth has joined #openDune
16:17:16 *** Xaroth has joined #openDune
16:17:16 *** ChanServ sets mode: +o Xaroth
16:23:57 <Alberth> hmm, I just had a fuzzy change :) I was playing harkonnen level 2, and it suddenly jumped to playing atreides while messing with the menu's :D
16:24:11 <TrueBrain> somewhere there is still such a bug ....
16:24:19 <TrueBrain> and I still have no idea :) Some instruction fucks up :)
16:25:24 <TrueBrain> from the hangs I see from time to time, I guess something creates an infinite loop, and rewrites parts of memory .. in your case the position which stores your house :p
16:25:33 <Alberth> the game is getting more stable for me
16:26:15 <Alberth> I have another crash, but that was after the above change. Is that still useful?
16:26:39 <TrueBrain> dunno .. what does it say?
16:27:01 <Alberth> Program Termination: jumped to 1391:0573, which is not decompiled.
16:27:01 <Alberth> The jump was triggered at decompiled/cs__1391.c:1662
16:27:01 <Alberth> The jump appears to originate from 1391:053A.
16:27:10 <TrueBrain> that is useful I guess
16:28:12 <TrueBrain> will do them by the end of the weekend or so :)
16:29:07 <glx> you're lucky, I still can't build anything except concrete stuff
16:29:16 <TrueBrain> glx: stack overflow I hope?
16:29:37 <TrueBrain> your inability to click the right button? :p :p :p
16:29:39 <TrueBrain> just kidding of course :)
16:30:19 <glx> hey I managed to pass 3 missions with dosbox, so I know where to click
16:30:32 <Alberth> I too must manoevre the mouse pointers around several screen area's in order to get something built :)
16:31:01 <glx> no, I can't go to the select what to build menu
16:31:20 <TrueBrain> I really wonder what exactly is doing the weirdness you see from time to time :(
16:31:28 <TrueBrain> (the visual stuff I really mean)
16:31:37 <TrueBrain> the stackoverflows will solve theirself :)
16:31:57 <glx> yes once jumps will be "jumps" again
16:32:48 <Alberth> is it a unique colour? maybe you can catch the instruction doing it.
16:33:04 <TrueBrain> it is random garbage, at random times, to random positions
16:33:29 <TrueBrain> I suspect it has to do with mouse movement ...
16:33:56 <TrueBrain> or rather: hardware interrupts ..
16:34:10 <Alberth> with me it is always white and red dots
16:34:34 <glx> yes same here (when I see them)
16:34:48 <TrueBrain> sometimes there are also complete icons
16:34:58 <Alberth> one byte is one pixel?
16:35:08 <TrueBrain> euh ... let me chec
16:35:44 <Alberth> the red colour seems pretty unique to the screen eg when playing non-harkonnen :)
16:36:25 <TrueBrain> but how to know which colours it is ..
16:36:45 <Alberth> I see them too in the small map. that may be better.
16:37:10 <TrueBrain> they appears over the whole screen ... with other words: it polutes 0xa0000
16:37:36 <glx> maybe some buffers problems
16:37:57 <TrueBrain> I think the overlay manager, tbh
16:38:01 <glx> anyway it's harmful for now
16:38:01 <TrueBrain> just I can't confirm it, nor find it
16:39:17 <TrueBrain> yes, very harmful :) At random you get more money, units disapear, you switch sides, .. :)
16:41:54 <glx> but it will solve itself in time (like stack overflow I get)
16:42:24 <TrueBrain> for now I just hope it doesnt give corruption in the code-segments, which is then translated to our static data ...
16:43:04 <glx> does the red/white stuff happen with JIT too?
16:48:01 <TrueBrain> so it is most likely a flag I don't set correctly
16:48:06 <TrueBrain> or an instruction I implemented SLIGHTLY wrong
16:48:13 <TrueBrain> what ever it is .. it is small .. and hiding :)
16:50:02 <TrueBrain> I also noticed sandworms in general display poorly
16:50:07 <TrueBrain> dunno if that is also true on DOSBox
16:51:44 <Alberth> I remember I usually relied on the white dot in the radar screen.
16:52:27 <TrueBrain> so it was always a problem
16:53:09 <TrueBrain> k .. I guess now is as good time as any other to do a bit of shopping ...
17:58:36 <TrueBrain> argh, I am getting crazy ... it is so hard to not violate N layers and still introduce code that makes nice functions
18:30:15 <Alberth> Program Termination: jumped to 22A6:08EE, which is not decompiled.
18:30:15 <Alberth> The jump was triggered at decompiled/cs__22A6.c:2436
18:30:15 <Alberth> The jump appears to originate from 22A6:08F0.
18:30:51 <TrueBrain> downloaded crash.bin
18:30:51 <Alberth> crash file already uploaded
18:31:19 <TrueBrain> what level are you in? (and what house)
18:31:25 <Alberth> still no enemies has attacked me :)
18:31:42 <Alberth> harkonnen level 2, just about done building everything
18:32:10 <Alberth> I was moving units into a better defense position
18:34:06 <TrueBrain> save often ;) Ghehe :)
18:34:22 <TrueBrain> I am working on something that should avoid a lot of those problems
18:37:11 <TrueBrain> yeah, I moved the stack overflow to the decompiler!
18:51:15 <TrueBrain> it is so incredible tricky to restore the data and handle it correctly ...
18:51:20 <TrueBrain> there are so many corner cases ......
19:40:34 <Alberth> Program Termination: jumped to 0C3A:0E0C, which is not decompiled.
19:40:34 <Alberth> The jump was triggered at decompiled/cs__0C3A.c:3987
19:40:34 <Alberth> The jump appears to originate from 0C3A:0E05.
19:40:34 <Alberth> placing a slab of concrete
20:10:44 *** Xaroth_ has joined #openDune
20:32:20 *** Xaroth has joined #openDune
20:32:20 *** ChanServ sets mode: +o Xaroth
20:35:36 <Xaroth> ISP went to change the speed RIGHT WHEN I DIDN'T WANT THEM TO
20:35:42 <Xaroth> ... they sent me a flower tho
20:43:52 <TrueBrain> send them dead roses back :p
20:44:13 <TrueBrain> "My love for you is like this rose; dead"
20:44:28 <TrueBrain> (or is that really terrible?)
21:07:04 <TrueBrain> yeah, I am going to bed too .. maybe tomorrow I have more inspiration how to fix this problem in a nice and good way
21:07:11 <TrueBrain> else I go for the ugly and dirty :p Mwhaha
continue to next day ⏵