162 lines
4.3 KiB
C++
162 lines
4.3 KiB
C++
///////////////////////////// FICHEROS A INCLUIR /////////////////////////////
|
||
extern int Fichero_cd_in2(char Dinamicos_Estaticos);
|
||
|
||
#include <dos.h>
|
||
#include <mem.h>
|
||
#include <alloc.h>
|
||
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <conio.h> // Para getch();
|
||
#include <graphics.h> // Para outtextxy(...); y cleardevice(...);
|
||
|
||
#include "d:\program\src_dos\libs\make_bot\make_bot.h" // Fuciones de MAKE_BOTON
|
||
#include "cd_icons.h"
|
||
#include "cd_error.h"
|
||
// #include "cd_raton.h"
|
||
|
||
extern int far _Cdecl Svga256_fdriver[];
|
||
int huge DetectVGA256()
|
||
{
|
||
return 2;
|
||
}
|
||
|
||
extern void Inicializa_Dibujo(void);
|
||
extern void Inicializa_Iconos(void);
|
||
extern void Coloca_Iconos_Dos_Windows(void);
|
||
extern char far *Icono; // 18
|
||
void InicializaSVGA(void);
|
||
extern char dac[256*3];
|
||
extern "C" void APAGA_PANTALLA(char *);
|
||
extern "C" void ENCIENDE_PANTALLA(char *);
|
||
|
||
extern void Menu_de_Edicion(void);
|
||
extern void Coloca_Iconos(int Start_Icon);
|
||
|
||
// extern unsigned char *P_Raton1, *P_Raton2, *P_Raton3, *P_Raton4;
|
||
// void *Pantalla;
|
||
|
||
int main(void/*int argc, char *argv[]*/){
|
||
|
||
|
||
InicializaSVGA();
|
||
|
||
/*Û*/ memset( dac, 0, 256*3 ); /*Û*/
|
||
unsigned Segt = FP_SEG(dac), Off = FP_OFF(dac);
|
||
/*Û*/ asm mov ax, 0x1012 ; /*Û*/
|
||
/*Û*/ asm mov bx, 0 ; /*Û*/
|
||
/*Û*/ asm mov cx, 256 ; /*Û*/
|
||
/*Û*/ asm mov es, Segt ; /*Û*/
|
||
/*Û*/ asm mov dx, Off ; /*Û*/
|
||
/*Û*/ asm int 0x10 ; /*Û*/
|
||
|
||
if( //carga_botones("cd_in.img") // Carga botones del fichero "botones.p1"
|
||
Fichero_cd_in2(0)
|
||
!= 1 ) {
|
||
Fichero_cd_in2(112);
|
||
|
||
// Imprime_Estaticos( 112, "cd_in.img");
|
||
Espera_Tecla_o_Raton();
|
||
closegraph();
|
||
cprintf("\n\rError en la CARGA DE BOTONES");
|
||
exit(112);
|
||
}
|
||
|
||
Fichero_cd_in2(1);
|
||
// Imprime_Estaticos( 1, "cd_in.img"); // Imprime botones estaticos 'Seccion 1'
|
||
|
||
Imprime_Secuencia(1); // Imprime secuencia 1.
|
||
|
||
Fichero_cd_in2(2);
|
||
|
||
// Imprime_Estaticos( 2, "cd_in.img"); // Imprime botones estaticos 'Seccion 2'
|
||
// para los textos
|
||
|
||
/*Û*/ PunteroRaton = 100; /*Û*/
|
||
/*Û*/ inicializa_raton_grafico( 0, 0, 618, 460); /*Û*/
|
||
/*Û*/ if ( PunteroRaton != 100 ) { /*Û*/
|
||
/*Û*/ closegraph(); /*Û*/
|
||
/*Û*/ cprintf("Memoria_Insuficiente para el RATON\n\r");/*Û*/
|
||
/*Û*/ exit(1); /*Û*/
|
||
/*Û*/ } /*Û*/
|
||
|
||
Inicializa_Iconos();
|
||
Coloca_Iconos_Dos_Windows();
|
||
Coloca_Iconos(1);
|
||
|
||
ENCIENDE_PANTALLA(dac);
|
||
|
||
|
||
/*
|
||
if ( (Pantalla = malloc( JD_imagesize(0, 0, 21, 21) )) == NULL ) {
|
||
Imprime_Estaticos( SIN_CVN, "cd_in.img"); // Imprime botones estaticos 'Seccion 2'
|
||
Espera_Tecla_o_Raton();
|
||
closegraph();
|
||
cprintf("\n\rError en la asignaci¢n de memoria para la mascara del raton");
|
||
exit(2);
|
||
}
|
||
*/
|
||
|
||
|
||
True_Push = ON; // Activa el TRUE PUSH ( PRESION REAL )
|
||
|
||
Menu_de_Edicion();
|
||
/*
|
||
free(P_Raton1);
|
||
free(P_Raton2);
|
||
free(P_Raton3);
|
||
free(P_Raton4);
|
||
*/
|
||
APAGA_PANTALLA(dac);
|
||
closegraph();
|
||
/*
|
||
farfree(Icono);
|
||
free(Pantalla);
|
||
*/
|
||
Libera_Raton_Animado();
|
||
|
||
cprintf("Gracias por utilizar mi Software\n\r");
|
||
cprintf(" Jos‚ David Guill‚n\n\r");
|
||
cprintf("\n\r");
|
||
|
||
return 0;
|
||
}
|
||
|
||
|
||
void InicializaSVGA(void) {
|
||
|
||
int Gd = DETECT, Gm;
|
||
int Drv, errorcode;
|
||
|
||
installuserdriver("Svga256",DetectVGA256);
|
||
/* If driver is linked with file, remove comments */
|
||
registerfarbgidriver(Svga256_fdriver);
|
||
|
||
errorcode = registerfarbgifont(small_font_far);
|
||
|
||
/* report any registration errors */
|
||
if (errorcode < 0)
|
||
{
|
||
printf("Graphics error: %s\n", grapherrormsg(errorcode));
|
||
printf("Press any key to halt:");
|
||
getch();
|
||
exit(1); /* terminate with an error code */
|
||
}
|
||
|
||
|
||
initgraph(&Gd,&Gm,"");
|
||
|
||
/* read result of initialization */
|
||
errorcode = graphresult();
|
||
|
||
if (errorcode != grOk) /* an error occurred */
|
||
{
|
||
printf("Graphics error: %s\n", grapherrormsg(errorcode));
|
||
printf("Presione una tecla para finalizar:");
|
||
getch();
|
||
exit(1); /* return with error code */
|
||
}
|
||
|
||
|
||
|
||
}
|