?? videograph.asm
字號:
/*****************************************************************************
** **
** Project Name: Video_Output **
** **
******************************************************************************
(C) Copyright 2003 - Analog Devices, Inc. All rights reserved.
File Name: videograph.asm
Date Modified: 4/4/03 CL Rev 1.0
Software: VisualDSP++ 3.1
Hardware: ADSP-BF533 EZ-KIT Board
Special Connections: None
Purpose: This videograph.asm file sets generates an NTSC color bar
pattern and places the data in SDRAM memory.
******************************************************************************/
#include "defBF533.h"
#define NUM_OF_VOUT_FRAMES 2
.section program;
.global _NtscVideoOutFrameBuffInit;
.extern PalLineMap;
.extern NtscLineMap;
.extern SystemCodeMap;
.extern ColorBarTable;
.align 4;
dummy_start:
_NtscVideoOutFrameBuffInit:
[--sp] = rets;
[--sp] = (r7:0, p5:0);
[--sp] = astat;
P0.h = 0x0000;
P0.l = 0x0000;
// load base of system code map in P3
P5.h = SystemCodeMap;
P5.l = SystemCodeMap;
// load base of pal line map in P1
P4.h = NtscLineMap;
P4.l = NtscLineMap;
//number of frames -> NUM_FRAMES
p2 = NUM_OF_VOUT_FRAMES;
LSETUP(NtscOutputFieldStart, NtscOutputFieldEnd) LC0 = P2;
NtscOutputFieldStart:
r0 = 1; //line #1
//number of lines -> 525
P2 = 525;
LSETUP(NtscOutputLineStart, NtscOutputLineEnd) LC1 = P2;
NtscOutputLineStart:
call NtscOutputLine;
NtscOutputLineEnd:
r0 += 1; //increment line number
NtscOutputFieldEnd:
nop;
astat = [sp++];
(r7:0, p5:0) = [sp++];
rets = [sp++];
rts;
NtscOutputLine:
[--sp] = lc0;
[--sp] = lb0;
[--sp] = lt0;
[--sp] = lc1;
[--sp] = lb1;
[--sp] = lt1;
// determine if this is a VBlank line
R1 = R0>>5; // get offset (divide line number by 32)
R1 = R1<<2; // multiply by 4 for word access
P2 = R1; // move computed offset to P register
R3 = 0x1F; // prepare mask
nop;nop;
P1 = P4 + P2; // add offset to P1
R2 = [P1]; // get line mask word
R1 = R0 & R3; // get bit offset in line mask word
R2 >>= R1; // shift to get flag in bit 0
CC = BITTST(R2 , 0); // test bit 0
R2 = 0; // default add 0 to P3
R3 = 12; // prepare to add 8 to P3
if CC R2 = R3; // if CC this is vertical blanking so add 8 to P3
P2 = R2; // move offset in P2
// see below for final offset in P3
// determine which field we are outputing
R1 = 266; // line number where we are changing field (266)
CC = R1<R0; // test line to see if this field 1 or 2
R3 = 24; // offset to add to P3 if this is field 2
P3 = P5 + P2; // finally add to P3
R2 = 0; // by default don't offset P3
if CC R2 = R3; // if CC this is field 2
R1 = 3; // line number where we are changing field (3)
CC = R0<R1; // test line to see if this field 1 or 2
if CC R2 = R3; // if CC this is field 2
P2 = R2; // move offset in P2
nop;nop;nop;
P3 = P3 + P2; // finally add to P3
// **************** OUTPUT EAV ******************
R1 = [P3 + 4]; // load EAV code , see down for storage
#if 0
[P0++] = R1; // store EAV in FIFO
#else
r2 = r1 >> 24;
b[p0++] = r2;
r2 = r1 >> 16;
b[p0++] = r2;
r2 = r1 >> 8;
b[p0++] = r2;
b[p0++] = r1;
#endif
// ***************** OUTPUT HORIZONTAL BLANKING ***************
// store blank data information
R1.h = 0x8010;
R1.l = 0x8010;
//number of sample to output 134/2
#if 0
P2 = 67;
LSETUP(NtscOutputBlank1, NtscOutputBlank1) LC0 = P2;
NtscOutputBlank1:
[P0++] = R1;
#else
P2 = 67;
LSETUP(NtscOutputBlank1_s, NtscOutputBlank1_e) LC0 = P2;
NtscOutputBlank1_s:
r2 = r1 >> 24;
b[p0++] = r2;
r2 = r1 >> 16;
b[p0++] = r2;
r2 = r1 >> 8;
b[p0++] = r2;
NtscOutputBlank1_e: b[p0++] = r1;
#endif
// **************** OUTPUT SAV ******************
R2 = [P3 + 8]; // load video output flag
R1 = [P3]; // load SAV code, see down for storage
CC = BITTST(R2, 0); // test bit 0 to know if we have to output some video
#if 0
[P0++] = R1; // output SAV in FIFO
#else
r2 = r1 >> 24;
b[p0++] = r2;
r2 = r1 >> 16;
b[p0++] = r2;
r2 = r1 >> 8;
b[p0++] = r2;
b[p0++] = r1;
#endif
IF CC JUMP NtscOutputColorBarLine;
// ***************** OUTPUT EMPTY HORIZONTAL DATA ***************
// store blanking information
R1.h = 0x8010;
R1.l = 0x8010;
//number of sample to output 720/2
#if 0
P2 = 360;
LSETUP(NtscOutputBlank2, NtscOutputBlank2) LC0 = P2;
NtscOutputBlank2:
[P0++] = R1;
#else
P2 = 360;
LSETUP(NtscOutputBlank2_s, NtscOutputBlank2_e) LC0 = P2;
NtscOutputBlank2_s:
r2 = r1 >> 24;
b[p0++] = r2;
r2 = r1 >> 16;
b[p0++] = r2;
r2 = r1 >> 8;
b[p0++] = r2;
NtscOutputBlank2_e: b[p0++] = r1;
#endif
lt1 = [sp++];
lb1 = [sp++];
lc1 = [sp++];
lt0 = [sp++];
lb0 = [sp++];
lc0 = [sp++];
rts;
NtscOutputColorBarLine:
// ***************** OUTPUT REFERENCE COLOR HORIZONTAL DATA **************
// get pointer to color bar table
P3.h = ColorBarTable;
P3.l = ColorBarTable;
//number of color bar
P2 = 8;
LSETUP(NtscColorBarStart, NtscColorBarEnd) LC0 = P2;
NtscColorBarStart:
// get next color bar data
R1 = [P3++];
//number of sample to output (720/8)/2
#if 0
P2 = 45;
LSETUP(NtscOutputColorBarData, NtscOutputColorBarData) LC1 = P2;
NtscOutputColorBarData:
[P0++] = R1;
#else
P2 = 45;
LSETUP(NtscOutputColorBarData_s, NtscOutputColorBarData_e) LC1 = P2;
NtscOutputColorBarData_s:
r2 = r1 >> 24;
b[p0++] = r2;
r2 = r1 >> 16;
b[p0++] = r2;
r2 = r1 >> 8;
b[p0++] = r2;
NtscOutputColorBarData_e:b[p0++] = r1;
#endif
NtscColorBarEnd:
NOP;
lt1 = [sp++];
lb1 = [sp++];
lc1 = [sp++];
lt0 = [sp++];
lb0 = [sp++];
lc0 = [sp++];
rts;
dummy_end:
_NtscVideoOutFrameBuffInit.END:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -