IRC logs for #opendune on OFTC at 2009-11-27
⏴ go to previous day
08:21:53 *** Xaroth has joined #openDune
08:21:53 *** ChanServ sets mode: +o Xaroth
08:31:56 *** Xaroth_ has joined #openDune
08:46:52 *** Xaroth has joined #openDune
08:46:52 *** ChanServ sets mode: +o Xaroth
09:16:52 <Xaroth> I officially hate KPN again
09:39:39 *** Xaroth_ has joined #openDune
09:40:20 <Xaroth_> gah, trying to work on emu_Tile_GetDistanceOffset .. should have brought my notepad with me :P
09:42:40 <Xaroth_> tile32.s.x & 0x3F should return tile32.d.px, right?
10:08:02 <Xaroth_> ooo dune reference in the last few order of the stick
10:15:13 <planetmaker> "order of the stick"
10:15:18 <planetmaker> a very nice web comic
10:16:03 <planetmaker> also available 4 volumes as paper editions so far ;-)
10:16:34 <planetmaker> the author deserved it to earn something for his nice comics. :-)
10:17:27 <planetmaker> unfortunately the last half of year the update frequency kinda sucks :-(
10:17:36 <SmatZ> well, I am just disabling AdBlock at sites I like
10:19:52 <SmatZ> I have never paid over internet
10:20:02 <SmatZ> I am not even sure it's possible with my bank account
10:20:13 <SmatZ> (it most likely is, just I never tried it)
10:20:21 <planetmaker> credit card :-). But you can order them at amazon
10:20:37 <planetmaker> I don't use paypal, though.
10:20:55 <planetmaker> And amazon allows me to use normal banking transfers
12:10:08 *** Xaroth has joined #openDune
12:10:08 *** ChanServ sets mode: +o Xaroth
12:58:42 <TrueBrain> + Unit_SetAction(u, (houseID == g_global->playerHouseID) ? ui->variable_28 : ui->variable_48); <- actionPlayer / actionAI, with as comment: default action for player units, ...
13:01:09 <TrueBrain> don't forget the newline at the end of emu_unit.c
13:03:00 *** Xaroth_ has joined #openDune
13:20:14 *** Xaroth has joined #openDune
13:20:14 *** ChanServ sets mode: +o Xaroth
13:21:12 <glx> hmm thanks to the precommit failure :)
13:24:03 <glx> hmm Unit_*StringToType comments may need an update (but I won't do it) :)
13:26:25 <DorpsGek> SVN: glx (r618) -Add: named and C-ified Unit_SetAction()
13:55:22 <TrueBrain> yes, please, oh yes
13:57:24 <Xaroth> at least you have a sane internet connection atm.
13:57:55 <DorpsGek> SVN: glx (r619) -Codechange: rename Script_Structure_NoOperation() to Script_General_NoOperation() and use it for units too
14:14:41 <TrueBrain> glx: not on the same address ;)
14:20:06 <Xaroth> called kpn, countered every 'standard response' the first line tried to give me
14:20:22 <Xaroth> got 2nd line help.. they said they'd look into it :/
14:20:58 <Xaroth> it takes an automated process 10 minutes to upgrade my connection, it takes a specialist a week...
14:40:38 <glx> hmm f__167E_0005_0013_AF0C() looks like Tools_Index_IsValid(uint16 id) but it doesn't look very safe for structures ;)
14:41:16 <TrueBrain> isn't it for units only?
14:41:41 <TrueBrain> because it is in cs 167E
14:42:01 <TrueBrain> team stuff in 167E, not?
14:42:05 <TrueBrain> 'airunit', sorry :p
14:42:51 <glx> Tools_Index_* are in 167E too
14:43:24 <TrueBrain> well, make the emu_ the unsafe variant, and when converting to C, see if it can be done with the safe variant ;)
14:44:49 <glx> well I can make it safe without changing result I think
14:56:14 <glx> hmm makes me think we may need to add some checks before all Unit_Get_ByIndex() calls as emu_Unit_Get_ByIndex() checks for index validity
14:56:37 <TrueBrain> Get_ByIndex has an assert, not? :)
14:56:53 <glx> yes, but emu_ returns NULL in this case
14:56:56 <TrueBrain> but yes, that is the reason I check for >= UNIT_MAX in most of the emu_ functions (I believe :p)
14:57:14 <TrueBrain> I hope in the C version, it won't ever happen, and the assert is enough
14:58:39 <glx> but everytime asm checks for emu_ return is NULL, we should check index validity instead I think
14:59:04 <TrueBrain> if I get you right, yes, and I did that in all functions I did
14:59:37 <TrueBrain> emu_Structure_CalculatePowerAndCredit()
14:59:39 <TrueBrain> if (houseID >= HOUSE_MAX) return;
14:59:41 <TrueBrain> h = House_Get_ByIndex(houseID);
15:00:55 <TrueBrain> unless of course the emu_ functions give a csip32, in that case you should add a check before it that checks if it isn't 0
15:01:24 <TrueBrain> for that same reason I changed a few uint8 houseIDs to House *h in the non-emu a few days ago
15:01:36 <TrueBrain> as the C version should accept a House *h, not an index, where possible
15:01:53 <TrueBrain> (which assures something else validated the index and made it an object)
15:02:06 <TrueBrain> but I am not sure what you are refering to, as you are kind of vague, so I hope that is what you mean
15:06:45 *** Xaroth_ has joined #openDune
15:08:44 <glx> after a quick check, I think we did index check when dune2 did return check
15:08:52 <Xaroth_> 2nd line dude called back
15:09:01 <Xaroth_> and said it was turned back
15:09:04 <Xaroth_> SO... time to verify :P
15:09:47 <Xaroth_> well it means I can spend time at home finding a new kable intarweb provider
15:09:51 <Xaroth_> Bandbreedte (verzenden/ontvangen) [kbps/kbps]:1.029 / 8.007
15:10:28 <TrueBrain> Xaroth_: suggestion: write a very angry letter explaining, demanding money back for your phone cost and hours spend on it
15:10:41 <TrueBrain> don't forget to include money for that latter and the poststamp on it
15:10:47 <Xaroth_> got a bouquet of flowers :/
15:17:09 *** Xaroth_ is now known as Xaroth
15:17:29 *** ChanServ sets mode: +o Xaroth
15:17:44 <Xaroth> hm, how come glx is still voiced, while he's a dev
15:23:46 <glx> if dune2 assumes the structure is valid, we can do it too
15:24:09 <glx> else we'll get an assert before it uses it ;)
15:24:17 <TrueBrain> + id = emu_get_memory16(emu_ss, emu_sp, 0x0) <- too spacy :)
15:25:31 <TrueBrain> hmm, no, now the emu_ variant is different from the original code .. simply because emu_Structure_Get_ByIndex accepts invalid indexis, and just returns NULL (on which it access flags, and who knows what that does :p)
15:25:37 <TrueBrain> so I do suggest to add a validation
15:25:51 <TrueBrain> we should not produce C code which can potential do harmful things :p
15:26:11 <TrueBrain> I do not exacpt a IsValid to ever assert :p
15:27:19 <TrueBrain> I am suprised IT_TILE is always validated as 'true'
15:27:27 <TrueBrain> maybe btw add a seperate case for it
15:27:34 <TrueBrain> and make the default return 'false'?
15:27:57 <TrueBrain> just for the sanity of it all
15:28:34 <TrueBrain> in general I would like to keep this line: do what ever is needed to keep emu_ functions the same as the assembly, but make the C functions sane and clear
15:30:00 <TrueBrain> don't you think that is more sane?
15:36:39 <glx> ok no obvious problems in A1, it should be ok :)
15:39:53 <DorpsGek> SVN: glx (r620) -Add: named and C-ified Tools_Index_IsValid()
15:45:30 <DorpsGek> SVN: truebrain (r621) -Codechange: fix up the coding style in all emu_ files
15:45:49 <TrueBrain> glx: please look over my changes, and try to follow them :) It became a bit messy over time, I used 3 methods, you used 2 others .. lets try to keep one ;)
17:59:19 <TrueBrain> s/id/index/ please :)
18:02:05 <glx> I used the same style for others Tools_Index
18:03:06 <TrueBrain> didn't noticed it earlier :)
18:03:14 <TrueBrain> I somehow dislike 2 letter variables :)
18:03:19 <TrueBrain> well, the only ones I like are 'i', 'j', 'k'
18:03:29 <TrueBrain> and 'x' and 'y', but the latter for the obvious reasons :p
18:03:43 <TrueBrain> but okay :) Rest looks fine to me :)
18:11:05 <glx> using more explicit variable/arg names
18:17:38 <DorpsGek> SVN: glx (r622) -Add: named and C-ified Tools_Index_GetPackedTile()
18:20:47 * glx continues with Tools_Index_GetTileXY() :)
18:38:57 <glx> aaarrrrggg it does ugly overcomplicated things
20:42:49 <glx> the overcomplicated stuff was unpack :)
20:43:52 <glx> unpacking the encoded packed tile is just silly when you can just unpack the packed tile
20:44:22 <glx> dune2 really does weird things sometimes :)
20:46:13 <TrueBrain> the spacing now looks odd :p
20:48:10 <TrueBrain> looks good; didnt check the assembly, but I trust you :)
20:51:58 <glx> of course spacing comes from previous function ;)
20:54:24 <glx> I played A1 and checked ordos was still sending 'thopter agains my base in A7 savegame
20:55:15 <glx> they help a lot to understand other parts of the code
20:56:34 <glx> hmm maybe I can name variable_54
21:08:53 <DorpsGek> SVN: glx (r623) -Add: named and C-ified Tools_Index_GetTile()
21:14:24 <TrueBrain> there, slapped SVN hard, now it should auto-update the worklist (still not remove functions though, but that is because I can't track namechanges)
21:15:31 <glx> I continue on 167E, but didn't pick up function in worklist
21:15:48 <TrueBrain> well, I suggest you do update it when you go offline
21:15:52 <TrueBrain> otherwise I can just ask you ;)
21:17:24 <TrueBrain> but I like most the stats on the worklist :)
21:17:30 <TrueBrain> it is nice to know we are at 8% :)
21:21:00 <TrueBrain> glx: btw, found a better name for Tools_Index by now? As it turns out to be a nice collection of functions which are all related :) Maybe another file is appropiate?
21:22:19 <glx> but we have time to think about it ;)
21:22:46 <glx> it's easy to do a search and replace later to rename all function
21:23:04 <TrueBrain> I am now going to try to find why oh why it is the case that TCC works on a version without any content in src/*, but doesn't work with latest svn .. somewhere we made a boo-hoo
21:23:04 <glx> as they all start with Tools_Index ;)
21:23:15 <TrueBrain> yup .. but think about it will you ;)
21:29:32 <TrueBrain> 578 compiles, 580 breaks .. hmm .. order of includes ...
21:32:01 <TrueBrain> k .. what ever that is, it is not causing all the problems in runtime
21:37:32 <TrueBrain> and: uint16 ip; uint16 cs;
21:37:34 <TrueBrain> what is the difference?
21:46:47 <TrueBrain> I can't find anything different between the two
21:46:54 <TrueBrain> yet, tcc fails with the first, works with the latter
21:51:10 <DorpsGek> SVN: truebrain (r624) -Fix (r534): sizeof(u) != sizeof(Unit)
22:00:14 <DorpsGek> SVN: truebrain (r625) -Revert (r624): partly reverted code that should never have been commited in the first place
22:05:20 <DorpsGek> SVN: truebrain (r626) -Fix: some minor stuff to make the decompiler happy again
22:07:39 <TrueBrain> it really really doesn't make sense ...
22:07:46 <TrueBrain> when I revert r601, it all works
22:07:50 <TrueBrain> but that is just weird, as there is no real difference
22:09:35 <TrueBrain> why you need stdlib.h?
22:11:03 <TrueBrain> for tools.h, use: extern struct Unit *
22:22:29 <DorpsGek> SVN: glx (r627) -Add: named and C-ified Tools_Index_GetUnit()
22:23:16 <DorpsGek> SVN: truebrain (r628) -Codechange: polish the code a bit with respect to csip32 usage
22:31:04 <TrueBrain> I don't get this csip problem :(
22:31:58 <DorpsGek> SVN: truebrain (r629) -Codechange: some more polising related to csip32
22:32:31 <DorpsGek> SVN: truebrain (r630) -Fix: something breaks TCC when 'ip:cs' are 'uint32:16' instead of 'uint16'. No idea what/why.
22:52:35 <DorpsGek> SVN: truebrain (r631) -Fix: TCC doesn't like it if you include <strings.h> before <stdio.h>, but also not when you typedef a few things and try to load <stdio.h> in between. TCC is weird ..
22:52:42 <TrueBrain> k .. that makes TCC workable again :p
23:35:24 <DorpsGek> SVN: glx (r632) -Add: named and C-ified Tools_Index_GetStructure()
continue to next day ⏵