IRC logs for #opendune on OFTC at 2010-10-24
⏴ go to previous day
13:23:47 *** tolbin has joined #openDune
17:45:10 *** fjb is now known as Guest470
21:32:09 <TrueBrain> owh, glx, when I compile OpenDUNE, it gives me a (seemly) valid warning
21:32:12 <TrueBrain> about uninitlized var
21:32:38 <TrueBrain> there indeed is a route where it is not initialized
21:35:12 <TrueBrain> yes, when there are no units
21:35:17 <TrueBrain> but was this really the code?
21:39:33 <glx> ho indeed it's not initialized, I missed it
21:47:03 <glx> this loc10 should be packed :)
21:49:16 <DorpsGek> SVN: glx (r1149) -Fix (r1142): wrong variable used
21:50:27 <TrueBrain> @base 10 16 [calc 0x2c94 + 0x55a]
21:51:14 <DorpsGek> TrueBrain: 14.1666666667
21:51:35 <TrueBrain> @calc 0x550 - 0x60 * 14
21:52:25 <glx> it's converted, just need cleaning
21:52:36 <TrueBrain> I am trying to figure this function out, but I fail
21:54:21 <TrueBrain> uint16 loc22 = emu_ax;
21:54:23 <TrueBrain> if (loc22 == 0x0) {
21:54:26 <TrueBrain> if (loc22 != 0x0) {
21:54:30 <TrueBrain> sometimes ... Dune is funny :)
21:57:25 <glx> or if (loc2 == 0) { do something that doesn't touch loc02); if (loc02 == 0) { ... }
22:00:20 <glx> btw I like my "decompile" script
22:01:30 <glx> but for "static" code I just do "decompile base start end"
22:01:58 <TrueBrain> what does it do then?
22:04:03 <TrueBrain> ./* 3212(??) */ PACK csip32 variable_3212[1]; /*!< ?? */
22:04:06 <TrueBrain> no clue about the size ...
22:04:11 <TrueBrain> not even sure it is a csip32 ..
22:06:15 <glx> f__06F7_0493_0015_AAB2() says me it should be a csip32
22:06:33 <TrueBrain> then I guessed right :D
22:06:57 <glx> emu_ax = emu_get_memory16(emu_ss, emu_bp, 0x6);
22:06:57 <glx> emu_orw(&emu_ax, emu_get_memory16(emu_ss, emu_bp, 0x8));
22:06:57 <glx> if (emu_ax != 0) goto l__04A8;
22:06:57 <glx> emu_xorw(&emu_ax, emu_ax);
22:07:15 <TrueBrain> in theory can still be a != 0 on a tile32
22:07:20 <TrueBrain> but yeah, I assumed it was a csip32 :)
22:07:32 <TrueBrain> f__06F7_0008_0018_D7CD starts with reading 0x8/0xA
22:07:49 <TrueBrain> and later on , the 3212 is used in relation to this
22:09:34 <glx> if we knew what is stored in variable_395A
22:10:52 <glx> hmm all I know is it's 0x770 data block
22:14:27 <glx> anyway in emu_07D4 I considered it was a csip32
22:14:32 <glx> if (emu_get_csip32(csip1C.s.cs, csip1C.s.ip, 0xC).csip == 0x0) continue;
22:14:57 <TrueBrain> over what do we talk now?
22:15:31 <TrueBrain> 3212 doesn't exist yet in current SVN
22:15:35 <TrueBrain> hence my confusion with your latest paste :)
22:15:56 <glx> my paste is about 395A ;)
22:16:14 <TrueBrain> how is 395A related to 3212?
22:17:02 <TrueBrain> right, my new function compiles
22:17:05 <TrueBrain> I just have no clue what it does
22:17:05 <glx> emu_ax = emu_get_memory16(emu_ss, emu_bp, 0x8);
22:17:05 <glx> emu_dx = emu_get_memory16(emu_ss, emu_bp, 0x6);
22:17:05 <glx> emu_get_memory16(emu_es, emu_bx, 0xE) = emu_ax;
22:17:05 <glx> emu_get_memory16(emu_es, emu_bx, 0xC) = emu_dx;
22:17:24 <glx> that's storing 3212 in 395A
22:17:59 <glx> well it's a csip until we know what objects are in 395A
22:18:10 <glx> the only sure info is their size
22:18:32 <TrueBrain> but 3212 is an array of csip32s
22:18:37 <TrueBrain> doesn't matter what is in 395A :)
22:18:59 <TrueBrain> right, now I have to validate code I wrote over the last few weeks .. haha ..
22:19:15 <TrueBrain> not even being sure it is related :)
22:19:32 <TrueBrain> lets start with stack corruption :p
22:21:51 <glx> useful for some unresolved jumps and to get data for cs/ip switches
22:22:56 <glx> but for code in overlays I first need to find the real address in dune2.exe
22:24:23 <TrueBrain> I am still so surprised this 'just' works
22:24:40 <TrueBrain> iek, it seems my function 'just' works
22:25:15 <glx> you fully converted before first compilation and run ?
22:25:45 <glx> last time I did it like that I failed
22:25:47 <TrueBrain> it HAS to contain a bug ...
22:26:00 <glx> and I needed to redo the conversion from start
22:26:21 <TrueBrain> 37B0 .. readonly ... useless
22:27:23 <TrueBrain> function has something to do with shooting ...
22:27:45 <glx> 37B0 maybe a debug switch
22:28:25 <glx> because there are 2 tests for it: ==0 and !=0
22:29:17 <TrueBrain> value 14 when a building explodes, 4 times
22:29:28 <TrueBrain> value 1 when shooting at a random empty spot on the map
22:29:33 <TrueBrain> value 3 when shooting at a building
22:30:09 <TrueBrain> I think explosion type of some kind
22:30:57 <glx> is there a 2DCE near this ?
22:32:12 <TrueBrain> amount of hitpoints ...
22:32:25 <TrueBrain> emu_push((ui->variable_54 + unit->o.hitpoints / 20) & 3);
22:33:28 <TrueBrain> to me it feels the &3 is at the wrong place
22:33:53 <TrueBrain> but yeah, it is the type of damage or something
22:34:59 <glx> hmm Unit_Move is my work IIRC, so it's possible the & 3 is wrong :)
22:35:27 <TrueBrain> would it be possible to double verify that?
22:35:30 <TrueBrain> it is possible it is right
22:35:36 <TrueBrain> but I wonder what the var_54 is doing there
22:35:41 <TrueBrain> as var_54 seems to be damage-type
22:35:48 <TrueBrain> so then why add hitpoints and mod 3 ...
22:35:56 <TrueBrain> might be a bug of course
22:36:44 <TrueBrain> it indeed is the type of 'explosion' you see after something is hit
22:37:47 <TrueBrain> do we have all images somewhere in viewable format?
22:40:58 <TrueBrain> 0, 1 and 2 are indeed no, small, and big boom
22:42:02 <TrueBrain> no clue, but seems like it
22:42:09 <TrueBrain> maybe the no, small, big repeats itself for all types
22:43:13 <TrueBrain> right, all units within 16 tiles react to a boom
22:44:20 <TrueBrain> in fact, it even hurts units
22:44:49 <TrueBrain> if ((u->o.type != UNIT_SANDWORM || type != 13) && u->o.type != UNIT_FRIGATE) {
22:45:01 <TrueBrain> so all except type 13 hurt a sandworm
22:45:08 <glx> 802 emu_ax = emu_get_memory16(emu_es, emu_bx, 0x54);
22:45:08 <glx> 803 emu_lfp(&emu_es, &emu_bx, &emu_get_memory16(emu_ss, emu_bp, 0x6));
22:45:08 <glx> 805 emu_ax = emu_get_memory16(emu_es, emu_bx, 0xE);
22:45:09 <glx> 808 emu_idivw(&emu_ax, emu_bx);
22:45:11 <glx> 810 emu_addw(&emu_dx, emu_ax);
22:45:13 <glx> 811 emu_andw(&emu_dx, 0x3);
22:45:15 <glx> 813 emu_push(emu_cs); emu_push(0x065A); emu_cs = 0x06F7; f__06F7_0008_0018_D7CD();
22:46:21 <TrueBrain> if (!(u->o.type == UNIT_SANDWORM && type == 13) && u->o.type != UNIT_FRIGATE) {
22:47:51 <TrueBrain> Team->variable_0C <- 'can break from team'
22:49:20 <glx> dunno, I didn't check all the references
22:49:46 <TrueBrain> if you attack a team
22:49:51 <TrueBrain> and the team has no target
22:49:56 <TrueBrain> it does not start to attack you
22:50:07 <TrueBrain> but if it is attacking someone
22:50:20 <TrueBrain> and your bullettype is -1, it does start to come after you ..
22:50:48 <TrueBrain> if the team is attacking, and their current target is a non-bullet unit, it comes after you
22:51:54 <TrueBrain> right, and the: if me harvester, you unit, I drive you over
22:52:04 <TrueBrain> UnitInfo->variable_3C -> foot-type
22:52:42 <TrueBrain> 99% sure about that
22:52:48 <TrueBrain> but will do those changes after this commit :)
22:53:24 <TrueBrain> variable_37B0 <- if set, no 'explosion' damage
22:53:27 <TrueBrain> and the AI become a bit more stupid
22:53:34 <TrueBrain> doesn't attack you and shit
22:58:35 <TrueBrain> emu_Math_ValueToPercent ... darn, forgot what it did :p
22:59:23 <TrueBrain> where B is the max, and A is the current
23:00:09 <glx> D:\developpement\opendune\trunk\src\script\unit.c(1122): case 0x00: return u->o.hitpoints * 256 / ui->hitpoints;
23:00:39 <TrueBrain> right .. I have seen values of 14 for the 3212 ..
23:00:42 <TrueBrain> I will assume that as max for now
23:01:53 <glx> emu_get_memory16(emu_ds, 0x00, 0x3B34) = 0xD7;
23:01:53 <glx> emu_get_memory16(emu_ds, 0x00, 0x3B36) = 0x35;
23:01:53 <glx> emu_get_memory16(emu_ds, 0x00, 0x3B50) = 0xD8;
23:01:53 <glx> emu_get_memory16(emu_ds, 0x00, 0x3B52) = 0x35;
23:02:06 <glx> I hate when things are in the middle of an array
23:02:20 <glx> variable_3A3E in that case
23:02:20 <TrueBrain> /* 320D() */ PACK uint8 unknown_320D[0x0005];
23:02:22 <TrueBrain> /* 3212(64) */ PACK csip32 variable_3212[14]; /*!< ?? */
23:02:23 <TrueBrain> /* 3252() */ PACK uint8 unknown_3252[0x0052];
23:02:25 <TrueBrain> I hate when I misalign ..
23:15:00 <TrueBrain> src/unit.c:1703: error: invalid operands to binary + (have 'int' and 'tile32')
23:15:52 <TrueBrain> objs/decompiled/::cs(A.o const): In function `f__0C3A_1216_0013_E56D':
23:15:54 <TrueBrain> /prog/opendune/trunk/decompiled/::cs(A.c const):1348: undefined reference to `emu_Map_MakeExplosion'
23:22:54 <DorpsGek> SVN: truebrain (r1150) -Add: C-ified Map_MakeExplision()
23:25:38 <TrueBrain> locdi = g_global->variable_3A3E[loc08][2 + (ui->movementType / 2)];
23:26:58 <glx> 3A3E is too generic for now
23:27:11 <TrueBrain> yes, but dividing the movement type by 2 ..
23:27:36 <glx> maybe a conversion mistake
23:28:04 <TrueBrain> MOVEMENT_SLITHER <- what is SLITHER?
23:29:40 <TrueBrain> case 0x12: return (ui->movementType & 0x40) == 0 ? 0 : 1;
23:29:46 <glx> where did you get thes names ?
23:29:53 <TrueBrain> I thought you did :p
23:29:55 <TrueBrain> strings, most likely
23:34:23 <glx> + locdi = g_global->variable_3A3E[loc08][2 + (ui->movementType / 2)]; <-- I can explain the / 2
23:34:41 <glx> it's because we access 8bit value
23:35:55 <glx> + locdi = g_global->variable_3A3E[loc08][2 + (ui->movementType / 2)];
23:35:55 <glx> + if (ui->movementType % 2 == 0) {
23:36:09 <TrueBrain> then only the 2+ is weird :p
23:36:28 <glx> well the +2 was probably there already
23:37:27 <TrueBrain> - case 0x12: return (ui->variable_3C & 0x40) == 0 ? 0 : 1;
23:37:28 <TrueBrain> + case 0x12: return (ui->movementType & 0x40) == 0 ? 0 : 1;
23:37:34 <TrueBrain> I see no evidence that flag is ever set
23:37:36 <glx> 2 + should mean there's a movement indexed array at [2]
23:37:40 <TrueBrain> as all other checks are on == <something>
23:39:00 <DorpsGek> SVN: truebrain (r1151) -Add: named UnitInfo->variable_3C and TeamInfo->variable_0A to MovementType; also renamed all magic values with enums
23:39:24 <DorpsGek> SVN: truebrain (r1152) -Fix: minor layout
23:41:34 <DorpsGek> SVN: truebrain (r1153) -Add: named another debug variable
23:42:39 <TrueBrain> 393 done .. sigh .. :p
23:43:20 <TrueBrain> glx: there are a few entries marked as WIP on the worklist .. are those valid?
23:43:27 <TrueBrain> (my worklist is empty)
23:44:51 <glx> maybe old stuff I tried to convert
23:45:28 <TrueBrain> might be misclicks from me having it open all the time
23:45:33 <TrueBrain> (the most empty page I have in bookmarks :p)
23:45:39 <TrueBrain> but I wanted to start with WSA stuff
23:46:25 <TrueBrain> first, time for bed
23:49:03 <TrueBrain> B52A (WSA related) has 4 entry points, and is self-containing, if I read this right .. will be lovely
23:49:08 <TrueBrain> right, bedtime; ngiht
continue to next day ⏵