First commit 20/04/1996
This commit is contained in:
69
VIDEOC~1.TXT
Normal file
69
VIDEOC~1.TXT
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
Bit 5 --> Indica con 0 que empieza un sincronismo de pantalla
|
||||
Bit 6 --> Indica que empieza una linea ( cuando esta a 0 )
|
||||
Bit 4 --> Indica si es par o impar (0-1)
|
||||
|
||||
Bit 0 }-> Commutador
|
||||
Bit 1 }-> Video
|
||||
|
||||
|
||||
|
||||
|
||||
USO: video [LINEA_INICIO] [LINEA_FIN] [TIEMPO_RETARDO_MICRO_SEG]
|
||||
*/
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <dos.h>
|
||||
|
||||
void main( int argc, char *argv[] )
|
||||
{
|
||||
int LineaINI, LineaFIN;
|
||||
char LineaPI;
|
||||
double RETARDO;
|
||||
|
||||
if ( argc < 4 )
|
||||
{
|
||||
sprintf( "\nERROR de parametros: video [LINEA_INICIO] [LINEA_FIN] [TIEMPO_RETARDO_MICRO_SEG]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
LineaINI = atoi( argv[1] );
|
||||
LineaFIN = atoi( argv[2] );
|
||||
Retardo = atod( argv[3] );
|
||||
|
||||
do {
|
||||
|
||||
// Esperamos a que empieze un sincronismo de pantalla
|
||||
while( inportb(888) & 32 );
|
||||
|
||||
// Mira si son lineas pares o impares e inicializa el contador de n<> de l<>nea
|
||||
if ( inportb(888) & 16 )
|
||||
LineaPI = 1;
|
||||
else
|
||||
LineaPI = 0;
|
||||
|
||||
while( linea < 313 )
|
||||
{
|
||||
if ( !(inport( 888 ) & 64) )
|
||||
{
|
||||
linea += 2;
|
||||
if ( LineaINI <= linea && linea <= LineaFIN )
|
||||
{
|
||||
outportb( 888, F2 );
|
||||
|
||||
// Perdemos "Retardo" micro-segundos
|
||||
while( (clock() - SegINI)<<3 < Retardo );
|
||||
|
||||
outportb( 888, F1 );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} while ( !kbhit() );
|
||||
|
||||
|
||||
while( kbhit() ) getch();
|
||||
}
|
Reference in New Issue
Block a user