HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

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


Reply
 
Thread Tools
Old Apr 22, 2005, 06:38 PM   #1
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 online now   Reply With Quote


Old Apr 22, 2005, 08:14 PM   #2
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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, 08:32 PM Threadstarter Thread Starter   #3
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 online now   Reply With Quote
Old Apr 22, 2005, 09:01 PM   #4
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

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 09:12 PM.
Max M. is offline   Reply With Quote
Old Apr 22, 2005, 09:32 PM Threadstarter Thread Starter   #5
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

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 online now   Reply With Quote
Old Apr 22, 2005, 11:14 PM Threadstarter Thread Starter   #6
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,561
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Got it working, thanks again.

-Russ
Russ is online now   Reply With Quote
Reply

Thread Tools