commit 89c34dd4164db8f905ee75b18f87cfe2bb9388c9 Author: jdg Date: Fri Sep 3 17:40:35 2021 +0200 First commit 02/07/1999 diff --git a/AUTODOS.DSK b/AUTODOS.DSK new file mode 100644 index 0000000..d8853bd Binary files /dev/null and b/AUTODOS.DSK differ diff --git a/B-T.h b/B-T.h new file mode 100644 index 0000000..1201ce7 --- /dev/null +++ b/B-T.h @@ -0,0 +1,99 @@ +#include + +#define DIBUJA 1 +#define DEPRIME 2 +#define Dibuja_Todos 3 +#define COMPRUEBA 4 +#define STD_BY 5 + +#define NORMAL 0 +#define INTENSO 1 + +#define ATRAS -1 +#define NUEVA_BUSQUEDA 0 +#define ADELANTE 1 + +#define SEC_OPTAR 5 +#define ENCUADRE 3 + +// Niveles de acceso al programa +#define TOTAL 0 +#define USUARIO 1 +#define NINGUNO 2 + + +typedef struct +{ + char FillBgS, FillBgC; + char NumFg, NumBg, NumLn; + char TxtBgN, TxtBgI, TxtFgN, TxtFgI; + char Printer, PrintTo[80]; +} CONFIG; + + +typedef struct +{ + long Codigo; + char NIF[10+1]; + char Nombre[45+1]; + + char Direccion[40+1]; + char Num[4+1]; + char Piso[4+1]; + + char Localidad[25+1]; + char Provincia[15+1]; + + long CodPostal; + + char Cod1; + char Cod2; + char Cod3; +} MAILINGS; + + + + + + + +int Optar( int optar, ... ); +void ponicono(int x,int y,char matriz[18][18], char pos); +void formatea_u_long( unsigned long Numero, char *Inter_Chg); +int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1); +void Error( int code ); + + +// M¢dulo de referencias +void InfoProductos(void); + +// M¢dulo de Compras +void ComprasDiarias( int NivelAcceso ); + +// Informacion de los proveedores +void InfoProveedores(void); + +//ÛÛ +void espera_soltar(void); +void espera_pulsar(void); +void activa_raton(void); +void desactiva_raton(void); +void inicializa_raton_texto(void); +struct Boton_Texto{ + char x; char y; + char Texto[80]; + + int ID_T1; + int ID_T2; +}; + + + +int Funcion_Botones(int Funcion, int nBotones, struct Boton_Texto *Boton_Texto); + +extern int boton_izq, boton_der; +extern int x_raton, y_raton, RATON; + +//ÛÛ + +extern int AnoActual; diff --git a/B-Tmain.cpp b/B-Tmain.cpp new file mode 100644 index 0000000..d012631 --- /dev/null +++ b/B-Tmain.cpp @@ -0,0 +1,525 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "B-T.h" + +#define OFF 0 +#define ON 1 + +#ifdef __cplusplus + #define __CPPARGS ... +#else + #define __CPPARGS +#endif + +char far *MemTexto = (char far *)0xB8000000; +char ROWselect = 6, notENABLED; + + + +int MenuPrincipal(void); +void Installer(void); + +int boton_izq; int boton_der; +int x_raton, y_raton, RATON = 1; + +int Execute( char *program ) +{ + if ( access( program, 0 ) != 0 ) + { + Optar( 1, "ATENCION", "No se encontr¢ el programa requerido", "asegurese que esta en la ruta:", program, NULL ); + } else { + system( program ); + MenuPrincipal(); + } +}; + + +int main(void) +{ + inicializa_raton_texto(); + if( RATON ) desactiva_raton(); + + MenuPrincipal(); +// sleep( 5 ); + + Installer(); + + textcolor( WHITE ); + textbackground( BLACK ); + clrscr(); + cprintf( "\nSol Negro (c) | 1999" ); + cprintf( "\n" ); + + _setcursortype(_NORMALCURSOR); + +return 0; + +} + + +void SN(void) +{ + static int columna = 15, inc = 1, cont; + static clock_t start=clock(); + int i, j; + + // fila -^ ^--- columna + if ( notENABLED ) return; + + MemTexto[ ROWselect*80*2 + 60*2 +1 ] = 0x0E; + MemTexto[ ROWselect*80*2 + 61*2 +1 ] = 0x0E; + MemTexto[ ROWselect*80*2 + 62*2 +1 ] = 0x0E; + MemTexto[ ROWselect*80*2 + 63*2 +1 ] = 0x0E; + if ( ( cont >= 0 && cont < 17 ) || cont >= 68 ) + { + MemTexto[ ROWselect*80*2 + 60*2 ] = '<'; + MemTexto[ ROWselect*80*2 + 61*2 ] = '-'; + MemTexto[ ROWselect*80*2 + 62*2 ] = '-'; + MemTexto[ ROWselect*80*2 + 63*2 ] = '³'; + } else + if ( ( cont < 35 ) || cont >= 52 ) + { + MemTexto[ ROWselect*80*2 + 60*2 ] = ' '; + MemTexto[ ROWselect*80*2 + 61*2 ] = '<'; + MemTexto[ ROWselect*80*2 + 62*2 ] = '-'; + MemTexto[ ROWselect*80*2 + 63*2 ] = '°'; + } else { + MemTexto[ ROWselect*80*2 + 60*2 ] = ' '; + MemTexto[ ROWselect*80*2 + 61*2 ] = ' '; + MemTexto[ ROWselect*80*2 + 62*2 ] = '<'; + MemTexto[ ROWselect*80*2 + 63*2 ] = '²'; + } + + if ( ( clock() - start ) > .05 ) + start = clock(); + else + return; + cont++; + cont = (cont++)%70; + columna+= inc; if ( columna == 59 ) inc = -1; + if ( columna == 15 ) inc = +1; + + // GRADIENTE SN + for ( i=1; i < 4; i++ ) + { + MemTexto[ i*80*2 + columna *2 + 1] = ( inc==1 ? 0x00 : 0x0F ); + MemTexto[ i*80*2 + (columna+1)*2 + 1] = ( inc==1 ? 0x08 : 0x07 ); + MemTexto[ i*80*2 + (columna+2)*2 + 1] = ( inc==1 ? 0x08 : 0x07 ); + MemTexto[ i*80*2 + (columna+3)*2 + 1] = ( inc==1 ? 0x07 : 0x07 ); + MemTexto[ i*80*2 + (columna+4)*2 + 1] = ( inc==1 ? 0x07 : 0x08 ); + MemTexto[ i*80*2 + (columna+5)*2 + 1] = ( inc==1 ? 0x07 : 0x08 ); + MemTexto[ i*80*2 + (columna+6)*2 + 1] = ( inc==1 ? 0x0F : 0x00 ); + } + + // GRADIENTE (SOL) + j = (columna-15)/3; + for ( i=0; i < 18; i++ ) // Filas + // Columnas + { + MemTexto[ i*80*2 + j *2 + 1] = ( inc==1 ? 0x00 : 0x0F ); + MemTexto[ i*80*2 + (j+1)*2 + 1] = ( inc==1 ? 0x08 : 0x07 ); + MemTexto[ i*80*2 + (j+2)*2 + 1] = ( inc==1 ? 0x08 : 0x07 ); + MemTexto[ i*80*2 + (j+3)*2 + 1] = ( inc==1 ? 0x07 : 0x07 ); + MemTexto[ i*80*2 + (j+4)*2 + 1] = ( inc==1 ? 0x07 : 0x08 ); + MemTexto[ i*80*2 + (j+5)*2 + 1] = ( inc==1 ? 0x07 : 0x08 ); + MemTexto[ i*80*2 + (j+6)*2 + 1] = ( inc==1 ? 0x0F : 0x00 ); + } + + +} + +int MenuPrincipal(void) +{ + _setcursortype(_NOCURSOR); + textcolor( DARKGRAY ); + textbackground( BLACK ); + clrscr(); + + cprintf("| _ \n\r"); + cprintf(" / / ÜÜ Ü Ü Ü Ü Ü ÜÜÜ ÜÜ Ü\n\r"); + cprintf(" øøø / _/ ßÜ Û Û Û ÛßÜÛ ÛÜ Û Ü ÛÜß Û Û\n\r"); + cprintf(" ýýøø _/ ÜÜß ßÜß ÛÜ Û ßÛ ßÜ ßÜÜß Û Û ßÜß\n\r"); + cprintf(" ýýýøø / \n\r"); + cprintf(" êêêýøø __/ \n\r"); + cprintf(" êêêêýøø \n\r"); + cprintf(" êêêêýøø ----__- \n\r"); + cprintf(" êêêêýøø \n\r"); + cprintf(" êêêêýøø __--_ \n\r"); + cprintf(" êêêýøø \\ \n\r"); + cprintf(" ýýýøø \\_ \n\r"); + cprintf(" ýýøø \\_ \n\r"); + cprintf(" øøø \\_ \n\r"); + cprintf(" øø \\ \\_ \n\r"); + cprintf(" | \\ \n\r"); + cprintf(" | | \\ \n\r"); + cprintf(" | \n\r"); + + textcolor( RED ); + cprintf(" \n\r"); + + return 0; +} + + +int Funcion_Botones(int Funcion, int nBotones, struct Boton_Texto *Boton_Texto) +{ + + char i; + int DEVOLVER = -1; + int longitud, key, key2; + + switch( Funcion ) { + case DIBUJA: + highvideo(); + textcolor(BLACK); + textbackground(11); + gotoxy(Boton_Texto[nBotones].x, Boton_Texto[nBotones].y); + DEVOLVER = 0; + longitud = strlen( Boton_Texto[nBotones].Texto ); + while( DEVOLVER <= longitud ) { + if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { + DEVOLVER ++; + textcolor(RED); + cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); + textcolor(BLACK); + } else cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); + DEVOLVER ++; + } + + // cprintf("%s", Texto); + + textbackground(7); // ±SALIR±Ü + cprintf("ß"); // ßßßßßßß + gotoxy(Boton_Texto[nBotones].x+1, Boton_Texto[nBotones].y+1); + for(i = 0; i < longitud; i ++ ) // ±±±±±±±Ü + cprintf("Ü"); // ßßßßßßß + break; + case DEPRIME: + highvideo(); + textcolor(BLACK); + textbackground(11); + gotoxy(Boton_Texto[nBotones].x, Boton_Texto[nBotones].y); + DEVOLVER = 0; + longitud = strlen( Boton_Texto[nBotones].Texto ); + //////////////// + textbackground(BLACK); + while( DEVOLVER <= (longitud+1) ) { + if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { + DEVOLVER ++; + } + cprintf(" "); + DEVOLVER ++; + } + textbackground(11); + gotoxy(Boton_Texto[nBotones].x+1, Boton_Texto[nBotones].y+1); + DEVOLVER = 0; + while( DEVOLVER <= longitud ) { + + if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { + DEVOLVER ++; + textcolor(RED); + cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); + textcolor(BLACK); + } else cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); + DEVOLVER ++; + } +// cprintf("%s", Texto); // + // ±±±±±±± + break; + case Dibuja_Todos: + for( i=0; i < nBotones; i++) + Funcion_Botones( DIBUJA, i, Boton_Texto); + break; + case COMPRUEBA: + if( bioskey(1)!=0 ) { + key = toupper( getch() ); DEVOLVER = -2; + if ( key == 0 ) { key2 = toupper( getch() ); DEVOLVER = -1; } + for( i=0; i < nBotones && DEVOLVER <= -1; i++){ + if( key == Boton_Texto[i].ID_T1 ) { + if( key == 0 ) { + if( key2 == Boton_Texto[i].ID_T2 ){ + DEVOLVER = (i + 1); + Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); + delay(150); + //sleep(1); + Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); + } + } else + { DEVOLVER = (i + 1); + Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); + delay(150); + //sleep(1); + Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); + } + } + } + + if( DEVOLVER == -2 ) + { ungetch(key); } + + if( DEVOLVER == -1 ) + { ungetch(key2); } + + + } else if( RATON ) { + DEVOLVER = 0; + for( i=0; i < nBotones && DEVOLVER == 0; i++) { + longitud = strlen( Boton_Texto[i].Texto ); + if ( (x_raton+1) >= Boton_Texto[i].x && (x_raton+1) <= ( Boton_Texto[i].x + longitud -1) && + y_raton == (Boton_Texto[i].y-1) ) { DEVOLVER = (i + 1); + Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); + if( RATON ) activa_raton(); + espera_soltar(); + if( RATON ) desactiva_raton(); +// delay(150); + Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); + } + } + } + break; + case STD_BY: + Funcion_Botones(Dibuja_Todos, nBotones, Boton_Texto); + do{ + if( RATON ) activa_raton(); + if( RATON ) espera_pulsar(); else while( bioskey(1)==0 ); + if( RATON ) desactiva_raton(); + DEVOLVER = Funcion_Botones(COMPRUEBA, nBotones, Boton_Texto); + }while(DEVOLVER==0 && bioskey(1)==0 ); + + } + return DEVOLVER; +} + +void inicializa_raton_texto(void) +{ + union REGS ent, sal; + + ent.x.ax = 0; + int86(0x33, &ent, &sal); /* averigua si hay rat¢n conectado */ + + if(sal.x.ax==0) { RATON = 0; return; } + + ent.x.ax = 15; + ent.x.cx = 8; + ent.x.dx = 16; + int86(0x33, &ent, &sal); /* fija la raz¢n mickey/pixel */ + + ent.x.ax = 7; + ent.x.cx = 0; + ent.x.dx = 639; + int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. horizontal */ + + ent.x.ax = 8; + ent.x.cx = 0; + ent.x.dx = 199; + int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. vertical */ + + ent.x.ax = 4; + ent.x.cx = 320; + ent.x.dx = 100; + int86(0x33, &ent, &sal); /* fija la posici¢n del rat¢n */ + + ent.x.ax = 1; + int86(0x33, &ent, &sal); /* muestra el puntero del rat¢n */ +} +void activa_raton(void) +{ + union REGS ent, sal; + + ent.x.ax = 1; + int86(0x33, &ent, &sal); +} + +void desactiva_raton(void) +{ + union REGS ent, sal; + + ent.x.ax = 2; + int86(0x33, &ent, &sal); +} + +void espera_pulsar(void) +{ + union REGS ent, sal; + + do{ + if(bioskey(1)!=0) break; + ent.x.ax = 3; + int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */ + + SN(); + }while((sal.x.bx & 3)==0); + boton_izq=sal.x.bx & 1; + boton_der=(sal.x.bx >> 1) & 1; + x_raton= (sal.x.cx >> 1) / 4; // / 8 + y_raton= (sal.x.dx)/8; // /8 +} + +void espera_soltar(void) +{ + union REGS ent, sal; + + do{ + ent.x.ax = 3; + int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */ + }while((sal.x.bx & 3)!=0); + boton_izq=sal.x.bx & 1; + boton_der=(sal.x.bx >> 1) & 1; + x_raton=sal.x.cx >> 1; + y_raton=sal.x.dx; +} + + + +///////////////////////////////////////////////////////////////////////////// +void Installer(void) +{ + struct Boton_Texto BT[6]; +/* +23456789-123456789-123456789- + { Preparar DISCO DURO } + + { VOLCAR WINDOWS 98 CD->HD } + { VOLCAR WINDOWS 95 CD->HD } + + { VOLCAR UTILIDADES CD->HD } + { TESTEO DEL EQUIPO } + + { SALIR } +*/ + + BT[0].x = 26; BT[0].y = 20; strcpy( BT[0].Texto, " &SALIR "); BT[0].ID_T1 = 83; BT[0].ID_T2 = 0; + + BT[1].x = 26; BT[1].y = 7; strcpy( BT[1].Texto, " &Preparar DISCO DURO "); BT[1].ID_T1 = 80; BT[1].ID_T2 = 0; + + BT[2].x = 26; BT[2].y =10; strcpy( BT[2].Texto, " &TESTEO DEL EQUIPO "); BT[2].ID_T1 = 84; BT[2].ID_T2 = 0; + BT[3].x = 26; BT[3].y =12; strcpy( BT[3].Texto, " VOLCAR &UTILIDADES CD->HD "); BT[3].ID_T1 = 85; BT[3].ID_T2 = 0; + + BT[4].x = 26; BT[4].y =15; strcpy( BT[4].Texto, " VOLCAR &WINDOWS 98 CD->HD "); BT[4].ID_T1 = 87; BT[4].ID_T2 = 0; + BT[5].x = 26; BT[5].y =17; strcpy( BT[5].Texto, " VOLCAR WINDOWS 9&5 CD->HD "); BT[5].ID_T1 = 53; BT[5].ID_T2 = 0; + + + char ok = 0; + int BPush, key; + char nBT = 2; + char reentrada = 0; + + _setcursortype( _NOCURSOR ); +// DibujaPantallaArticulos(); + do { + notENABLED = OFF; + if ( reentrada == 0 ) + BPush = Funcion_Botones(STD_BY, 6, BT); + else + reentrada = 0; + notENABLED = ON; + switch ( BPush ) + { + case 0: // No se pulso ningun BOTON + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -2: // Hay una tecla normal en BUFFER +/* + if ( ( key = getch() ) != 13 && key != 27 ) + ungetch( key ); +*/ + if ( ( key = getch() ) == 13 ) + { + reentrada = 1; BPush = nBT; + } + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case -1: // Hay una tecla especial en BUFFER + switch( getch() ) + { + // Flecha Izquierda + case 75: + case 15: + break; + // Flecha Derecha + case 77: + case 9: + break; + // Flecha Arriba + case 72: +MemTexto[ ROWselect*80*2 + 60*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 61*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 62*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 63*2 ] = ' '; + + nBT--; if ( nBT == 0 ) nBT = 6; + switch(nBT) + { + case 1: ROWselect = 19; break; + case 2: ROWselect = 6; break; + case 3: ROWselect = 9; break; + case 4: ROWselect = 11; break; + case 5: ROWselect = 14; break; + case 6: ROWselect = 16; break; + } + break; + // Flecha Abajo + case 80: +MemTexto[ ROWselect*80*2 + 60*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 61*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 62*2 ] = ' '; +MemTexto[ ROWselect*80*2 + 63*2 ] = ' '; + + nBT++; if ( nBT == 7 ) nBT = 1; + switch(nBT) + { + case 1: ROWselect = 19; break; + case 2: ROWselect = 6; break; + case 3: ROWselect = 9; break; + case 4: ROWselect = 11; break; + case 5: ROWselect = 14; break; + case 6: ROWselect = 16; break; + } + break; + // Inicio + case 71: + break; + // Fin + case 79: + break; + } + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + break; + case 1: + ok = 1; + break; + // Preparar DISCO DURO + case 2: + Execute( "UT_systm\\PMAGIC\\PQMAGIC.EXE" ); + break; + // Volcar W98 -> HD + case 5: + Execute( "UT_systm\\C98.BAT" ); + break; + // Volcar W95 -> HD + case 6: + Execute( "UT_systm\\C95.BAT" ); + break; + // Volcar UTILIDADES -> HD + case 4: + Execute( "UT_systm\\CUT.BAT" ); + break; + // TESTEO + case 3: + Execute( "UT_systm\\TESTdos\\Test.exe" ); + break; + } + } while(!ok); +} + + diff --git a/B-UT.cpp b/B-UT.cpp new file mode 100644 index 0000000..b38a04d --- /dev/null +++ b/B-UT.cpp @@ -0,0 +1,278 @@ +#include +#include +#include +#include +#include +#include +#include + +#define BLANCO EGA_WHITE +#define ENCUADRE 3 +#define SEC_OPTAR 5 + +#include "B-T.h" + +void BEEP(void); + + /**************************************************************************\ +|* *| +|* InputCadenaG *| +|* *| +|* Descripci¢n: *| +|* Edita una cadena en formato gr fico *| +|* *| +|* Entradas: *| +|* Puntero a los datos editados *| +|* 0 alfanumerico 1 numerico *| +|* longitud de la cadena (TEXTO/NUMERO) *| +|* color del texto *| +|* color de fondo *| +|* Limites de acotacion *| +|* *| +|* Salidas: (ninguna) *| +|* *| +|* *| + \**************************************************************************/ +int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1) +{ + // A todas las y les sumaba antes +RoW*12 parametro que indica la linea + + int ls; // longitud cadena + char Status = 0; + char *s1; // puntero a cadena inicial + int c, ok, i; + + s1 = s; // inicio cadena + + textbackground( cf ); + + gotoxy( X0, Y0 ); + for ( i = 0; i < X1; i++ ) + putch( 32 ); + textcolor( cc ); + gotoxy( X0, Y0 ); + cprintf( "%s", s1 ); + + _setcursortype( _SOLIDCURSOR ); + + ls = strlen ( s ); // Longitud de actual + + s += ls; // se coloca en el final + + do{ + c = getch(); // obtiene tecla + + if ( c == 27 ) Status = 1; + + ok = ( c == 27 || c == 13 || c == 0); // 13 = INTRO || Especiales + + if ( c == 8 && ls > 0 && !ok ) { // 8 = Back Space + ls--; + s--; + + *s = '\0'; + + gotoxy( X0, Y0 ); + for ( i = 0; i < X1; i++ ) + putch( 32 ); + textcolor( cc ); + gotoxy( X0, Y0 ); + cprintf( "%s", s1 ); + + + } else { + if ( !numalp && c >= 32 && c <= 254 && ls < lmax) { + + *s++ = c; + ls++; + + *s = '\0'; + + gotoxy( X0, Y0 ); + for ( i = 0; i < X1; i++ ) + putch( 32 ); + textcolor( cc ); + gotoxy( X0, Y0 ); + cprintf( "%s", s1 ); + + } else { + if ( numalp && isdigit(c) && ls < lmax) { + *s++ = c; + ls++; + + *s = '\0'; // Cero final + + gotoxy( X0, Y0 ); + for ( i = 0; i < X1; i++ ) + putch( 32 ); + textcolor( cc ); + gotoxy( X0, Y0 ); + cprintf( "%s", s1 ); + + } + /*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/ + else if( c == 27 ) {*s='\0'; ok = 1; } + /*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/ + else BEEP(); + } + } + + }while(!ok); + + _setcursortype( _NOCURSOR ); + + ok = 1; + *s = ' '; + while( ok && ls >= 0 ) { + if(*s==' ') { *s = '\0'; s--; ls--; + } else { s++; ok = 0; } + } + + *s = '\0'; + + while(kbhit()) getch(); // Vacia Buffer impidiendo falsas + // pulsaciones... + + return ( (Status<<8) + (ls&0x00FF) ); +} + +void BEEP(void) +{ + + sound(440); + delay(50); + nosound(); + +} + + +void formatea_u_long( unsigned long Numero, char *Inter_Chg) +{ + char Buffer1[80]; + + int c; + + sprintf(Buffer1, "%lu", Numero); + + Inter_Chg[0]='\0'; + + strrev(Buffer1); + + c = strlen( Buffer1 ); + + while( c >= 3 ) + { + + c -= 3; + strncat( Inter_Chg, Buffer1, 3); + + strrev(Buffer1); + + Buffer1[c] = '\0'; + + strrev(Buffer1); + + if(strlen(Buffer1)!=0) + strcat( Inter_Chg, "." ); + } + + strcat( Inter_Chg, Buffer1); + strrev(Inter_Chg); + + +/*// return Buffer2;*/ +} + + +int Optar( int optar, ... ) +{ +struct Boton_Texto BT[6]; +int devolver = 0; + +BT[0].x = 22; BT[0].y = 15; strcpy( BT[0].Texto, " acep&Tar "); BT[0].ID_T1 = 84; BT[0].ID_T2 = 20; +BT[1].x = 51; BT[1].y = 15; strcpy( BT[1].Texto, " &Cancelar"); BT[1].ID_T1 = 67; BT[1].ID_T2 = 46; + + static char fondo[4096]; + static char Memoria = 0; + + int DEV = 0, ok = 0, linea = 0; + int Center; char *buff; + + va_list ap; + va_start( ap, &optar ); + + if ( Memoria == 1 ) + { + puttext( 21, 5, 63, 17, (void *)fondo ); Memoria = 0; + if ( optar == ENCUADRE ) return DEV; + } + + Memoria = 1; + + gettext( 21, 5, 63, 17, (void *)fondo ); + +textbackground( BLACK ); +textcolor( CYAN ); +gotoxy( 21, 5 ); cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"); +gotoxy( 21, 6 ); cprintf("³ ³"); +gotoxy( 21, 7 ); cprintf("ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´"); +gotoxy( 21, 8 ); cprintf("³ ³"); +gotoxy( 21, 9 ); cprintf("³ ³"); +gotoxy( 21, 10 ); cprintf("³ ³"); +gotoxy( 21, 11 ); cprintf("³ ³"); +gotoxy( 21, 12 ); cprintf("³ ³"); +gotoxy( 21, 13 ); cprintf("³ ³"); +gotoxy( 21, 14 ); cprintf("³ ³"); +gotoxy( 21, 15 ); cprintf("³ ³"); +gotoxy( 21, 16 ); cprintf("³ ³"); +gotoxy( 21, 17 ); cprintf("ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"); + + + + textcolor( RED ); + linea = 0; + while ( (buff = va_arg(ap, char *)) != NULL ) + { + Center = (42 - strlen( buff ) ) / 2; + gotoxy( 21+Center+1, ( (linea == 0 ) ? 6 : 8 + linea ) ); + cprintf( "%s", buff ); + linea++; + } + + va_end(ap); + + if ( optar != ENCUADRE ) + { + ok = 0; while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + if ( optar == 1 ) + do { + switch( Funcion_Botones(STD_BY, 2, BT) ) + { + case 0: + // No se pulso ningun BOTON + case -2: + case -1: + while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER + if ( optar == 0 ) ok = 1; + break; + case 1: + DEV = 1; ok = 1; + break; + case 2: + DEV = 0; ok = 1; + break; + } + }while( !ok ); + else { espera_pulsar(); espera_soltar(); } + + puttext( 21, 5, 63, 17, (void *)fondo ); + + Memoria = 0; + + } + + return DEV; +} + + + diff --git a/M.BAT b/M.BAT new file mode 100644 index 0000000..3de38e8 --- /dev/null +++ b/M.BAT @@ -0,0 +1 @@ +autodos \ No newline at end of file diff --git a/autodos.prj b/autodos.prj new file mode 100644 index 0000000..d00f1da Binary files /dev/null and b/autodos.prj differ diff --git a/sn.exe b/sn.exe new file mode 100644 index 0000000..56009b4 Binary files /dev/null and b/sn.exe differ