First commit 09/04/1995

This commit is contained in:
2021-09-03 17:50:32 +02:00
commit e0a9c4f8c9
120 changed files with 13455 additions and 0 deletions

215
CD_IN/CD_RATON.CPP Normal file
View File

@ -0,0 +1,215 @@
///////////////////////////////////////////////////////////////////////////
///// Nombre: Craton.cpp ///
///// Modulo: Perteneciente a JD_FONTS.CPP ///
//// Descripci<63>n: Utilidades para el manejo del raton ///
//// ///
//// Autor: ( Ver Pc-Mania n<> 20 ) ///
//// Autor puntero del raton: Jos<6F> David Guill<6C>n Dominguez ///
//// Fecha: ( Desconocida ) ///
//// ///
//// Compilador Borland C++ 3.0 ( Creaci<63>n original en Turbo C 2.0 ) ///
///////////////////////////////////////////////////////////////////////////
#include <dos.h>
#include <conio.h>
void desactiva_raton(void);
void activa_raton(void);
void inicializa_raton_grafico(int x1, int y1, int x2, int y2, int px, int py);
void Anclar_Raton(void);
int Espera_Tecla_o_Raton(void);
int raton=0;
int x_raton;
int y_raton;
int boton_izq;
int boton_der;
extern int PunteroRaton;
int dir_raton [32+32] = {
// 0x3FFF, /*<2A> <20> 1 1 1 1 1 1 1 1 1 1 1 1 1 1*/
// 0x1FFF, /*<2A> <20> <20> 1 1 1 1 1 1 1 1 1 1 1 1 1*/
// 0x0FFF, /*<2A> <20> <20> <20> 1 1 1 1 1 1 1 1 1 1 1 1*/
// 0x07FF, /*<2A> <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1 1 1*/
// 0x03FF, /*<2A> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1 1*/
// 0x07FF, /*<2A> <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1 1 1*/
// 0xC3FF, /*1 1 <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1 1*/
0x007F, /*<2A> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1*/
0x00FF, /*<2A> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1 1*/
0x01FF, /*<2A> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1*/
0x01FF, /*<2A> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1 1 1*/
0x00FF, /*<2A> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1 1*/
0x007F, /*<2A> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1 1 1 1*/
0x18FF, /*<2A> <20> <20> 1 1 <20> <20> <20> 1 1 1 1 1 1 1 1*/
// 0xFC7F, /*1 1 1 1 1 1 <20> <20> <20> 1 1 1 1 1 1 1*/
// 0xF83F, /*1 1 1 1 1 <20> <20> <20> <20> <20> 1 1 1 1 1 1*/
// 0xF01F, /*1 1 1 1 <20> <20> <20> <20> <20> <20> <20> 1 1 1 1 1*/
// 0xE00F, /*1 1 1 <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1*/
// 0xE00F, /*1 1 1 <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1*/
// 0xF83F, /*1 1 1 1 1 <20> <20> <20> <20> <20> 1 1 1 1 1 1*/
// 0xF83F, /*1 1 1 1 1 <20> <20> <20> <20> <20> 1 1 1 1 1 1*/
0x800F, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1*/
0x8083, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1*/
0x8001, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1*/
0xF810, /*1 1 1 1 1 <20> <20> <20> <20> <20> <20> 1 <20> <20> <20> 1*/
0x8810, /*1 <20> <20> <20> 1 <20> <20> <20> <20> <20> <20> 1 <20> <20> <20> 1*/
0x8811, /*1 <20> <20> <20> 1 <20> <20> <20> <20> <20> <20> 1 <20> <20> <20> 1*/
0x8003, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1*/
0x8007, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1*/
0x800F, /*1 <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> 1 1 1 1*/
// 0x0000, /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
// 0x4000, /*0 <20> 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
// 0x6000, /*0 <20> <20> 0 0 0 0 0 0 0 0 0 0 0 0 0*/
// 0x7000, /*0 <20> <20> <20> 0 0 0 0 0 0 0 0 0 0 0 0*/
// 0x7800, /*0 <20> <20> <20> <20> 0 0 0 0 0 0 0 0 0 0 0*/
// 0x3000, /*0 0 <20> <20> 0 0 0 0 0 0 0 0 0 0 0 0*/
// 0x1800, /*0 0 0 <20> <20> 0 0 0 0 0 0 0 0 0 0 0*/
0x0000, /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
0x7E00, /*0 <20> <20> <20> <20> <20> <20> 0 0 0 0 0 0 0 0 0*/
0x7C00, /*0 <20> <20> <20> <20> <20> 0 0 0 0 0 0 0 0 0 0*/
0x7C00, /*0 <20> <20> <20> <20> <20> 0 0 0 0 0 0 0 0 0 0*/
0x7E00, /*0 <20> <20> <20> <20> <20> <20> 0 0 0 0 0 0 0 0 0*/
0x6700, /*0 <20> <20> 0 0 <20> <20> <20> 0 0 0 0 0 0 0 0*/
0x0200, /*0 0 0 0 0 0 <20> 0 0 0 0 0 0 0 0 0*/
// 0x0100, /*0 0 0 0 0 0 0 <20> 0 0 0 0 0 0 0 0*/
// 0x0380, /*0 0 0 0 0 0 <20> <20> <20> 0 0 0 0 0 0 0*/
// 0x07C0, /*0 0 0 0 0 <20> <20> <20> <20> <20> 0 0 0 0 0 0*/
// 0x0FE0, /*0 0 0 0 <20> <20> <20> <20> <20> <20> <20> 0 0 0 0 0*/
// 0x0380, /*0 0 0 0 0 0 <20> <20> <20> 0 0 0 0 0 0 0*/
// 0x0380, /*0 0 0 0 0 0 <20> <20> <20> 0 0 0 0 0 0 0*/
// 0x0000, /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
0x0000, /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
0x3E70, /*0 0 <20> <20> <20> <20> <20> 0 0 <20> <20> <20> 0 0 0 0*/
0x0248, /*0 0 0 0 0 0 <20> 0 0 <20> 0 0 <20> 0 0 0*/
0x0244, /*0 0 0 0 0 0 <20> 0 0 <20> 0 0 0 <20> 0 0*/
0x0242, /*0 0 0 0 0 0 <20> 0 0 <20> 0 0 0 <20> 0 0*/
0x2244, /*0 0 <20> 0 0 0 <20> 0 0 <20> 0 0 0 <20> 0 0*/
0x2248, /*0 0 <20> 0 0 0 <20> 0 0 <20> 0 0 <20> 0 0 0*/
0x3E70, /*0 0 <20> <20> <20> <20> <20> 0 0 <20> <20> <20> 0 0 0 0*/
0x0000 /*0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0*/
};
void inicializa_raton_grafico(int x1, int y1, int x2, int y2, int px, int py)
{
struct SREGS seg;
union REGS ent, sal;
long dir;
ent.x.ax = 0;
int86(0x33, &ent, &sal); /* averigua si hay rat<61>n conectado */
raton = sal.x.ax; /* indica a la variable global el estado
del raton */
if(raton!=0) {
ent.x.ax = 15;
ent.x.cx = 5;
ent.x.dx = 11;
int86(0x33, &ent, &sal); /* fija la raz<61>n mickey/pixel */
ent.x.ax = 7;
ent.x.cx = x1;
ent.x.dx = x2;
int86(0x33, &ent, &sal); /* fija la posici<63>n m<>x. y m<>n. horizontal */
ent.x.ax = 8;
ent.x.cx = y1;
ent.x.dx = y2;
int86(0x33, &ent, &sal); /* fija la posici<63>n m<>x. y m<>n. vertical */
if(!PunteroRaton) {
dir = (long)dir_raton;
ent.x.ax = 9;
ent.x.bx = 0;
ent.x.cx = 0;
ent.x.dx = (int) dir;
seg.es = (int) (dir >> 16);
int86x(0x33, &ent, &sal, &seg); /* asigna un cursor diferente */
}
ent.x.ax = 4;
ent.x.cx = px;
x_raton=ent.x.cx >> 1;
ent.x.dx = py;
y_raton=ent.x.dx;
int86(0x33, &ent, &sal); /* fija la posici<63>n del rat<61>n */
ent.x.ax = 1;
int86(0x33, &ent, &sal); /* muestra el puntero del rat<61>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 Anclar_Raton(void){
union REGS ent, sal;
do {
ent.x.ax = 3;
int86(0x33, &ent, &sal);
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
} while(boton_izq==1 || boton_der==1);
}
int Espera_Tecla_o_Raton(void){
union REGS ent, sal;
ent.x.ax = 3;
do{
int86(0x33, &ent, &sal); // lee posici<63>n y estados del bot<6F>n
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
}while( boton_izq == 0 && boton_der == 0 && kbhit()==0 );
/////////////////////////////////////////
// RETURN Derecho Izquierdo //
// //
// 0 0 0 //
// 1 1 0 //
// 2 0 1 //
// 3 1 1 //
// //
/////////////////////////////////////////
int Que;
if ( boton_der==0 && boton_izq==0 ) Que = 0;
if ( boton_der==1 && boton_izq==0 ) Que = 1;
if ( boton_der==0 && boton_izq==1 ) Que = 2;
if ( boton_der==1 && boton_izq==1 ) Que = 3;
return Que;
}