TEXTO/SNES.CPP
2021-09-12 19:55:53 +02:00

624 lines
23 KiB
C++

#include <alloc.h>
#include <stdlib.h>
#include <mem.h>
#include <conio.h>
#include <math.h>
#include <dos.h>
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
/////////////////// Otro tipo de fondo: LLuvia de estrellas
typedef struct
{
int Ex, Ey, Ez;
char Ecolor;
} CAMPO_de_ESTRELLAS;
CAMPO_de_ESTRELLAS *Cestrellas, *o;
void Actualiza(CAMPO_de_ESTRELLAS *Cest);
void Star3d(CAMPO_de_ESTRELLAS *Cest);
void pon_estrella(CAMPO_de_ESTRELLAS *Cest);
void llena_campo(CAMPO_de_ESTRELLAS *Cest);
void deinit_star(void);
void init_star(void);
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
// Escribe un caracter en (x,y) -> Color|Fondo en VText 0x7900
#define WriteChar50( x, y, caracter, Col, Fon, VText ) VText[80*y + x] = (((unsigned)caracter)&0x00FF) | (((unsigned)( (Fon<<4)+Col )<<8)&0xFF00);
/*
( (Fon<<4)+Col )
( ( (int)( (char)Fon << 4) + Col )<< 8 )
7 6 5 4 º 3 2 1 0
ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ×ÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿
³ B ³ b ³ b ³ b º f ³ f ³ f ³ f ³
ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ×ÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ
º
In this 8-bit newattr parameter,
þ ffff = 4-bit foreground color (0 to 15)
þ bbb = 3-bit background color (0 to 7)
þ B = blink-enable bit
*/
// Proyecto para mostrar cosas en modo texto: 80x50
// Preparamos un buffer virtual a pantalla: 80x50*2 bytes/punto = 8000 bytes
int *textoVirtual;
int XSinMov[256], YSinMov[256];
int TSin[360+90];
void RellenaTablas(void)
{
float angle;
angle = 0;
while( angle < 256 )
{
XSinMov[angle] = YSinMov[angle] = (int)( sin( (2*M_PI*angle*1.4)/360 ) * 360) / (2*M_PI);
YSinMov[angle] = 0;
angle+=1;
};
angle = 0;
while( angle < (360+90) )
{
TSin[angle] = (int)(sin( (2*M_PI*angle)/360 ) * 360 / (2*M_PI) );
angle+=1;
};
}
char PRIMARIO8 = YELLOW; char SECUNDARIO1 = RED;
void Put( int x, int y, unsigned char c)
{
if ( x < 0 || x >= 80 ) return;
if ( y < 0 || y >= 50 ) return;
WriteChar50( x, y, '±', (c==0 ? 0 : PRIMARIO8), SECUNDARIO1, textoVirtual );
};
//#define RADIO 255
// Radio de partida
#define RADIO 255
#define SALTOS_ANCHOS 7
//#define SALTOS_PROFUNDOS 8
// Grado de torcion
#define SALTOS_PROFUNDOS 8
//#define SALTOS_ANCHOS 7
// Saltos de radio
#define BLOQUEO_RADIO 1
#define INCREMENTAL 1
//#define PROFUNDIDAD_TUNEL 35
#define PROFUNDIDAD_TUNEL 35
#define FACTOR_SERPIENTE 0.015F
//#define TODO_BLANCO
//#define TODO_GRIS
int PERFECCION_CIRCULO = 8;
// Circulo con impresi¢n de giro ( MEJORA POR JD )
void Circulo( int x, int y, int radio, int giro, int Color )
{
int angle;
for ( angle = 0; angle < 360; angle+=PERFECCION_CIRCULO )
Put( x + (radio*FACTOR_SERPIENTE*TSin[ (giro + angle)%360 + 90 ]), y + (radio*FACTOR_SERPIENTE*TSin[ (giro+angle)%360 ]), angle >= 0 && angle <= 50 ? (Color-PROFUNDIDAD_TUNEL) : Color );
};
// Circulo con impresi¢n de giro ( MEJORA POR JD )
void CirculoB( int x, int y, int radio, int giro )
{
int angle;
for ( angle = 0; angle < 360; angle+=PERFECCION_CIRCULO )
Put( x + (radio*FACTOR_SERPIENTE*TSin[ (giro + angle)%360 + 90 ]), y + (radio*FACTOR_SERPIENTE*TSin[ (giro+angle)%360 ]), 0 );
};
void TunelEstrellas(void)
{
int depth, Color;
static unsigned char ZMov = 0;
static int GiroAngular = 0;
unsigned char Movimiento = ZMov;
static Subidon = 255;
static Velocidad = 0;
// Controles de giro por JD:
// SUAVE ZMov
// DURO Movimiento
int OGiroAngular = GiroAngular;
GiroAngular = ( GiroAngular++ ) % 360;
ZMov ++;
Movimiento = ZMov;
Color = 255-PROFUNDIDAD_TUNEL;
// Color = 255;
Velocidad++;
if ( Velocidad == 5 )
{
Velocidad = 0;
// Subidon --; if ( Subidon < 255-PROFUNDIDAD_TUNEL ) Subidon = 255;
Subidon = (Subidon++)%PROFUNDIDAD_TUNEL;
}
int Retorcido = 0;
for ( depth=0; depth<SALTOS_ANCHOS*PROFUNDIDAD_TUNEL; depth+=SALTOS_ANCHOS*INCREMENTAL, Movimiento+=SALTOS_PROFUNDOS, Color++ )
// for ( depth=INCREMENTAL*SALTOS_ANCHOS*(PROFUNDIDAD_TUNEL-1); depth>=0; depth-=SALTOS_ANCHOS*INCREMENTAL, Movimiento+=SALTOS_PROFUNDOS, Color-- )
{
Retorcido+=15;
/*
OGiroAngular = GiroAngular;
GiroAngular = ( GiroAngular++ ) % 360;
*/
// Borra el anterior
CirculoB( XSinMov[(unsigned char)(Movimiento-1)] + 40, YSinMov[(unsigned char)(Movimiento-1)] + 25, RADIO - depth*BLOQUEO_RADIO, OGiroAngular + 0*Movimiento + Retorcido );
Subidon = (Subidon++)%PROFUNDIDAD_TUNEL;
// Dibuja el nuevo circulo
// Circulo( XSinMov[Movimiento] + 160, YSinMov[Movimiento] + 100, RADIO - depth*BLOQUEO_RADIO, GiroAngular + 0*Movimiento, (Subidon >= Color && Subidon <= Color + 2 ) ? 1: Color );
Circulo( XSinMov[Movimiento] + 40, YSinMov[Movimiento] + 25, RADIO - depth*BLOQUEO_RADIO, GiroAngular + 0*Movimiento + Retorcido, Subidon%6 == 0 || Subidon%6 == 1 ? 1+Subidon : Color);
}
delay(10);
}
// Escribe un caracter en (x,y) -> Color|Fondo en VText 0x7900
#define WriteChar50( x, y, caracter, Col, Fon, VText ) VText[80*y + x] = (((unsigned)caracter)&0x00FF) | (((unsigned)( (Fon<<4)+Col )<<8)&0xFF00);
class TextoAnimado
{
private:
int *pPlanoVirtual;
int *sPlanoVirtual;
int *tPlanoVirtual;
public:
TextoAnimado(void);
~TextoAnimado(void){ delete [] pPlanoVirtual; delete [] sPlanoVirtual; delete [] tPlanoVirtual; };
void locateText( int x, int y, unsigned char *texto, char color, char fondo );
void VuelcaPantallas(void);
void BorraTodo(void) { memset( MK_FP( 0xB800, 0 ), 0, 8000 );
memset( tPlanoVirtual, 0, 8000 );
memset( pPlanoVirtual, 0, 8000 );
memset( sPlanoVirtual, 0, 8000 ); };
int *pPlano(void){ return pPlanoVirtual; };
int *sPlano(void){ return sPlanoVirtual; };
};
void TextoAnimado::locateText( int x, int y, unsigned char *texto, char color, char fondo )
{
while( *texto != '\0' )
{
if ( (*texto) != (unsigned char)'ú' )
{
WriteChar50( x++, y, *(texto++), color, fondo, pPlanoVirtual )
} else {
WriteChar50( x++, y, 0, 0, 0, pPlanoVirtual )
texto++;
}
}
}
TextoAnimado::TextoAnimado(void)
{
if ( ( pPlanoVirtual = new int [4000] ) == NULL )
{
pPlanoVirtual = sPlanoVirtual = tPlanoVirtual = (int *)MK_FP( 0xB800, 0 );
} else
if ( ( sPlanoVirtual = new int [4000] ) == NULL )
{
sPlanoVirtual = tPlanoVirtual = (int *)MK_FP( 0xB800, 0 );
} else
if ( ( tPlanoVirtual = new int [4000] ) == NULL )
tPlanoVirtual = (int *)MK_FP( 0xB800, 0 );
}
void TextoAnimado::VuelcaPantallas(void)
{
int count = 3999;//4000;
int * dest, * scr;
// Volcamos el segundo plano, ENTERO
memcpy( tPlanoVirtual, sPlanoVirtual, 8000 );
// Volcamos el primer plano, pero cuidado caracter ú == transparente
dest = tPlanoVirtual;
scr = pPlanoVirtual;
while( count-- )
{
if ( *scr )
{
*(dest++) = *(scr++);
} else {
scr++; dest++;
}
};
memcpy( MK_FP( 0xB800, 0 ), tPlanoVirtual, 8000 );
}
TextoAnimado prueba1;
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
#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, 2, "a\\Aerofght.smc", "neila" },
{ 2, 5, "d\\darkness.smc", "neila" },
{ 2, 6, "d\\dazebefo.smc", "neila" },
{ 2, 7, "d\\dbzlots.smc", "neila" },
{ 2, 8, "d\\demonbla.smc", "neila" },
{ 2, 9, "d\\demoncre.smc", "neila" },
{ 2, 10, "d\\devilsto.smc", "neila" },
{ 2, 11, "d\\dezaemon.smc", "neila" },
{ 2, 12, "d\\dochers.smc", "neila" },
{ 2, 13, "d\\dokapon2.smc", "neila" },
{ 2, 14, "d\\doluckyp.smc", "neila" },
{ 2, 15, "d\\donkeykc.smc", "neila" },
{ 2, 16, "d\\donkeyko.smc", "neila" },
{ 2, 17, "d\\doraemon.smc", "neila" },
{ 2, 18, "d\\doubled5.smc", "neila" },
{ 2, 19, "d\\doenworl.smc", "neila" },
{ 2, 20, "d\\dragon.smc", "neila" },
{ 2, 21, "d\\dragonvi.smc", "neila" },
{ 2, 22, "d\\dreambak.smc", "neila" },
{ 2, 23, "d\\dropzone.smc", "neila" },
{ 2, 26, "f\\F1hero94.smc", "neila" },
{ 2, 27, "f\\F1polep2.smc", "neila" },
{ 2, 28, "f\\Famfishm.smc", "neila" },
{ 2, 29, "f\\Familyci.smc", "neila" },
{ 2, 30, "f\\Fantasy3.smc", "neila" },
{ 2, 31, "f\\Fzero.smc", "neila" },
{ 50, 2,"g\\Ghostsan.smc", "neila" },
{ 50, 5, "M\\Madden95.smc", "neila" },
{ 50, 6, "M\\Magnabra.smc", "neila" },
{ 50, 7, "M\\Mahjong2.smc", "neila" },
{ 50, 8, "M\\Mahjongg.smc", "neila" },
{ 50, 9, "M\\Majang3.smc", "neila" },
{ 50, 10, "M\\Makeruna.smc", "neila" },
{ 50, 11, "M\\Mario-ea.smc", "neila" },
{ 50, 12, "M\\Marioall.smc", "neila" },
{ 50, 13, "M\\Mariowor.smc", "neila" },
{ 50, 16, "P\\Parodius.smc", "neila" },
{ 50, 17, "P\\Pbobble.smc", "neila" },
{ 50, 18, "P\\Pilot.smc", "neila" },
{ 50, 19, "P\\Punchout.smc", "neila" },
{ 50, 22, "S\\Sunsetro.smc", "neila" },
{ 50, 23, "S\\Superbom.smc", "neila" },
{ 50, 26, "U\\Uniracer.smc", "neila" },
{ 50, 27, "U\\Unsquadr.smc", "neila" },
{ 50, 30, "W\\Wings2.smc", "neila" },
};
void DibujaPantalla(void)
{
clrscr();
prueba1.locateText( 0, 0, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 1, "úAúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúGúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 2, "úú Aero Fighter úúúúúúúúúúúúúúúúúúúúúúúúúú Ghost'an'Gobblinsúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 3, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 4, "úDúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúMúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 5, "úú Lord of Darkness úúúúúúúúúúúúúúúúúúúúúúúúúú Madden NFL'95 úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 6, "úú Daze Before Chrismas úúúúúúúúúúúúúúúúúúúúúúúúúú Magna Braban úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 7, "úú Dragon Ball Z LOTS úúúúúúúúúúúúúúúúúúúúúúúúúú Super Mahjongg2 úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 8, "úú Demon's Blazon úúúúúúúúúúúúúúúúúúúúúúúúúú Mahjong Goku Tenjiku úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0, 9, "úú Demon's Crest úúúúúúúúúúúúúúúúúúúúúúúúúú Majang 3 úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,10, "úú Devil Storm úúúúúúúúúúúúúúúúúúúúúúúúúú Makeruna MakeDou úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,11, "úú Dezaemon úúúúúúúúúúúúúúúúúúúúúúúúúú Fun with Numbers úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,12, "úú Bakto! Dochers úúúúúúúúúúúúúúúúúúúúúúúúúú Super Mario all Star úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,13, "úú Dokapon2 úúúúúúúúúúúúúúúúúúúúúúúúúú Super Mario World úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,14, "úú Dolucky Puzzle Tour úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,15, "úú Donkey Kong Country úúúúúúúúúúúúúúúúúúúúúúúúúPúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,16, "úú Donkey Kong Country2 úúúúúúúúúúúúúúúúúúúúúúúúúú Parodius úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,17, "úú Doraemon Tokihougyok úúúúúúúúúúúúúúúúúúúúúúúúúú Puzzle Bobble úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,18, "úú DD5 The Shadow Falls úúúúúúúúúúúúúúúúúúúúúúúúúú Pilot Wings úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,19, "úú Down the World úúúúúúúúúúúúúúúúúúúúúúúúúú Super Punch-Out! úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,20, "úú Dragon - Bruce Lee úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,21, "úú Dragon View úúúúúúúúúúúúúúúúúúúúúúúúúSúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,22, "úú Dream Basketball DH úúúúúúúúúúúúúúúúúúúúúúúúúú Sunset Riders úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,23, "úú DropZone úúúúúúúúúúúúúúúúúúúúúúúúúú Super Bomberman úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,24, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,25, "úFúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúUúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,26, "úú F-1 Hero 94 úúúúúúúúúúúúúúúúúúúúúúúúúú Uniracer úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,27, "úú F1 Pole Position 2 úúúúúúúúúúúúúúúúúúúúúúúúúú U.N. Squadron úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,28, "úú FamFishM úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,29, "úú Family City úúúúúúúúúúúúúúúúúúúúúúúúúWúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,30, "úú Final Fantasy 3 úúúúúúúúúúúúúúúúúúúúúúúúúú Wings races high úú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,31, "úú F-Zero úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", BLACK, LIGHTGRAY );
prueba1.locateText( 0,32, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúNúúúúúúúúúlúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,33, "úúúúúúúúúúúúúúúúúúúúúúúúúúúlúúúúúúúlúúúúúúúúúoúúúúúúúúúoúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,34, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúúoúúúúúúúúúúúúúSúúúúúúgúrúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,35, "úúúúúúúúúúúúúúúúúúúúúúúúúgúeúúúSú Sol NegúúúúúNúeúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,36, "úúúúúúúúúúúúúúúúúúúúúlúoúúúúNúúúegro Sol Núúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,37, "úúúúúúúúúúúúúúúúúúúúúúúúúSúúúúgro Sol NegroúúúúSúoúúúúNúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,38, "úúúúúúúúúúúúúúúúoúrúúúúúúúúúSol Negro Sol Negúúúúúúlúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,39, "úúúúúúúúúúúúúúúúúúúúgúeúNúúSol Negro Sol Negroúúúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,40, "úúúúúúúúúúúúúúúúúúúúúúúúúúúúl Negro Sol Negroúúúeúúúúoúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,41, "úúúúúúúúúúúúúúúúúúúúúlúoúSúúúNegro Sol Negroúúúúúgúrúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,42, "úúúúúúúúúúúúúúúúúeúNúúúúúúúúúúro Sol NegroúúúúSúúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,43, "úúúúúúúúúúúúúúúúúúúúúúgúeúNúúúúúSol NegrúúúNúúúúoúlúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,44, "úúúúúúúúúúúúúúúúúúoúrúúúúúúúoúúúúúúúúúúúúúúúeúúúúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 0,45, "úúúúúúúúúúúúúúúúúúúúúúúúúúlúúúúoúúúúSúúúúúúúúgúúúúúúúúúúúúúúúúúúúúúúúúúúúú", WHITE, BLACK );
prueba1.locateText( 1,46, "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ", WHITE, LIGHTGRAY);textcolor(BLACK); prueba1.locateText(78,46, "¿", BLACK, LIGHTGRAY);
prueba1.locateText( 1,47, "³", WHITE, LIGHTGRAY);prueba1.locateText( 2,47, " ³", BLACK, LIGHTGRAY);
prueba1.locateText( 1,48, "À", WHITE, LIGHTGRAY);textcolor(BLACK); prueba1.locateText( 2,48, "ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ", BLACK, LIGHTGRAY);
};
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[ 47*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] &= 0x8F;
screen[ 47*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] |= 7<<4;
/*
gotoxy( Pos + Dir*longt + 3, 24 );
prueba1.locateText( 0, 0, " " );
*/
}
}
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 );
prueba1.locateText( 0, 0, "þ" );
*/
screen[ 47*80*2 + ( Pos + Dir*longt + 2)*2 + 1 ] &= 0x8F;
screen[ 47*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;
screen =(char *) prueba1.pPlano();
p = searchpath("snes.EXE");
printf("Search for snes.EXE : %s\n", p);
if ( p == NULL )
{
printf( "Debes copiar el EMULADOR SNES al path como snes.exe\n");
printf( "Ejemplo: \n");
printf( " copy snes.ex C:\\dos\\snes.EXE \n");
return;
}
textmode( C4350 );
RellenaTablas(); _setcursortype( _NOCURSOR ); prueba1.BorraTodo(); textoVirtual = prueba1.sPlano();
init_star();
DibujaPantalla();
for ( i = 0; i < 22; 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;
}
prueba1.locateText( 4, 47, " ", LIGHTGRAY, LIGHTGRAY );
sprintf( buffer, "Linea de comandos: snes %s", /*ArbolActual[Item].Passw,*/ ArbolActual[Item].Direc );
prueba1.locateText( 4,47, buffer, RED, LIGHTGRAY );
while ( !ok )
{
TunelEstrellas();
// Actualiza(Cestrellas);
prueba1.VuelcaPantallas();
Kit();
if ( kbhit() && (ok = getch()) == 0 )
{
for ( i = 0; i < 22; 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 = 44;
break;
case 80:
Item++; if ( Item > 44 ) Item = 0;
break;
}
for ( i = 0; i < 22; 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;
}
prueba1.locateText( 4, 47, " ", LIGHTGRAY, LIGHTGRAY );
// sprintf( buffer, "Linea de comandos: rar x -p%s %s C:", /*strrev( */ArbolActual[Item].Passw/* )*/, ArbolActual[Item].Direc );
sprintf( buffer, "Linea de comandos: snes %s", /*ArbolActual[Item].Passw,*/ ArbolActual[Item].Direc );
prueba1.locateText( 4,47, buffer, RED, LIGHTGRAY );
}
if ( ok == 13 )
{
// sprintf( buffer, "-p%s", ArbolActual[Item].Passw );
execl ( p, p, ArbolActual[Item].Direc, NULL);
ok = 1;
}
if ( ok == 27 ) ok = 1; else ok = 0;
}
textbackground( BLACK );
textcolor( LIGHTGRAY );
textmode( C80 );
clrscr();
deinit_star();
}
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
void init_star(void)
{
randomize();
if ( ( Cestrellas = (CAMPO_de_ESTRELLAS *)malloc( sizeof(CAMPO_de_ESTRELLAS)*200 ) ) == NULL ) return;
if ( ( o = (CAMPO_de_ESTRELLAS *)malloc( sizeof(CAMPO_de_ESTRELLAS)*200 ) ) == NULL ) return;
llena_campo(Cestrellas);
}
void deinit_star(void)
{
free( Cestrellas );
free( o );
}
void llena_campo(CAMPO_de_ESTRELLAS *Cest)
{
int estrellas;
for ( estrellas = 0; estrellas < 200; estrellas++ )
pon_estrella( &Cest[estrellas] );
}
void pon_estrella(CAMPO_de_ESTRELLAS *Cest)
{
Cest -> Ex = random(40)+1;
Cest -> Ey = random(25)+1;
Cest -> Ez = 100 ;
Cest -> Ecolor = WHITE;
}
void Star3d(CAMPO_de_ESTRELLAS *Cest)
{
// Star3d( Cestrellas );
while( !kbhit() ) Actualiza(Cest);
}
void Actualiza(CAMPO_de_ESTRELLAS *Cest)
{
int Ex, Ey, conta;
static float FactorMovimientoX = 0, FactorMovimientoY = 0, ox = 0, oy = 0;
static float x=0.1, y=0.1;
static char color = 0;
for( conta=0; conta<200; conta++ )
{
if ( o[conta].Ex+ox> 0 && o[conta].Ex+ox < 79 && o[conta].Ey+oy > 0 && o[conta].Ey+oy < 49 )
WriteChar50 ( o[conta].Ex+ox, o[conta].Ey+oy, '*', 0, 0, textoVirtual );
// putpixel ( o[conta].Ex+ox+5, o[conta].Ey+oy+(317/2), 0 );
Ex = ( ((200*Cest[conta].Ex)/Cest[conta].Ez));//+40;
Ey = ( ((200*Cest[conta].Ey)/Cest[conta].Ez));//+25;//240;
Cest[conta].Ez = Cest[conta].Ez - 5 ;
o[conta].Ex = Ex;
o[conta].Ey = Ey;
color++;
if ( color > 10 )
{
if ( Cest[conta].Ecolor == WHITE )
Cest[conta].Ecolor = LIGHTGRAY;
else if ( Cest[conta].Ecolor == LIGHTGRAY )
Cest[conta].Ecolor = DARKGRAY;
else
Cest[conta].Ecolor = WHITE;
color = 0;
}
if ( Ex>79 && Ey>49 )
pon_estrella ( &Cest[conta] );
if ( Cest[conta].Ez <= 20 || Ex>79 || Ey>49 || Ex<0 || Ey<0 )
// if ( Cest[conta].Ez <= 20 || Ex>635 || Ey>470 || Ex<5 || Ey<317 )
pon_estrella ( &Cest[conta] );
if ( Ex+FactorMovimientoX > 0 && Ex+FactorMovimientoX < 79 && Ey+FactorMovimientoY > 0 && Ey+FactorMovimientoY < 49 )
// putpixel ( Ex+FactorMovimientoX, Ey+FactorMovimientoY+100, Cest[conta].Ecolor );
WriteChar50 ( Ex+FactorMovimientoX, Ey+FactorMovimientoY, '*', Cest[conta].Ecolor%16, 0, textoVirtual );
// putpixel ( Ex+FactorMovimientoX+5, Ey+FactorMovimientoY+(317/2), Cest[conta].Ecolor );
}
ox = FactorMovimientoX;
oy = FactorMovimientoY;
FactorMovimientoX+= x;
FactorMovimientoY+= y;
if ( FactorMovimientoX > 1 ) x = -0.1;
if ( FactorMovimientoX < -1 ) x = 0.1;
if ( FactorMovimientoY > 1 ) y = -0.1;
if ( FactorMovimientoY < -1 ) y = 0.1;
}