First commit 13/02/1995

This commit is contained in:
José David Guillén 2021-09-12 19:56:57 +02:00
commit 0b071899d4
20 changed files with 654 additions and 0 deletions

30
CIV2T.CPP Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
void main( int argc, char *argv[] )
{
char c;
FILE *f;
long longw = 0xABCDEF01;
if ( argc != 2 || (f = fopen( argv[1], "a+b" )) == NULL )
{
printf( "Fichero %s no existe...\n\n", argv[1] );
exit(-1);
}
c = 4;
fseek( f, 0x14 , SEEK_SET );
fwrite( &c, sizeof(char), 1, f );
c = 0;
fseek( f, 0x14FD , SEEK_SET );
fwrite( &c, sizeof(char), 1, f );
fseek( f, 0x1A71 , SEEK_SET );
fwrite( &c, sizeof(char), 1, f );
fseek( f, 0x242C1 , SEEK_SET );
fwrite( &c, sizeof(char), 1, f );
fclose(f);
}

BIN
CIV2T.EXE Normal file

Binary file not shown.

24
CLASS.CPP Normal file
View File

@ -0,0 +1,24 @@
#include <iostream.h>
class Prueba {
public:
Prueba( int X, int Y ){ cout<<"\nObjeto creado con X:"<<X<<", Y:"<<Y; };
~Prueba(){ cout<<"\n Objeto destruido" ; };
private:
int x;
int y;
};
void main(void)
{
Prueba *p;
p = new Prueba(5,9);
delete p;
}

BIN
CLASS.EXE Normal file

Binary file not shown.

36
DINERO.CPP Normal file
View File

@ -0,0 +1,36 @@
#include <stdio.h>
void main ( int argc, char *argv[] )
{
char buffer[4] = "123";
FILE *file;
printf( " JD Soft. _-ùFuTuRe ViSiOnù-_ \n " );
printf( "\n " );
printf( " A que jode cuando te quedas sin dinero, eh! \n " );
printf( " pues ahora ese problema se va a acabar... \n " );
printf( "\n " );
printf( "NOTA: Solo valido para la civiliz. de los GRIEGOS: ( la mia!!! )\n " );
if ( argc != 2 )
{
printf ( " debe especificar la partida a MODIFICAR!!! \n " );
} else {
if ( ( file = fopen( argv[1], "r+b" ) ) == NULL )
{
printf ( " No se pudo abrir el fichero, sigue racaneando pasta por hay... \n" );
} else {
buffer[0] = 0x30;
buffer[1] = 0x75;
buffer[2] = 0x00;
fseek( file, 0x2990 + 2, SEEK_SET );
fwrite( &buffer, sizeof( char ), 2, file );
fclose( file );
}
}
}

BIN
DINERO.EXE Normal file

Binary file not shown.

BIN
EGAVGA.BGI Normal file

Binary file not shown.

402
JD_DEMO1.CPP Normal file
View File

@ -0,0 +1,402 @@
/* ESPIRAL: dibuja espirales poligonales aleatorias */
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <dos.h>
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
#define FONDO_BLANCO 0x40 // Ahora he puesto rojo sobre negro
#define FONDO_NEGRO 0x04
#define TAMA_MENSAJE 80
void muestra_mensaje(char far *);
void imprime(char *columna);
void corre_1izq(char far *p1);
void pone_atributos(void);
void copy_cadena(char *destino, char *origen);
char far *punt=(char far *) 0xb8000000;
char matriz[16];
char mensaje[TAMA_MENSAJE]="JD & VD: PRESENTAN..\0";
char far *dir, far *pfar;
char columna[16];
int speed=3;
char f=2;
/* constantes y variables globales */
#define PAUSA 0 /*3 segundos de pausa entre espirales*/
int maxcol; /*l¡mite de colores*/
int centroX; /*coordenadas del centro de la pantalla*/
int centroY;
double cuadra; /*factor de cuadratura*/
double pi; /*n£mero pi*/
double grad; /*constante de conversi¢n grados/radianes*/
int dimx,dimy; /*dimensiones pantalla (n£mero pixels)*/
int texto_grande(char *texto);
/* prototipos de funciones: */
extern int far Svga256_fdriver[];
int huge DetectVGA256()
{
int Vid=0;
return Vid;
}
void Inicia_Graficos(void);
void Muestra_256c(void);
void Espiral(void);
/********************************************************************
* main
********************************************************************/
void main(void)
{
Inicia_Graficos();
while (kbhit()) getch(); /*vac¡a buffer*/
Muestra_256c();
texto_grande("Esto es solo una demostacion");
texto_grande("de como puede ser nuestro");
texto_grande("DEMO_DEMO_DEMO");
while (! kbhit()) { /*sale con una tecla*/
Espiral(); /*dibuja una espiral*/
}
if (kbhit()) getch(); /*vac¡a posibles teclas*/
closegraph(); /*vuelve al modo texto*/
}
/********************************************************************
* Espiral: dibuja una espiral poligonal aleatoria.
********************************************************************/
void Espiral(void) /*<1>*/
{
double r; /* radio */
double ia; /* incremento  ngulo */
double ir; /* incremento radio */
double rlim; /* l¡mite radio */
double s,c,old_s,old_c; /* seno y coseno actuales <2> */
double ca,old_ca; /* coseno anterior */
double isin,icos; /* incremento seno y coseno */
int x,y;
int old_x,old_y;
int old_col;
int ang=0;
rlim = centroY*2.5; /*fija l¡mite*/
ia = (double)( (rand()%3600)/10.0); /*extrae incrementos <3>*/
ir = 1.0+(double)((rand()%200)/100.0);
isin = sin(ia*grad);
icos = cos(ia*grad);
setcolor( (old_col=1+rand()%96) ); /*y color, no negro <4>*/
cleardevice(); /*borra pantalla*/
////////// Comienza rotaci¢n sobre espiral: Aunque el resto del programa espiral
// es un parche de un ejemplo, esta funci¢n ha sido creada por J.D.
////////// Por favor no borre estas lineas...
ang=1;
do{
r = 0.0; /*parte del centro*/
old_s=sin(ang-1); s = sin(ang);
old_c=cos(ang-1); c = cos(ang);
x=old_x=centroX;
y=old_y=centroY;
while (r < rlim) {
moveto(old_x,old_y);
old_ca = old_c;
old_c = old_c * icos-old_s *isin;
old_s = old_s * icos+old_ca *isin;
old_x = centroX + (int)(floor(r* old_c * cuadra+0.5));
old_y = centroY + (int)(floor(r* old_s + 0.5));
setcolor(0);
lineto(old_x,old_y);
moveto(x,y);
ca = c; /*copia coseno*/
c = c * icos-s *isin; /*nuevo coseno <5>*/
s = s * icos+ca *isin; /*nuevo seno*/
x = centroX + (int)(floor(r * c * cuadra+0.5)); /*nuevas coordenadas <6>*/
y = centroY + (int)(floor(r * s + 0.5));
setcolor(old_col);
lineto(x,y); /*traza l¡nea*/
r += ir; /*incrementa radio*/
}
ang++;
}while( ang<180);
}
void Inicia_Graficos(void){
int Gd = 0;
int Gm = 0;
installuserdriver("Svga256",DetectVGA256);
/* If driver is linked with file, remove comments */
/* registerfarbgidriver(Svga256_fdriver); */
initgraph(&Gd,&Gm,"");
maxcol = getmaxcolor(); /*color m s alto*/
dimx = getmaxx()+1; /*y l¡mites pantalla*/
dimy = getmaxy()+1;
centroX = dimx/2; /*calcula centro <2>*/
centroY = dimy/2;
cuadra = (dimx/(double)dimy)/(4.0/3.0); /*cuadratura <3>*/
pi = 4.0*atan(1.0); /*n£mero pi <4>*/
grad = pi/180.0; /*constante convers. <5>*/
}
void Muestra_256c(void){
int a_x, a_y;
int x, y, col=0, col_e;
int x_x, y_y, X_x, Y_y;
a_x = dimx / 16;
a_y = dimy / 16;
if(maxcol==255)
for(y=0; y<16; y++)
for(x=0; x<16; x++) {
setfillstyle(1, col);
bar(x*a_x, y*a_y, a_x+(x*a_x), a_y+(y*a_y));
col++;
}
////// Elige un color, (no negro):
col=0;
col_e=(1+(rand()%2540)/10);
////// lo busca en la paleta:
for(y=0; y<16 && col!=col_e; y++)
for(x=0; x<16 && col!=col_e; x++) {
setfillstyle(1, 1);
bar(x*a_x, y*a_y, a_x+(x*a_x), a_y+(y*a_y));
delay(50);
setfillstyle(1, col);
bar(x*a_x, y*a_y, a_x+(x*a_x), a_y+(y*a_y));
col++;
}
////// lo amplia:
setfillstyle(1, col_e);
x_x = (x*a_x);
y_y = (y*a_y);
X_x = (a_x+(x*a_x));
Y_y = (a_y+(y*a_y));
while( x_x > 0 || X_x < 320 || y_y > 0 || Y_y < 200 ){
bar(x_x , y_y, X_x, Y_y );
if (x_x>0) x_x--;
if (X_x<320) X_x++;
if (y_y>0) y_y--;
if (Y_y<200) Y_y++;
}
char c[5];
settextstyle(0, 0, 24);
for(y=5; y>=0; y--){
for(x=0; x<5; x++) {
setfillstyle(1, 0);
bar(0,0,dimx,dimy);
setfillstyle(1, col_e);
bar(0,0,dimx,dimy);
}
sprintf(c, "%d", y);
outtextxy(64, 4, c);
}
}
int texto_grande(char *texto)
{
char *p=mensaje;
int ch=0,loop=0;
copy_cadena( p, texto);
// speed=atoi(argv[2]);
// if (((ch=(argv[3][0]))=='L') || ch=='l')
// loop=1;
// f=((argv[4][0]-'0')>1) ? 2 : 1;
closegraph(); /*vuelve al modo texto*/
// clrscr();
pone_atributos();
_setcursortype(_NOCURSOR);
asm {
push ax
push bx // Salvamos los registros principales ...
push cx // que ser n afectados por la interrupci¢n.
push dx
push es
push bp
mov ah,0x11
mov al,0x30
mov bh,6 // Juego de caracteres de la ROM-BIOS de 8*16
int 0x10 // Devuelve en ES:BP la direcci¢n del J. de chars.
}
pfar=(char far *) MK_FP(_ES, _BP);// pfar=DIR. del J. de Chars.
asm {
pop bp
pop es
pop dx // restauramos los registros
pop cx
pop bx
pop ax
}
do
muestra_mensaje(pfar);
while (!kbhit() && loop);
_setcursortype(_NORMALCURSOR);
punt=pfar=p=NULL;//Esto NO es necesario pero est  bien.
clrscr();
Inicia_Graficos();
return (0); //Si todo va bien retornamos 0.
}
void muestra_mensaje(char far *buffer)
{
int c,c1,si_no,i=0;
char ch;
si_no=0;
while (mensaje[i]) {
dir=buffer;
dir+=16*mensaje[i++];
for ( c=0; c<16; c++)
matriz[c]=*dir++;
for (c1=0; c1<8; c1++)
for ( c=0; c<16; c++){
ch=matriz[c];
ch&=0x80; // Para ver si el MSB est  a 1 o 0.
columna[c]=ch;
matriz[c]<<=1;
if (si_no++%2) { // Esto es para que no sean tan anchas
imprime(columna);//las letras (las dejo en la mitad)
delay(speed);
}
}
} // End while
} // End funci¢n muestra_mensaje
void imprime(char *columna)
{
int i;
char far *p1=(char far *) 0xb8000000;
// Aqui va una funci¢n que realiza un SCROLL horizontal a la izq.
for (i=0; i<79; i++) {
corre_1izq(p1+2);
p1+=2;
}
for ( i=0, p1=(char far *) 0xb8000000+(80*2)-2; i<16; i++, p1+=160*f)
if (*columna++) {
*p1='Û';
*(p1+160)='Û';
} else {
*p1=' ';
*(p1+160)=' ';
}
}
void corre_1izq(char far *p1)
{
int i;
char far *p=p1-2;
for ( i=0; i<25; i++) {
*p=*p1;
p+=160;
p1+=160;
}
}
void pone_atributos(void)
{
char far *p, far *p1=(char far *) 0xb8000000+1-2;
int i,j;
p=p1;
for (i=0; i<47; i++) {
p1+=2;
p=p1;
for (j=0; j<25; j++) {
*p=FONDO_BLANCO;
p+=160;
}
}
for (i=0; i<41; i++) {
p1+=2;
p=p1;
for (j=0; j<25; j++) {
*p=FONDO_NEGRO;
p+=160;
}
}
}
void copy_cadena(char *destino, char *origen){
while (*destino++=*origen++) /*nada*/;
}

BIN
JD_DEMO1.EXE Normal file

Binary file not shown.

BIN
MLETRA.EXE Normal file

Binary file not shown.

51
PCX.CPP Normal file
View File

@ -0,0 +1,51 @@
#define RES_X 320
#define RES_Y 200
/**************************************************************************\
|* *|
|* MuestraImagen *|
|* *|
|* Descripci¢n: *|
|* Descomprime y copia a la pagina indicada un PCX *|
|* *|
|* Entradas: nombre de la imagen *|
|* *|
|* *|
|* Salidas: OK Todo ha ido bien *|
|* ERROR Algo va mal *|
|* *|
\**************************************************************************/
int MuestraImagen( char *file )
{
int alto, ancho, contador;
unsigned char byte;
FILE *fp;
if ( (fp = fopen( file,"rb")) != NULL )
{
// Saltamos la cabecera
fseek( fp, 128, SEEK_SET );
for(alto=0; alto<RES_Y; alto++)
{
for(ancho=0; ancho<RES_X; )
{
byte=getc(fp);
if(byte<=0xC0)
{
set_point (ancho, alto, byte);
ancho++;
} else {
contador=byte&0x3F; byte=getc(fp);
for(; contador>0; contador--)
{
set_point (ancho, alto, byte);
ancho++;
}
}
}
}
fclose(fp);
} else return ERROR;
return OK;
}

32
RAR.CPP Normal file
View File

@ -0,0 +1,32 @@
#include <stdio.h>
#include <conio.h>
void main( int argc, char *argv[] )
{
int i;
unsigned char *aux;
printf ( "\n Linea de parametros fue: \n" );
for ( i = 0; i < argc; i++ )
printf ( "%s ", argv[i] );
printf( "\n \n \n ¨Deletrear linea de comandos? (S/-): \n " );
switch( getch() )
{
case 'S':
case 's':
for ( i = 1; i < argc; i++ )
{
printf( "\n" );
aux = argv[i];
do {
printf ( "%03d %c + ", (unsigned int)(*aux), (unsigned char)(*aux) );
} while ( *(++aux) != '\0' );
}
getch();
break;
}
}

BIN
RAR.EXE Normal file

Binary file not shown.

9
README.md Normal file
View File

@ -0,0 +1,9 @@
#varios
*13/02/1995*
ToDo: wwtcf?
![screenshot](/varios.png "Screenshot")

20
SERIE.CPP Normal file
View File

@ -0,0 +1,20 @@
#include <stdio.h>
#include <conio.h>
#include <bios.h>
#include "serutil.h"
void main ( void )
{
char key;
clrscr();
while ( ( key = getch() ) != 27 )
{
if ( ser_WriteByte( 1, 0xFF, 1, 0, 0 ) != 0 )
printf ( "\n Error !!! " );
}
}

BIN
SERIE.EXE Normal file

Binary file not shown.

BIN
SERIE.PRJ Normal file

Binary file not shown.

BIN
SVGA256.BGI Normal file

Binary file not shown.

50
TEST.CPP Normal file
View File

@ -0,0 +1,50 @@
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void main( int argc, char *argv[] )
{
int src, dst;
printf( "\n\n---------------------\n\n" );
printf( "JD soft.\nTest Program...\n\n" );
printf( "Usage:\n TestPort [src] [dst] \n and write character's to send...\n" );
printf( "or TestPort [src] 0 (To send 0xFF to [src]\n");
printf( "\nNote: [src] & [dst] on Hex\n\n---------------------");
if ( argc <= 1 ) return;
char *endptr, key;
int Reset = 1;
src = strtoul( argv[1], &endptr, 16);
dst = strtoul( argv[2], &endptr, 16);
if ( argc == 3 )
{
printf( "\n\nWriting: %X to %X \n(Press key to send)", src, dst );
while( (key=getch()) != 27 )
{
printf ( "\nSend: %X (%c)", key, key );
outportb( src, key );
key = inportb( dst );
printf ( " and Receive: %X (%c)", key, key );
}
} else {
printf( "\n\nWriting: %X \n(Press key to switch bettewn 0 and 0xFF)", src );
while( (key=getch()) != 27 )
{
if ( Reset )
{
outportb( src, 0xFF );
printf ( "\nSend: 0xFF" );
} else {
outportb( src, 0 );
printf ( "\nSend: 0" );
}
Reset = !Reset;
}
}
}

BIN
TEST.EXE Normal file

Binary file not shown.