?? m.c
字號(hào):
#include "m.h"
#include "mtv.h"
#include "dtv.h"
cregister unsigned int IER,IFR,CSR,ICR,ISTP;
#define RBR 0xa0300000
#define THR 0xa0300000
#define IIER 0xa0300004
#define IIR 0xa0300008
#define FCR 0xa0300008
#define LCR 0xa030000c
#define MCR 0xa0300010
#define LSR 0xa0300014
#define MSR 0xa0300018
#define SCR 0xa030001c
#define DLL 0xa0300000
#define DLM 0xa0300004
#define DMATARGETADDRESS 0x80040000
#define SCREENWIDTH 720
#define SCREENHEIGHT 576
#define BUFFERHEIGHT 620
#define SCREENWIDTHWORD 180
#define BUFFERWIDTH 768
#define BUFFERWIDTHWORD 192
#define GRAYRANGEX 30
#define GRAYRANGEY 144
extern unsigned int nPositionX,nPositionY;
extern unsigned char *pScreenBuffer;
extern unsigned int *pW,uW;
extern int nI,nJ;
void IMGProcess();
int main()
{
CSR=0x100; /* Disable all interrupts */
IER=1; /* Disable all interrupts except NMI */
ICR=0xffff; /* Clear all pending interrupts */
initSYS();
*(unsigned volatile int *)EMIF_GCR = 0x3300; /* EMIF global control */
*(unsigned volatile int *)EMIF_SDCTRL = 0x5648f000;
*(unsigned volatile int *)EMIF_SDRP = 0x61a; /* EMIF SDRM refresh period */
*(unsigned volatile int *)EMIF_SDEXT= 0x54529; /* EMIF SDRM extension */
*(unsigned volatile int *)EMIF_CE0 = 0x30; /* EMIF CE0 control */
*(unsigned volatile int *)EMIF_CE1 = CE1_32; /* EMIF CE1 control, 32bit */
*(unsigned volatile int *)EMIF_CE2 = CE2_32_max;
*(unsigned volatile int *)EMIF_CE3 = CE3_32; /* EMIF CE3 control */
Init_DTVFPGA(0);
*(unsigned volatile int *)MTV_WDMA_ADD = 0x0000ffff;
*(unsigned volatile int *)MTV_WDMA_PARAM = 0x0000ff00;
*(unsigned volatile int *)MTV_RDMA_ADD = 0x0000ffff;
*(unsigned volatile int *)MTV_RDMA_PARAM = 0x00001808;
*(unsigned volatile int *)DTV_WDMA_ADD = 0x0005ffff;
*(unsigned volatile int *)DTV_WDMA_PARAM = 0x00001808;
*(unsigned volatile int *)DTV_RDMA_ADD = 0x0000fff0;
*(unsigned volatile int *)DTV_RDMA_PARAM = 0x00001808;
nPositionX=16; nPositionY=200;
pScreenBuffer=(unsigned char*)DMATARGETADDRESS;
initInterrupt(); //中斷初始化,開(kāi)INT7中斷
for(;;)
{
}
}
void IMGProcess()
{
for ( nI=0;nI<GRAYRANGEY;nI++ )
{
pW=(unsigned int*)DMATARGETADDRESS+(nI+nPositionY)*BUFFERWIDTHWORD+nPositionX;
for ( nJ=0;nJ<GRAYRANGEX;nJ++,pW++)
{
uW=(*pW);
if ( (uW>>24)>0x80 ) { uW&=0x0ffffff; uW|=0x0fe000000; }
else { uW&=0x0ffffff; uW|=0x1000000; }
if ( ((uW>>16)&0x0ff)>0x80 ) { uW&=0x0ff00ffff; uW|=0x0fe0000; }
else { uW&=0x0ff00ffff; uW|=0x10000; }
if ( ((uW>>8)&0x0ff)>0x80 ) { uW&=0x0ffff00ff; uW|=0x0fe00; }
else { uW&=0x0ffff00ff; uW|=0x100; }
if ( (uW&0x0ff)>0x80 ) { uW&=0x0ffffff00; uW|=0x0fe; }
else { uW&=0x0ffffff00; uW|=1; }
(*pW)=uW;
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -