#include <nagra2.h>
List of all members.
Detailed Description
Definition at line 189 of file nagra2.h.
Constructor & Destructor Documentation
| cN2Timer::cN2Timer |
( |
void |
| ) |
|
Definition at line 36 of file nagra2.c.
{
cycles=intrCycles=delayInterrupt=0; ctrl=0; val=0; divisor=0; invDivisor=0; latch=0xFF;
timerBugged=false;
}
| cN2Timer::cN2Timer |
( |
void |
| ) |
|
Member Function Documentation
| bool cN2Timer::AddCycles |
( |
unsigned int |
count | ) |
|
Definition at line 42 of file nagra2.c.
References count.
{
if(Running()) {
cycles+=count;
if(!delayInterrupt && InterruptSet() && cycles>=intrCycles) {
delayInterrupt=intrCycles-cycles+3;
if(delayInterrupt<0) delayInterrupt=count; else delayInterrupt+=count;
intrCycles=0;
if((ctrl&tmCONTINUOUS)) Update();
}
}
if(delayInterrupt) {
delayInterrupt-=count;
if(delayInterrupt<0) delayInterrupt=0;
if(!delayInterrupt) {
Update();
return true;
}
}
return false;
}
| bool cN2Timer::AddCycles |
( |
unsigned int |
count | ) |
|
| void cN2Timer::Ctrl |
( |
unsigned char |
c | ) |
|
Definition at line 131 of file nagra2.c.
References L_SYS_EMU, Latch(), and PRINTF.
{
if(Running()) {
ctrl=(ctrl&~tmRUNNING) | (val&tmRUNNING);
if(!Running()) {
Stop();
--cycles;
Update();
PRINTF(L_SYS_EMU,"n2timer %d: stopped cycles=%d (%02x) ctrl=%02x latch=%02x\n",nr,cycles,val,ctrl,latch&0xff);
}
}
else {
ctrl=(ctrl&~tmMASK) | (val&tmMASK);
divisor=GetDivisor();
if(divisor) invDivisor=1.0/divisor;
if(Running()) {
if(!(ctrl&tmLATCHED) && divisor>0) {
if(this->val==0) {
timerBugged=true;
cycles=(unsigned int)divisor;
}
else {
cycles=(unsigned int)(((timerBugged?0x100:latch)-this->val+1) * divisor);
}
}
if((ctrl&tmINTERRUPT)) {
intrCycles=cycles+(unsigned int)((timerBugged?0x101:this->val?this->val:latch)*divisor);
if(nr==2) PRINTF(L_SYS_EMU,"n2timer %d: set for %u cycles (%02x %02x)",nr,intrCycles-cycles,Latch(),ctrl&0xff);
}
ctrl&=~tmLATCHED;
}
}
}
| unsigned char cN2Timer::Ctrl |
( |
void |
| ) |
|
| unsigned char cN2Timer::Ctrl |
( |
void |
| ) |
|
| void cN2Timer::Ctrl |
( |
unsigned char |
c | ) |
|
| unsigned int cN2Timer::Cycles |
( |
void |
| ) |
|
| unsigned int cN2Timer::Cycles |
( |
void |
| ) |
|
| unsigned char cN2Timer::Latch |
( |
void |
| ) |
[inline] |
| void cN2Timer::Latch |
( |
unsigned char |
val | ) |
|
Definition at line 121 of file nagra2.c.
{
if(!Running()) {
latch=val; if(latch==0) latch=0x100;
cycles=0;
ctrl|=tmLATCHED;
timerBugged=false;
}
}
| void cN2Timer::Latch |
( |
unsigned char |
val | ) |
|
| unsigned char cN2Timer::Latch |
( |
void |
| ) |
[inline] |
| int cN2Timer::Number |
( |
void |
| ) |
[inline] |
| int cN2Timer::Number |
( |
void |
| ) |
[inline] |
| void cN2Timer::SetNumber |
( |
int |
Nr | ) |
[inline] |
| void cN2Timer::SetNumber |
( |
int |
Nr | ) |
[inline] |
The documentation for this class was generated from the following files:
- contrib/sasc-ng/sc/PLUGINS/src/sc-src/systems/nagra/nagra2.h
- systems/nagra/nagra2.h
- contrib/sasc-ng/sc/PLUGINS/src/sc-src/systems/nagra/nagra2.c
- systems/nagra/nagra2.c