/////////////////////////////////////////////////////////////////////////// ///// Nombre: CInfo.CPP /// ///// Modulo: Perteneciente a Catalogo.C /// //// DescripciĒn: Muestra informaciĒn del sistema.. (CPU, VIDEO...) /// //// /// //// Autor: Jos‚ David Guill‚n Dominguez /// //// Fecha: 26 - 07 - 1994 /// //// /// //// Compilador Borland C++ 3.0 /// /////////////////////////////////////////////////////////////////////////// #include #include #include #include #include void DatosRaton(void); void printxy(int x, int y, int m, char *texto); extern int raton; /* Indica si esta instalado el raton (def. NO) */ extern int x_raton; // En el MĒdulo: Craton.CPP extern int y_raton; // En el MĒdulo: Craton.CPP extern int boton_izq; // En el MĒdulo: Craton.CPP extern int boton_der; // En el MĒdulo: Craton.CPP extern int dir_raton [32+32]; // En el MĒdulo: Craton.CPP extern int access; /* Indica si se tiene acceso al menu ppal. (def. NO) */ extern void BorraViewPort(int view); extern void printxy(int x, int y, int m, char *texto); extern void desactiva_raton(void); // En el MĒdulo: Craton.CPP extern void activa_raton(void); // En el MĒdulo: Craton.CPP extern void inicializa_raton_grafico(int x1, // En el MĒdulo: Craton.CPP int y1, int x2, int y2, int px, int py); extern int sb2; void Info(char *nombrecargado) { union REGS ent, sal; int salir; BorraViewPort( 3); setcolor(63); printxy(28, 19, 0, "Programa y versiĒn: CATALOGO v4.0, JųD Anyware"); setcolor( 8); printxy(29, 39, 1, "P. EXE: "); printxy(29, 40, 1, "VersiĒn registrada a:"); printxy(29, 42, 1, "EjecuciĒn de INFO: Interna"); printxy(29, 44, 1, "DOS, enviroment:"); printxy(29, 45, 1, "DOS, memoria:"); printxy(29, 46, 1, "Hardware detectado: CPU: FPU:"); printxy(29, 47, 1, "Raton: "); printxy(29, 49, 1, "Gr ficos: 640x480 VGA, 16 colores"); printxy(29, 50, 1, "Driver Gr fico: VGA Device Driver (EGAVGA)"); printxy(29, 51, 1, "Chips Gr fico:"); printxy(29, 53, 1, "Salida de sonido digital:"); printxy(29, 55, 1, "Nivel de acceso:"); setcolor( 7); printxy(37, 39, 1, nombrecargado); // Lugar desde donde fue ejecutado // el programa. printxy(51, 40, 1, "VersiĒn PreView"); // Nombre del usuario registrado // Enviroment del DOS { auto int ver; auto int mayor, menor; auto char buffer[5]; ver = bdos(0x30, 0, 0); mayor = ver & 0xFF; menor = ver >> 8; sprintf(buffer, "%d.%d", mayor, menor ); printxy(46, 44, 1, buffer); } printxy(49, 45, 1, " "); // Memoria reportada por el DOS /////////////////////////// Hardware detecciĒn //////////////////////////// printxy(54, 46, 1, " "); // C.P.U. printxy(71, 46, 1, " "); // F.P.U. if (raton) DatosRaton(); // Raton else printxy(36, 47, 1, "Raton no instalado"); if(access) printxy(49, 55, 1, "COMPLETO"); // Nivel de acceso COMPLETO else printxy(49, 55, 1, "BAJO"); // Nivel de acceso BAJO if(sb2) printxy(55, 53, 1, "Sound Blaster DETECT"); else printxy(55, 53, 1, "usando Speaker"); salir = 0; if(raton!=0) { inicializa_raton_grafico(325, 33, 584, 189, 454, 111); activa_raton(); } do { if (kbhit()) { getch(); salir = 1; } if( raton!=0 && !salir ) { ent.x.ax = 3; int86(0x33, &ent, &sal); /* lee posiciĒn y estados del botĒn */ boton_izq = sal.x.bx & 1; boton_der = (sal.x.bx >> 1) & 1; if (boton_izq || boton_der) salir = 1; } }while (!salir); desactiva_raton(); BorraViewPort( 3); if(raton!=0) { inicializa_raton_grafico(0, 0, 624, 464, 320, 240); activa_raton(); } } void DatosRaton(void) { struct SREGS segmento; union REGS registro; static char *tipo[]={"Bus","Serie","InPort","PS/2","HP"}; struct { int status; int botones; short verhi,verlo; short tipo,irq; } minfo; registro.x.ax=0; int86(0x33,®istro,®istro); minfo.status=registro.x.ax; minfo.botones=registro.x.bx; registro.x.ax=0x24; int86(0x33,®istro,®istro); minfo.verhi=registro.h.bh; minfo.verlo=registro.h.bl; minfo.tipo=registro.h.ch-1; minfo.irq=registro.h.cl; ///////////////////////////////////////////////////////////////// //////////////////// Muestra datos obtenidos ////////////////// ///////////////////////////////////////////////////////////////// char *string = "buffer de linea"; printxy(36, 47, 1, tipo[minfo.tipo]); itoa(minfo.verhi, string, 10); printxy(43, 47, 1, string); printxy(45, 47, 1, "."); itoa(minfo.verlo, string, 10); printxy(46, 47, 1, string); printxy(48, 47, 1, ", IRQ "); itoa(minfo.irq, string, 10); printxy(54, 47, 1, string); printxy(56, 47, 1, ","); itoa(minfo.botones, string, 10); printxy(58, 47, 1, string); printxy(60, 47, 1, "Botones"); } void printxy(int x, int y, int m, char *texto) { if (m==1) outtextxy( x*8 -7, y*8 - 7, texto); else outtextxy( x*8 - 7, y*16 - 16, texto); }