IRC logs for #opendune on OFTC at 2011-02-21
⏴ go to previous day
02:57:13 <DorpsGek> SVN: glx (r1349) -Fix (r1305): don't return too early from an emulator wrapper
10:10:57 <TrueBrain> r1349 can cause errors ...
10:12:17 <DorpsGek> SVN: truebrain (r1350) -Fix (r1349): by not returning too early, we cause segfaults. Fix it correctly ;)
12:40:33 *** fjb is now known as Guest2110
13:07:33 <glx> uint8 *emu_get_memorycsip(csip32 csip)
13:07:33 <glx> if (csip.csip == 0) return NULL;
13:07:33 <glx> return &emu_get_memory8(csip.s.cs, csip.s.ip, 0x0);
13:08:06 <glx> I don't see how your fix prevent segfault, it's exactly the same ;)
13:11:13 <SmatZ> once it returns 0, other time it returns &emu_mem ?
13:13:36 <SmatZ> glx: ok :) and it really fixed a crash?
13:14:13 <glx> maybe it was just preventive
13:25:27 <TrueBrain> it is; we didn't always had that return NULL there ;)
13:26:33 <TrueBrain> but you are right, I forgot we changed that .. still this is more in the style of the other emus :D
13:37:23 <glx> Map_CreateLandscape() is a nice function (and it's easy to test)
13:37:52 <glx> I load a8 busy, I restart scenario, if landscape is different I failed
13:39:43 <glx> so it seems unveiled tiles type is stored in the save but not ununveiled ones
14:09:12 <TrueBrain> going to do both B4CD I guess ...
14:09:16 <TrueBrain> the second is only used by the first :p
14:11:28 <TrueBrain> glx: emu_Unknown_07D4_02F8
14:11:33 <TrueBrain> why not C-ify it normally?
14:11:43 <TrueBrain> and the part: g_global->scenario.mapScale + 1 == 0
14:11:52 <TrueBrain> mapScale is unsigned, so that never ever happens .. any idea?
14:12:29 <TrueBrain> mapScale is only set to 0, 1 or 2
14:16:00 <TrueBrain> it really is what the line reads ..... very oddddddddd
14:16:08 <glx> IIRC it's not fully C-ified to not add a wrapper
14:16:42 <TrueBrain> well, I hope we never do this logic inline, so it needs to become a dedicated C function at some point I guess?
14:16:55 <glx> mapScale can be 0, 1 or 2, but it's always 0 IIRC
14:17:13 <TrueBrain> so mapScale + 1 has no meaning
14:17:18 <TrueBrain> so mapScale + 1 == 0 has no meaning
14:18:32 <TrueBrain> to me it reads like a mark-dirty function, but it is a bit odd :p
14:22:37 <SmatZ> emu_shlw(&emu_bx, 0x1);
14:22:53 <SmatZ> I wonder, wasn't this lost while translating f__07D4_02F8_0055_0679()?
14:23:11 <SmatZ> it's uint16 array I guess
14:58:30 <DorpsGek> SVN: truebrain (r1351) -Add: C-ified Map_UnveilTile()
14:58:38 <TrueBrain> owh, and named a function
15:04:55 <TrueBrain> glx: I need you :D B4CD:13DF
15:09:23 <glx> hmm IIRC I have a paper with some overlay offsets
15:09:36 <TrueBrain> didn't you had a script for that? :)
15:09:56 <glx> I have but I need a real segment :)
15:10:14 <glx> my memory is good, I have a paper, B4CD = 48C7
15:10:39 <TrueBrain> I am happy you have a paper :D
15:11:29 * SmatZ gives TrueBrain paper, so he has it too
15:11:41 <TrueBrain> haha, I want to see you do that :D
15:11:47 <TrueBrain> giving it virtually doesn't really help :D
15:12:27 <TrueBrain> no relative jump notes? :(
15:13:17 <glx> oh it's just a return indeed
15:14:21 <TrueBrain> ah, yes; tnx glx :)
15:14:48 <glx> jumps are not relative, but the real addresses are in the file
15:14:55 <TrueBrain> yeah, but harder to read :D
15:15:00 <TrueBrain> segment .. offset ... blegh :p
15:15:39 <glx> it's just an objdump with some stuff added in front
15:16:52 <glx> the added stuff being CS:IP
15:17:23 <TrueBrain> sometimes a function correctly checks for > 63 etc etc
15:17:28 <TrueBrain> other times, they just do & 0xFFF
15:23:04 <TrueBrain> funny how one time they do -1, +1, -64, +64
15:23:08 <TrueBrain> other time they use an array for it :p
15:23:12 <TrueBrain> MAKE UP YOUR MIND WOMAN!
15:28:46 <TrueBrain> lets see how my conversion did :D
15:30:57 <TrueBrain> owh, forgot to rename emu_si to locsi :D
15:31:21 <glx> and of course you removed push/pop
15:34:20 <DorpsGek> SVN: truebrain (r1352) -Add: C-ified Map_UnveilTile_Neighbour(). segment B4CD: goodbye
15:34:38 <DorpsGek> SVN: truebrain (r1353) -Fix (r1352): I love raising revisions because I forget to commit dirs
15:35:21 <TrueBrain> Dune2 calls Unit_HouseUnitCount_Add(Unit_Get_ByPackedTile(), ) like that, without checking if there is a unit on the packed tile
15:35:26 <TrueBrain> because the _Add function does that
15:35:32 <TrueBrain> I consider that bad coding policy :p
15:36:36 <DorpsGek> SVN: truebrain (r1354) -Fix: Dune2 often leaves != NULL checks for the called-function. I consider this bad coding policy, and the callee should validate instead.
15:37:08 <TrueBrain> in 90% of the cases the != NULL in the function is not needed ... waste of CPU ...
15:39:20 <TrueBrain> 151A looks interesting
15:39:36 <TrueBrain> looks a lot like code I have seen recently .. converted by you ... a case with Map_Update entries :)
15:56:14 <TrueBrain> yeah, will spend the rest on the week on 151A I guess :)
15:57:05 <TrueBrain> all callers are C-ified, so it should be nice :)
16:07:19 <glx> I think there's a bug in Script_Structure_Destroy(), line 647 should not be there
16:11:08 <TrueBrain> it is meant for Tools_Index_Encode
16:13:13 <glx> not very harmful (except for the stack usage)
16:14:21 <TrueBrain> you would expect crashes at some point :p
16:20:44 <DorpsGek> SVN: glx (r1355) -Fix: MSVC warnings and an unwanted push
16:23:34 <glx> I like when they check Tile_Pack() result to be < 4096 and >= 0
16:24:09 <glx> like an uint16 could be < 0
16:24:23 <TrueBrain> think it is an inline function :)
16:27:54 <glx> converted up to l__0596, still works
16:30:05 <TrueBrain> I am off for the night, bye all :)
18:35:21 *** Xaroth has joined #openDune
18:35:21 *** ChanServ sets mode: +o Xaroth
continue to next day ⏵