IRC logs for #opendune on OFTC at 2009-12-02
            
00:00:14 <glx> well signed shift
00:00:20 <Xaroth> hrnf
00:00:35 <glx> in C it's a normal shift ;)
00:00:42 <Xaroth> (something *= 40) >> 7
00:00:56 <Xaroth> er, minus the =
00:01:32 <Xaroth> gah, totally messed up
00:01:35 <glx> ((something * si) + 40) >> 7
00:01:37 <Xaroth> i need to comment better
00:01:40 <Xaroth> yeh, that
00:03:04 <glx> but sometimes the multiplication is not needed in converted code
00:03:59 <SmatZ> gcc will do it for you when addressing array ;)
00:05:34 <glx> yes but only if it's for an array :)
00:05:45 <glx> doesn't look like it for this function
00:06:48 <Xaroth> now this entire thing makes no sense anymore :o
00:07:28 <glx> 4 args
00:07:37 <Xaroth> 3
00:07:42 <Xaroth> first is a tile32
00:07:44 <glx> true
00:07:54 <Xaroth> first is returned when 3rd == 0
00:08:01 <Xaroth> so return value also tile32
00:09:11 <Xaroth> ugh, i hate optimized code :P
00:09:23 <Xaroth> local vars 1 and 2 are a tile32 together
00:09:34 <Xaroth> it finishes with a GetXY on that
00:09:48 <Xaroth> which is quite odd, as it initializes them separately
00:10:00 <Xaroth> with GetX arg1, and GetY arg2 as X and Y
00:10:42 <glx> of course, remember it's a 16bit CPU
00:11:00 <Xaroth> yes, but why not just copy the values from arg1 directly
00:11:06 <Xaroth> rather than processing them through another function :o
00:12:16 <Xaroth> so instead of the code doing tile32 local = arg1; it does some wierd stuff
00:12:48 <glx> it adds some offsets
00:13:04 <Xaroth> GetX/GetY don't add offsets?
00:13:31 <glx> no after that
00:13:46 <Xaroth> yes
00:13:50 <glx> and it can't work on 32bit values directly
00:14:04 <Xaroth> ah well, i'm probably just expecting too much smartness from it :P
00:14:43 <Xaroth> @calc 40 / ( 2 ** 7 )
00:14:43 <DorpsGek> Xaroth: 0.3125
00:15:15 <Xaroth> @calc 41 / ( 2 ** 7 )
00:15:15 <DorpsGek> Xaroth: 0.3203125
00:15:28 <Xaroth> anyways
00:16:31 <Xaroth> now just to figure out what that array contains :P
00:17:36 <Xaroth> http://paste.xaroth.nl/?show=30
00:17:40 <Xaroth> that's the conversion, i think.
00:17:53 <Xaroth> didn't completely cover the getting from array thing tho
00:18:07 <Xaroth> so arg2 is an index
00:18:19 <Xaroth> arg3 seems to be a multiplier?
00:18:57 <Xaroth> and arg1 is the original tile to base it from
00:19:23 <Xaroth> er, actually made an error in that one :o
00:19:45 <Xaroth> http://paste.xaroth.nl/?show=31 corrected.
00:22:31 <Xaroth> time to go to sleep now
00:22:44 <Xaroth> feel free to correct me on that paste if i'm wrong.
00:23:05 <Xaroth> and @TrueBrain: I am fully aware there is no coding standard in that mockup what-so-ever! :P
01:01:05 <DorpsGek> SVN: glx (r646) -Add: figured out a few variables
01:02:46 <DorpsGek> SVN: glx (r647) -Add: named another memcopy function
01:16:47 *** glx has quit IRC
01:18:01 *** glx has joined #openDune
01:18:01 *** ChanServ sets mode: +o glx
05:03:50 *** glx has quit IRC
10:26:18 <TrueBrain> Xaroth: 40 != 0x40
10:26:20 <TrueBrain> far from, in fact
10:26:33 <Xaroth> it's a mockup!
10:26:43 <Xaroth> to figure out wtf is going on :)
10:27:04 <Xaroth> code rewrite will come tonight, i hope
10:27:31 <TrueBrain> even in mockups, 0x40 != 40 :)
10:27:39 <TrueBrain> as mostly .. the 0x40 value shows why it is 0x40 :p
10:27:40 <Xaroth> that, is true
10:27:41 <TrueBrain> which 40 doesn't do :)
10:27:52 <Xaroth> @base 16 10 40
10:27:52 <DorpsGek> Xaroth: 64
10:27:58 <TrueBrain> @base 16 2 40
10:27:58 <DorpsGek> TrueBrain: 1000000
10:28:18 <Xaroth> @calc 40 / (2**7)
10:28:18 <DorpsGek> Xaroth: 0.3125
10:28:20 <Xaroth> er
10:28:23 <Xaroth> @calc 0x40 / (2**7)
10:28:23 <DorpsGek> Xaroth: 0.5
10:28:34 <Xaroth> ceil :o
10:28:39 <TrueBrain> good boy :)
10:29:25 <Xaroth> now to find the purpose tho :/
10:32:18 <Xaroth> @calc 255*255
10:32:18 <DorpsGek> Xaroth: 65025
10:32:30 <Xaroth> @calc 65025 / (2**7)
10:32:30 <DorpsGek> Xaroth: 508.0078125
10:32:41 <Xaroth> @base 10 2 509
10:32:41 <DorpsGek> Xaroth: 111111101
10:32:59 <Xaroth> er, 508 still rounded, but that doesn't matter.
10:33:56 <Xaroth> +111111100 is px 255 and offset +1 :o
10:35:23 <Xaroth> @base 10 2 [calc 255*-255 / (2**7)]
10:35:23 <DorpsGek> Xaroth: Error: Invalid <number> for base 10: -508.0078125
10:35:52 <Xaroth> @base 10 2 -508
10:35:52 <DorpsGek> Xaroth: -111111100
10:35:59 <Xaroth> er
10:36:04 <Xaroth> right...
10:36:21 <Xaroth> negative binary numbers ftw? :P
10:55:48 <Xaroth> gah
10:56:05 <Xaroth> trying to google how cross compiling windows binaries on linux works, google only gives results for the opposite
10:56:39 <TrueBrain> mingw32 ...
10:56:49 <TrueBrain> and can you compile linux binaries on windows?
10:56:52 <TrueBrain> I somehow doubt that ...
10:57:13 <Xaroth> http://metamod-p.sourceforge.net/cross-compiling.on.windows.for.linux.html
10:57:21 <Xaroth> cygwin
10:57:30 * Xaroth shrugs
10:57:42 <TrueBrain> you don't want cygwin for linux binaries ...
10:58:32 <Xaroth> I don't want cygwin, at all
11:03:12 <Xaroth> more reading stuff \o/
11:08:14 <Xaroth> heh
11:08:36 <Xaroth> found C code for the G15 interface
11:08:58 <Xaroth> bit more stuff doable with that than the .net variant I used to work with
11:17:32 <TrueBrain> okay ... I have 3 hours, I should be working on a project, but fuck that today, OpenDUNE time .. what to do ..
11:33:06 <DorpsGek> SVN: truebrain (r648) -Add: named another function
12:08:24 <TrueBrain> @base 10 16 [calc 0x8d37 - 0x8cfd]
12:08:24 <DorpsGek> TrueBrain: 3A
12:24:42 <TrueBrain> although Italian and Spanish are kind of there, only French and German really work
12:35:12 <DorpsGek> SVN: truebrain (r649) -Add: figured out a few variables (mostly related to end-game)
12:35:31 <DorpsGek> SVN: truebrain (r650) -Add: named a few functions (mostly related to end-game)
12:35:48 <TrueBrain> k .. most of that is pretty straight forward
12:53:07 <Xaroth> :o
13:26:34 *** glx has joined #openDune
13:26:34 *** ChanServ sets mode: +o glx
13:26:53 <glx> hello
13:44:16 <Xaroth> o/
14:36:24 <glx> hehe f__01F7_1FE1_005F_A74A() does nice things :)
14:36:38 <glx> it generates a function on stack then call it
14:43:51 <glx> so all cs__3EEE.c functions come from it
14:44:13 <glx> and are indeed only one function
14:45:55 <glx> I just fail to understand the function generated for int 25 and 26 (never done btw)
14:46:57 <glx> the function is then 55 CD 25/26 36 8F 06 (function start IP) 5D CB
16:10:25 <Xaroth> o_O
16:10:51 <Xaroth> a function generator :o
16:47:16 <glx> btw it's called for int 10 only so generated function is 55 CD 10 5D CB ie all cs__3EEE.c functions
18:37:22 *** blathijs has quit IRC
18:41:44 <DorpsGek> SVN: glx (r651) -Add: named a few functions
18:46:12 *** blathijs has joined #openDune
18:46:12 *** charm.oftc.net sets mode: +v blathijs
20:57:34 *** Alberth has joined #openDune
20:57:40 <Alberth> hello
20:58:12 <Alberth> I got a assertion failure
20:58:17 <Alberth> mopendune: src/pool/unit.c:36: Unit_Get_ByMemory: Assertion `g_global->unitStartPos.csip <= address.csip && address.csip < g_global->unitStartPos.csip + sizeof(Unit) * UNIT_INDEX_MAX' failed.
20:58:17 <Alberth> zsh: abort (core dumped) ./opendune
20:58:30 <Alberth> the "m" in "mopendune" may be mine :)
21:03:54 <glx> hmm a trace would help
21:04:15 <glx> to know what called the function with invalid arg
21:04:48 <glx> because this function is used very often :)
21:04:48 <Alberth> yes, if only I could find a core file
21:05:45 <glx> what were you doing when it happened?
21:06:34 <Alberth> fighting
21:07:10 <Alberth> ordering vehicles to attack, and get out of the line of fire by a rocket launcher
21:07:34 <Alberth> no core file in sight
21:09:58 <Alberth> does the program do something with catching exceptions like this?
21:10:38 <glx> I don't think so
21:10:51 <glx> anyway I found a probable cause
21:11:25 <Alberth> alternatively, I recently upgraded to Fedora 12 with gcc 4.4.2, perhaps something different is done with the new compiler
21:11:50 <glx> hmm 2 possible causes indeed
21:12:49 <Alberth> oh, I had a carry-all flying in to pick up damaged vehicles
21:12:53 <glx> house.c:371 or script_general.c:79
21:19:38 <Alberth> house.c is about a starport?
21:19:44 <Alberth> I don't have one
21:23:14 *** Xaroth sets mode: +vv Alberth boekabart
21:29:03 <Alberth> nope, the core file is really not created anywhere in my $HOME :( kind of worrying
21:30:27 <glx> hmm isn't core creation dependant on some system config too ?
21:33:00 <TrueBrain> core generation is disabled on most systems
21:33:08 <TrueBrain> hi btw :)
21:34:02 <Alberth> hi TB
21:34:16 <glx> anyway house.c is surely wrong (I need to check the original asm, but the probability is very high ;) )
21:34:17 <Alberth> I switch it on in my .zshrc
21:34:42 <Alberth> core(5) has a list of reasons, but none of them apply
21:35:03 <glx> but as you don't have starport the only other possible cause is Script_General_GetDistance
21:35:37 <TrueBrain> glx: what would be wrong about the house.c one?
21:35:54 <glx> ,...,...,...,...,...,...if (ucsip.csip == 0) {
21:35:54 <glx> ,...,...,...,...,...,...,...u = Unit_Get_ByMemory(ucsip);
21:35:56 <glx> that ?
21:36:15 <TrueBrain> haha :) That is nasty :p
21:36:24 <TrueBrain> I am so happy it is your code ;)
21:36:48 <TrueBrain> that was mean ... :)
21:37:51 <glx> hmm unit.c:577 could be made safer too
21:38:23 <TrueBrain> Script_General_GetDistance is btw fine, just placed wrong
21:38:28 <TrueBrain> it should be under Script_Unit
21:38:43 <TrueBrain> no clue why it isn't ....
21:39:06 <TrueBrain> glx: unit.c:577 is valid by definition
21:39:15 <glx> I know
21:39:19 <TrueBrain> btw, Alberth, what you experiences is most likely the emulated memory getting corrupted
21:39:24 <TrueBrain> it happens from time to time, for causes we still don't know
21:39:32 <TrueBrain> although that weird white/red stuff is gone, I believe
21:40:25 <Alberth> ok
21:40:30 <TrueBrain> or can you reproduce it in clear steps?
21:41:16 <glx> <@TrueBrain> no clue why it isn't .... <-- you made it IIRC ;)
21:41:17 <Alberth> I was only doing 5 things at the same time, doing heavy battle involves lots of clicking :)
21:41:27 <TrueBrain> yup
21:41:31 <TrueBrain> glx: yup ;)
21:41:58 <TrueBrain> glx: and I have been digging my brain, but I still have no clue why I would put it in the General section, while it assumes the objectPtr is a unit ...
21:42:10 <Alberth> I'll try again another time
21:42:13 <TrueBrain> Alberth: well, make sure next time you generate a core file ;)
21:42:28 <glx> yes a trace is required for asserts ;)
21:42:53 <TrueBrain> I would love to get my hands on one ... to really see if it is random corruption, or a valid bug
21:43:21 <Alberth> yeah, I'll keep an eye on them, and report when your program doesn't give me one :p
21:43:44 <TrueBrain> glx: you fix the == to != soon? :)
21:44:12 <Alberth> good night
21:44:16 <TrueBrain> night Alberth
21:44:20 <TrueBrain> tnx for playing ;)
21:44:31 <glx> I'll check the asm and I'll fix it
21:44:45 <TrueBrain> glx: I doubt reading the asm would tell you anything else then: WRONG! :p
21:45:16 *** Alberth has left #openDune
21:45:48 <DorpsGek> SVN: glx (r652) -Fix (r609): incorrect comment
21:52:03 <DorpsGek> SVN: glx (r653) -Fix (r534): another inverted test
21:58:41 <TrueBrain> night all
22:15:06 <Xaroth> nn TB
22:42:42 <Xaroth> @calc 2 ** 7
22:42:42 <DorpsGek> Xaroth: 128
22:51:09 <Xaroth> glx: http://paste.xaroth.nl/?show=32 << that header file looks like it's perfectly usable in a C app right?
22:52:27 <glx> yes it's C
22:52:40 <Xaroth> well that was easy
22:53:03 <Xaroth> I was almost going to bother looking (or making) something myself .. but that's from the logitech sdk :o
22:53:33 <Xaroth> so now it just needs an intermediate that defines whether A: it's enabled, B: per-environment-specific headers/calls
22:59:33 <Xaroth> but I doubt it's of any use to the project at this point in time
23:00:25 <Xaroth> enough silly ideas for that when the time is there