IRC logs for #opendune on OFTC at 2009-11-21
            
00:18:27 <TrueBrain> emu_Tools_Var79E4_Update <- sounds like randomizer? :p
00:19:43 <TrueBrain> glx: please use 4 digit flags for 16bit variables
00:19:47 <TrueBrain> so not 0x100, but 0x0100
00:19:55 <TrueBrain> else it is hard to differ between 0x100 and 0x1000 ;)
00:20:00 <TrueBrain> nice job on the commits btw :)
00:22:18 <glx> sorry for the 0x100 :)
00:22:27 <TrueBrain> no problem, just mentioning :)
00:22:36 <TrueBrain> today I worked in the train on scripts .. pretty nifty stuff
00:22:45 <TrueBrain> uncovered a beginning .. still lots to do :p
00:25:22 <glx> just looked at the 2 left GameLoop
00:25:34 <glx> GameLoop_Unit is huge
00:26:07 <TrueBrain> I think I keep Unit stuff for a raining day :p
00:26:09 <TrueBrain> a bitch ...
00:27:15 <TrueBrain> btw, tried naming a few functions in the GameLoop_House?
00:28:41 <TrueBrain> glx:
00:28:42 <TrueBrain> if (!loc02) {
00:28:44 <TrueBrain> is that correct?
00:31:14 <glx> stupid websvn
00:31:24 <glx> it doesn't show old file when file is deleted
00:31:29 <TrueBrain> lol
00:32:20 <TrueBrain> but okay, it was maybe better of me to say: it is not correct ;)
00:32:37 <TrueBrain> - if (emu_get_memory16(emu_ss, emu_bp, -0x2) != 0x0) goto l__0775;
00:32:38 <TrueBrain> - goto l__07F5;
00:32:40 <TrueBrain> -l__0775:
00:32:41 <TrueBrain> was the original code
00:34:22 <TrueBrain> either way, I wish you all a very good night
00:35:10 <glx> right I got it wrong :)
00:37:08 <DorpsGek> SVN: glx (r538) -Fix (r534): inverted a test
01:40:42 *** Xaroth_ has joined #openDune
01:42:31 *** Xaroth has quit IRC
02:00:26 *** tneo has quit IRC
02:00:49 *** tneo_ has joined #openDune
04:09:16 *** glx has quit IRC
10:29:24 *** Xaroth_ is now known as Xaroth
10:37:41 <TrueBrain> morning
13:14:46 *** glx has joined #openDune
13:14:46 *** ChanServ sets mode: +v glx
13:14:59 <glx> hello
13:15:18 <TrueBrain> and a good morning to you too :)
13:17:57 <glx> I tried to understand f__0C3A_20DB_0011_DA16 (to name it)
13:18:06 <TrueBrain> and? :p
13:18:08 <glx> it seems to update hitpoints
13:19:12 <glx> but after l__21AE there's a weird thing
13:19:26 <glx> ,...emu_get_memory16(emu_ss, emu_bp, -0x8) = 0x1;
13:19:26 <glx> ,...emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x8), 0x0);
13:19:26 <glx> ,...if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x8) <= (int16)0x0) goto l__21E3;
13:19:33 <glx> like always true
13:19:42 <TrueBrain> bool debug = false;
13:20:19 <TrueBrain> well, of course it depends what would have happened if it would fall through
13:20:35 <TrueBrain> it is always false btw :p
13:22:02 <glx> ,...if ((int16)emu_ax >= (int16)emu_get_memory16(emu_es, emu_bx, 0xE)) goto l__21E3; /* s->hitpointsMax >= s->hitpoints */
13:22:02 <glx> ,...emu_get_memory16(emu_ss, emu_bp, -0x8) = 0x1;
13:22:02 <glx> ,...emu_cmpw(&emu_get_memory16(emu_ss, emu_bp, -0x8), 0x0);
13:22:02 <glx> ,...if ((int16)emu_get_memory16(emu_ss, emu_bp, -0x8) <= (int16)0x0) goto l__21E3;
13:22:02 <glx> full test block
13:22:27 <glx> so even the first test is theorically not needed ;)
13:22:57 <TrueBrain> well, it is like: if (max >= hitpoints || 1 < 0)
13:23:03 <TrueBrain> so the last part simply has no use
13:23:28 <TrueBrain> euh, max < hitpoints :p
13:23:41 <TrueBrain> no, && :p
13:24:03 <TrueBrain> let me get the code, it depends a bit on how this if is created
13:24:57 <TrueBrain> yes, the -0x8 thing is a useless statement in this case
13:25:21 <TrueBrain> so I strongly suspect it being a debug statement
13:31:41 <glx> anyway this function is something like Structure_CalculateHitpointsMax(houseID)
13:34:17 <TrueBrain> the total hitpoints a house can handle? :)
13:34:22 <TrueBrain> I guess that is used for scoring?
13:49:59 <TrueBrain> @calc 0xc + 10
13:49:59 <DorpsGek> TrueBrain: 22
13:55:52 <glx> http://glx.dnsalias.net:8080/opendune/crash_0C3A_1311.bin
13:56:47 <glx> default case of a probable switch ;)
13:57:22 <TrueBrain> I am in the middle of rewriting script stuff, so until that is finished, I can't run it :)
13:57:40 <glx> np
13:58:21 <glx> I think I'll go for Structure_CalculateHitpointsMax(houseID), can be renamed later if needed
13:58:43 <TrueBrain> you never answered my question abou tit ;) Does it calculate the total hitpoints, or?
13:59:30 <glx> ,...emu_get_memory16(emu_es, emu_bx, 0x56) = emu_ax; /* s->hitpointsMax = si.hitpoints * min(%power, 256) / 256 */
13:59:37 <glx> it does that :)
14:00:00 <TrueBrain> somehow I think that s->hitpointsMax is named wrong
14:00:09 <TrueBrain> as when ever that value is really used, the si is accessed
14:00:41 <TrueBrain> oh, hmm .. it is possible it is named correct ...
14:00:44 <glx> then it does
14:00:46 <glx> ,...emu_get_memory16(emu_es, emu_bx, 0x56) = emu_ax; /* s->hitpointsMax = max(s->hitpointsMax, structInfo[s->type].hitpoints / 2) */
14:00:46 <TrueBrain> I never tried repairing stuff when out of power
14:01:08 <TrueBrain> so when out of power, I can't repair my structures to 100%?
14:03:13 <TrueBrain> emu_negw(&emu_ax, emu_ax);
14:03:14 <TrueBrain> emu_sbbw(&emu_ax, emu_ax);
14:03:16 <TrueBrain> emu_incw(&emu_ax);
14:03:17 <TrueBrain> what the ... eeuuh ...
14:03:58 <TrueBrain> ah ... 0 if emu_ax is 1, else 0 .. or something like that :p
14:04:04 <glx> hmm (-emu_ax) - (-emu_ax) + 1 ?
14:04:15 <glx> with carry ?
14:04:16 <TrueBrain> sbb adds 'cf'
14:04:31 <TrueBrain> neg sets 'cf' to 0 when ax is 0, else to 1
14:04:46 <TrueBrain> so if ax = 0, sbb is 0, else it is -1.
14:04:53 <TrueBrain> +1, so it is !ax
14:09:58 <TrueBrain> I have this really weird thing with the script stuff .. there is one unused command, but when I trace it, is a very weird one .. as it uses uninitializes local variables :s
14:10:54 <glx> well if it's unused it's not a problem
14:15:30 <Xaroth> o/
14:22:22 <TrueBrain> euh .. it is even worse, that 18th opcode jumps in the middle of an instruction :s
14:23:42 <TrueBrain> ah, no I hav been reading it wrong :)
14:33:34 <TrueBrain> okay, 1 opcode left :)
14:44:38 <Xaroth> GAH
14:44:41 <Xaroth> bastarding riot games
14:44:48 <Xaroth> the US servers are now US-only
14:44:56 * Xaroth installs EU client
14:48:44 <DorpsGek> SVN: glx (r539) -Add: figured out a few variables
14:49:15 <glx> and fixed comments while at it (<! is not !<)
14:51:39 <Xaroth> scripting stuffs ? :o
14:54:22 <TrueBrain> okay ... mr Olaf and I don't agree on 4 sub-opcodes .. he says it is <, I say it is >
14:55:00 <glx> very different :)
14:58:22 <TrueBrain> I don't have enough other sources to validate which of us is correct
15:00:03 <TrueBrain> either way, scripting engine uncovered :)
15:00:07 <TrueBrain> I just need to clean up the code
15:01:26 <TrueBrain> Xaroth: OpenDUNE already runs on Mac :p
15:19:48 <Xaroth> but we've not released our first stable yet :)
15:39:23 <TrueBrain> it is weird .. scripts do not use reversed stack order for function calls, if I read this correct
15:39:26 <TrueBrain> which is ...... annoying
15:53:33 <TrueBrain> in other words ... push(2) push(1) sub(), results in 1
15:53:41 <TrueBrain> where in C (or any other sane language) it would result in -1
16:09:59 <Xaroth> maybe it toes abs ?
16:10:07 <TrueBrain> huh? No
16:10:16 <TrueBrain> I was giving you an example, not doubting the internals :p
16:11:18 <TrueBrain> I could also have said: push(4) push(2) div(), results in 2, where in any sane language it would have given 0
16:11:47 <Xaroth> heh
16:11:48 <Xaroth> l
16:11:50 <Xaroth> k, even
16:12:02 <TrueBrain> but this is just weird, and stupid in fact :p
16:12:20 <Xaroth> that the internal scripting thingie?
16:12:23 <Xaroth> maybe on purpose :o
16:12:28 <Xaroth> to make it somewhat readable
16:12:31 <TrueBrain> no, just lack of thinking ahead :p
16:13:06 <TrueBrain> problem now is that every functions need to know how many params they get
16:13:11 <TrueBrain> as to get the first, you need to know the amount
16:13:27 <TrueBrain> normally sp+2 is your first param ... now it is sp+amount
16:13:36 <TrueBrain> so I dunno if that is more readable :p
16:13:45 <Xaroth> for us, no
16:13:48 <TrueBrain> $(sp+4) - $(sp+2), meaning p1 - p2
16:13:51 <Xaroth> for them, probably :P
16:13:55 <TrueBrain> even in subroutines in the scripts
16:14:12 <TrueBrain> (especially there even)
16:14:37 <TrueBrain> besides, it goes against the idea to have a bottom-up stack (which they do)
16:14:39 <TrueBrain> but okay ..
16:19:49 <TrueBrain> glx: would you mind adding emu_house.c?
16:20:30 <TrueBrain> oh
16:20:33 <TrueBrain> you did in pool/emu_house.c
16:20:36 <TrueBrain> that is not .... correct :p
16:22:02 <glx> oh
16:22:12 <glx> sorry
16:22:20 <TrueBrain> np, it just took me a moment to find the right file :p
16:23:02 <glx> I based my work on emu_structure.c and this one is not in pool
16:23:17 <glx> I should had look at emu_unit.c indeed
16:23:23 <TrueBrain> the emu_ files are auxilary files for the real files
16:23:34 <TrueBrain> so if you have src/house.c, the emu wrappers should be in src/emu_house.c
16:23:44 <TrueBrain> where the wrappers for src/pool/house.c are in src/pool/emu_house.c
16:23:54 <glx> I know, I just didn't check :)
16:24:09 <TrueBrain> oh, and in pool the file is wrongly named :p
16:24:11 <TrueBrain> (emu_building)
16:24:17 <TrueBrain> I will fix that when I finish with my script stuff :p
16:24:56 <glx> ok fixing emu_house.c
16:30:31 <DorpsGek> SVN: glx (r540) -Fix (r534): emu_GameLoop_House() wrapper was not in the right file
16:31:19 <TrueBrain> thank you
16:32:33 <DorpsGek> SVN: truebrain (r541) -Fix (r534): make the decompiler happy
16:32:41 <TrueBrain> (was nothing you could know about)
16:33:52 <DorpsGek> SVN: truebrain (r542) -Add: named one more function
16:35:14 <glx> decompiler is weird ;)
16:35:20 <TrueBrain> nah
16:35:27 <TrueBrain> if no function uses a function, it is not going to output it
16:35:33 <TrueBrain> so sometimes you have to tell him you still need a function
16:36:00 <TrueBrain> in theory we should do this for ALL functions we use
16:36:10 <TrueBrain> but that is too much work for me, so I only do the ones that otherwise become unused :p
16:36:27 <TrueBrain> fun fact: structures are called 3 times to run the script, units and airunits I think, only 2 times
16:36:34 <TrueBrain> euh, one time
16:43:10 <TrueBrain> f__2BC0_0013_000A_39BD() <- very inteligent function ...
16:43:23 <TrueBrain> LE/BE I guess?
16:43:36 <TrueBrain> meaning scripts are in BE
16:54:15 <glx> f__2BC0_0004_000F_950B() is nice too :)
16:54:22 <TrueBrain> for 32bit values, yes :)
16:54:46 <glx> hmm now I need min too
16:55:03 <glx> I think it's time to put min and max in the right location
16:55:30 <TrueBrain> I thought you already did :p
16:55:43 <glx> no I kept max in house.c ;)
16:55:53 <TrueBrain> lazy lazy lazy :p
16:57:20 <glx> src/math.h ?
16:57:32 <TrueBrain> src/os/math.h please :)
16:57:47 <TrueBrain> lets keep all those OS related shit in src/os/ ;)
16:57:52 <TrueBrain> soon I will move all uintNN stuff there too
16:59:50 <glx> macro or inline functions for min and max ?
17:00:36 <TrueBrain> I think macro is better? Dunno .. don't really care tbh :)
17:02:15 <glx> ok macro then (can be change into functions later if needed)
17:11:10 <DorpsGek> SVN: glx (r543) -Add: src/os/math.h for all math related stuff
17:21:13 <glx> http://glx.dnsalias.net:8080/opendune/Structure_CalculateHitpointsMax.diff <-- still needs some work I think
17:21:36 <TrueBrain> ghehe, wrong comment in math.h :p
17:22:07 <TrueBrain> + find.index = 0xFFF; <- missing an F there
17:22:37 <TrueBrain> if (s->houseID != houseID) continue; <- really? Silly check .. as the Find kind of guarantees that :p
17:23:04 <glx> I just converted code, and I said still needs some work ;)
17:23:17 <glx> like adding safety check at the begining
17:23:43 <TrueBrain> and just remove the loc08 .. it is stupid :( Stupid dune2 coders :p
17:24:01 <TrueBrain> sometimes you have too much newline for my taste, sometimes too little :p
17:24:13 <TrueBrain> but code looks fine by me
17:24:44 <TrueBrain> now I understand hitpointsMax; it is not the max value, it is the value the structure is 'growing' to over time
17:25:03 <TrueBrain> or at least, this functions shows that it is much more likely to have that meaning ;)
17:26:01 <TrueBrain> bah, I need to define all functions uses by scripts :p
17:32:12 <TrueBrain> damn ... I made a mistake in my script stuff for sure
17:32:17 <TrueBrain> now the hard part ... finding that mistake :p
17:32:18 <TrueBrain> ghehehehe
17:32:20 <TrueBrain> first: DINNER!
17:32:44 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch
18:23:42 <glx> just reading emu_Script_IsLoaded asm, it's funny to see stuff like if (emu_ax == 0) emu_ax = 0 ;)
18:24:00 <TrueBrain> return values and used variables ;)
18:25:56 <glx> and unnneeded gotos
18:26:10 <glx> sometimes compilers are just stupid
18:27:23 <glx> btw reset, load and isloaded seems correct
18:27:35 <TrueBrain> yeah, I tested them seperately
18:27:45 <TrueBrain> Script_Run has a bug at some position :p
18:27:51 <glx> too bad ;)
18:34:15 <glx> you can have a hint for the broken position ?
18:34:33 <TrueBrain> nope; I will be adding tons of printfs when Fringe is finished :)
18:45:52 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=17 :: Bug Created :: Random crash
18:49:53 <TrueBrain> Xaroth: feature request: add username to bugs notices
18:50:35 <TrueBrain> why does tneo now find a missing function in the script stuff? :p
18:51:56 <TrueBrain> too bad for him it is memory corruption
18:52:49 <TrueBrain> also means the memory corruption shit is still there :(
19:03:59 *** tneo_ is now known as tneo
19:04:52 <TrueBrain> okay, there we go ... what is wrong with my script replacement :)
19:08:06 <glx> up to case 2 it looks correct :)
19:15:50 <TrueBrain> okay, for sure I fucked up the cs:ip order of the EXECUTE SUBROUTINE opcode :p
19:16:10 <TrueBrain> doesn't solve the problem
19:20:05 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=18 :: Bug Created :: Game finished pressed Proceed
19:20:23 <tneo> :-D
19:21:43 <TrueBrain> http://paste.openttd.org/218242 <- opcode / parameter / current
19:21:48 <TrueBrain> last instruction makes it crash
19:22:18 <TrueBrain> tneo: same problem as #17
19:22:21 <TrueBrain> but concratz on finishing ;)
19:22:41 <tneo> thx :-)
19:22:51 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=18 :: New Status: closed (duplicate)
19:31:07 <TrueBrain> k, getting there ...
19:37:33 <glx> the paste is output from before current check ?
19:37:48 <TrueBrain> the paste output is outdated, I fixed that problem :)
19:38:13 <TrueBrain> but it was just before 'switch (opcode)'
19:44:16 <glx> hmm case 10 and 11 don't look good
19:46:21 <glx> but I need to compare with asm
19:46:41 <TrueBrain> lol .. yes, by just looking at them you won't be able to detect wrongness :p
19:57:22 <TrueBrain> hmmm ... I compared both versions ... and something weird happens after 14 / 16
19:57:33 <TrueBrain> 14 = execute, so execute function 16
20:01:19 <tneo> TrueBrain, I have pasted the wrong info in 18
20:01:32 <TrueBrain> tneo: ah ... :p
20:01:34 <TrueBrain> so reopen it
20:01:38 <tneo> ok
20:02:28 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=18 :: New Status: feedback (reopened)
20:02:52 <TrueBrain> tnx :)
20:13:39 <TrueBrain> okay, the first 400 opcodes now match ... then it goes wrong ..
20:13:45 <TrueBrain> I think I will need to output the stack too :p
20:19:11 <TrueBrain> the code appears correct, just not the order of execution ..
20:25:54 <TrueBrain> shit ... scripts do not execute in the exact same order every run :'(
20:26:20 <glx> +,...,...,...emu_cs = function.s.cs; emu_ip = function.s.ip;
20:26:20 <glx> +,...,...,...emu_push(emu_get_memory16(emu_ss, emu_sp, 0x0)); emu_push(emu_get_memory16(emu_ss, emu_sp, 0x2));
20:26:20 <glx> +,...,...,...emu_push(emu_cs); emu_push(0x0935);
20:26:36 <glx> -,...emu_ip = emu_get_memory16(emu_ss, emu_bp, -0xE);
20:26:37 <glx> -,...emu_push(emu_cs);
20:26:37 <glx> -,...emu_cs = emu_get_memory16(emu_ss, emu_bp, -0xC);
20:26:37 <glx> -,...emu_push(0x0935);
20:26:56 <glx> wrong cs pushed
20:27:04 <TrueBrain> that might be the final piece of this puzzle yes
20:27:12 <TrueBrain> there is much more with the lines you have, but I fixed most of it :p
20:27:58 <TrueBrain> yippie, now all problems appear solved
20:28:03 <TrueBrain> lets see if scripts still work
20:28:20 <TrueBrain> yippie :)
20:28:23 <TrueBrain> I rule ;)
20:28:25 <TrueBrain> tnx glx :)
20:29:36 <TrueBrain> new patch uploaded
20:32:07 <TrueBrain> so, now we can make a EMC decompiler :p
20:32:13 <TrueBrain> (and compiler, for that matter)
20:32:32 <TrueBrain> I only want to take care of that cs:ip switch .. I don't like it ..
20:35:07 <glx> not easy to change I think
20:36:03 <glx> maybe a function array
20:36:14 <TrueBrain> or a normal switch, if I know all the locations
20:36:52 <glx> well I guess all locations are in memory :)
20:39:13 <TrueBrain> yes ... but non-relocated in binary, which is a bitch
20:39:17 <TrueBrain> and I can't copy/paste from dosbox :(
20:40:49 <TrueBrain> so hacky the hack hack .. :)
20:41:47 <TrueBrain> the structure thingy has many the same functions ...
20:42:21 <TrueBrain> one that returns '0' :)
20:42:25 <TrueBrain> really ... WHY?!
20:42:28 <glx> AirUnit 1E is script
20:42:40 <TrueBrain> I hope +0x12
20:42:45 <TrueBrain> (which includes +0x1E)
20:42:51 <TrueBrain> but that it doesn't start at +0x1E
20:43:46 <glx> no real 1E
20:44:13 <glx> ,...emu_ax = emu_get_memory16(emu_ds, 0x00, 0x6124);
20:44:13 <glx> ,...emu_addw(&emu_ax, 0x1E);
20:44:13 <glx> ,...emu_push(emu_get_memory16(emu_ds, 0x00, 0x6126));
20:44:13 <glx> ,...emu_push(emu_ax);
20:44:13 <glx> ,...emu_push(emu_cs); emu_push(0x00EF); emu_cs = 0x15C2; emu_Script_Run();
20:44:20 <TrueBrain> that is just stupid :(
20:44:42 <glx> 0x6124 is currentAirUnit
20:45:33 <TrueBrain> don't tell me, add it ;) :p
20:46:42 <glx> I have other pending changes ;)
20:47:03 <TrueBrain> so don't do two things at once :p :p
20:48:03 <glx> though http://glx.dnsalias.net:8080/opendune/Structure_CalculateHitpointsMax.diff should be commitable
20:48:50 <TrueBrain> align the 'find' assignment please :p
20:48:51 <TrueBrain> hihi
20:48:59 <glx> hmm div/0
20:49:07 <glx> something is wrong
20:49:19 <TrueBrain> + emu_push(true); <- 'true'? Rather '1', to avoid confusion later on I guess
20:50:06 <TrueBrain> but yes, it looks commitable (if you fixed your problem :p)
21:02:45 <DorpsGek> SVN: truebrain (r544) -Add: C-ified a few Script functions, which uncovered a few variables and function-names
21:05:01 <glx> oh indeed args for V2P are inverted, it's b * 256 / a
21:05:26 <glx> so there's an error in GameLoop_House :)
21:10:23 <DorpsGek> SVN: glx (r545) -Fix (r534): V2P is b * 256 / a, not a * 256 / b
21:15:32 <DorpsGek> SVN: truebrain (r546) -Codechange: put a bit sense into a few older pieces of code .. Free() should take a pointer, not a csip32, Structure is *s, not *b, AirUnit is *au, not *a, ..
21:15:57 <DorpsGek> SVN: truebrain (r547) -Codechange: building was renamed to structure long ago
21:18:12 <TrueBrain> k, that sanity check was long overdue :p
21:18:17 <TrueBrain> now back to my scripts ...
21:19:17 <TrueBrain> + if ((h->creditsStorage * 256 / h->credits) > 200) {
21:19:21 <TrueBrain> that _really_ does not make sense ...
21:19:31 <TrueBrain> say there is a storage of 1000, and credits of 500
21:19:37 <TrueBrain> @calc 1000 * 256 / 500
21:19:37 <DorpsGek> TrueBrain: 512
21:19:45 <TrueBrain> then it says: shortage?
21:19:56 <TrueBrain> sorry, but the old code was far more correct
21:21:00 <TrueBrain> V2P really is p1 * 256 / p2
21:21:13 <TrueBrain> just remember that p2 is pushed first, then p1
21:22:03 <glx> V2P is p2/p1
21:22:21 <glx> bp+8 / bp+6
21:23:14 <TrueBrain> yeah, you are right; nevertheless, house.c was correct, and is broken now :p
21:23:46 <TrueBrain> p2 is credits
21:24:02 <TrueBrain> emu_si = creditsStorage = p1
21:24:28 <TrueBrain> I really never looked at what P2V or V2P did .. it is just what makes sense :)
21:24:37 <TrueBrain> and you always divide to the one that is the bigger with V2P
21:24:46 <TrueBrain> creditStorage clearly is always the bigger
21:29:15 <TrueBrain> - emu_push(emu_get_memory16(emu_es, emu_bx, 0x12));
21:29:17 <TrueBrain> - emu_push(emu_si);
21:29:18 <TrueBrain> - emu_push(emu_cs); emu_push(0x0555); emu_cs = 0x34C1; overlay(0x34C1, 0); emu_Math_ValueToPercent();
21:29:23 <TrueBrain> for code reference ;) House+0x12 is 'credits'
21:30:38 <glx> hmm true
21:33:19 <glx> http://glx.dnsalias.net:8080/opendune/house.diff
21:33:24 <glx> now it's ok :)
21:33:41 <glx> V2P returns 0xFFFF for p1=0
21:33:51 <TrueBrain> ah ;)
21:34:05 <TrueBrain> in theory storage should never be zero with g_global->playerCreditsNoSilo == 0 being true ..
21:34:10 <TrueBrain> but okay, I guess it can happen at the end of the game ;)
21:34:29 <TrueBrain> (when you are about to lose :p)
21:34:41 <glx> better safe than sorry :)
21:36:43 <DorpsGek> SVN: glx (r548) -Revert (r545): r534 code was right, just not safe
21:44:47 <glx> hmm P2V seems to do an overflow check
21:44:56 <glx> sort of
21:49:56 <glx> hmm now I reach an assert
21:55:12 <TrueBrain> k ... I have functions in 16C5 left .. I guess AirUnit, but I don't have the struct yet
22:05:08 <glx> ok found the cause of the assert :)
22:05:20 <glx> sizeof(s) != sizeof(Structure) ;)
22:05:27 <glx> stupid error
22:05:31 <TrueBrain> auch :)
22:12:22 <glx> ok new version available
22:14:35 <TrueBrain> looks okay to me
22:14:44 <glx> hitpointsMax "decreases" when power is needed
22:15:28 <TrueBrain> @base 16 10 [calc 0x6128 + 60]
22:15:28 <DorpsGek> TrueBrain: 149810
22:15:34 <TrueBrain> @base 10 16 [calc 0x6128 + 60]
22:15:34 <DorpsGek> TrueBrain: 6164
22:16:13 <glx> so hitpointsMax is more like an "armor" or something like that I think
22:16:32 <TrueBrain> well, it reads to me that it is a value it is going to
22:16:34 <TrueBrain> but isn't at yet
22:16:56 <TrueBrain> as when there is 90% power, it will always remain at 90% hp, not?
22:17:37 <DorpsGek> SVN: truebrain (r549) -Fix (r547): forgot to update MSVC project files
22:17:56 <glx> possible too
22:18:02 <DorpsGek> SVN: truebrain (r550) -Add: put scripting functions in a static array, which allows easy converting to C
22:18:17 <TrueBrain> what do you think about r550? Nice enough solution? :)
22:18:38 <glx> anyway hitpointsMax can't be lower than si->hitpoints / 2
22:18:53 <TrueBrain> of course, in no way a structure can get below 50% without it being shot at
22:21:38 <glx> nice solution indeed :)
22:21:56 <DorpsGek> SVN: truebrain (r551) -Add: protect against unwanted buffer overflow by abusive scripts
22:22:32 <TrueBrain> 25 functions out of the 104 are never called
22:22:35 <glx> ./*&f__0EDB_0184,*/ NULL, <-- I don't understand the comment syntax
22:22:37 <TrueBrain> makes you wonder why they were added :p
22:22:46 <TrueBrain> I am going to resolve those now ;)
22:23:00 <TrueBrain> not sure how yet ..
22:27:15 <glx> hmm emu_Structure_CalculateHitpointsMax() is never called, should I keep the wrapper ?
22:27:28 <TrueBrain> nope
22:27:58 <glx> but the decompiler may need it
22:28:14 <TrueBrain> for what?
22:28:21 <TrueBrain> if it isn;t used, it won't need it anymore
22:28:27 <glx> not decompile it again
22:28:34 <TrueBrain> oh, like that
22:28:38 <TrueBrain> yes, you need to keep the block
22:28:47 <TrueBrain> but remove the () after the first @implements
22:29:11 <TrueBrain> on the other hand ..
22:29:13 <TrueBrain> no, not even that :p
22:29:19 <TrueBrain> remember the @defines that were needed? :)
22:29:36 <TrueBrain> let me try ..
22:31:43 <TrueBrain> k, indeed, just remove it
22:31:49 <TrueBrain> and remove the @define line from emu_house.c
22:31:53 <TrueBrain> in the GameLoop_House header
22:36:29 <glx> ok so no wrapper and no asm and it will just work
22:36:44 <TrueBrain> and if not, I will patch it up that it does ;)
22:37:11 <glx> anyway it decompiles only when the function is used if I understand
22:37:16 <TrueBrain> yes
22:37:29 <TrueBrain> starting with the hardlinks, it makes a tree of functions that are called
22:37:33 <TrueBrain> and it only handles those
22:37:41 <TrueBrain> where the implemented list is ignored in the tree creation
22:41:28 <TrueBrain> k, created 12 crash.bins
22:41:34 <TrueBrain> glx: any crash.bins I need to handle for you?
22:41:57 <glx> http://glx.dnsalias.net:8080/opendune/crash_0C3A_1311.bin
22:42:01 <glx> IIRC
22:42:33 <TrueBrain> nothing else?
22:42:55 <TrueBrain> wow, Nyerguds registered to our forum! Xaroth! Xaroth! Xaroth! :p
22:43:17 <glx> that's the only crash.bin I have created :)
22:45:14 <DorpsGek> SVN: glx (r552) -Add: named and C-ified one more function
22:45:38 <TrueBrain> of course he (as always) completely missed the point :0
22:45:39 <TrueBrain> haha :)
22:47:20 <TrueBrain> you got to love Nyerguds :)
22:48:03 <DorpsGek> SVN: truebrain (r553) -Add: decompiler likes to include all header files in a file
22:48:11 <TrueBrain> glx: decompiler gives no diff, so it works :) :)
22:48:17 <glx> nice
22:48:54 <TrueBrain> tneo: you missed the text: "Thank you for playing Dune II." :)
22:49:07 <TrueBrain> you played for 3 hours on the last mission? Wow :)
22:49:52 <TrueBrain> http://forum.opendune.org/viewtopic.php?f=9&t=24&p=75#p75
22:50:06 <TrueBrain> new information: you need 6 bits to store the value '6' ;)
22:52:56 <DorpsGek> SVN: truebrain (r554) [JIT] -Fix: two more problems found by tneo
22:53:30 <DorpsGek> SVN: truebrain (r555) -Update (r554, #17, #18): update decompiled code
22:53:43 <TrueBrain> Xaroth: mantis script is broken :'(
22:53:50 <TrueBrain> http://bugs.opendune.org/view.php?id=17
22:54:00 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=17 :: New Status: closed (fixed)
22:54:17 <TrueBrain> it in fact is Mantis which is broken, but okay
22:54:30 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=18 :: New Status: closed (fixed)
22:55:21 <TrueBrain> Xaroth: I edited the comments in those 2 entries, and added the wrong thingy in #1, so please take a look when you have time (no rush at all!)
22:55:48 <TrueBrain> glx: your crash-log did something very bad
22:57:15 <glx> but it looked like a simple default case
22:57:44 <TrueBrain> it is not something you can help I think
22:59:03 <glx> maybe one of the memory changes caused weird stuff after the jump resolution
22:59:13 <TrueBrain> yup
22:59:38 <glx> but the main goal of the crash.bin was to resolve a jump ;)
22:59:41 <DorpsGek> SVN: truebrain (r556) [JIT] -Add: mapped another 2 functions (crash-bins provided by glx)
22:59:47 <TrueBrain> and I isolated it :)
23:00:08 <TrueBrain> btw, tneo, once again, tnx for the feedback :) Much appreciated :)
23:15:16 <Xaroth> <@TrueBrain> Xaroth: mantis script is broken :'( << what broke?
23:15:25 <TrueBrain> in the 'affected' it added links
23:15:29 <TrueBrain> which contained a #
23:15:31 <TrueBrain> so it got a bit weird :p
23:15:33 <TrueBrain> see #1 :)
23:16:15 <Xaroth> that last comment you added on #1 is really odd
23:16:23 <DorpsGek> SVN: truebrain (r557) [JIT] -Add: mapped another 50 functions (crash-bins provided by TrueBrain)
23:16:28 <TrueBrain> that is what happened
23:16:37 <TrueBrain> (well, I removed the non-important shit)
23:17:34 <DorpsGek> SVN: truebrain (r558) -Update (r556, r557): update decompiled code
23:17:38 <Xaroth> the affects list?
23:17:43 <TrueBrain> yes
23:18:05 <Xaroth> AH, hang on
23:18:09 <Xaroth> it auto-generates those
23:18:32 <Xaroth> fixed, i think
23:19:13 <Xaroth> that should have been a debug-only thingie
23:19:28 <TrueBrain> ghehe
23:19:35 <TrueBrain> that failed :p
23:19:45 <Xaroth> off to bed now
23:19:49 <TrueBrain> night!!
23:20:02 <Xaroth> nn
23:24:33 <DorpsGek> SVN: truebrain (r559) -Add: all missing script functions (the ones which are normally not used)
23:27:16 <TrueBrain> I think I did enough for this day :)
23:28:23 <TrueBrain> now the (very) slow process of identifying each script function
23:28:46 <TrueBrain> but I am going to put on a movie and find some sleep
23:28:49 <TrueBrain> nightynight
23:31:47 <TrueBrain> glx: nice work today :) Keep it up ;)
23:32:00 <glx> night TrueBrain
23:50:04 <TrueBrain> glx: I was playing for a bit more .. it seems you broke starport
23:50:12 <TrueBrain> if you have the time, please look at it :) Else I will tomorrow ;)
23:50:14 <TrueBrain> now for real: night ;)
23:50:28 <TrueBrain> (broken as in: things are never really delivered :p It stays at T-MINUS 1)
23:50:47 <glx> hmm GameLoop_House ?