IRC logs for #opendune on OFTC at 2011-01-09
⏴ go to previous day
00:34:25 *** Xaroth_ has joined #openDune
13:36:37 <glx> with Tools_Random_Range()
14:59:15 <TrueBrain> right ... found a function which is 1500 lines long
14:59:58 <glx> without unresolved stuff I hope
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:02:24 <glx> nice amount of local vars
15:03:17 <TrueBrain> okay, it has 6 options
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: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:32 <TrueBrain> what other things do we hav eon the right ...
15:32:42 <TrueBrain> guess house launch or something?
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:46:40 <Xaroth|Work> whoops, yes it is
15:46:44 <Xaroth|Work> you talk to much TrueBrain :P
15:51:43 <TrueBrain> indeed, it is the missile house thingy
16:21:42 <TrueBrain> seems we also have to make an ObjectInfo
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
19:52:45 <glx> nice I can't repair my windtrap
19:52:57 <glx> (and probably other things
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> 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> Crash-dump in 'memory/crash.bin'
19:56:47 <TrueBrain> thought it was a glitch
19:56:53 <TrueBrain> as it happens more often that my opendune crashes
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:02:32 <TrueBrain> repairing works fine here
20:02:43 <TrueBrain> ah, no, crash on windtrap
20:03:28 <DorpsGek> SVN: truebrain (r1255) -Fix (r1254): forgot 3 comments
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: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:25:34 <glx> -0x10 and -0x12 are really not used later ?
20:27:59 <TrueBrain> okay, -0xC is unit, and -0x14 is structure ..
20:28:16 <TrueBrain> (well, UnitInfo, StructureInfo, ObjectInfo)
20:29:30 <DorpsGek> SVN: truebrain (r1256) -Fix (r1254): don't remove too many local variables; some might still be used ;)
20:31:42 <glx> assert(g_global->structureStartPos.csip <= address.csip && address.csip < g_global->structureStartPos.csip + sizeof(Structure) * STRUCTURE_INDEX_MAX_HARD);
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: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: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:43:25 <glx> but it then won't warn for "invalid" C ;)
20:43:42 <glx> like mixed code and declaration
20:44:30 <TrueBrain> was not hinting to do it always
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:55:01 <DorpsGek> SVN: glx (r1258) -Add: Unit_B4CD_01BF()
20:55:11 <glx> forgot something in the message
23:37:35 *** planetmaker has joined #openDune
23:37:35 *** solenoid.oftc.net sets mode: +v planetmaker
23:45:10 *** olinuxx has joined #openDune
continue to next day ⏵