IRC logs for #opendune on OFTC at 2011-01-09
            
00:34:25 *** Xaroth_ has joined #openDune
00:41:04 *** Xaroth has quit IRC
04:32:10 *** fjb has quit IRC
04:40:11 *** glx has quit IRC
12:07:51 *** fjb has joined #openDune
13:31:55 *** glx has joined #openDune
13:31:55 *** ChanServ sets mode: +o glx
13:33:05 <glx> hello
13:36:01 <TrueBrain> http://forum.opendune.org/viewtopic.php?f=9&t=114 <- glx: any idea?
13:36:24 <glx> random IIRC
13:36:37 <glx> with Tools_Random_Range()
14:59:15 <TrueBrain> right ... found a function which is 1500 lines long
14:59:16 <TrueBrain> holy crap
14:59:28 <glx> outch
14:59:31 <glx> that's big
14:59:58 <glx> without unresolved stuff I hope
15:00:18 <TrueBrain> yup
15:01:01 <TrueBrain> it is run every time the palacetick is executed
15:01:07 <TrueBrain> and the countdown is not 0
15:01:27 <TrueBrain> I can't imagine any function that needs to be called there, which is so big :p
15:01:40 <TrueBrain> 10E4_0F1A btw
15:02:24 <glx> nice amount of local vars
15:02:50 <glx> and an array
15:03:17 <TrueBrain> okay, it has 6 options
15:03:18 <TrueBrain> euh, 7
15:03:20 <glx> and many switches
15:03:27 <TrueBrain> and '1' for example, is only a short piece of code
15:03:38 <TrueBrain> so it is just one huge catch-them-all function :p
15:04:23 <TrueBrain> although I can only find instances where it is called with '1'
15:05:14 <TrueBrain> ah, some kind of weird complex function is called to pick between those ...
15:06:01 <TrueBrain> maybe it updates all status of all stuff one by one or what ever
15:19:08 <TrueBrain> well, it has to be converted some day ... I am just going to start with it :)
15:19:36 <TrueBrain> src/ is 23k lines of code
15:19:40 <TrueBrain> decompiled/ is 63k lines of code
15:26:43 <glx> decompiled is full of locXX = emu_ax; emu_ax = locXX; ;)
15:26:56 <glx> that rapidely increase line count
15:29:50 <TrueBrain> it indeed is the update of a part of the GUI
15:29:57 <TrueBrain> 3 for example is structure thingy on the right
15:30:02 <TrueBrain> 2 for units
15:30:13 <TrueBrain> movement thing is 5
15:31:37 <TrueBrain> 7 placement, 4 attack
15:31:41 <TrueBrain> leaves 6 and 8 ... hmm
15:32:26 <TrueBrain> 6 harvest
15:32:32 <TrueBrain> what other things do we hav eon the right ...
15:32:42 <TrueBrain> guess house launch or something?
15:33:15 <glx> build ?
15:34:23 <TrueBrain> no, that is all in structure
15:34:27 <TrueBrain> weird, I also sometimes read value '1'
15:34:32 <TrueBrain> when going from unit to structure
15:34:37 <TrueBrain> but it is there only really short
15:36:01 <TrueBrain> either way, a name would be: GUI_Widget_DrawActionPanel
15:44:20 <Xaroth|Work> nog een killmail
15:46:32 <TrueBrain> wrong channel :p
15:46:40 <Xaroth|Work> whoops, yes it is
15:46:44 <Xaroth|Work> you talk to much TrueBrain :P
15:46:50 <TrueBrain> or you too little
15:49:45 <Xaroth|Work> true
15:51:43 <TrueBrain> indeed, it is the missile house thingy
15:59:39 <TrueBrain> @calc 0x64
15:59:39 <DorpsGek> TrueBrain: 100
16:19:22 <TrueBrain> calc 0xd
16:19:25 <TrueBrain> @calc 0xd
16:19:25 <DorpsGek> TrueBrain: 13
16:21:42 <TrueBrain> seems we also have to make an ObjectInfo
16:23:39 <glx> ha
16:28:16 <TrueBrain> owh, it seems I committed my modified dune.cfg
16:28:21 <TrueBrain> one without sound and voices :D
16:28:58 <DorpsGek> SVN: truebrain (r1253) -Revert (r1250): stop committing your own configuration file
16:30:02 <DorpsGek> SVN: truebrain (r1254) -Add: initial step in converting a 1500 line long function, while leaving it in the decompiled tree
16:30:06 <TrueBrain> r1254 is a bit unusual
16:30:19 <TrueBrain> but I thought it would be better to commit this partly progress for now
16:30:26 <TrueBrain> while leaving everything else intact
16:30:45 <TrueBrain> I need ObjectInfo before I can really make it in clean C
16:30:52 <TrueBrain> for now: FOOOOODDDD
17:51:45 *** fjb is now known as Guest3828
17:51:46 *** fjb has joined #openDune
17:59:19 *** Guest3828 has quit IRC
19:52:45 <glx> nice I can't repair my windtrap
19:52:57 <glx> (and probably other things
19:53:07 <TrueBrain> my fault?
19:53:29 <glx> maybe, I need to check clean trunk first
19:55:22 <glx> same happens in clean trunk
19:56:32 <glx> Program Termination: jumped to 01F7:1472, which is not decompiled.
19:56:32 <glx> The jump was triggered at d:\developpement\opendune\trunk\decompiled\cs__01f7.c
19:56:32 <glx> :3264
19:56:32 <glx> The jump appears to originate from 01F7:1465.
19:56:32 <glx> Please send the file 'memory/crash.bin' to upstream developers.
19:56:33 <glx> Creating crash-dump ...
19:56:33 <glx> Crash-dump in 'memory/crash.bin'
19:56:44 <TrueBrain> he, I had the same
19:56:47 <TrueBrain> thought it was a glitch
19:56:53 <TrueBrain> as it happens more often that my opendune crashes
19:57:55 <glx> hmm emu_String_Format
19:59:53 <TrueBrain> owh .. yeah ... that might be true ...
20:00:23 <TrueBrain> GUI_DrawText_Wrapper(String_Get_ByIndex(stringID), 288, 43, 29, 0, 0x111);
20:00:32 <TrueBrain> assumed that would work, instead of the construct that was in place
20:00:37 <TrueBrain> I might be wrong
20:02:32 <TrueBrain> repairing works fine here
20:02:43 <TrueBrain> ah, no, crash on windtrap
20:03:07 <TrueBrain> refinery works tho
20:03:28 <DorpsGek> SVN: truebrain (r1255) -Fix (r1254): forgot 3 comments
20:08:18 <glx> http://paste.openttdcoop.org/show/46/ <-- the trace
20:09:16 <TrueBrain> tnx :)
20:09:18 <TrueBrain> in my function indeed
20:09:21 <TrueBrain> no clue why it fails
20:17:40 <TrueBrain> it draws ds:3774 ...
20:17:51 <TrueBrain> which is just %d
20:19:29 <glx> I don't get emu_String_sprintf_params()
20:19:57 <glx> especially the args passed to emu_String_Format()
20:21:06 <glx> sprintf_params is called with buffer_csip, string_csip, args_csip
20:21:54 <TrueBrain> emu_get_memory16(emu_ss, emu_bp, -0xA) = g_global->structureStartPos.s.cs;
20:21:55 <TrueBrain> emu_get_memory16(emu_ss, emu_bp, -0xC) = g_global->structureStartPos.s.ip + s->o.index * sizeof(Structure);
20:21:55 <glx> String_Format() is then called with args_ip, string_csip
20:21:57 <TrueBrain> emu_get_memory16(emu_ss, emu_bp, -0xE) = 0x2C94;
20:21:58 <TrueBrain> emu_get_memory16(emu_ss, emu_bp, -0x10) = 10 + s->o.type * sizeof(StructureInfo);
20:22:00 <TrueBrain> those lines are valid, right?
20:22:43 <glx> looks right yes
20:24:04 <glx> hmm around l__1075
20:25:34 <glx> -0x10 and -0x12 are really not used later ?
20:25:49 <glx> hmm -0x14 and -0x12
20:26:11 <TrueBrain> hmm, -0x14 is
20:26:12 <TrueBrain> weird .
20:26:37 <glx> how is it accessed ?
20:26:45 <glx> via lfp ?
20:26:57 <TrueBrain> yup
20:27:59 <TrueBrain> okay, -0xC is unit, and -0x14 is structure ..
20:28:04 <TrueBrain> -0x10 is Object
20:28:16 <TrueBrain> (well, UnitInfo, StructureInfo, ObjectInfo)
20:28:26 <glx> seems so
20:28:38 <TrueBrain> scanned for -0x12
20:28:40 <TrueBrain> not -0x14
20:29:30 <DorpsGek> SVN: truebrain (r1256) -Fix (r1254): don't remove too many local variables; some might still be used ;)
20:30:37 <TrueBrain> nice catch glx :)
20:31:20 <glx> hmm now I get an assert
20:31:33 <TrueBrain> how/where?
20:31:42 <glx> assert(g_global->structureStartPos.csip <= address.csip && address.csip < g_global->structureStartPos.csip + sizeof(Structure) * STRUCTURE_INDEX_MAX_HARD);
20:32:35 <glx> http://paste.openttdcoop.org/show/47/
20:33:27 <glx> {s={...} csip=0x00002bd1 }
20:34:14 <glx> emu_Structure_UntargetMe(s); <-- lol
20:34:45 <glx> how can that even compile
20:35:37 <DorpsGek> SVN: truebrain (r1257) -Fix: forgot to remove emu_ from a converted function
20:35:41 <TrueBrain> no clue ...
20:35:44 <TrueBrain> it really shouldn't
20:39:11 <SmatZ> implicit function declaration
20:39:15 <glx> ok to get a warning I need to declare the function as extern void emu_Structure_UntargetMe(void)
20:39:25 <SmatZ> it should give a warning though
20:39:36 <glx> SmatZ: they are explicitely declared without args
20:39:56 <SmatZ> the explicit declaration is returning int and taking variable argument list
20:39:58 <glx> extern void emu_Structure_UntargetMe() doesn't warn if you give it args
20:40:09 <SmatZ> yeah, () is "variabla argument list"
20:40:16 <SmatZ> (void) is "no argument"
20:40:38 <SmatZ> () is (...) in C++
20:41:44 <SmatZ> (void) is () in C++
20:42:18 <TrueBrain> ah, the lovely C vs C++ prblems :D
20:42:33 <TrueBrain> in other words, run it through a C++ compiler, and it does warn ;)
20:42:36 <SmatZ> :D
20:43:25 <glx> but it then won't warn for "invalid" C ;)
20:43:42 <glx> like mixed code and declaration
20:44:06 <glx> or something like that
20:44:30 <TrueBrain> was not hinting to do it always
20:44:32 <TrueBrain> just once ;)
20:46:18 <SmatZ> you aren't compiling in C99 mode?
20:46:43 <SmatZ> I thought you are, ok :)
20:47:41 <glx> it's a plain C project :)
20:49:12 <glx> + snprintf ;)
20:55:01 <DorpsGek> SVN: glx (r1258) -Add: Unit_B4CD_01BF()
20:55:11 <glx> forgot something in the message
23:33:49 *** planetmaker has quit IRC
23:33:49 *** olinuxx has quit IRC
23:37:35 *** planetmaker has joined #openDune
23:37:35 *** solenoid.oftc.net sets mode: +v planetmaker
23:45:10 *** olinuxx has joined #openDune