IRC logs for #opendune on OFTC at 2011-05-24
            
00:28:07 *** Xaroth_ has joined #openDune
00:34:19 *** Xaroth has quit IRC
00:37:52 <DorpsGek> SVN: glx (r1610) -Add: C-ified GUI_StrategicMap_PrepareRegions()
01:08:40 <DorpsGek> SVN: glx (r1611) -Add: C-ified GUI_StrategicMap_ReadHouseRegions()
01:26:09 <DorpsGek> SVN: glx (r1612) -Add: C-ified InitRegions()
02:04:46 *** glx has quit IRC
07:16:17 *** Xaroth_ has quit IRC
07:16:28 *** Xaroth has joined #openDune
07:16:28 *** ChanServ sets mode: +o Xaroth
12:00:36 *** glx has joined #openDune
12:00:37 *** ChanServ sets mode: +o glx
12:01:07 <glx> hello
12:57:45 <glx> REGIONX.INI stuff is really smart
13:01:32 <TrueBrain> do tell?
13:54:08 <glx> for each house there's the list of new conquered regions
13:54:41 <glx> and text to display is synchronised to region index
13:55:32 <glx> ATR = 13, 7, 20, 14, 21, 22
13:55:32 <glx> ORD = 19, 27, 26, 25, 24, 23
13:55:32 <glx> HAR = 6, 5, 4, 10, 3, 9
13:55:32 <glx> ENGTXT13 = The Atreides claimed strategic regions.
13:55:32 <glx> ENGTXT19 = House Ordos moved in on the east.
13:55:33 <glx> ENGTXT6 = The Harkonnen invaded from the north.
13:55:52 <glx> in this case it's synchronised to first region of each house
13:56:29 <glx> but you can have more text for a house with synchronisation like ENGTXT13 and ENGTXT21
13:56:42 <glx> would show 2 strings for atreides
13:57:42 <Xaroth|Work> so you can make text appear for each zone that is conquered?
13:57:49 <glx> yes
13:57:51 <Xaroth|Work> sweet :P
13:58:22 <glx> and you can add delay by adding alread conquered regions to the list :)
14:00:21 <Xaroth|Work> hax, but hey, it works :P
14:00:40 <Xaroth|Work> and combine the both to send multiple lines of text for 1 conquered zone
14:25:43 <DorpsGek> SVN: glx (r1613) -Add: C-ified GUI_StrategicMap_ShowProgression()
14:57:31 <DorpsGek> SVN: glx (r1614) -Add: C-ified GUI_StrategicMap_DrawText()
16:44:57 <DorpsGek> SVN: glx (r1615) -Add: C-ified GUI_StrategicMap_DrawRegion() and GUI_StrategicMap_FastForwardToggleWithESC(). Bye B503.
16:46:08 <TrueBrain> wow ... nice going glx :D
16:46:22 <glx> I like the name of the last function :)
16:46:30 <TrueBrain> :D
16:48:57 <glx> next one will be B488
17:22:05 <Xaroth|Work> according to the work list we hit 66% conversion? nice
17:22:26 <glx> it's probably outdated again :)
17:22:39 <Xaroth|Work> even better
17:33:33 <glx> if (arg14 != 0x0) {
17:33:33 <glx> emu_cmpw(&arg14, 0x0);
17:33:33 <glx> if (arg14 == 0x0) { /* Unresolved jump */ emu_ip = 0x01B8; emu_last_cs = 0xB488; emu_last_ip = 0x019C; emu_last_length = 0x0024; emu_last_crc = 0x0351; emu_call(); return; }
17:33:33 <glx> emu_cmpw(&colour, 0x0);
17:33:33 <glx> if (colour == 0x0) { /* Unresolved jump */ emu_ip = 0x01B8; emu_last_cs = 0xB488; emu_last_ip = 0x01A2; emu_last_length = 0x0024; emu_last_crc = 0x0351; emu_call(); return; }
17:33:35 <glx> }
17:33:37 <glx> weird ;)
17:36:29 <TrueBrain> HAHAHAHAHAHA
17:36:30 <TrueBrain> :D
17:36:39 <TrueBrain> I love the arg!=0 arg==0 :D
17:36:42 <TrueBrain> <3 dune2
17:47:29 *** Alberth has joined #openDune
19:45:24 <DorpsGek> SVN: truebrain (r1616) -Fix: removed some unused emu_ functions
19:46:32 <TrueBrain> argh, I have to resist the temptation to rewrite some parts already :p
19:46:43 <TrueBrain> 67% and 78% :)
19:49:44 <TrueBrain> Malloc is in fact Calloc
19:52:21 <TrueBrain> (Tools_Malloc that is)
19:54:27 <TrueBrain> 24FD is Sleep(sec)
19:55:04 <TrueBrain> well, not really Sleep, as it does timer updates etc
19:55:07 <TrueBrain> so .. hmm .. meh :D
19:55:19 <TrueBrain> guess I can convert it :D
19:59:40 <TrueBrain> although it looks more like a Sleep(2 * ticks)
19:59:42 <TrueBrain> lol
19:59:45 <TrueBrain> >= should be > I guess
19:59:48 <TrueBrain> meh .. it really reads >=
20:00:05 <glx> ok screen 2 and screen 3 are the same
20:00:26 <TrueBrain> All even screens are identical to the odds
20:00:31 <TrueBrain> 0 = 1, 2 = 3, 4 = 5, ..
20:00:44 <TrueBrain> we talked about that a few days ago, remember :D
20:01:00 <glx> maybe even are screens, while odd are memory
20:01:10 <TrueBrain> they are identical in every way
20:01:17 <TrueBrain> (the pointers)
20:01:29 <glx> yes but the code doesn't know it ;)
20:02:03 <TrueBrain> true
20:02:48 <glx> like memory 3 is used as buffer when loading a file
20:04:38 <DorpsGek> SVN: truebrain (r1617) -Add: C-ified Tools_Sleep. Go away 24FD!
20:13:54 <TrueBrain> lol, 01F7_1FB0 is just a HUGE wrapper around int10 :D
20:19:24 <glx> 8 #define sleep Sleep
20:19:24 <glx> 8 #define sleep Tools_Sleep
20:19:24 <glx> oups ?
20:19:36 <TrueBrain> hmm ... I should check my diffs I guess
20:19:40 <TrueBrain> somehow it didn't show up :(
20:19:43 <TrueBrain> can you revert that please?
20:19:57 <glx> will do
20:20:01 <TrueBrain> tnx
20:20:10 <TrueBrain> I renamed it later on to Tools_Sleep to avoid collision :D
20:22:30 <DorpsGek> SVN: truebrain (r1618) -Add: named some IntVideo related functions
20:23:02 <DorpsGek> SVN: truebrain (r1619) -Fix (r1617): committed something that shouldn't have been committed. Wanna bet you now want to open this diff? :D
20:23:04 <TrueBrain> fixed it myself :D
20:23:11 <TrueBrain> didn't expect r1618 to be done already :p
20:23:29 <TrueBrain> I don't see use implementing 263B at this stage. They will be removed anyway
20:26:01 <glx> f__22A6_0E34_002B_E39A() should be emu_GFX_GetPixel()
20:27:10 <glx> and emu_ is not needed, will convert it after my commit
20:27:20 <TrueBrain> I think 2642_0002 is Widget_MakeDirty, and 2642_0069 Widget_Redraw
20:27:57 <TrueBrain> 2B6C_0197 MakeDirty and 2B6C_0292 Redraw
20:28:17 <glx> arg pre hook
20:28:26 <TrueBrain> :D
20:28:27 <TrueBrain> whitespaces? :D
20:28:46 <DorpsGek> SVN: glx (r1620) -Add: C-ified GUI_Screen_FadeIn2(). And B488 is gone.
20:28:52 <glx> yup
20:28:57 <TrueBrain> I wonder how to proof it ...
20:29:32 <TrueBrain> omg, FadeIn2 is EXPENSIVE
20:29:52 <TrueBrain> and this randomizer is done via global memor? Omg :p
20:30:25 <TrueBrain> I am happy to read you didn't try to copy/paste my code :D
20:30:52 <TrueBrain> yet nearly identical :)
20:30:54 <TrueBrain> so that is good :)
20:31:24 <TrueBrain> right; beer now, the Dirty stuff later
20:31:25 <TrueBrain> :D
20:46:04 <DorpsGek> SVN: glx (r1621) -Add: C-ified GFX_GetPixel()
20:49:15 *** Alberth has left #openDune
21:53:12 <TrueBrain> maybe it is set-lock or something
21:53:14 <TrueBrain> to avoid redraw
21:54:04 <TrueBrain> it always does A before ScreenCopy and B after
21:55:08 <TrueBrain> hmm
21:55:11 <TrueBrain> also something to do with mouse
21:55:18 <TrueBrain> Mouse_Hide / Mouse_Show?
21:55:26 <TrueBrain> then why does it matter which widget etc
21:55:27 <TrueBrain> hmm
21:56:45 <TrueBrain> yeah, it really is something with the mouse
21:57:56 <glx> there are different 2B6C couples
21:59:54 <TrueBrain> I think 000E is HideMouse and 006E is ShowMouse
22:00:01 <TrueBrain> the others are all wrappers to check if it needs to be done I guess
22:00:22 <glx> http://svn.opendune.org/~glx/temp.patch <-- found another GFX_Screen_Copy
22:00:34 <glx> (a useless one ;) )
22:00:53 <TrueBrain> finally one that copies the whole screen
22:00:56 <TrueBrain> was wondering about that
22:01:33 <TrueBrain> yeah, seems the other functions check if the mouse needs undrawing
22:01:51 <glx> it is used to copy from 3 to 2 (or 5 to 4) but only if the segments are different
22:02:08 <TrueBrain> so there are cases where that does happen
22:02:10 <TrueBrain> funny
22:02:13 <TrueBrain> double buffer systems I guess
22:02:21 <TrueBrain> preprare in odd number, copy to even one
22:03:00 <glx> yes load from file in odd, copy to even
22:03:11 <TrueBrain> 0137 and 0169 are wrappers around 000e and 006e again
22:03:39 <TrueBrain> so yeah, I can translate 2642, 2B6C and parts of 22A6
22:03:52 <TrueBrain> tempted to only name them, but meh .. small effort
22:04:02 <TrueBrain> GUI_Mouse_HideWhenInWidget
22:04:07 <TrueBrain> GUI_Mouse_HideWhenInRegion
22:04:12 <TrueBrain> GUI_Mouse_Hide
22:04:15 <TrueBrain> and Shows
22:04:17 <TrueBrain> I guess
22:05:23 <glx> seems good
22:05:42 <TrueBrain> I dont get the 22A6 functions
22:05:44 <TrueBrain> they write 0x31
22:05:47 <TrueBrain> but .. when is it used :p
22:06:39 <TrueBrain> they also accept 2 parameters, which are ignored
22:06:40 <TrueBrain> lol
22:10:46 <DorpsGek> SVN: glx (r1622) -Add: C-ified GFX_Screen_Copy3()
22:12:37 <DorpsGek> SVN: truebrain (r1623) -Add: named 2 functions that have no goal
22:13:33 <DorpsGek> SVN: truebrain (r1624) -Fix: renamed GUI function to GFX, as that is what it really is
22:17:26 <TrueBrain> okay, lets convert these functions then :D
22:17:42 <glx> ha f__22A6_127B_0036_F8C9() is easy
22:17:59 <glx> but still used in decompiled :(
22:18:01 <TrueBrain> << 3 with condictions :D
22:18:21 <TrueBrain> WeirdSystemToPixelCoordinates :D
22:20:23 <glx> it's just width * height
22:20:32 <TrueBrain> with <<, right?
22:20:46 <glx> of course, to get the real size
22:21:06 <glx> emu_push(sprite[5]);
22:21:07 <glx> emu_push((*(uint16 *)(sprite + 3) << 3) + 2);
22:21:07 <glx> emu_push(emu_cs); emu_push(0x0068); emu_cs = 0x22A6; f__22A6_127B_0036_F8C9();
22:21:39 <glx> sprite data are weird I guess :)
22:21:51 <glx> << 3 then << 3 again
22:22:25 <TrueBrain> lol
22:22:41 <TrueBrain> sprite + 3 == sprite[3]
22:22:42 <TrueBrain> :p
22:22:57 <TrueBrain> just 16bit, instead of 8
22:23:03 <TrueBrain> so I guess sprite is more a struct :)
22:23:20 <glx> it's raw sprite data :)
22:23:30 <TrueBrain> a bytes ...
22:23:32 <glx> there should be some header
22:23:35 <TrueBrain> so height is 8bit, width is 16bit
22:23:44 <TrueBrain> but still ... sprite[3] + sprite[4] << 8
22:23:46 <TrueBrain> or what ever, is nicer
22:23:49 <TrueBrain> (also BE/LE safe :D)
22:32:39 <TrueBrain> euh .. check this out:
22:32:47 <TrueBrain> emu_get_memory16(emu_ss, emu_bp, 0x2) = emu_ax
22:32:48 <glx> sprite[3] is width (at least that's what we have in Sprite_GetWidth()
22:32:51 <TrueBrain> bp+2? Wth?
22:33:22 <glx> push(emu_ax), change the pushed value
22:33:34 <TrueBrain> +6 is first push
22:33:39 <TrueBrain> +4 is ip, +2 is cs ...
22:33:49 <TrueBrain> UGH! I am drunk :(
22:33:57 <TrueBrain> misread the - because my mouse was on it
22:33:58 <TrueBrain> ffs
22:34:04 <glx> haha
22:34:04 <TrueBrain> blended in perfectly
22:35:22 <TrueBrain> wow, optimized code
22:35:24 <TrueBrain> this is scary
22:35:36 <glx> hmm ok the left call in decompiled is in emu_File_Error
22:36:02 <TrueBrain> replace is there in decompiled :p
22:36:43 <glx> anyway emu_File_Error is used only in overlay code :)
22:37:23 <TrueBrain> @calc 0xc8
22:37:23 <DorpsGek> TrueBrain: 200
22:37:35 <glx> SCREEN_HEIGHT ;)
22:37:46 <glx> and 0x140 is width
22:37:54 <TrueBrain> 0x28 :D
22:38:02 <glx> width / 8
22:46:57 <TrueBrain> lol, SetMouseSprite is ugly :D
22:47:17 <TrueBrain> seems wrong too
22:47:27 <TrueBrain> pushing of stuff, no popping
22:47:28 <TrueBrain> any idea?
22:49:02 <glx> looks like my stuff
22:49:12 <TrueBrain> I just wonder about the begin block
22:49:13 <TrueBrain> rest is fine
22:49:17 <TrueBrain> but that block ... seems typo?
22:49:45 <glx> the stuff before the while is a leftover
22:49:51 <TrueBrain> k
22:49:54 <TrueBrain> removing it locally then :)
22:50:52 <glx> gotos are ugly too
22:51:42 <TrueBrain> meh; we should convert GFX_CopyToBuffer and co
22:55:13 <TrueBrain> bah, hangs by startup now :(
23:01:01 <DorpsGek> SVN: glx (r1625) -Add: C-ified GFX_GetSize()
23:03:27 <glx> oh doing f__2B6C_006E_002E_4FBC will remove emu_GUI_DrawSprite() monster
23:04:11 <glx> (and its switch (flags & 0x3904) )
23:04:21 <TrueBrain> I am doing those :)
23:04:40 <TrueBrain> but it hangs atm ..
23:04:41 <TrueBrain> dunno why yet
23:06:40 <TrueBrain> weird ... something weird broke ..
23:07:47 <glx> show a diff
23:09:00 <TrueBrain> a case that is unresolved is now called, lol
23:09:01 <TrueBrain> weird
23:09:17 <glx> timing issues
23:09:23 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch
23:10:50 <glx> arg hard to read
23:11:58 <TrueBrain> assert on Hide triggers
23:13:09 <TrueBrain> yeah, and it should do that
23:13:10 <TrueBrain> lol
23:13:17 <TrueBrain> allocations is done afterwards
23:13:21 <TrueBrain> so ... then ... wtf? Lol :D
23:13:35 <TrueBrain> owh, duh ... *sigh*
23:13:46 <glx> where is 708C check ?
23:13:54 <TrueBrain> its in the assert
23:14:24 <TrueBrain> but there is a single flow which can hit it
23:14:29 <TrueBrain> right, it no longer crashes, it just hangs now ...
23:15:44 <TrueBrain> it exists Show
23:15:47 <TrueBrain> but hangs .. hmm ..
23:17:31 <glx> ok applied patch, will be easier I hope
23:18:00 <TrueBrain> it will assert
23:18:13 <TrueBrain> new patch uploaded
23:19:39 <glx> nice MSVC doesn't like it :)
23:20:08 <glx> undeclared causing redefinition errors
23:20:30 <TrueBrain> it is a WIP, yes
23:20:34 <glx> gcc warns a lot as weel
23:20:36 <TrueBrain> stupid MSVC :p
23:20:38 <glx> *well
23:20:58 <TrueBrain> new patch, error-free
23:21:12 <TrueBrain> warnings are of no important, so :)
23:21:32 <TrueBrain> its hanging in int21 ... now that is odd
23:23:58 <TrueBrain> hide/show is like OpenTTD btw :D you can call it, and if the mouse was not visible, it won't be afterwards :p
23:24:05 <TrueBrain> well, OpenTTD with his Pause/Unpause :p
23:25:10 <glx> mouseDrawn is a weird name ;)
23:25:29 <TrueBrain> suggestions?
23:25:41 <glx> it's the opposite
23:26:33 <TrueBrain> mouseHidden is weird :p
23:26:45 <TrueBrain> mouseHiddenDept
23:26:47 <TrueBrain> h
23:26:48 <TrueBrain> there
23:27:06 <TrueBrain> but the name doesnt make the game run :D
23:27:15 <glx> ok infinite loop somewhere
23:27:35 <TrueBrain> I smell a buffer overflow .. just where :p
23:29:01 <glx> I'm inside the malloc from opendune.c:2027
23:29:11 <TrueBrain> it is indeed a buffer overflow
23:29:16 <TrueBrain> when I remove the CopyToBuffer, it works
23:29:33 <glx> but it worked before
23:30:55 <TrueBrain> which means my patch does it :D
23:32:17 <glx> Hide: 0 1
23:32:17 <glx> Show: 0 2
23:32:17 <glx> Show: 0 1
23:32:28 <TrueBrain> seems dimensions are too big ... that is odd ...
23:33:45 <TrueBrain> mouseWidth returns 130
23:33:47 <TrueBrain> LOL
23:34:11 <glx> 7074 ?
23:34:32 <TrueBrain> 7076
23:35:11 <glx> maybe I inverted the shift
23:35:58 <TrueBrain> mouse is 16 by 130 * 8
23:35:59 <TrueBrain> lol
23:36:41 <TrueBrain> something is weird ...
23:36:49 <glx> emu_shrw(&emu_bx, emu_cl);
23:36:49 <TrueBrain> you say width is the [3] in 16bit
23:36:50 <TrueBrain> << 3
23:36:52 <TrueBrain> + 2
23:36:58 <TrueBrain> but then again you do a << 3
23:36:59 <glx> it's shrw
23:37:06 <glx> not shlw
23:37:15 <glx> my mistake
23:37:34 <TrueBrain> but what I don't get ...
23:37:39 <TrueBrain> this should be a problem for a while :p
23:37:46 <TrueBrain> owh, all this time the buffer allocation was big enough
23:38:30 <TrueBrain> >> 3 would make sense
23:38:34 <TrueBrain> I was wondering why it was reading 2 bytes :p
23:38:59 <TrueBrain> now my mouse sprite is 16x4 (*8)
23:39:02 <TrueBrain> which makes more sense
23:39:04 <TrueBrain> still hangs :(
23:40:39 <DorpsGek> SVN: glx (r1626) -Fix (r1538): shift in the wrong direction
23:42:42 <TrueBrain> it keeps hanging ... wtf ...........
23:47:55 <glx> mouseRegionRight 0x013f unsigned short
23:48:05 <glx> sorry it's ok
23:48:49 <TrueBrain> parameter order was wrong
23:48:51 <TrueBrain> but that doesn't help
23:49:15 <TrueBrain> OMG!!!
23:49:17 <TrueBrain> noooooo
23:49:19 <TrueBrain> found it ...
23:49:29 <TrueBrain> kinda anway .. lol
23:49:33 <TrueBrain> crashes later on, but progress :p
23:49:48 <glx> what was it ?
23:50:23 <TrueBrain> normally we push cs:ip etc
23:50:30 <TrueBrain> var4, var3, var2, var1
23:50:39 <TrueBrain> 0x22A6 is a library .. compiled with other-order parameters
23:50:45 <TrueBrain> you push it like var1, var2, var3, var4
23:50:55 <glx> weird
23:50:56 <TrueBrain> (so first on stack is last parameter)
23:51:00 <TrueBrain> no, you can still do that in C too
23:51:07 <TrueBrain> cstack, ....
23:51:11 <TrueBrain> can't remember the others
23:51:16 <TrueBrain> back in DOS it was always a hell
23:51:21 <TrueBrain> you needed to know hot parameters were handled over
23:52:10 <TrueBrain> can't remember what it is called :(
23:52:27 <TrueBrain> anyway, that might explain some weirdness with GFX stuff :p
23:52:28 <TrueBrain> lol
23:53:36 <TrueBrain> anyway, it now has the tendency to crash when I move outside the screen :D
23:59:00 <TrueBrain> when I enter a region in the right hand side, it crashes ... omg ... I HATE THE MOUSE