IRC logs for #opendune on OFTC at 2011-02-27
⏴ go to previous day
12:41:13 *** fjb is now known as Guest2837
14:49:14 <TrueBrain> not doing anything, so go ahead ;)
14:50:03 <glx> will remove nasty emu_push(emu_ss); emu_push(emu_bp - 0x2C); ;)
15:23:43 <TrueBrain> src/opendune.c:356, comparison is always false due to limited range of data type
15:24:48 <TrueBrain> the only one who can give this error :)
15:24:54 <TrueBrain> the != 0 most likely is not the problem :p
15:25:19 <TrueBrain> as it should be for you :)
15:25:26 <TrueBrain> something like typedef unsigned char uint8
15:25:38 <TrueBrain> char by definition is signed :)
15:25:47 <TrueBrain> but funny, that MSVC doesnt' complain about it :D
15:25:51 <TrueBrain> mostly it is the other way around :p
15:26:03 <glx> gcc didn't complain IIRC, let me check
15:27:46 <glx> ha rigth it complains too
15:28:02 <TrueBrain> btw, normally we write '\0' for these cases
15:28:10 <TrueBrain> but that is minor stuff .. function is fuzzy either way :D
15:28:50 <TrueBrain> I would write it something like: for (s = string; *s != '\0'; s++) if (*s == 0xE1) *s = 1;
15:28:53 <TrueBrain> as that is what it does :p
15:29:51 <glx> this didn't want to come in my mind
15:30:31 <TrueBrain> and something like: s = strpos(string, var_364A); if (s != NULL) ..?
15:30:41 <TrueBrain> owh, yeah, I get what it does
15:30:49 <TrueBrain> it wants to make it 2 strings if some char is there ...
15:31:12 <TrueBrain> s[-1] .. does that do what you expect?
15:31:16 <TrueBrain> thought that was invalid ...
15:32:00 <TrueBrain> SmatZ: is char *s = string + 1; s[-1] = 0xD; valid?
15:32:19 <TrueBrain> never seen it before I have to admit, so I really don't know :)
15:32:41 <TrueBrain> I assumed variable_264A is 0xD too ...
15:33:11 <TrueBrain> I just love Dune2 :D
15:34:02 <TrueBrain> and as suggested name: GUI_DrawText_Multiline
15:35:06 <TrueBrain> not atm, need to work :(
15:35:10 <TrueBrain> really dislike work :p
15:35:56 <TrueBrain> nice functions you uncovered :)
15:36:37 <glx> B4E6 does nice things too
15:36:38 <TrueBrain> (hadn't read opendune.c in a while, seemly :p)
15:38:10 <DorpsGek> SVN: truebrain (r1423) -Fix (r1422): quickfix a GCC warning
15:38:17 <TrueBrain> I hope MSVC doesn't complain about the way I fixed this :p
15:39:32 <TrueBrain> Expected a signed vs unsigned warning now :p
15:44:34 <SmatZ> TrueBrain: it should be valid :)
15:44:52 <TrueBrain> one could read it as last byte, which is silly for sure
15:45:16 <SmatZ> well, unless length of string is 0
15:45:18 <TrueBrain> but I really though C had the restriction of array index being unsigned :p
15:45:35 <SmatZ> it was even used in OpenTTD code
15:45:39 <TrueBrain> you learn something new every day :p
15:45:44 <SmatZ> some KUDr's wrappers used that too
15:45:46 <TrueBrain> never seen it in OpenTTD code :p
15:45:50 <TrueBrain> owh, that explains :p
15:45:57 <TrueBrain> stupid glue-code of his ....
15:46:05 <TrueBrain> (sorry, really disliked most of that unreadable work :p)
15:46:22 <SmatZ> FORCEINLINE CHdr& Hdr()
15:46:25 <SmatZ> return ptr_u.m_pHdr_1[-1];
15:46:35 <glx> we also have sprite[-1] in opendune :)
16:02:29 <glx> . /* 41B2(16) */ PACK uint16 variable_41B2[1][8]; /*!< ?? */
16:03:07 <TrueBrain> hmm, I remember something like that
16:03:30 <glx> same for PACK struct_1A2C variable_1A2C[1]; ;)
16:03:46 <TrueBrain> I believe I added a [1][N] too somewhere
16:03:50 <glx> they are accessed as array so I make arrays
16:04:20 <TrueBrain> yeah, it sometimes happens in Dune2
16:04:37 <TrueBrain> but in this case it feels really silly, yes
16:05:19 <TrueBrain> so if you think it is needed, go for it :)
16:06:32 <glx> . /* 4062(320) */ PACK uint16 variable_4062[20][8]; /*!< ?? Position and size of widgets? */
16:06:32 <glx> . /* 41A2() */ PACK uint8 unknown_41A2[0x0010];
16:06:32 <glx> . /* 41B2(16) */ PACK uint16 variable_41B2[1][8]; /*!< ?? */
16:06:53 <glx> maybe 41A2 and 41B2 are just part of 4062
16:08:25 <glx> g_global->variable_41B2[0][2] = maxWidth >> 3;
16:08:25 <glx> g_global->variable_4062[13][2] = g_global->variable_41B2[0][2] + 2;
16:08:25 <glx> g_global->variable_4062[13][0] = 19 - (maxWidth >> 4);
16:08:25 <glx> g_global->variable_4062[13][1] = 160 - ((g_global->variable_41B2[0][3] * g_global->variable_6C71) >> 1);
16:08:25 <glx> g_global->variable_4062[13][3] = (g_global->variable_41B2[0][3] * g_global->variable_6C71) + 11;
16:12:07 <glx> and the access as array makes more sense then, something like bla[21 + arg06]
17:16:33 <DorpsGek> SVN: glx (r1424) -Add: C-ified GameLoop_B4E6_0108()
18:53:35 <glx> hmm there's a bug in r1424 (mouse cursor disappeared)
18:58:30 <TrueBrain> or leave it and wait for a bugreport :D
18:59:08 <DorpsGek> SVN: glx (r1425) -Fix (r1424): removed too much
18:59:34 <glx> f__2B6C_0169_001E_6939() should be Toggle_Mouse ;)
19:49:31 *** glevans2 has joined #openDune
continue to next day ⏵