IRC logs for #opendune on OFTC at 2009-10-08
⏴ go to previous day
00:00:15 <Xaroth> right, TrueBrain , you're famous
00:00:30 <Xaroth> we had 1 visitor to the forum comming from a search: "
00:00:30 <Xaroth> we had 1 visitor to the forum comming from a search: "dune 2 truebrain
00:00:38 <Xaroth> er.. right.. irssi is messed up sometimes :P
00:01:43 <Xaroth> (what else could it be :P )
07:19:34 *** Xaroth_ has joined #openDune
08:34:52 *** Xaroth has joined #openDune
08:34:52 *** ChanServ sets mode: +o Xaroth
09:19:13 <nsz> ansi c89 == iso c90 (the american standard happened earlier than the international, but they are the same)
09:19:25 <nsz> and of course none of them is freely available..
09:20:09 <nsz> but you can get the latest draft of the document for free or the 2nd k&r book..
09:20:27 <TrueBrain> why do they make standards non-free ... makes them useless,not? :(
09:44:56 <TrueBrain> okay ... sending 0x80+ to an int8 .. I can solve that 2 ways .. in all cases it is a sign-extend, so I can just do that in the decompiler, and use the uint16 version of the instruction
09:45:09 <TrueBrain> or I can change the wrapper of the sign-extend version, to accept uint8, and that I case it later on
10:23:38 <TrueBrain> I went for the first approach :)
10:29:39 <DorpsGek> SVN: truebrain (r183) -Codechange: make decompiled/ warning-free
10:50:07 <DorpsGek> SVN: truebrain (r184) -Codechange: make src/ warning-free
10:50:15 <DorpsGek> SVN: truebrain (r185) -Add: make warnings act like errors
10:50:28 <TrueBrain> there you go, a C89 product
10:51:06 <TrueBrain> now I wonder if gcc 2.95.3 can compile this :p
11:09:23 <DorpsGek> SVN: truebrain (r186) [LibEMU] -Codechange: // comments to /* */ comments
11:10:55 <TrueBrain> error: initializer element is not computable at load time <- I don't get it ...
11:11:00 <TrueBrain> HardLink hl = { cs, ip, proc };
11:11:09 <TrueBrain> typedef struct HardLink { uint16 cs; uint16 ip; void (*proc)();} HardLink;
11:38:34 <DorpsGek> SVN: truebrain (r187) [LibEMU] -Codechange: make LibEMU C89 compatible
11:38:50 <DorpsGek> SVN: truebrain (r188) [LibEMU] -Add: enable '-ansi -pedantic' and treat all warnings as errors
11:39:00 <TrueBrain> that should make glx happy :)
11:47:23 <TrueBrain> fuck, 'fileno' only exists in non-ansi
11:47:34 <TrueBrain> for linux this was easy to avoid .. for mingw not so much
11:52:11 <TrueBrain> and for some reason I can no longer produce libemu.dll :s
11:55:28 <DorpsGek> SVN: truebrain (r189) [LibEMU] -Fix (r187): minor fixes for cross-compiling
11:55:36 <DorpsGek> SVN: truebrain (r190) [LibEMU] -Fix: cleaned up the Makefile a bit
11:56:24 <DorpsGek> SVN: truebrain (r191) [LibEMU] -Fix (r190): nasty forgotten statement
12:01:54 <TrueBrain> Program terminated with signal SIGALRM, Alarm clock.
12:01:57 <TrueBrain> something is wrong :p
12:09:22 <DorpsGek> SVN: truebrain (r192) [LibEMU] -Codechange: prettify!
12:10:01 <DorpsGek> SVN: truebrain (r193) [LibEMU] -Fix: switch to POSIX safe sigaction (instead of non-compatible signal(), which breaks in ANSI)
12:10:16 <DorpsGek> SVN: truebrain (r194) -Fix: cleaned up the Makefile a bit
12:12:06 <TrueBrain> I have a nice suprise for you ;) A lot of changes :)
12:12:21 <TrueBrain> can you pretty please test LibEMU and OpenDUNE with both mingw and MSVC? And MSVC in C should work now too :)
12:12:28 <TrueBrain> let me know any warnings/errors (there should be none)
12:12:42 <glx> hmm thunderbird tells me opendune.org is not secure.opendune.org (certificate related)
12:14:00 <TrueBrain> https has the openttd certificate loaded ;)
12:17:00 <glx> 4 warnings for libemu with MSVC
12:17:19 <glx> Avertissement,...1,...warning C4244: '=' : conversion de 'uint16' en 'uint8', perte possible de données,...d:\developpement\libemu\src\int33.c,...147
12:17:19 <glx> Avertissement,...2,...warning C4244: '=' : conversion de 'uint16' en 'uint8', perte possible de données,...d:\developpement\libemu\src\libemu.c,...136
12:17:19 <glx> Avertissement,...3,...warning C4244: '=' : conversion de 'int16' en 'uint8', perte possible de données,...d:\developpement\libemu\src\math.c,...374
12:17:19 <glx> Avertissement,...4,...warning C4244: '=' : conversion de 'int16' en 'uint8', perte possible de données,...d:\developpement\libemu\src\math.c,...390
12:21:34 <glx> of course bool is not defined now for opendune
12:25:44 <TrueBrain> bool is defined for OpenDUNE
12:27:42 <TrueBrain> does that fix all warnings in LibEMU?
12:28:24 <glx> define is disabled for msvc ;)
12:28:48 <glx> but let me fix the projects and this include first
12:36:27 <glx> should we treat warnings as errors for msvc too ?
12:36:41 <TrueBrain> although they do give other errors
12:37:08 <glx> hmm better not do it then
12:37:59 <TrueBrain> but my patch works? :)
12:38:11 <DorpsGek> SVN: glx (r195) [LibEMU] -Change: let MSVC compile .c files as C
12:40:17 <DorpsGek> SVN: truebrain (r196) [LibEMU] -Fix: MSVC warnings about silent (u)int16 -> (u)int8 casting (MSVC doesn't like that :p)
12:40:44 <TrueBrain> one down, one to go :)
12:40:53 <DorpsGek> SVN: glx (r197) -Change: let MSVC compile .c files as C
12:45:34 <glx> (2 of them are caused by linking opendune release with debug libemu)
12:48:00 <TrueBrain> how much does it solve it?
12:50:07 <glx> all except the latest (caused by assert)
12:51:11 <TrueBrain> I have no idea what that last line means
12:51:17 <TrueBrain> I am not french, remember ;) Ghehehe :p
12:52:16 <glx> 'function' : not all control paths return a value
12:57:38 <TrueBrain> does the result owrk?
12:57:56 <DorpsGek> SVN: truebrain (r198) -Fix: MSVC warnings about silent (u)int16 -> (u)int8 casting (MSVC doesn't like that :p)
12:58:19 <glx> yes (well same as before ;) )
13:04:22 <TrueBrain> tcc fails on the assert_compile .. that sucks
13:07:38 <TrueBrain> uint16 + uint8 = sizeof() 4 :(
13:10:13 <TrueBrain> tcc claims to support __attribute__((packed))
13:13:41 <TrueBrain> I can't it pass tcc compiler ...
13:16:06 <TrueBrain> problem is that: uint16 + uint8 + uint16 + uint8 is not 6, but 8 ...
13:19:56 <TrueBrain> and I can't find a real way to solve that problem :(
13:20:09 <TrueBrain> in fact, packed and aligned seems to do nothing for a struct :(
13:20:30 <nsz> generating code for that is extremely ugly
13:20:56 <nsz> i mean using unaligned uint16
13:21:06 <TrueBrain> ah, yes .. but that is what is needed :(
13:21:32 <TrueBrain> at 0x0049 in the Unit struct is a uint32
13:21:36 <TrueBrain> (to give 1 example)
13:24:31 <TrueBrain> but it really doesn't ;)
13:25:34 <TrueBrain> uint16 a __attribute__((packed));
13:25:36 <TrueBrain> uint16 b __attribute__((packed));
13:25:37 <TrueBrain> uint16 c __attribute__((packed));
13:25:39 <TrueBrain> uint8 d __attribute__((packed));
13:25:40 <TrueBrain> uint16 e __attribute__((packed));
13:25:42 <TrueBrain> uint8 f __attribute__((packed));
13:25:43 <TrueBrain> } __attribute__((packed)) a;
13:25:45 <TrueBrain> assert_compile(sizeof(a) == 10);
13:25:49 <TrueBrain> sorry :) I wanted to paste the pastebin URL :(
13:27:48 <TrueBrain> but it is just insane, to add the entry for EVERY VARIABLE :p
13:28:08 <glx> and with .align directive ?
13:28:47 <TrueBrain> dunno how to get thatone to work :)
13:28:54 <nsz> #define _PCK __attribute__((packed));
13:29:04 <nsz> then it's a bit shorter :)
13:30:04 <TrueBrain> #pragma pack(1) works too
13:30:50 <TrueBrain> just not the push and pop version
13:32:17 <TrueBrain> ah, it does, but only with #pragma, not via __pragma
13:35:23 <TrueBrain> any idea how to put this correctly in a define:
13:35:27 <TrueBrain> #define MSVC_PACKED_BEGIN #pragma pack(push, 1)
13:37:21 <glx> there's __pragma() because it's not possible otherwise
13:38:56 <glx> #pragma are handled by preprocessor, so I think it's impossible to use them with #define
13:41:33 <TrueBrain> okay .. other solution ... you can also put __attribute__((packed)) BEFORE the var .. so then it can be done relative 'nice'
13:42:32 <TrueBrain> 1: /* 0000(2) */ P uint16 index; /*!< The index of the Unit in the array. */
13:42:36 <TrueBrain> 2: /* 0000(2) */ PACK uint16 index; /*!< The index of the Unit in the array. */
13:42:41 <TrueBrain> or other suggestions?
13:47:03 <TrueBrain> I guess P can conflict, where PACK most likely never does
13:59:40 <TrueBrain> LOL! all the time including building.h works, but when I include <stdio.h> before building.h, it fails :p
14:01:11 <TrueBrain> I undef it explicit
14:02:03 <TrueBrain> can't find it defined anywhere ..
14:05:10 <glx> hmm but stdio.h is included before building.h in building.c and that works
14:05:26 <TrueBrain> on tcc, if I move the stdio.h below building.h in building.c, it works
14:05:29 <TrueBrain> if it is above, it fails
14:05:34 <TrueBrain> (the assert_compile)
14:06:27 <TrueBrain> it is not realted to the name PACK, as renaming it doesn't solve it
14:07:04 <TrueBrain> and indeed, the sizeof is different afterwards
14:07:11 <glx> can tcc output preprocessed source ?
14:08:44 <TrueBrain> indeed the attribute is gone ..
14:10:58 <TrueBrain> #define __attribute__(x)
14:18:00 <DorpsGek> SVN: truebrain (r199) [LibEMU] -Fix: allow compiling in non-ANSI
14:19:30 <DorpsGek> SVN: truebrain (r200) [LibEMU] -Fix (r199): typo in comment
14:20:22 <DorpsGek> SVN: truebrain (r201) [LibEMU] -Fix: split CFLAGS in 2 lines for feature extension to other compilers
14:20:33 <DorpsGek> SVN: truebrain (r202) -Fix: split CFLAGS in 2 lines for feature extension to other compilers
14:20:55 <DorpsGek> SVN: truebrain (r203) -Fix: allow compiling in non-ANSI
14:21:38 <DorpsGek> SVN: truebrain (r204) -Add: add struct pack support for Tiny C Compiler (TCC)
14:21:49 <DorpsGek> SVN: truebrain (r205) [LibEMU] -Add: add struct pack support for Tiny C Compiler (TCC)
14:22:05 <TrueBrain> there ... it compiles :) Running is another story I guess
14:29:38 <TrueBrain> tcc keeps on generating 64bit files .. I want 32bit! :p
14:31:25 <TrueBrain> finally .. now it needs to find the right crt0.o ... :p
14:31:49 <glx> Program Termination: jumped to 41C8:057B, which is not decompiled.
14:31:49 <glx> The jump was triggered at decompiled/cs__B4A2.c:1833
14:31:49 <glx> The jump appears to originate from B4A2:0569.
14:32:03 <glx> I think it jumps somewhere inside the same function
14:32:29 <TrueBrain> it happens a lot that jumps go inside their own function
14:32:33 <TrueBrain> to skip a few lines of code, mostly
14:34:41 <TrueBrain> added to my todo list :)
14:36:08 <TrueBrain> first I need to make sure tcc picks the other libc to link to :p
14:38:05 <TrueBrain> :/lib64/libc.so.6: bad architecture :'(
14:43:21 <TrueBrain> lol: /lib32/libncursesw.so: referenced dll 'libc.so.6' not found
14:44:42 <TrueBrain> hmm .. now it compiled, and it tends to start, but crashes with a crashlog immediatly
14:47:04 <TrueBrain> with the JIT attached it seems to do something ..
14:47:15 <TrueBrain> although the screen stays black ... lol
14:51:05 <TrueBrain> haha, on runtime stack corruption :)
14:53:25 <TrueBrain> glx: level 2 Atreides?
14:53:42 <glx> I wish I could finish level 1
14:54:01 <glx> but as I can only build and place concrete stuff
14:58:54 <DorpsGek> SVN: truebrain (r206) [JIT] -Add: 4 more problems found by Alberth, TrueBrain and glx
14:59:11 <DorpsGek> SVN: truebrain (r207) -Update (r206): update decompiled code
14:59:31 <TrueBrain> that were all the crash-logs I have around
15:03:52 <glx> just looking the changes in B4A2, a resolved jump became a new unresolved jump ;)
15:04:03 <TrueBrain> only in some cases :)
15:10:19 <TrueBrain> k .. me continues playing H4 ..
15:10:32 <TrueBrain> tomorrow another day to try my idea of function-detection :)
15:16:15 <TrueBrain> all this time no new data .. and all of a sudden A LOT of new data :p
15:19:37 <TrueBrain> ghehe .. I all of a sudden get a random icon over my radar :p
15:19:40 <TrueBrain> sometimes things go wrong ;)
15:27:32 <TrueBrain> stupid AI gets new harvester if you destroy his ...
15:33:21 <TrueBrain> k, have a good evening all!
16:30:57 <Xaroth> got a flower from KPN....
16:33:20 <Xaroth> a simple 'sorry for fucking up your internet' should have been enough...
16:33:32 <Xaroth> seeing WE STILL HAVE A SUCKY CONNECTION >:(
22:00:23 <TrueBrain> after 5 hours you say: :o?
22:22:05 <Xaroth> it was -THAT- quiet :P
22:48:33 <DorpsGek> SVN: truebrain (r208) [JIT] -Add: mapped another 155 functions (campaign 4, start of campagin 5)
22:50:05 <DorpsGek> SVN: truebrain (r209) -Update (r208): update decompiled code
22:51:34 <TrueBrain> there, enough for today :)
22:51:41 <TrueBrain> A, H and O lvl4 done
continue to next day ⏵