IRC logs for #opendune on OFTC at 2010-03-26
⏴ go to previous day
08:40:28 <TrueBrain> well, it is the Move function of all units (and with that, all weapons)
13:43:15 *** arik1812 has joined #openDune
14:45:14 <glx> I'm looking at Unit_Damage(), it gets UnitInfo before checking for unit validity ;)
14:45:43 <TrueBrain> and glx, the function of last night, really is Move, or how ever you want to call it
14:45:52 <TrueBrain> including the move of bullets :p Kind of fancy :)
14:57:40 <TrueBrain> for some reason I miss 34CD:007F
14:58:30 <TrueBrain> it should be there ...
14:58:43 <TrueBrain> it is in the txt ...
15:00:30 <TrueBrain> f__B4CD_17DC_0019_CB46
15:01:47 <glx> there's no unresolved around 7F
15:02:04 <TrueBrain> 0972, calls 34CD:007F with an unresolved call
15:02:15 <TrueBrain> (shows up when looking in the dune2.exe)
15:02:45 <TrueBrain> :/* Unresolved call */ emu_push(emu_cs); emu_push(0x11A0); emu_cs = 0x34CD; emu_ip = 0x007F; emu_last_cs = 0x0972; emu_last_ip = 0x119B; emu_last_length = 0x0009; emu_last_crc = 0xAAB4; emu_call();
15:02:56 <TrueBrain> but I don't see why it couldn't resolve it ... I can ...
15:03:36 <glx> so it's somewhere in f__B4CD_0000_0011_95D0()
15:05:08 <glx> but 34CD:007F is in the middle of another instruction
15:05:27 <glx> ,...emu_orb(&emu_get_memory8(emu_ds, emu_bx, 0x8DE5), emu_al);
15:05:38 <glx> unless something is wrong
15:08:04 <TrueBrain> nono, 34CD is the overlay caller
15:08:12 <TrueBrain> f__B4CD_17DC_0019_CB46 is called from it
15:08:17 <TrueBrain> (check the Called From entries)
15:08:45 <glx> ha right overlays are bitches :)
15:09:09 <TrueBrain> emu_push(emu_cs); emu_push(0x11A0); emu_cs = 0x34CD; overlay(0x34CD, 0); f__B4CD_17DC_0019_CB46();
15:09:15 <TrueBrain> yes .. but I hav eno clue why
15:09:30 <TrueBrain> possible it was never recorded .. hmm .. yes .. that would be possible
15:10:50 <TrueBrain> emu_push(rotationNeeded & 0xFF);
15:10:51 <TrueBrain> emu_push(emu_cs); emu_push(0x10DB); emu_cs = 0x34CD; overlay(0x34CD, 0); f__B4CD_17DC_0019_CB46();
15:11:00 <TrueBrain> emu_push(emu_cs); emu_push(0x11A0); emu_cs = 0x34CD; overlay(0x34CD, 0); f__B4CD_17DC_0019_CB46();
15:11:02 <TrueBrain> notice the lack of 0xFF?
15:11:05 <TrueBrain> the B4CD does it anyway
15:11:15 <Xaroth|Work> heh, new southpark ep
15:11:18 <TrueBrain> the value in the push both come from the same function too btw
15:11:22 <TrueBrain> Dune2 code is SO INCONSISTANT
15:18:41 <TrueBrain> if (!Tools_Index_IsValid(encoded)) return 0;
15:18:49 <TrueBrain> is used in 12 of the 13 functions I am looking at
15:18:53 <TrueBrain> if (encoded == 0) return 0;
15:18:57 <TrueBrain> both doing the same, for that matter
15:19:23 <TrueBrain> nowhere there is a if (Tools_Index_GetType(encoded) != IT_TILE) return 0;, when the tile is accessed
15:19:25 <TrueBrain> but if (Tools_Index_GetType(encoded) != IT_UNIT) return 0; I do see
15:20:45 <TrueBrain> lol, glx, I also here have a function which first calls a subfunction with the unit, then checks if the unit is NULL :p
15:21:20 <glx> I hope the called function checks for !NULL
15:21:56 <TrueBrain> so easy resolved :)
15:28:11 <TrueBrain> 3 functions remaining
15:28:49 <TrueBrain> not the smallest of the bunch .. brr
15:29:46 <glx> hmm time to decompile by hand for me (around 1A34:0CC8)
15:30:48 <TrueBrain> want me to continue? :p
15:31:06 <glx> I have that part already ;)
15:31:13 <glx> ,...if ((int16)emu_di >= (int16)0x19) { /* Unresolved jump */ emu_ip = 0x0CE8; emu_last_cs = 0x1A34; emu_last_ip = 0x0CE2; emu_last_length = 0x0020; emu_last_crc = 0xEC24; emu_call(); return; }
15:31:13 <glx> ,...emu_xorw(&emu_ax, emu_ax);
15:31:13 <glx> ,.../* Unresolved jump */ emu_ip = 0x0CEB; emu_last_cs = 0x1A34; emu_last_ip = 0x0CE6; emu_last_length = 0x0020; emu_last_crc = 0xEC24; emu_call();
15:31:21 <glx> the problem was more this
15:32:50 <glx> I can guess a if () { ax = 0 } else { ax = 1}
15:33:26 <TrueBrain> the first if sets ax = 1
15:33:34 <TrueBrain> the else sets it to 0 (the part you see)
15:34:01 <TrueBrain> jge CE8 (the if you see)
15:34:21 <TrueBrain> then you are at CF4
15:34:37 <TrueBrain> I had DOSBox open anyway ;)
15:35:01 <glx> I could do it from hex but it takes more time
15:35:25 <TrueBrain> you can always ask, no problem
15:35:44 <TrueBrain> scriptengine is something accessed via the parameter, sometimes via structureCurrent .. but as far as I know, they are both identical ...
15:35:58 <TrueBrain> useful: yes; workable: much less :p
15:37:12 <glx> the harder things are 80, 81, 82 and similar
15:37:34 <TrueBrain> so ask, and I launch DOSBox ;) Or install a heavy-debug DOSBox yourself ;) :)
15:38:47 <glx> usually I just check in txt to resolve easy jumps
15:39:28 <TrueBrain> emu_si = UNIT_MISSILE_TURRET;
15:39:31 <TrueBrain> if (Tile_GetDistance(Tools_Index_GetTile(loc08), s->position) < 0x300) {
15:39:33 <TrueBrain> emu_si = UNIT_BULLET;
15:39:56 <TrueBrain> so 1 and 2 tiles from turret are buleets
15:40:33 <TrueBrain> variable[2] is used for turrets, what they have targeted :p
15:42:01 <TrueBrain> hmm ... this is weird ... first, emu_si is set to 0xFFFF, then to either UNIT_MISSILE_TURRET or UNIT_BULLET .. then it does 2 ifs to check if it is one of the two, and otherwise jump to the unknown .. but .. that can never happen :s
15:42:32 <TrueBrain> and of course, tracing that unknown, it just exists ... DAH
15:42:37 <glx> not the first time they do it
15:42:43 <TrueBrain> ah, it is a switch() with a default
15:43:03 <TrueBrain> then I know a better solution ...
15:43:07 <TrueBrain> if (s->type == STRUCTURE_ROCKET_TURRET && Tile_GetDistance(Tools_Index_GetTile(loc08), s->position) >= 0x300) {
15:45:38 <DorpsGek> TrueBrain: 7.86666666667
15:45:58 <DorpsGek> TrueBrain: 9.86666666667
15:46:14 <TrueBrain> a turret asks properties from a launcher and tank ....
15:46:31 <TrueBrain> @calc 0x378 - 0x5a * 9
15:54:57 <TrueBrain> Unit::originEncoded <- clear enough name?
15:55:02 <TrueBrain> can you guess what it indicates?
16:01:55 <glx> where the unit come from ?
16:02:05 <TrueBrain> in an encoded state :p
16:02:40 <TrueBrain> fireRate .. you know a better name, to indicate the time between firing?
16:05:06 <TrueBrain> 2 more functions to go before I commit this
16:05:11 <TrueBrain> as I need to test it, and don't have the time for that now :p
16:06:17 <DorpsGek> SVN: truebrain (r1026) -Add: named a few variables
16:06:21 <TrueBrain> I hope it still compiles now :)
17:10:05 <glx> hmm enemy infantry explodes when dying, something is wrong :)
17:15:39 <glx> oh msvc doesn't warn when you use = intstead == ;)
17:35:06 <DorpsGek> SVN: glx (r1027) -Add: C-ified Unit_Damage()
18:58:13 <DorpsGek> SVN: glx (r1028) -Add: C-ified Unit_UntargetMe()
continue to next day ⏵