commit 35dcdbd89107a6f63d31bbb4fe27cd562921f52e Author: jdg Date: Wed Sep 8 21:13:54 2021 +0200 First commit 29/09/1996 diff --git a/FUEGO.CPP b/FUEGO.CPP new file mode 100644 index 0000000..a30ae26 --- /dev/null +++ b/FUEGO.CPP @@ -0,0 +1,127 @@ +#include +#include +#include + + +char *MPantalla; +char Pantalla[320][200]; + +void DoPaleta(void); +void CreaBase(void); +void CalculaFuego(void); + + + +void main( void ) +{ + int x, y; + + MPantalla = (char *)MK_FP(0xA000, 0); // create a pointer to video memory + + asm mov al, 0x13 + asm mov ah, 0x00 + asm int 0x10 + + + // Hacer paleta + DoPaleta(); + randomize(); + CreaBase(); +/* + for ( x = 30; x < 290; x++ ) + for ( y = 190; y < 80; y++ ) + MPantalla[320*y+x] = Pantalla[x][y]; +*/ + do + { + CalculaFuego(); +/* + for ( x=30; x<290; x++) + for ( y=190; y > 80; y -- ) + MPantalla[320*y+x] = Pantalla[x][y]; +*/ + } while ( !kbhit() ); + + textmode(LASTMODE); + +} + + +void DoPaleta(void) +{ + int i; + + for ( i=0; i<15; i++ ) + { + outport( 0x3c9, 0 ); + outport( 0x3c9, 0 ); + outport( 0x3c9, 0 ); + } + + for ( i=0; i<7; i++ ) + { + outport( 0x3c9, i*4);//i*4 ); + outport( 0x3c9, i*4);//i*4 ); + outport( 0x3c9, 0 ); + } + + for ( i=0; i<31; i++ ) + { + outport( 0x3c9, 63 ); + outport( 0x3c9, 63-i*2 ); + outport( 0x3c9, 0 ); + } + + for ( i=0; i<63; i++ ) + { + outport( 0x3c9, 63 ); + outport( 0x3c9, 0 ); + outport( 0x3c9, 0 ); + } + + outport( 0x3c8, 0 ); + outport( 0x3c9, 0 ); + outport( 0x3c9, 0 ); + outport( 0x3c9, 0 ); + +} + +void CreaBase(void) +{ + int i; + + for ( i=100; i < 220; i++ ) + { + if ( random(100) < 30 ) + //Pantalla[i][190] = random(150); + MPantalla[320*190 + i ] = random(150); + } + + for ( i=100; i < 220; i++ ) + { + if ( random(100) < 30 ) + //Pantalla[i][189] = random(150); + MPantalla[320*189 + i ] = random(150); + } + +} + +void CalculaFuego(void) +{ + + int Cur, x, y; + + for ( y = 120; y < 190; y++) + for ( x = 75; x < 245; x++) + { +// Cur = (Pantalla[x][y+1] + Pantalla[x+1][y+1] + Pantalla[x-1][y+1] + Pantalla[x+1][y]) >>2 ; + Cur = (MPantalla[x+320*(y+1)] + MPantalla[320*(y+1) + x+1] + MPantalla[320*(y+1)+x-1] + MPantalla[320*y +(x+1)]) >>2 ; + + if ( Cur > 1 ) Cur--; +// Pantalla[x][y-1] = Cur; + MPantalla[320*( y-1) + x] = Cur; + } + + CreaBase(); + +} diff --git a/FUEGO.EXE b/FUEGO.EXE new file mode 100644 index 0000000..34bb885 Binary files /dev/null and b/FUEGO.EXE differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8ef2db --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#FUEGO + + +*29/09/1996* + +ToDo: wwtcf? + + +![screenshot](/FUEGO.png "Screenshot")