3 x12_sendcommand function call – Sensoray 512 DOS User Manual
Page 18
 
18
6.3 X12_SENDCOMMAND function call
The X12_SENDCOMMAND function is used to send a command to the 512 driver. See section 6.3 for 
command details. 
 
Entry: 
Register Description Value 
 
SI Function number X12_SENDCOMMAND + either CARD0 for the first card 
or CARD1 for the second card.
AX Command X12_VI_START 
 X12_VI_STOP 
X12_VI_GETDMADATA 
X12_VI_PUTDMADATA 
X12_VI_SETINPUT 
X12_VI_SETINPUTTYPE 
X12_VI_GETSTATUS 
X12_RESETDEVICE 
 
Exit: 
Register Description Value 
 
AX Timeout flag Non-zero is timeout 
 Zero is success 
 
Example: 
 
#include “x12.h” //Included for 512 dos driver support 
#include “dos.h” //Included for software interrupt support 
. 
. 
X12PARAM _far *Param; //Declare a pointer to an X12PARAM object 
union REGS regs; // 
. 
. 
regs.x.si = X12_GETCMDPARAPTR + CARD0; //Select the driver function 
int86(X12INT,®s,®s); //Call the driver 
Param = (X12PARAM _far *) MK_FP(regs.x.dx, regs.x.ax); //Make a pointer from the returned register values 
 
Param->Mode = ENCODE; 
regs.x.ax = X12_VI_START; //The video start command 
regs.x.si = X12_SENDCOMMAND + CARD0; //Select the driver function 
int86(X12INT,®s,®s); //Call the driver 
 
if(regs.x.ax) 
{ 
 printf("Error Timeout\n"); 
 return 0; 
} 
 
IMPORTANT:
Every time the X12_SENDCOMMAND is called any changes to the X12PARAM
members DO0, DO1, DO2 or DDIR0, DDIR1, DDIR2 take effect. Upon return VQSize, DI0, DI1, DI2, 
DroppedFrames, FrameCount, and Status are updated.