IRC logs for #opendune on OFTC at 2009-09-19
            
03:00:18 *** glx has quit IRC
11:33:43 <TrueBrain> hmmm .. sometimes what functions do is a complete mystery!
11:38:51 <planetmaker> what would be life without mystery :-)
11:38:55 <planetmaker> hello TrueBrain :-)
11:38:59 <TrueBrain> very true :)
11:39:02 <TrueBrain> howdie planetmaker :)
11:40:06 <TrueBrain> getting the hang of OpenTTD and OSX?
11:40:31 <planetmaker> Trying to. trying to.
11:41:13 <planetmaker> Thanks btw for your advice last night. Somehow neither yours nor Rubi's suggestions helped.
11:41:25 <planetmaker> Defining the CFLAG doesn't make it go away...
11:41:27 <planetmaker> well...
11:41:29 <planetmaker> nvm.
11:41:38 <TrueBrain> I looked at my source for 10.6 OSX, I just removed that blob :p
11:41:40 <TrueBrain> it is silly :)
11:42:26 <planetmaker> well. As I stated in the FS entry: removing that check works.
11:42:28 <TrueBrain> but I am sure that is not considered a real solution :) Gheheh :)
11:42:39 <planetmaker> ^^ that's what I'd suspect, too :-)
11:42:48 <planetmaker> And it doesn't feel right, I have to say.
11:43:13 <planetmaker> Still I'll need to test what it looks like on 10.4. I haven't come around to testing it with that line removed
11:43:15 <TrueBrain> only OSX needs the check :p That is what is a bit weird ...
11:43:39 <TrueBrain> well, it just warns when something fucked up :p I guess you can also add: !defined(STRGEN) &&
11:44:25 <planetmaker> the point is though: if I ignore that warning, it doesn't matter.
11:44:41 <TrueBrain> because the warning is bogus in all cases I got the warning :p
11:44:43 <planetmaker> Everything seems to run as it's supposed to be. But then... there are many things which would need testing
11:45:04 <planetmaker> hehe. Tell that Rubidium :-)
11:45:14 <planetmaker> But I guess he's not in the mood to take OSX patches...
11:45:19 <TrueBrain> it is a safety put in place because nobody could really test it; it checks the sanity of the configure
11:45:38 <TrueBrain> Rubidium is a good person, but he is so fed up with OSX, that talking to him about it is useless
11:45:51 <TrueBrain> naming OSX makes his head turn black, I am sure we all know that feeling :)
11:45:53 <planetmaker> yes. I figured.
11:45:59 <planetmaker> And it sadens me.
11:46:15 <planetmaker> As it kinda makes anything I do, even if I manage to fix anything, pointless.
11:46:28 <TrueBrain> he expects miracles ;)
11:46:53 <planetmaker> :-P
11:47:09 <TrueBrain> there is a point with certain problems where you can't believe anything helps it in any way, till it is shown to you that it solves all problems
11:47:40 <planetmaker> the point, though is: I'm not capable of solving ALL problems. It's meanwhile too many
11:47:53 <TrueBrain> yup; you need to start somewhere and slowly work your way up
11:47:58 <TrueBrain> baby steps :)
11:47:58 <planetmaker> but I can make small steps. Solving some. And IMO each step helps
11:48:03 <planetmaker> yes :-)
12:04:01 <TrueBrain> weird, in mouse mode 0 (normal mouse mode), new_x and new_y is set AFTER button-click is handled, which works on these values
12:04:09 <TrueBrain> so clicking works kind of on the old values, rather than the new
12:06:26 *** glx has joined #openDune
12:06:26 *** ChanServ sets mode: +v glx
12:09:22 <planetmaker> what do I actually need in order to get this opendune compiled and/or running on my computer?
12:09:30 <TrueBrain> libsdl
12:09:31 <planetmaker> I guess I'll need windows and...?
12:09:53 <planetmaker> ok, I should have that from OpenTTD :-)
12:10:12 <glx> you don't want windows :)
12:10:20 <TrueBrain> no :p
12:10:24 <TrueBrain> OSX should work just fine
12:10:28 <TrueBrain> else Linux is a good advise ;)
12:10:35 <planetmaker> oh, really? :-) Good to know
12:10:53 <planetmaker> Well, I have access to each of them :-)
12:11:03 <TrueBrain> you have SDL on your OSX?
12:11:19 <planetmaker> macports is my friend ;-)
12:11:33 <TrueBrain> can you give OpenDUNE a spin? dih stopped when he found out he had to install SDL :p
12:11:52 <planetmaker> hm... you make me unsure, but I *think* I have it. I'll see.
12:12:22 <glx> TrueBrain: I have a highly simplified working timer (doesn't help for the stack overflows)
12:12:33 <TrueBrain> glx: non-threaded?
12:12:40 <TrueBrain> does it help with MSVC?
12:12:41 <TrueBrain> show me :)
12:12:49 <glx> well threaded but not by us
12:13:17 <planetmaker> seems I didn't. But it's installing right now
12:13:40 <glx> http://glx.dnsalias.net:8080/openttd/pic_timer.diff <-- ignore the 2 last chunks and the printfs ;)
12:14:58 <glx> with timer queue behaviours don't change, so msvc still not animate palette and mingw hang at some points
12:16:18 <glx> the pic_get_?sec() changes are to make msvc more accurate (code similar to mingw's gettimeofday implemention)
12:16:46 <glx> but when msvc is "accurate" I rapidely get stack overflow
12:17:17 <glx> so I think emu flags are wrong in msvc
12:17:37 <TrueBrain> stack overflow is by lack of good optimization
12:17:47 <TrueBrain> for Linux GCC this just worked, which is more a cheat than a real solution
12:18:35 <glx> hmm I can try to play with msvc options
12:18:50 <TrueBrain> is the better pic_get_?sec really eneded?
12:19:33 <glx> usec is always XXX000 with the timeGetTime version
12:19:36 <TrueBrain> the only reason I returned usec is because linux does that .. we operate at msec level
12:20:32 <TrueBrain> as I am afraid this consumes a bit too much CPU, for little to no gain
12:21:18 <TrueBrain> (our timer operates at 20ms, so any higher resolution is not required for good functional code I guess)
12:23:49 <glx> right
12:24:09 <planetmaker> he... I guess I know why dih quit on installing SDL :-P
12:24:36 <TrueBrain> why? :)
12:24:42 <glx> I remember myself installing sdl on osx 10.4.8 in vmware
12:24:45 <planetmaker> SDLlib doesn't compile
12:25:01 <planetmaker> with a number of members not defined
12:25:24 <TrueBrain> BAD macports :p
12:26:04 <planetmaker> it's not macports
12:26:13 <planetmaker> it's quartz not defining stuff: http://paste.openttd.org/216937
12:26:36 <TrueBrain> :(
12:27:27 <planetmaker> and the same actually, if I download directly from sdllib page
12:27:42 <planetmaker> the binary doesn't work here, is probably not for 10.6 yet :-P
12:28:07 <TrueBrain> sad
12:28:17 <glx> hey not surprising
12:28:35 <planetmaker> well. if macports installs it, it *should* work
12:28:41 <planetmaker> they told, they updated stuff
12:28:48 <TrueBrain> THEY LIED!
12:28:57 <planetmaker> obviously ;-)
12:33:37 <TrueBrain> k, I am pretty sure Dune2 was written in C++
12:33:51 <TrueBrain> I found things that feel and/or act like members and static variables
12:42:14 <TrueBrain> a lot of the mouse handler is never called ... I wonder why that is ...
12:58:14 <Xaroth> is there any way to tell?
12:58:55 <TrueBrain> http://paste.openttd.org/216938
12:58:58 <TrueBrain> freak ass code :s
13:03:54 <TrueBrain> I rewrote a function of 200 lines, of which I have no clue what it does ......
13:05:17 <TrueBrain> well, yes, it handled button click :p
13:16:52 <TrueBrain> but at least it works, and seems to work correctly :)
13:17:01 <TrueBrain> which is, seen the code, something special :p
14:07:09 <TrueBrain> if ((emu_ax.h & 0x8) != 0) {
14:07:11 <TrueBrain> if (emu_ax.l != 0x41 && emu_ax.l != 0x42) {
14:07:14 <TrueBrain> is it me, or doesn't that make sense?
14:09:52 <TrueBrain> oh, wait, ax.h and ax.l :) Nevermind ;)
14:23:31 <Xaroth> it still makes no sense :P
14:23:58 <TrueBrain> if not mouse button release and not left or right button, then ...
14:24:07 <TrueBrain> I think it also allows other types of mouse to work
14:24:22 <TrueBrain> in the old days you also had a pen you could press on the screen :p
14:24:26 <Xaroth> ah
14:24:29 <TrueBrain> (not wireless :p)
14:25:27 <TrueBrain> still it is magic what it really does :p
14:26:35 <Xaroth> what are the .h and .l things then .. high and low bits?
14:26:43 <TrueBrain> a counter that does += 2 on ever click, and it keeps track of what it did press ...
14:26:44 <TrueBrain> yup
14:26:51 <TrueBrain> 16 bit, so .h is the last 8 bits, and .l is the first 8 bits
14:27:05 <TrueBrain> emu_ax.x = (emu_ax.h << 8) + emu_ax.l
14:27:21 <TrueBrain> 32bit machines have ex, and 64bit rx
14:27:30 <TrueBrain> but then they stopped doing high and low :p
14:28:44 <TrueBrain> it is like a small recorder
14:28:52 <TrueBrain> it records the mouse button state, and the position of the mouse
14:29:08 <TrueBrain> is there ever a 'drag' something in Dune2?
14:29:54 <Xaroth> not that i'm aware of
14:31:10 <TrueBrain> hmm .. it really is drag code ..
14:31:15 <TrueBrain> in a very very intelligent way
14:33:19 <Xaroth> good, we'll keep it :P
14:38:58 <TrueBrain> it records button clicks, and their locations ... I guess later on it is handled
14:39:04 <TrueBrain> the interrupt just logs it, for later usage
14:41:25 <Xaroth> multiple unit select was already on my list to-get :P
14:41:31 <Xaroth> so this is only useful :P
14:41:42 <TrueBrain> ghehe :)
14:44:34 <TrueBrain> I really need to start adding structs, as it is not really improving the readability :p
14:47:55 <TrueBrain> my code will not work on PPC ..
14:48:07 <TrueBrain> should I take care of that?
14:48:22 <Xaroth> PPC? pocket pc?
14:48:30 <TrueBrain> PowerPC
14:48:38 <TrueBrain> I meant BE machines (BigEndian)
14:48:44 <Xaroth> eh, hm
14:48:58 <TrueBrain> LE machines, Intel machines so to say, store things different in memory than BE machines
14:49:12 <TrueBrain> http://en.wikipedia.org/wiki/Endianness
14:49:18 <Xaroth> yeh i know the difference
14:49:30 <Xaroth> er.. we can always add support later if there's animo
14:49:34 <TrueBrain> so I would like to make a struct and attach that to the memory
14:49:39 <TrueBrain> but that will assume LE :p
14:49:45 <TrueBrain> well, that is not that easy
14:49:49 <TrueBrain> as you need to swap ALL those fields
14:50:03 <TrueBrain> well .. I guess an init-state can fix that
14:50:36 <TrueBrain> k
15:11:19 <TrueBrain> okay, mouse buttons are translated to just keyboard entries
15:11:20 <TrueBrain> that explains :)
15:14:09 <DorpsGek> SVN: commit (r77) by truebrain - -Codechange: minor layout in mouse code
15:16:36 <TrueBrain> thinks slowly fall into place :) I love that part of this job ;)
15:19:15 <DorpsGek> SVN: commit (r78) by truebrain - -Add: converted a small snippet of the input handler
15:20:18 <TrueBrain> btw, Xaroth, on average you can state that ever cs__ file was a single .c files
15:22:16 <TrueBrain> shit, I broke mouse handling :p
15:22:18 <TrueBrain> haha
15:24:30 <DorpsGek> SVN: commit (r79) by truebrain - -Add: introduce 'bool' to make the goal of functions more clear, and fix mouse handling with that
15:27:10 <TrueBrain> @calc 0xa94 - 0x1b4
15:27:10 <DorpsGek> TrueBrain: 2272
15:27:14 <TrueBrain> @base 10 16 2272
15:27:14 <DorpsGek> TrueBrain: 8E0
15:27:28 <Xaroth> so it was made in C(++) and not ASM?
15:27:45 <TrueBrain> Xaroth: that I already knew (as it has the Borland C++ footprint), but yes :)
15:27:58 <TrueBrain> Xaroth: that is the reason we have such a clear stack-frame and stuff :)
15:28:19 <Xaroth> you call that clear? :P
15:28:33 <TrueBrain> you never seen real assemble written apps I guess
15:29:35 <TrueBrain> how to call the function that attaches a struct to the memory
15:29:44 <TrueBrain> system_InitInput
15:29:46 <TrueBrain> input_Init
15:29:49 <TrueBrain> ..
15:30:06 <Xaroth> hm
15:30:18 <Xaroth> first I think
15:31:13 <Xaroth> apparently ammler read the news about us ditching redmine
15:31:26 <Xaroth> and I have this suspicion he's a redmine fanboi
15:32:29 <TrueBrain> where?
15:32:40 <Xaroth> ottdc channel
15:32:54 <TrueBrain> and he is, yes; but he only works with relative very small repos
15:35:21 <TrueBrain> local variables I call, suprise suprise, 'local'
15:35:26 <TrueBrain> I think that is most clear for now ..
15:36:34 <glx> http://glx.dnsalias.net:8080/openttd/pic_timer.diff <-- timer simplification only
15:37:03 <TrueBrain> why the win32_winnt define?
15:37:33 <glx> because it requires at least win2000
15:38:23 <glx> anyway dune2 runs "natively" in win9x :)
15:38:30 <glx> so it's not a big problem
15:38:32 <TrueBrain> poor win98 users :p
15:38:37 <TrueBrain> glx: euh .. that is not the aim of this project ;)
15:38:41 <TrueBrain> but for now it will do just fine :)
15:39:05 <DorpsGek> SVN: commit (r80) by truebrain - [LibEMU] -Add: a better timer for Windows (glx)
15:39:08 <TrueBrain> tnx glx :)
15:44:05 <TrueBrain> @base 16 10 af
15:44:05 <DorpsGek> TrueBrain: 175
15:50:59 <glx> mouse handling is still not very good
15:51:18 <glx> (at least on windows)
15:51:44 <TrueBrain> on no platform
15:51:47 <TrueBrain> I am starting to realise why
15:51:54 <TrueBrain> when you go to another screen, DO NOT MOVE YOUR MOUSE :p
15:51:56 <TrueBrain> then it works perfectly :)
15:52:21 <TrueBrain> the problem is, I think anyway, that the mouse callback should not be called when the interrupt flag is set
15:52:30 <glx> hmm so when I click on play I must wait for the house menu ?
15:52:32 <TrueBrain> but I can't delay such actions, and so it will be ignored, which is even worse
15:52:54 <TrueBrain> now it happens when something is reading the input buffer, I also fill it .. and then nasty things happen :p
15:53:02 <TrueBrain> click, wait till you see it, move mouse
15:53:05 <TrueBrain> or better: use keyboard ;)
15:53:56 <glx> anyway it still hangs after some times ;) (not your fault I know)
15:55:06 <glx> some functions are nasty, they call themself recursively
15:55:21 <TrueBrain> yup
15:55:24 <glx> like f__22A6_0645_0061_7A47 and f__22A6_0692_0014_FFAB
15:55:31 <TrueBrain> there are many many many :)
15:55:34 <TrueBrain> all waiting for a timer :)
15:57:22 <TrueBrain> hmm .. next job for next week for me: add makedepend :P
15:59:06 <glx> use depend from openttd ;)
15:59:22 <TrueBrain> I was planning to ;) :)
15:59:28 <TrueBrain> it is better than the X11 one :p
16:00:38 <glx> and when doing that, add libemu.a as a dep for opendune
16:00:59 <glx> that way I don't have to rm opendune.exe before make after a libemu update
16:01:36 <TrueBrain> will do :)
16:02:04 <TrueBrain> http://devs.opendune.org/~truebrain/input_local.patch
16:02:08 <TrueBrain> suggestions? comments?
16:04:00 <glx> +,...if ((local->unknown_01B3 & 0x1000) == 0x1000) { <-- reminds me the old unk2 in openttd ;)
16:04:07 <TrueBrain> yup :)
16:04:12 <TrueBrain> I can't find a better way to mark those for now :)
16:04:26 <TrueBrain> leaving the offset in gives a form of reference ...
16:04:56 <TrueBrain> but as you can see, large sports are of unknown data .. mostly because something like A94 is between functions
16:05:00 <TrueBrain> not sure what to do about that
16:05:59 <glx> so 0x01B3 holds a flag
16:06:05 <TrueBrain> yeah
16:06:08 <TrueBrain> more flags :p
16:06:32 <TrueBrain> * @implements 29E8:0A19:002A:2DE6 ()
16:06:33 <TrueBrain> * @implements 29E8:0A43:0007:9B22
16:06:46 <TrueBrain> I have 2 functions, one at A19 of length 2A, and one at A43 of length 7
16:06:51 <TrueBrain> in between is that datablock
16:07:12 <TrueBrain> maybe I should make a different struct for it
16:07:46 <TrueBrain> oh, not in between
16:07:48 <TrueBrain> I should learn to read
16:08:32 <TrueBrain> * @implements 29E8:0A8A:000A:EB53 ()
16:08:34 <TrueBrain> * @implements 29E8:0AD6:0010:7A1F
16:08:35 <TrueBrain> between those 2 is data
16:08:57 <TrueBrain> so I wonder if this struct is the best way to represent the data
16:09:34 <glx> dunno
16:10:55 <TrueBrain> Xaroth
16:10:57 <TrueBrain> ?
16:11:21 <TrueBrain> the main problem is that I am not sure from where to where is code :p
16:11:40 <TrueBrain> A94 for example is 'static uint16' inside a function
16:11:54 <TrueBrain> (or anyway, it holds the same idea)
16:13:12 <TrueBrain> so in time they can be removed from the struct in general, and be merged in nicely :) Like many more code ;)
16:14:21 <TrueBrain> (reload) I think this is better ... naming 'variable' if we known it is used as such, and naming it 'unknown' if we don't know
16:17:27 <glx> alignment of comments is wrong :)
16:17:36 <TrueBrain> reload :p
16:17:42 <TrueBrain> also renamed 'local' to s_input_local
16:17:47 <TrueBrain> maybe is more clear for later references
16:18:02 <TrueBrain> s_ from static, input for the namespace, and local as it is most likely local data
16:18:12 <TrueBrain> in contrast, the mouse data is not local
16:18:17 <TrueBrain> so that would be s_input_mouse
16:19:00 <DorpsGek> SVN: commit (r81) by truebrain - -Codechange: put variables from memory in a struct, for easy naming and reference
16:19:06 <TrueBrain> first piece of readability :) :)
16:19:22 <glx> 1B5 and 23A are functions ?
16:20:49 <glx> implicit declaration
16:26:39 <TrueBrain> they might be functions, I dunno
16:36:10 <glx> <+glx> implicit declaration <-- 'system_Init_Input' in main.c :)
16:37:52 <Xaroth> ?
16:41:42 <glx> oh I can go to the Yes/No menu if I press keys to pass animation
16:42:06 <glx> Program Termination: jumped to 29E8:0E1B, which is not decompiled.
16:42:06 <glx> The jump was triggered at decompiled/cs__29E8.c:1967
16:42:06 <glx> The jump appears to originate from 29E8:0E16.
16:42:13 <glx> but I can't pass that
16:42:46 <glx> oh I'm in game \o/
16:43:28 <glx> keypress crashed it :(
16:47:48 <glx> hmm bool is not a good idea for msvc (I compile as c++)
16:48:22 <TrueBrain> glx: will fix tha tlater ;)
16:48:36 <glx> easy to fix for me ;)
16:48:45 <TrueBrain> put it in a block, and giv eme the patch :p
16:54:40 <glx> http://glx.dnsalias.net:8080/openttd/opendune_msvc.diff
16:57:07 <DorpsGek> SVN: commit (r82) by truebrain - -Codechange: a bit of renaming, making functions static, fixing coding-style, ..
16:57:50 <DorpsGek> SVN: commit (r83) by truebrain - -Fix: MSVC compatibility and project update (glx)
17:13:17 <TrueBrain> k, I am out for the rest of the weekend :) Have a good one all!
17:13:26 <TrueBrain> (MOVIEPARK GERMANY!!! WHOHO! :))
17:15:19 <planetmaker> enjoy it, TrueBrain :-)
19:25:56 <Xaroth> It's a fun park, TrueBrain :)
20:13:30 <TrueBrain> nobody here has a newzbin account I guess? :p
20:26:37 <Xaroth> nop
20:28:11 <TrueBrain> sad
20:28:16 <TrueBrain> most software works with it
20:28:18 <TrueBrain> kind of annoying
20:31:05 <nsz> never heard of it
20:32:31 <TrueBrain> oh well ... my parents internet connection is kind of crappy, so I wish you all a good night :) Well .. not perse the connection, more the computer :p
20:32:32 <TrueBrain> ghehe
20:32:34 <TrueBrain> bye all :)
20:33:09 <nsz> night