IRC logs for #opendune on OFTC at 2011-04-03
⏴ go to previous day
02:15:22 *** glevans2 has joined #openDune
07:47:26 *** Alberth has joined #openDune
08:19:09 <Alberth> so I was quite wrong about the meaning of div, it seems
12:28:00 <Alberth> busy with f__B483_04CB_0015_EBB4() , do you have a base address for that file? It does "emu_ax = emu_get_memory16(emu_cs, emu_bx, 0x0);" @ l__04FF and @ l__063A, which are static arrays, I think
12:29:17 <TrueBrain> euh .. overlays cannot store static data
12:29:22 <TrueBrain> it is flushed out very fast
12:29:25 <TrueBrain> (on next overlay swap)
12:29:30 <TrueBrain> so that is _very_ unusual
12:29:59 <TrueBrain> sorry ... I should shut up :D
12:30:13 <Alberth> I will add 'const' the next time :)
12:33:34 <glx> btw there was a little mistake in your last conversion ;)
12:33:58 <glx> but things like that happens to all of us
12:33:58 <Alberth> I noticed, my interpretation of div was very wrong :)
12:34:06 <Alberth> thanks for checking & fixing
12:38:14 <glx> after some reading in 22A6, I think I know the meaning of 22A6:0068 - 22A6:006E range
12:38:40 <glx> it's some kind of draw area limits
12:40:15 <glx> set in f__22A6_10DD_0023_B468(), checked when drawing lines
12:45:00 <Alberth> do we know what the first character of the string in SoundData is (for voices, at least)
12:45:08 <Alberth> possibly language or so
12:48:22 <glx> FAFFIRM.VOC, GAFFIRM.VOC, ZAFFIRM.VOC
12:48:32 <glx> yes english uses Z for some reason
12:56:04 <glx> sprintf((char *)g_global->variable_9939, filename + 1, g_global->playerHouseID < HOUSE_MAX ? g_houseInfo[g_global->playerHouseID].prefixChar : ' '); <-- for "?XXX"
12:58:25 <glx> ?%cWIN.VOC -> AWIN.VOC, HWIN.VOC and OWIN.VOC
13:00:13 * Alberth gives TrueBrain a cookie
13:01:23 <TrueBrain> Alberth: important to know is that languages were hacked on later
13:01:33 <TrueBrain> you will see that all over the place
13:02:00 <TrueBrain> as sometimes they clearly had a hard job doing it :p
13:04:44 <glx> yeah like AUNIT.VOC, HUNIT.VOC, OUNIT.VOC, GUNIT.VOC, FUNIT.VOC
13:04:46 <Alberth> what? you mean there are people outside America speaking a different language???
13:06:03 <Alberth> oh, those are the 0x4[567] values of course
13:07:26 <glx> but a lot of language stuff is probably missing
13:07:45 <Alberth> they left that for us to improve :p
13:08:09 <glx> no we rarely started the game in different language, so a lot of unresolved stuff
13:08:23 <TrueBrain> we did a bit of french :p
13:08:36 <TrueBrain> also important to know: french or german (can never remember which) uses a different font
13:08:42 <glx> and voices rarely start for me ;)
13:08:45 <TrueBrain> so you often see check for the language, and some slightly different code
13:08:50 <TrueBrain> this is because of the font :)
13:09:05 <glx> not only the font, words order too
13:11:11 <TrueBrain> and shit like: 'a' to attack .. french has more words starting with an 'a'
13:11:15 <TrueBrain> so you have shortcut and shortcut2
13:11:27 <TrueBrain> one is language specific, other is always english, it seems :p
13:18:47 <glx> but indeed B483:04CB seems to do the language selection for .VOC
13:25:59 <glx> ok let's try to C-ifie DrawLine
13:35:20 <Alberth> do we have default: NOT_REACHED(); like macros?
13:35:39 <TrueBrain> nope; as that never happens in Dune :)
13:35:45 <TrueBrain> it always has a default jump somewhere
13:36:35 <Alberth> yep into the JIT 'not yet explored' entry point :p
13:37:57 <Alberth> it is a jump table where a 'default' case was added for catching JIT decompiling, I think
13:38:11 <Alberth> but the code shows there are no more cases
13:38:33 <Alberth> so I can remove 'default', or add a 'NOT_REACHED()' macro there
13:40:19 <TrueBrain> mostly it has a jump before the switch
13:40:22 <TrueBrain> restricting the size
13:40:36 <TrueBrain> like .. if (emu_bx < 6) goto l__X
13:40:50 <TrueBrain> l__Y is 'default' here
13:41:42 <TrueBrain> and if that is not compiled yet, ask glx :D
13:42:04 <glx> well he has the script and the base address ;)
13:52:47 <glx> oh nice functions in the middle of functions
18:20:15 <Alberth> must do some other stuff now, will be back in 20-30 minutes or so
18:58:32 <Alberth> patch updated, s/variable_1150/currentVoiceSet/ s/voice_set/voiceSet/
19:00:35 <glx> + Voice_LoadVoices(-2); >-- I'd keep 0xFFFE
19:02:04 <glx> and you can remove the indirection in the switches
19:43:57 <glx> we have an enum for languages
19:46:29 <glx> I think you can do if (prefix[i] == *str)
19:48:28 <glx> oh indeed it could be just switch(*str)
19:55:24 <Alberth> last line needs some more explanation, I am afraid. Do you mean the 6th case (ie not one of the special characters), or the loop?
19:58:17 <glx> you can remove the for (i = 0; i < 5) loop, then directly switch(*str) { case '%': ... case '+':... default: continue; }
19:59:23 <Alberth> what about the 6th case then? (above label l__064A: )
20:00:15 <Alberth> I suspected as much :)
20:00:55 <glx> in the second loop, you can do the same, just default case will do more
20:01:47 <Alberth> oh, of course, you only loop over the set of characters, not over the characters of the string as well.
20:02:24 <glx> yes it just checks the first one to determine what to do
20:03:48 <glx> sprintf((char *)g_global->variable_9939, (char *)emu_get_memorycsip(g_global->voices[voice].string), i); <-- can be sprintf((char *)g_global->variable_9939, str, i); :)
20:06:15 <Alberth> and I was so glad to have all that code converted from assembly :p
20:07:14 <glx> conversion needs many steps :)
20:09:34 <Alberth> either we have too many LANGUAGE_* constants, or they are missing a few cases in the code :)
20:17:56 <glx> we determined the enum based on string_2AF8 and following
20:23:23 <Alberth> hmm, you are missing the address -> character conversion not too bad, as it was not too readable anyway due to moving cases around
20:28:23 *** glevans2 has joined #openDune
20:30:09 <glx> +extern void emu_Unknown_B483_0823(); <-- better #include "unknown/unknown.h"
20:44:23 <Alberth> good night for now. if all is well, I'll find the patch committed in a few days. Otherwise, I will ask again when I get online again :)
22:41:31 *** glevans2 has joined #openDune
23:45:13 *** glevans2 has joined #openDune
23:57:16 *** glevans2 has joined #openDune
continue to next day ⏵