IRC logs for #opendune on OFTC at 2009-12-02
⏴ go to previous day
00:00:35 <glx> in C it's a normal shift ;)
00:00:42 <Xaroth> (something *= 40) >> 7
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: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: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:13:04 <Xaroth> GetX/GetY don't add offsets?
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:16:31 <Xaroth> now just to figure out what that array contains :P
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: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: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
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:41 <TrueBrain> which 40 doesn't do :)
10:29:25 <Xaroth> now to find the purpose tho :/
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:36:21 <Xaroth> negative binary numbers ftw? :P
10:56:05 <Xaroth> trying to google how cross compiling windows binaries on linux works, google only gives results for the opposite
10:56:49 <TrueBrain> and can you compile linux binaries on windows?
10:56:52 <TrueBrain> I somehow doubt that ...
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: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: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
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: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: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: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: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: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: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: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: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: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: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: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: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: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:48 <DorpsGek> SVN: glx (r652) -Fix (r609): incorrect comment
21:52:03 <DorpsGek> SVN: glx (r653) -Fix (r534): another inverted test
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
continue to next day ⏵