IRC logs for #opendune on OFTC at 2011-05-22
⏴ go to previous day
08:47:04 *** Alberth has joined #openDune
12:10:56 <Alberth> while testing I played a bit, and noticed graphic glitches after a while, mostly just after saving (perhaps onto an existing save game)
12:17:50 <Alberth> i have them in r1540 too, although how much I can trust that, I don't know :(
12:42:40 <glx> hmm there's really a problem with time calculation :)
12:43:10 <glx> 1h16 for A1 is clearly wrong :)
12:50:22 <DorpsGek> SVN: glx (r1579) -Add: C-ified GUI_FactoryWindow_GetStruct8BEA()
12:50:35 <Alberth> I bet that took longer than 1h16 :)
12:55:21 <DorpsGek> SVN: glx (r1580) -Fix: bye B4C1 (patch by Alberth)
14:01:09 <TrueBrain> is it me, or does emu_String_strstr more than ISO strstr?
14:01:15 <TrueBrain> input values are like HUMAN$CPU
14:01:32 <TrueBrain> nevermind, it is reversed
14:12:12 <Alberth> playing a bit with r1528 does not give me glitches
14:15:04 <glx> there are memory magick in Sprites_SetMouseSprite()
14:16:24 <glx> hmm but this function is not directly related to saving
14:18:47 <Alberth> 1539 was already established, 1538 has the include error
14:19:06 <DorpsGek> SVN: glx (r1581) -Add: C-ified GUI_FactoryWindow_DrawDetails()
14:56:11 <DorpsGek> SVN: glx (r1582) -Add: C-ified GUI_FactoryWindow_DrawCaption()
14:56:39 <glx> wow almost done for this segment
14:57:23 <glx> though f__B495_1A14_0013_AE3F() will be hard (some kind of callback used in 01F7)
14:58:45 <glx> TrueBrain: is it possible to update worklist ?
14:59:38 <TrueBrain> as soon as I commit :p
14:59:46 <TrueBrain> INI shit almost works ...
15:07:39 <TrueBrain> there ... I tihnk I solved all issues now ... :D
15:11:11 <Alberth> more like TB rules the world :)
15:11:27 <planetmaker> there's peace and peace ;-)
15:16:12 <TrueBrain> lets reduce the code size ... no need to copy paste all over the place ...
15:16:17 <TrueBrain> stupid Dune2 programmers :p
15:17:34 <planetmaker> nah. Intelligent. They were paid for work which is inferior to yours. And you do it for free.
15:20:13 <planetmaker> maybe not intelligent. clever rather
15:21:46 <glx> the other option is stupid compiler :)
15:22:47 <planetmaker> that's a less interesting option ;-)
15:24:14 <TrueBrain> where to place this?
15:24:39 <TrueBrain> that file is to handle Strings .. not for these kinds of functions :p
15:24:51 <planetmaker> string_func.c / .h
15:25:00 <TrueBrain> planetmaker: this is OpenDUNE
15:25:18 <planetmaker> I know :-) that's why it's .c and not .cpp ;-)
15:38:02 <TrueBrain> havent seen that in a while
15:38:27 <DorpsGek> SVN: truebrain (r1583) -Add: C-ified Ini_NNN() and String_Trim() functions. Bye B4FC. Hello real Scenario_Load()
15:38:32 <TrueBrain> hope I didn't do anything wrong
15:38:34 <TrueBrain> but this should work :)
15:40:29 <TrueBrain> 3 WSAs functions left in decompiled/ ..bah :p
15:40:35 <TrueBrain> I want to remove all emu_ shit from it :p
15:41:36 <TrueBrain> 850 lines long function ... BAH
15:42:58 <TrueBrain> Alberth: sar() maintains signess, yes
15:43:54 <Alberth> you talk of rshd/urshd, I guess
15:45:19 <DorpsGek> SVN: truebrain (r1584) -Add: C-ified ushr, sortof (patch by Alberth)
15:45:39 <Alberth> #73 contains Input_Keyboard_HandleKeys.patch which you may want to commit
15:45:39 <Alberth> Input_GetHistory.patch too, but it is far less clear what to do with that one
15:46:01 <TrueBrain> like I asked yesterday, please move them to the bug-report of the other Input_ related stuff
15:46:45 <TrueBrain> what I think the best approach will be, is to convert to SDL while replacing these functions, using your patches as reference mainly. I am still a bit afraid commiting them, giving the problems it gave last time we tried :)
15:47:26 <Alberth> I will create one, or just add them to Mouse_* in #70 ?
15:47:32 <TrueBrain> just add them there
15:48:14 <TrueBrain> GUI_Widget_Allocate2 <- GUI_Widget_And_Scrollbar_Allocate?
15:48:47 <TrueBrain> owh, are already committed
15:48:50 <TrueBrain> them, this is unreadable no
15:49:08 <TrueBrain> please don't do that ... I rather have 10000 bugs reports, then this unreadable one :D
15:49:25 <TrueBrain> guess all are committed at this point?
15:50:17 <TrueBrain> the reason bug trackers are not meant for patches :)
15:51:20 <TrueBrain> anyone any clue what is up with 2AE1_029F?
15:51:27 <TrueBrain> looks partly converted within decompiled?
15:51:35 <TrueBrain> might be my work, dunno
15:51:56 <TrueBrain> ugh, it is ... ugh ...
15:53:56 <TrueBrain> btw, we now use strtok which is _not_ thread safe
15:54:01 <TrueBrain> just so I at least told you guy s:D
16:00:34 <TrueBrain> should be replaced with strtok_r, but I was lazy
16:02:21 <glx> well dune2 used it too ;)
16:06:37 <DorpsGek> SVN: glx (r1585) -Add: C-ified GUI_FactoryWindow_UpdateDetails()
16:08:02 <TrueBrain> lol .. dune2 ... threading .. right :p
16:08:20 <TrueBrain> remembered why I never converted 2AE1, as my initial idea was to remove it all together
16:23:41 <glx> oh spotted a conversion error in GFX_22A6_034F()
16:25:45 <DorpsGek> SVN: truebrain (r1586) -Fix: remove a shitload of unused emu_ functions
17:08:00 <Alberth> no worries, just changed the description :)
17:08:20 <DorpsGek> SVN: glx (r1587) -Add: C-ified GFX_22A6_06D7()
17:26:52 <glx> ok so GUI_Unknown_24D0_000D() is a wrapper around GFX_22A6_06D7() and GFX_22A6_06D7() is similar to GFX_22A6_034F
17:51:30 <TrueBrain> fucking buffers that leak :D
17:53:41 <TrueBrain> when I enter a keystroke on my main machine, it leaks through the remote desktop
17:53:50 <TrueBrain> nothing to do with OpenDUNE :D
17:57:22 <DorpsGek> SVN: truebrain (r1588) -Fix: don't define function headers manual, but import the include file
18:00:54 <TrueBrain> right, just to avoid double work ... who is doing what atm? :)
18:02:36 * Alberth is about to take a shower, and is not working on anything atm
18:02:56 <Alberth> (related to opendune, that is)
18:03:24 <TrueBrain> k; going to do 259E and 2BA5 then :)
18:04:00 <glx> 2BA5 does something with the palette ;)
18:04:17 <TrueBrain> 259E is a wrapper around it :p
18:04:29 <TrueBrain> I am guessing: SetPalete
18:04:33 <TrueBrain> but will convert first :p
18:11:27 <TrueBrain> and it hits ... wtf?
18:12:28 <TrueBrain> divw has side-effects
18:12:30 <TrueBrain> keep forgetting that :D
18:16:46 <TrueBrain> glx: I am lazy: do you remember what the 0x3C8 / 0x3DA out/in was again?
18:18:46 <TrueBrain> its weird, the function gets 3 parameters ... but 2 of them are never read :p
18:18:50 <TrueBrain> I thought it was from-to
18:20:20 <TrueBrain> but yes indeed, it writes the palette to the DAC (video basically)
18:21:08 <TrueBrain> ah, 3C8 is index set, k :)
18:25:18 <TrueBrain> the algorithm they use tries to reduce the amount IO .. I don't care, so I used an ugly solution :D
18:40:04 <TrueBrain> lol, clearly, I did something wrong :D
18:46:45 <DorpsGek> SVN: truebrain (r1589) -Add: C-ified GFX_SetPalette(). It send the whole palette every time; optimizations are possible. Byebye 259E and 2BA5.
18:51:02 <DorpsGek> SVN: truebrain (r1590) -Fix: remove some more unused emu_ functions/files
18:51:38 <DorpsGek> SVN: truebrain (r1591) -Fix: unused extern define
18:52:20 <TrueBrain> right, except for opendune.c, all extern defines are gone from the src/* :D Up to the subtrees
18:58:36 <glx> <TrueBrain> divw has side-effects <-- emu_dx is % ;)
18:59:26 <TrueBrain> things that I should have written better :D
19:32:45 <DorpsGek> SVN: glx (r1592) -Add: C-ified GUI_FactoryWindow_UpdateSelection()
19:39:09 <TrueBrain> GFX_22A6_06D7 <- GFX_Copy
19:39:28 <TrueBrain> GUI_Unknown_24D0_000D <- GUI_Image_Copy?
19:40:13 <glx> GFX_22A6_037F is also a copy
19:40:32 <TrueBrain> as I think I have an GUI_Image_FadeIn
19:40:39 <TrueBrain> now just to find where it is used
19:43:13 <TrueBrain> LOL! when you start the game now, you immediatly complete the first mission
19:43:17 <TrueBrain> think something is broken :D
19:44:32 <TrueBrain> the check-end-game triggered too early
19:44:48 <glx> yup you start with 1000 and should lose 1 credits rapidely
19:45:01 <TrueBrain> I just read: Saboteur is approaching
19:45:06 <TrueBrain> should be Artreides
19:47:24 <TrueBrain> hmm .. this function also just copies, but randomized ... lol ... that is just odd
19:50:22 <TrueBrain> glx: did you at any point remove a while block around inb(0x3DA)?
19:52:08 <TrueBrain> hmm, yes, it appears to be working, it just happens WAY too fast
20:03:58 <TrueBrain> okay ... now only it does it the wrong way :D
20:06:19 <TrueBrain> that is just weird, everything appears correct :(
20:11:41 <TrueBrain> ah, yes, somehow a (2) became a (0)
20:20:45 <TrueBrain> glx: we removed all 3DA entries now, which is a good things; but we now just miss animation at certain places because it goes too fast :D
20:25:36 <TrueBrain> glx: and 22A6_034F is maked copy
20:26:27 <TrueBrain> if that one param is false only, it is identical to copy, as far as I can see
20:28:52 <DorpsGek> SVN: truebrain (r1593) -Add: C-ified GUI_Screen_FadeIn(). Salut 2C17.
20:29:29 <TrueBrain> ah, lol, one works with real screen coordinates
20:29:32 <TrueBrain> the other with the / 8 ones
20:30:40 <DorpsGek> SVN: truebrain (r1594) -Fix: replace magic numbers by enums
20:46:29 <DorpsGek> SVN: truebrain (r1595) -Fix: renamed a few functions (GUI_Screen_Copy / GUI_Screen_Copy2) and renamed a variable (screenActiveID)
20:46:35 <TrueBrain> named the magic 6C91
20:46:45 <TrueBrain> basically, Dune2 uses doublebuffer in a software kind of way :)
20:47:01 <TrueBrain> others are used too, but those are the two mains :)
20:47:54 <Alberth> you should visit more often :)
20:48:35 <TrueBrain> pure luck I finally got grip on what this does :)
20:48:55 <glx> 3 is often used for sprites
20:51:55 <Alberth> not entirely luck, when converting a single function, you don't look much at the bigger picture
20:52:08 <TrueBrain> the FadeIn forced me to do that :)
20:52:13 <TrueBrain> because it didn't do what it should do
20:52:34 <TrueBrain> and I found 1 function above the calling of FadeIn, that when changing from 0 to 2 made it work
20:52:41 <TrueBrain> quick svn blame later showed it was wrongly converted
20:52:46 <glx> 992F and friends could be named for a long time now :)
20:52:59 <TrueBrain> still clueless how to name them :p
20:53:24 <glx> somethingTop, somethingLeft, somethingWidth, ...
20:53:38 <TrueBrain> something, exactly :D
20:55:31 <TrueBrain> Memory_GetBlock and co are most likely the same btw, not Memory, but Screen
20:55:40 <glx> 7FC2 is isStarport, 7FCB is selectedItem (or so)
20:58:00 <DorpsGek> SVN: truebrain (r1596) -Fix: more renaming regarding the discovery of ScreenID
20:58:10 <TrueBrain> removed many Memory references, and renamed some functions
21:00:01 <TrueBrain> slowly things start to make sense :D
21:02:09 <TrueBrain> right, 2 more RandomRanges left
21:02:14 <TrueBrain> (which was what I was doing really :p)
21:07:37 <TrueBrain> Memory_GetBlock is a bit weird
21:08:47 <glx> and Memory_GetBlock2 is not ?
21:08:56 <TrueBrain> Memory_GetBlockN is a bit weird
21:10:19 <TrueBrain> but I dont get the [2]
21:11:10 <TrueBrain> I see there is a malloc for all those pages
21:11:37 <TrueBrain> and there is a flow there the [0] [1] becomes a csip pair
21:11:40 <TrueBrain> but in most cases it is not
21:12:34 <TrueBrain> funny enough, all screens are allocated, but then assigned to videomemory if possible
21:14:07 <TrueBrain> hmm ... I wonder if that isn't a glitch .. hmm ..
21:14:28 <TrueBrain> it is unresolved code that is manually resolved I guess
21:19:23 <TrueBrain> ah, yeah, it is wrong :)
21:19:46 <TrueBrain> 6C93[i][0] = emu_dx
21:19:49 <TrueBrain> 6C93[i][1] = emu_ax
21:20:10 <TrueBrain> but if I am not looking wrong, between those 2 lines it says: emu_ax = emu_dx
21:20:23 <TrueBrain> would make much more sense if emu_dx is stored in both :)
21:22:52 <TrueBrain> right ... we can either keep this generic, or just go with the only case OpenDUNE uses :p
21:24:39 <glx> 25c4:0236 28b06: 89 97 95 6c mov WORD PTR [bx+0x6c95],dx
21:24:39 <glx> 25c4:023a 28b0a: 8b de mov bx,si
21:24:39 <glx> 25c4:023c 28b0c: d1 e3 shl bx,1
21:24:39 <glx> 25c4:023e 28b0e: 8b 87 95 6c mov ax,WORD PTR [bx+0x6c95]
21:24:39 <glx> 25c4:0242 28b12: 8b de mov bx,si
21:24:41 <glx> 25c4:0244 28b14: d1 e3 shl bx,1
21:24:41 <glx> 25c4:0246 28b16: 89 87 93 6c mov WORD PTR [bx+0x6c93],ax
21:25:08 <TrueBrain> I wonder why that [0] and [1] is there
21:25:12 <TrueBrain> they are identical in every possible way
21:26:23 <glx> but one is for memblock, the other is for memblock2
21:26:39 <TrueBrain> and they are identical :p
21:28:32 <DorpsGek> SVN: truebrain (r1597) -Fix: typo in conversion (of unused code)
21:32:37 <TrueBrain> the gfx part also has 2 elements for that
21:33:07 <TrueBrain> SmatZ: do you have any insights in this? There are multiple screenbuffers (5 in this case). There is an array pointing to them of 10 elements in the way: [5][2]
21:33:36 <DorpsGek> SVN: truebrain (r1598) -Fix: some more renaming
21:36:19 <TrueBrain> I kinda understand the two wrappers. It is much faster if you know compile-time if you are access an even or odd entry
21:36:24 <TrueBrain> but why doing it at all ...... lol :p
21:36:34 <TrueBrain> should be all you need
21:37:13 <TrueBrain> well, lets postpone it till more conversion is done, as else I will be changing a lot of stuff :D:D
21:40:53 <TrueBrain> time to find some sleep
22:44:33 <DorpsGek> SVN: glx (r1599) -Add: C-ified GUI_FactoryWindow_PrepareScrollList()
22:45:03 <glx> converting this function helped me to find how to name 2 other functions :)
22:45:30 <glx> the game just run too fast to see the effect of the 2 other functions ;)
23:46:16 <glx> ha f__01F7_325B_0026_C673() is qsort
continue to next day ⏵