IRC logs for #opendune on OFTC at 2010-12-10
⏴ go to previous day
00:29:16 <glx> and maybe it's time to introduce some palette struct ;)
00:30:31 <SmatZ> glx: how comes there are so many + and very few - ?
00:30:56 <SmatZ> if I understand the diff
00:31:47 <SmatZ> glx: how comes there are only lines added in that diff?
00:32:04 <glx> the original function is still present ;)
00:32:11 <SmatZ> are you emulating BIOS function "set palette"?
00:33:06 <SmatZ> but that one calls int10, right?
00:33:20 <glx> no int10 is called before
00:33:39 <SmatZ> enough shame for today :)
00:34:02 <glx> this function just takes the palette, do something with it and fill an array
00:35:23 <SmatZ> what video mode does DUNE2 use? mode 13?
00:36:41 *** Xaroth_ has joined #openDune
00:41:10 <SmatZ> incredible work you have done
00:41:52 <glx> libemu is mostly TrueBrain's work :)
00:44:37 <glx> I just added sound blaster and midi support to it :)
00:45:26 <SmatZ> I haven't had a look at sounds stuff at all :(
00:45:51 <SmatZ> I just know how much pain is it to emulate video card :)
00:47:02 <glx> doesn't look that complicated
00:47:59 <glx> PIC was the hardest part IIRC
00:48:26 <SmatZ> hmm mode 13 seems to be planar
00:48:57 <glx> oh and I "ported" libemu to win32 too ;)
00:49:14 <SmatZ> how many IRQs do you handle?
00:50:07 <SmatZ> on the other hand, converting that low-level things to C can be a problem :)
00:51:06 <SmatZ> + maybe IRQ for the sound card :)
00:51:55 <glx> I implemented irq stuff for sound blaster
00:58:53 <SmatZ> I am a bit lost in that function
00:59:08 <SmatZ> emu_si = emu_get_memory16(emu_ss, emu_bp, 0x6);
00:59:09 <SmatZ> emu_ds = emu_get_memory16(emu_ss, emu_bp, 0x8);
00:59:19 <SmatZ> it is palette and arg0A, right?
00:59:29 <SmatZ> at the beginning of f__22A6_0597_0019_A23D()
01:01:14 <glx> converted functions use pointers when possible ;)
01:01:37 <glx> easier to work with pointers than CSIP
01:01:44 <SmatZ> is a far pointer as well I assume
01:02:05 <glx> it's emu_get_memory16(emu_ss, emu_bp, 0xA) and emu_get_memory16(emu_ss, emu_bp, 0xC)
01:02:42 <SmatZ> hmm bad I am feeling like if I were on drugs
01:02:52 <glx> it's just a return value in this function
01:03:17 <SmatZ> so you moved the check from the end of the function to its beginning :)
01:03:43 <SmatZ> ok makes a lot of sense now
01:03:53 <SmatZ> I didn't realise those pointers are far
01:05:05 <glx> and the original function returned loc12B3, but I removed this part as the return value is ignored anyway
01:05:54 <glx> and all locXXX were static, but used only in this function
01:12:05 <glx> hmm it seems it's a kind of color sorting
01:14:08 <SmatZ> when is that code used?
01:14:17 <SmatZ> I can imagine it's used in cutscenes
01:14:27 <SmatZ> like, when recolouring the Arrakis
01:21:33 <glx> hmm maybe some color mapping
01:27:04 <SmatZ> there is sometimes *magic* in graphics code :)
01:28:35 <SmatZ> loc6C7 is some minimum of sum of squares
01:29:15 <glx> well the result array is passed as an arg to GUI_DrawSprite() but this function is a real mess :)
01:32:43 <SmatZ> is that needed when both vars are <256?
01:34:28 <SmatZ> for all colours in the palette, it serches for RMS-nearest color in the palette
01:34:42 <SmatZ> except the same colour, unless it's reference
01:36:31 <SmatZ> it takes colours from the paletter, does some transform with them
01:36:41 <SmatZ> and assigns new palette colour :)
01:36:56 <SmatZ> so it's a colour transformation with matching the nearest available colour
01:37:23 <glx> it doesn't modify the palette, it just create a mapping
01:37:58 <SmatZ> arg10 is probably some "step"
01:38:34 <SmatZ> palette[3 * index + 0] - (((palette[3 * index + 0] - palette[3 * reference + 0]) * (arg10 / 2)) >> 7);
01:38:40 <SmatZ> makes the colour darker
01:38:58 <SmatZ> so some brightness control?
01:39:16 <SmatZ> without modifying the palette
01:39:32 <SmatZ> but searching nearest colour in the palette instead
01:44:49 <glx> ha right, it seems to be used for clicked buttons
01:45:55 <SmatZ> glx: like, it makes the buttons darker?
01:50:07 <glx> and using 3C3E instead 3C3A is funny :)
01:51:29 <glx> 3C3A and 3C3E are different mappings
01:52:27 <glx> so the function is something like GUI_Palette_CreateMapping
01:54:33 <glx> hmm arg10 can be some kind of intensity
01:56:16 <SmatZ> I thought the same originally
01:56:25 <SmatZ> but then... I am not sure about that anymore :)
01:58:16 <glx> it's called with 0x55 (85), 1/3 of 256
02:00:00 <SmatZ> what's the value of reference?
02:01:41 <SmatZ> does DUNE2 keep the basic 16 colours, or I can't expect 0xF to be white and 0xC to be red?
02:03:01 <SmatZ> though 0 is black as well
02:04:05 <glx> so it's like adding 33% of the reference color
02:04:43 <SmatZ> so it in fact IS making the sprite brighter/darker
02:04:59 <SmatZ> weird it's used only with those constant parameters
02:05:23 <SmatZ> algorithm optimised for black/white and 33% would be surely faster...
02:05:56 <glx> 22A6 is a graphic library
02:06:20 <SmatZ> programmers have always been lazy :P
02:07:02 <SmatZ> DUNE2 was perfectly playable on a 80286, so it's not an issue...
02:10:14 <glx> * Creates a palette mapping: color -> color + reference * intensity.
02:10:29 <glx> should be a good description :)
02:22:50 <DorpsGek> SVN: glx (r1187) -Add: C-ified GUI_Palette_CreateMapping()
10:55:22 *** fjb is now known as Guest584
15:51:03 <DorpsGek> SVN: glx (r1188) -Add: C-ified Font_Select()
15:52:45 <glx> can you refresh worklist ?
15:53:18 <TrueBrain> it should do that automatically :(
15:55:47 <glx> ha 781 is better than 802 :)
22:43:27 *** jamezon has joined #openDune
23:44:31 *** olinuxx has joined #openDune
continue to next day ⏵