GAMEPACK/GO.CPP
2021-09-12 19:48:40 +02:00

193 lines
7.3 KiB
C++
Raw Permalink Blame History

#include <dir.h>
#include <dos.h>
#include <stdio.h>
#include <conio.h>
#include <process.h>
typedef struct
{
int x, y; // Posicion en la pantalla
char Direc[80]; // Directorio donde localizarlo
char Passw[10]; // Password
} DATOS_CD;
DATOS_CD ArbolActual[] = {
{ 2, 3, "\\arcade\\ALIEN.RAR", "neila" },
{ 2, 4, "\\arcade\\BLAM.RAR", "malb" },
{ 2, 5, "\\arcade\\BUBBLE.RAR", "elbbub" },
{ 2, 6, "\\arcade\\ERADICAT.RAR", "tacidare" },
{ 2, 7, "\\arcade\\SYNDICA2.RAR", "2acidnys" },
{ 2, 8, "\\arcade\\TOMBRAID.RAR", "diarbmot" },
{ 2, 12, "\\deportiv\\AIRBORNE.RAR", "enrobria" },
{ 2, 13, "\\deportiv\\RLA.RAR", "lra" },
{ 2, 14, "\\deportiv\\FIFA97.RAR", "79afif" },
{ 2, 15, "\\deportiv\\FUTBOL5.RAR", "5lobtuf" },
{ 2, 16, "\\deportiv\\SPACEJAM.RAR", "majecaps" },
{47, 3, "\\estrateg\\BC.RAR", "cb" },
{47, 4, "\\estrateg\\DEADLY.RAR", "yldaed" },
{47, 5, "\\estrateg\\REICH.RAR", "hcier" },
{47, 6, "\\estrateg\\RIFLES.RAR", "selfir" },
{47, 7, "\\estrateg\\HARPOON2.RAR", "2nooprah" },
{47, 8, "\\estrateg\\REDALERT.RAR", "trelader" },
{47, 12, "\\simulado\\AMOK.RAR", "koma" },
{47, 13, "\\simulado\\SCREAM2.RAR", "2maercs" },
{47, 14, "\\simulado\\SWIV3.RAR", "3viws" },
{47, 18, "\\aventura\\FABLE.RAR", "elbaf" },
{47, 19, "\\aventura\\HAVE.RAR", "evah" }
};
void DibujaPantalla(void)
{
textbackground( LIGHTGRAY );
clrscr();
textcolor( BLACK );
cprintf( " \n\r");
cprintf( " Arcade Estrategia \n\r");
cprintf( " \n\r");
cprintf( " Alien Trilogy Battle Cruiser 3000 AD \n\r");
cprintf( " Balm Machine Head Jagged Alliance \n\r");
cprintf( " Bubble Bobble Combo Third Reich \n\r");
cprintf( " Eradicator Age of Rifles \n\r");
cprintf( " Syndicate Wars 2 Harpoon 2 \n\r");
cprintf( " Tomb Raider Command Conquer Red Alert \n\r");
cprintf( " \n\r");
cprintf( " Deportivos Simuladores \n\r");
cprintf( " \n\r");
cprintf( " Espn NBA AirBorne'96 Amok \n\r");
cprintf( " Australian Rugby League Screamer 2 \n\r");
cprintf( " Fifa Soccer 97 Swiv 3D \n\r");
cprintf( " Pc Futbol v5.0 \n\r");
cprintf( " Space Jam Aventuras \n\r");
cprintf( " \n\r");
cprintf( " Fable \n\r");
cprintf( " No tengo boca y quiero gr. \n\r");
cprintf( " \n\r");
cprintf( " \n\r");
textcolor( WHITE );
cprintf( " <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");textcolor(BLACK); cprintf("<EFBFBD>\n\r");textcolor( WHITE );
cprintf( " <20> ");textcolor(BLACK); cprintf(" <20>\n\r");textcolor( WHITE );
cprintf( " <20>");textcolor(BLACK); cprintf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
};
char far *screen = (char far *)0xB8000000;
void Kit(void)
{
static char Dir = 1;
static char Pos = 0;
char longt;
for ( longt = 0; longt < 10; longt++ )
{
if ( (Dir*longt + Pos) >= 0 && (Dir*longt + Pos) <= 75 )
{
screen[ 23*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] &= 0x8F;
screen[ 23*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] |= 7<<4;
/*
gotoxy( Pos + Dir*longt + 3, 24 );
cprintf( " " );
*/
}
}
Pos += Dir;
if ( Pos < 0 -2 ) Dir = 1;
if ( Pos > 75 +2 ) Dir = -1;
for ( longt = 0; longt < 10; longt++ )
{
if ( (Dir*longt + Pos) >= 0 && (Dir*longt + Pos) <= 75 )
{
/*
gotoxy( Pos + Dir*longt + 3, 24 );
cprintf( "<22>" );
*/
screen[ 23*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] &= 0x8F;
screen[ 23*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] |= 3<<4;
}
}
delay( /*1000*/25 );
}
void main(void)
{
int ok = 0;
int Item = 0, i;
char buffer[80];
char *p;
p = searchpath("rar.EXE");
printf("Search for TLINK.EXE : %s\n", p);
if ( p == NULL )
{
printf( "Debes copiar el archivo rar.ex al path como rar.exe\n");
printf( "Ejemplo: \n");
printf( " copy rar.ex C:\\dos\\RAR.EXE \n");
return;
}
DibujaPantalla();
for ( i = 0; i < 27; i++ )
{
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] &= 0x8F;
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] |= 5<<4;
gotoxy( 4, 24 ); cprintf(" ");
textcolor( RED );
gotoxy( 4, 24 ); cprintf( "Linea de comandos: rar x -p%s %s C:", /*strrev( */ArbolActual[Item].Passw/* )*/, ArbolActual[Item].Direc );
}
while ( !ok )
{
Kit();
if ( kbhit() && (ok = getch()) == 0 )
{
for ( i = 0; i < 27; i++ )
{
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] &= 0x8F;
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] |= 7<<4;
}
switch ( getch() )
{
case 72:
Item--; if ( Item < 0 ) Item = 21;
break;
case 80:
Item++; if ( Item >= 22 ) Item = 0;
break;
}
for ( i = 0; i < 27; i++ )
{
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] &= 0x8F;
screen[ ArbolActual[Item].y*80*2 + (ArbolActual[Item].x+i)*2 + 1 ] |= 5<<4;
gotoxy( 4, 24 ); cprintf(" ");
textcolor( RED );
gotoxy( 4, 24 ); cprintf( "Linea de comandos: rar x -p%s %s C:", /*strrev( */ArbolActual[Item].Passw/* )*/, ArbolActual[Item].Direc );
}
}
if ( ok == 13 )
{
sprintf( buffer, "-p%s", ArbolActual[Item].Passw );
execl ( p, p, "x", buffer, ArbolActual[Item].Direc, "C:", NULL);
ok = 1;
}
if ( ok == 27 ) ok = 1; else ok = 0;
}
textbackground( BLACK );
textcolor( LIGHTGRAY );
clrscr();
}