It is currently Tue Dec 12, 2017 4:56 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: triangle problems...
PostPosted: Thu Dec 08, 2005 12:46 am 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
im having as topics says that problem, my trgnl emulation in some games trough me whistles. its ok for christmas, but not for accuracy.
I want to know if the following is right, can somebody help me?:

Code:

if ((triangleLinearCounter != 0) && (triangleLenCounter != 0))
{

ClockStepGenerator(); //this clock step generator and feeds the trngl DAC
}
else      
   FeedDAC(CHANNEL_TRIANGLE, 0);      //else.. feed dac with "0"



Is that "else" well?

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 1:20 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1393
No - when the triangle channel is inactive, its position gets "stuck" wherever it was previously.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 2:06 am 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
Thanks for the help i fixed it, but im still having problems.
Blarrg mentions 2 steps that takes the linear counter if it is clocked:

1)
Code:
if (haltflag == TRUE) cLinear = CReloadValue;
else if (cLinear != 0) cLinear--;


2)
Code:
if  (controlflag == FALSE) haltflag = FALSE;


These two are executed separetly?
thxs again.

_________________
ANes


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 2:32 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Your code above looks correct, based on the following:

Quote:
When clocked by the frame sequencer, the following actions occur in order:

1) If halt flag is set, set counter to reload value, otherwise if counter is non-zero, decrement it.
2) If control flag is clear, clear halt flag.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 09, 2005 2:35 am 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
thnxs!!

_________________
ANes


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group