#exult@irc.freenode.net logs for 3 Jul 2003 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage

[01:40:04] <-- Fingolfin has left IRC ("42")
[01:42:20] --> Kirben has joined #exult
[01:42:20] --- ChanServ gives channel operator status to Kirben
[03:15:22] --> Matt_O has joined #exult
[04:33:44] --> animeloe has joined #exult
[04:33:50] --- animeloe is now known as Eclair
[06:59:28] --> Kirben2 has joined #exult
[06:59:28] <-- Kirben has left IRC (Read error: 104 (Connection reset by peer))
[07:59:33] --- Kirben2 is now known as Kirben
[09:48:39] --> Fingolfin has joined #exult
[09:48:39] --- ChanServ gives channel operator status to Fingolfin
[10:40:03] --> Colourless has joined #Exult
[10:40:03] --- ChanServ gives channel operator status to Colourless
[11:11:35] <-- Fingolfin has left IRC ("42")
[11:12:43] <-- DarkeZzz has left IRC (calvino.freenode.net irc.freenode.net)
[11:12:50] --> DarkeZzz has joined #exult
[11:23:08] <-- Colourless has left IRC (Read error: 60 (Operation timed out))
[13:44:58] --> Colourless has joined #Exult
[13:44:58] --- ChanServ gives channel operator status to Colourless
[13:45:30] <Colourless> hi
[15:09:14] --> Fingolfin has joined #exult
[15:09:14] --- ChanServ gives channel operator status to Fingolfin
[15:31:48] --> wjp has joined #exult
[15:31:48] --- ChanServ gives channel operator status to wjp
[15:38:43] <-- Kirben has left IRC (Read error: 104 (Connection reset by peer))
[18:25:01] <-- Fingolfin has left IRC ("42")
[19:36:41] --> artaxerxes has joined #exult
[19:36:41] --- ChanServ gives channel operator status to artaxerxes
[19:36:49] <artaxerxes> hi all
[19:37:00] <Colourless> hi
[19:37:05] <artaxerxes> I have a good news to announce. I've finished writing smooth. I just have to write the plugins now
[19:37:20] <wjp> hi
[19:37:21] <wjp> cool :-)
[19:37:22] <artaxerxes> and so far, everything works great!
[19:39:05] <artaxerxes> so far, the only plugin I wrote always return the same colour (00ff00) so it's not that useful, but soon enough it will return a random colour based on what colours you fed it with in the config file
[19:39:46] <Colourless> well, I put midi support into pentagram
[19:39:47] <artaxerxes> it's pretty small too and uses plugins (dlopen et al)
[19:39:51] <artaxerxes> nice!
[19:40:05] <artaxerxes> looks like pentagram is really advancing fast
[19:40:20] <Colourless> and it now includes 3 midi drivers, Windows, MacOSX and Emulated Opl2 (fmopl)
[19:40:22] <wjp> spending 4-8 hours a day on it helps :-)
[19:40:30] <artaxerxes> ;-0
[19:41:23] <artaxerxes> midi is just for music and not FX, right?
[19:41:30] <wjp> yes
[19:41:36] <artaxerxes> steps would be FX, right?
[19:41:48] <Colourless> pentagram's development seems to take 'huge' steps. Not much will happen, then someone will commit an entire new subsystem
[19:42:08] * wjp whistles innocently
[19:42:13] <Colourless> and again, not much happens till the next major commit
[19:42:14] <artaxerxes> what's left to be done? *look innocent*
[19:42:18] * wjp tries to draw attention away fromt the 50+ files he locally modified
[19:42:26] * Colourless coughs so much, you'll think he's sick
[19:42:33] <Colourless> hang on, i really am sick :)
[19:42:37] <artaxerxes> ;-)
[19:42:59] <wjp> you are? nothing serious, I hope?
[19:43:12] <Colourless> just some generic 'cold'
[19:43:44] * artaxerxes remembers it is winter in OZ now
[19:45:13] <artaxerxes> for smooth, I had to make horrible hacks, like modifying the palette on the fly for the receiving image, etc
[19:45:16] <Colourless> second one this year... damn that corona virus
[19:45:38] <artaxerxes> I cought the heineken virus last time
[19:46:07] * artaxerxes apologized to the whole chan for being corny
[19:46:15] <artaxerxes> s/zed/sed
[19:46:50] <wjp> s/sed/ses/ :-)
[19:47:05] <artaxerxes> true! :-)
[19:47:23] <Colourless> "=_
[19:47:28] <Colourless> that should be :-)
[19:48:10] <wjp> you broke more than your nose this time :-)
[19:48:39] <Colourless> i should state that blaming the 'corona' virus isn't entirely accurate. my cold could be due to a whole number of different viruses... the "heineken" is NOT one of them ;-)
[19:48:48] <Colourless> yeah, broke my entire face :-)
[19:52:18] <artaxerxes> anyone remembers what is the C function to return the time in millisec?
[19:52:28] <artaxerxes> (so I can use it with srand())
[19:52:41] <Colourless> there is no standard func to do that
[19:54:53] <wjp> oh wow, it took me only two tries to typedef a function pointer
[19:55:06] <wjp> and I didn't even have to resort to looking it up :-)
[19:55:21] <Colourless> :-)
[19:55:52] <Colourless> typedef (return type * name)(args); correct?
[19:56:14] <wjp> hm, I put the parentheses slightly different
[19:56:27] <Colourless> yes mine is wrong
[19:56:29] <Colourless> should be
[19:56:37] <Colourless> typedef return_type (*name)(args)
[19:56:51] <Colourless> i think...
[19:56:57] <wjp> yes
[19:57:45] <Colourless> or if you want to play it safe, typedef return_type (calling_convention * name)(args)
[19:58:40] <Colourless> specifing the calling convention though is only really needed when you are doing things between libraries
[19:58:52] <Colourless> s/between/with/
[20:00:18] <wjp> add to that: template<class T> Process* createAndLoadProcess(IDataSource* ids)
[20:00:38] <wjp> and a long list of addLoader("Process", createAndLoadProcess<Process>) lines :-)
[20:01:54] <Colourless> hmm. you trying to get a pointer to a templated function?
[20:02:01] <wjp> doesn't that work?
[20:02:24] <Colourless> msvc (6 at least, haven't tried with 7) can't do it
[20:02:50] <Colourless> the 'hack' to get around it is to put the functions as statics in a templated class
[20:03:18] <Colourless> you will notice that is what i did with the scalers in pentagram old
[20:05:12] <wjp> it doesn't work for me either
[20:05:16] <wjp> the class trick does
[20:06:31] <wjp> kernel->addLoader("CameraProcess", ProcessLoader<CameraProcess>::load);
[20:06:33] <Colourless> good thing you pasted that code here... otherwise you'd be scratching your head for hours trying to figure out what was wrong :-)
[20:06:51] <wjp> oh, I probably would've guessed pretty soon it was taking a pointer to a templated function :-)
[20:07:00] <wjp> (and _then_ I would've mentioned it here anyway ;-) )
[20:08:39] <wjp> ok... it compiles :-)
[20:34:32] <artaxerxes> do you guys have some experience with loading dynamic lib on command?
[20:35:13] <artaxerxes> I'm trying to have a variable in my main code accessible by a dyn lib
[20:35:24] <wjp> just what I experimented with when you talked about dynamic libs last :-)
[20:36:43] <Colourless> you need to pass a pointer to that variable to the lib via a function
[20:37:30] <artaxerxes> darn
[20:37:37] <artaxerxes> any other way?
[20:38:04] <Colourless> you could put your entire program state in a structure, and give the lib access to that structure (again by a pointer(
[20:38:14] <artaxerxes> I see
[20:38:31] <Colourless> s/entire/relevant/
[20:38:38] <wjp> IIRC there are other ways, but they get a bit messy :-)
[20:38:58] <Colourless> there are hacks that you can use (which i've done in an instance)
[20:39:30] <Colourless> these include such things as hard coding in the pointer to the address of the thing you want in your library :-)
[20:39:42] <artaxerxes> ohhhh
[20:39:55] <artaxerxes> and it worked? ;-)
[20:40:16] <wjp> or get the symbol from your main program with dlsym() in the child
[20:40:32] <artaxerxes> but them my main prog would have to be a loadable lib!
[20:40:34] <Colourless> yes very much so, cause i was 'hacking' at the host program
[20:40:47] <wjp> artaxerxes: not really; check the dlsym manpage
[20:41:11] <wjp> (the "pseudo-handles" part)
[20:41:38] <Colourless> such things can be done in windows. GetProcessAddress can get the address of any exports. And exe's can export symbols too
[20:42:02] <wjp> but I think passing the pointer is much cleaner and more transparent
[20:42:18] <wjp> (not too mention less dependant on the whims of the loader :-) )
[20:42:20] <artaxerxes> dlsym takes a "handle" of a dynamic library returned by dlopen and the
[20:42:20] <artaxerxes> null terminated symbol name, returning the address where that symbol is
[20:42:36] <artaxerxes> loaded. If the symbol is not found, dlsym returns NULL;
[20:42:36] <wjp> look for pseudo-handles further down
[20:42:44] <artaxerxes> ahh
[20:42:53] <Colourless> anyway, back to my hardcoding pointer hack. What i was actually doing was replacing code in the exe that was written in sse and replacing it with normal x86 FPU and 3dNow! code
[20:43:05] <wjp> :-)
[20:43:23] <artaxerxes> quite a hack I must say!
[20:43:51] <Colourless> run time patching of code in a running program :-)
[20:44:14] <Colourless> (using a dll)
[20:45:25] <wjp> cute :-)
[20:46:16] <Colourless> arguable the VirtualProtect function *shouldn't* let you change the r/w attrib of the segments of modules, other than the caller
[20:46:36] <Colourless> of course memory protection doesn't quite work like that
[20:46:51] <Colourless> you only have 2 levels, Kernel and User.
[20:47:05] <Colourless> everything in user can be modified by anything in user
[20:56:08] <artaxerxes> gotta go
[20:56:34] <artaxerxes> I'll post the source when I'm done with doing at least the first plugin
[20:56:36] <artaxerxes> bye
[20:56:38] <-- artaxerxes has left #exult ()
[21:13:51] <-- Colourless has left IRC ("casts invisibility")
[22:08:18] --> Fingolfin has joined #exult
[22:08:18] --- ChanServ gives channel operator status to Fingolfin
[22:34:00] <-- wjp has left IRC ("Zzzz...")
[22:59:34] <-- Matt_O has left IRC (Remote closed the connection)
[23:53:27] <-- Fingolfin has left IRC ("42")