DriverHeaven.net

 
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
LinkBack Thread Tools
Old Apr 22, 2005, 01:38 PM   #1
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Conditional microcode?

I am trying to include conditional microcode in a C++ plugin. What I mean by conditional, is microcode that is added/created based on conditional (if statements, etc) information. i.e. Like the microcode for epilog. I am having some trouble trying to figure out how to do it. It appears that epilog does it using prepare.h and process.h, but I do not have these files.

BTW: I am not talking about dynamic microcode (i.e. changing code on the fly), but rather defining the original microcode based on conditional information (i.e. you cannot do certain things dynamically, like adding inputs, etc, so I need to figure out what I need using conditional tests, and include it in the original code based on the results of those tests, etc).

Anyone know how I can do this?

-Russ
Russ is offline   Reply With Quote


Old Apr 22, 2005, 03:14 PM   #2
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,418
Rep Power: 47
Max M. will become famous soon enough

Hi Russ.

SDK38 /Fx_lib/epilog.cpp iEpilogPlugin::request_microcode() might give some hints on that. (although its macros make it to look tricky)
Max M. is offline   Reply With Quote
Old Apr 22, 2005, 03:32 PM   #3
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Hi Max M.,
Thanks for the reply.
The epilog.cpp iEpilogPlugin::request_microcode() funtion is what I am looking at. That function seems to use the begin_microcode() and end_microcode() functions to accomplish this, which do not seem to exist (I guess that they are part of process.h or prepare.h or some other include file that I do not have). Am i missing something?
Russ is offline   Reply With Quote
Old Apr 22, 2005, 04:01 PM   #4
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,418
Rep Power: 47
Max M. will become famous soon enough

begin_microcode() and end_microcode() are probably some driver's code macros. that macros probably define some conditions for other macros (temp_gpr, static_gpr, etc. all that you can see in da_epilog.cpp. Yep, it's a macro-hell - macros dependend on macros that depend on macros etc.) .
Well, i don't think you need them at all. the basic idea is that you define several different dsp_data structures (e.g. different dsp_register_info and/or dsp_code stuff)
and (depending on conditions you check inside of request_microcode()) you decide which one to submit to publish_microcode macro (Oh!)...

something like (pseudo-c):
Code:
--- my_plugin.da.cpp ---

dsp_register_info my_plugin_A_info = 
{
   // variant A here
};

 dsp_code my_plugin_A_code = 
{
   // variant A here
};

dsp_register_info my_plugin_B_info = 
{
   // variant B here
};

 dsp_code my_plugin_B_code = 
{
   // variant B here
};


// etc., note you should define all of publish_microcode fileds for both A and B 
// (see fxlib.h for publish_microcode definition)

-------------------------

--- my_plugin.cpp ---

int iMyPlugin::request_microcode() 
{
	if (YOUR_CONDITION_HERE)
	{
		publish_microcode(my_plugin_A);
	}
	else
	{
		publish_microcode(my_plugin_B);
	}

	return 0;
}

// again stare at what publish_microcode does. In fact, you don't even really
// need publish_microcode, you may assign all nesessary variables directly.

-------------------------

Last edited by Max M.; Apr 22, 2005 at 04:12 PM.
Max M. is offline   Reply With Quote
Old Apr 22, 2005, 04:32 PM   #5
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Thanks again for the reply, and thanks for the example pseudocode. I will give that a try and see if I can get it to do what I want.

-Russ
Russ is offline   Reply With Quote
Old Apr 22, 2005, 06:14 PM   #6
DriverHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 4,836
Rep Power: 41
Russ is a jewel in the roughRuss is a jewel in the roughRuss is a jewel in the rough

Got it working, thanks again.

-Russ
Russ is offline   Reply With Quote
Reply

Bookmarks

Thread Tools