- Fins la linea 2060
This commit is contained in:
@@ -1548,38 +1548,32 @@ void historia_final();
|
||||
}
|
||||
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure put_map(uint8_t *nom;color:byte; x,y: word;i,j: byte; desti:word);
|
||||
void put_map(uint8_t *nom, uint8_t color, uint16_t x, uint16_t y, uint8_t i, uint8_t j, uint8_t *desti)
|
||||
/* nom : nom de la matriu; color: 255 = original o color;
|
||||
x,y = posició pantalla; i,j = tamany matriu; desti = VGA o vaddr)*/
|
||||
var a,b:word;
|
||||
begin
|
||||
for a:=x+1 to x+i do
|
||||
for b:=y+1 to y+j do
|
||||
begin
|
||||
if color<>255 then putpixel(a,b,color,desti)
|
||||
else putpixel(a,b,nom[a-x,b-y],desti);
|
||||
end;
|
||||
end;
|
||||
{
|
||||
for (int a=x+1; a<=x+i; ++a)
|
||||
for (int b=y+1; b<=y+j; ++b)
|
||||
{
|
||||
if (color!=255) putpixel(a, b, (color!=255 ? color : nom[a-x,b-y]), desti);
|
||||
}
|
||||
}
|
||||
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure pilla_temps;
|
||||
begin
|
||||
gettime(h,m,s,c);
|
||||
hora := (s)+(m*60)+(h*3600);
|
||||
end;
|
||||
void pilla_temps()
|
||||
{
|
||||
hora = SDL_GetTicks() / 1000;
|
||||
}
|
||||
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure posa_el_temps(where:word);
|
||||
var
|
||||
h1,m1,s1,c1,minuts,segons,i : word;
|
||||
begin
|
||||
void posa_el_temps(uint8_t *where)
|
||||
{
|
||||
gettime(h1,m1,s1,c1);
|
||||
/*temps:=temps+(((h1-h)*24)+((m1-m)*60)+(s1-s));*/
|
||||
/*if (s1-s)>0 then temps:=temps+(100-c+c1) else temps:=temps+(c1-c);*/
|
||||
temps := (s1)+(m1*60)+(h1*3600) - hora;
|
||||
minuts :=(temps) div 60;
|
||||
segons :=(temps) mod 60;
|
||||
temps = (SDL_GetTicks() / 1000) - hora;
|
||||
const uint16_t minuts = temps / 60;
|
||||
const uint16_t segons = temps % 60;
|
||||
|
||||
|
||||
i:= 255;
|
||||
const int i = 255;
|
||||
|
||||
pinta_number(num_0, 180, i,82, where);
|
||||
pinta_number(num_0, 180, i+12, 82, where);
|
||||
@@ -1588,132 +1582,154 @@ begin
|
||||
pinta_number(num_11, 255, i+6, 82, where);
|
||||
|
||||
pinta_number(numero_G[minuts], 255, i, 82, where);
|
||||
pinta_number(numero_G[segons div 10],255,i+12,82,where);
|
||||
pinta_number(numero_G[segons mod 10],255,i+18,82,where);
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure resultat_time_attack;
|
||||
var i,minuts,segons : word;
|
||||
begin
|
||||
pinta_number(numero_G[segons / 10], 255, i+12, 82, where);
|
||||
pinta_number(numero_G[segons % 10], 255, i+18, 82, where);
|
||||
}
|
||||
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
void resultat_time_attack()
|
||||
{
|
||||
fadedown(0,0,0,1);
|
||||
load_mif(time_fin,vaddr2);
|
||||
load_mif(TIME_FIN, vaddr2);
|
||||
volcar32(vaddr2, vaddr);
|
||||
|
||||
ini_midi(musica_game_over);
|
||||
if midi then Playmidi;
|
||||
if (midi) Playmidi();
|
||||
|
||||
minuts:=(temps_final mod 3600) div 60;
|
||||
segons:=(temps_final mod 3600) mod 60;
|
||||
const uint16_t minuts = (temps_final % 3600) / 60;
|
||||
const uint16_t segons = (temps_final % 3600) % 60;
|
||||
|
||||
i:=180;
|
||||
const int i = 180;
|
||||
|
||||
pinta_number_zoom(4, numero_G[minuts], 255, i, 126, vaddr);
|
||||
pinta_number_zoom(4, num_11, 255, i+6*4, 126, vaddr);
|
||||
pinta_number_zoom(4,numero_G[segons div 10],255,i+12*4,126,vaddr);
|
||||
pinta_number_zoom(4,numero_G[segons mod 10],255,i+18*4,126,vaddr);
|
||||
pinta_number_zoom(4, numero_G[segons / 10], 255, i+12*4, 126, vaddr);
|
||||
pinta_number_zoom(4, numero_G[segons % 10], 255, i+18*4, 126, vaddr);
|
||||
|
||||
espera_vga;
|
||||
espera_vga();
|
||||
volcar32(vaddr, VGA);
|
||||
retard(300);
|
||||
gestio_records(43);
|
||||
retard(100);
|
||||
escriu_records(10);
|
||||
borrat_de_pantalla(vaddr);
|
||||
save_records;
|
||||
save_records();
|
||||
|
||||
if midi then begin StopMIDI; unloadmidi; midi:=false; end;
|
||||
if (midi)
|
||||
{
|
||||
StopMIDI();
|
||||
unloadmidi();
|
||||
midi = false;
|
||||
}
|
||||
}
|
||||
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure missatge_game_over;
|
||||
var
|
||||
i,j : word;
|
||||
k : byte;
|
||||
num1,num2,num3,num4,num5,num6,num7 : byte;
|
||||
|
||||
begin
|
||||
|
||||
void missatge_game_over()
|
||||
{
|
||||
fadedown(0,0,0,2);
|
||||
load_mif(pepefins,vaddr);
|
||||
load_mif(PEPEFINS, vaddr);
|
||||
|
||||
ini_midi(musica_game_over);
|
||||
if midi then Playmidi;
|
||||
if (midi) Playmidi();
|
||||
|
||||
if time_attack_mode then for i:=50 to 280 do
|
||||
for j:=130 to 190 do putpixel(i,j,239,vaddr);
|
||||
if story_mode_mode then
|
||||
begin
|
||||
if (time_attack_mode)
|
||||
for (int i=50; i<=280; ++i)
|
||||
for (int j=130; j<=190; ++j)
|
||||
putpixel(i, j, 239, vaddr);
|
||||
|
||||
if (story_mode_mode)
|
||||
{
|
||||
volcar32(vaddr, vaddr2);
|
||||
for i:=50 to 280 do
|
||||
for j:=130 to 190 do putpixel(i,j,239,vaddr2);
|
||||
espera_VGA;
|
||||
for (int i=50; i<=280; ++i)
|
||||
for (int j=130; j<=190; ++j)
|
||||
putpixel(i, j, 239, vaddr2);
|
||||
|
||||
espera_VGA();
|
||||
volcar32(vaddr2, VGA);
|
||||
retard(200);
|
||||
end;
|
||||
}
|
||||
|
||||
if story_mode_mode then
|
||||
begin
|
||||
i:=125/*135*/;
|
||||
j:=170;
|
||||
num1:=punts div 1000000;
|
||||
num2:=(punts mod 1000000) div 100000;
|
||||
num3:=((punts mod 1000000) mod 100000) div 10000;
|
||||
num4:=(((punts mod 1000000) mod 100000) mod 10000) div 1000;
|
||||
num5:=((((punts mod 1000000) mod 100000) mod 10000) mod 1000) div 100;
|
||||
num6:=(((((punts mod 1000000) mod 100000) mod 10000) mod 1000) mod 100) div 10;
|
||||
num7:=(((((punts mod 1000000) mod 100000) mod 10000) mod 100) mod 10);
|
||||
if (story_mode_mode)
|
||||
{
|
||||
const int i = 125; // 135
|
||||
const int j = 170;
|
||||
|
||||
if num1<>0 then pinta_number(numero_G[num1],255,i,j,vaddr);
|
||||
if (num2<>0) or (num1<>0) then pinta_number(numero_G[num2],255,i+6,j,vaddr);
|
||||
if (num3<>0) or (num2<>0) or (num1<>0) then pinta_number(numero_G[num3],255,i+12,j,vaddr);
|
||||
if (num4<>0) or (num3<>0) or (num2<>0) or (num1<>0) then pinta_number(numero_G[num4],255,i+18,j,vaddr);
|
||||
if (num5<>0) or (num4<>0) or (num3<>0) or (num2<>0) or (num1<>0) then pinta_number(numero_G[num5],255,i+24,j,vaddr);
|
||||
if (num6<>0) or (num5<>0) or (num4<>0) or (num3<>0) or (num2<>0) or (num1<>0)
|
||||
then pinta_number(numero_G[num6],255,i+30,j,vaddr);
|
||||
if (num7<>0) or (num6<>0) or (num5<>0) or (num4<>0) or (num3<>0) or (num2<>0) or (num1<>0)
|
||||
then pinta_number(numero_G[num7],255,i+36,j,vaddr);
|
||||
uint8_t num = (((((puntuacio[x] % 1000000) % 100000) % 10000) % 100) % 10);
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+36, j, vaddr);
|
||||
|
||||
/*pinta_number(numero_G[num1],255,i,j,vaddr);
|
||||
pinta_number(numero_G[num2],255,i+6,j,vaddr);
|
||||
pinta_number(numero_G[num3],255,i+12,j,vaddr);
|
||||
pinta_number(numero_G[num4],255,i+18,j,vaddr);
|
||||
pinta_number(numero_G[num5],255,i+24,j,vaddr);
|
||||
pinta_number(numero_G[num6],255,i+30,j,vaddr);
|
||||
pinta_number(numero_G[num7],255,i+36,j,vaddr);*/
|
||||
end;
|
||||
num = (((((puntuacio[x] % 1000000) % 100000) % 10000) % 1000) % 100) / 10;
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+30, j, vaddr);
|
||||
|
||||
espera_vga;
|
||||
num = ((((puntuacio[x] % 1000000) % 100000) % 10000) % 1000) / 100;
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+24, j, vaddr);
|
||||
|
||||
num = (((puntuacio[x] % 1000000) % 100000) % 10000) / 1000;
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+18, j, vaddr);
|
||||
|
||||
num = ((puntuacio[x] % 1000000) % 100000) / 10000;
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+12, j, vaddr);
|
||||
|
||||
num = (puntuacio[x] % 1000000) / 100000;
|
||||
if (num != 0)
|
||||
{
|
||||
pinta_number(numero_G[num], 255, i+6, j, vaddr);
|
||||
|
||||
num = puntuacio[x] / 1000000;
|
||||
if (num != 0) pinta_number(numero_G[num], 255, i, j, vaddr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
espera_vga();
|
||||
volcar32(vaddr, VGA);
|
||||
retard(300);
|
||||
if story_mode_mode then gestio_records(144);
|
||||
if (story_mode_mode) gestio_records(144);
|
||||
fadedown(0,0,0,0);
|
||||
|
||||
|
||||
escriu_records(10);
|
||||
borrat_de_pantalla(vaddr);
|
||||
vides:=0;
|
||||
no_queden_vides:=true;
|
||||
save_records;
|
||||
vides = 0;
|
||||
no_queden_vides = true;
|
||||
save_records();
|
||||
|
||||
if midi then begin StopMIDI; unloadmidi; midi:=false; end;
|
||||
if (midi)
|
||||
{
|
||||
StopMIDI();
|
||||
unloadmidi();
|
||||
midi = false;
|
||||
}
|
||||
}
|
||||
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure comprobar_comp_i_sprites;
|
||||
const
|
||||
tamany_comp = 2415;
|
||||
tamany_sprites = 968792;
|
||||
void comprobar_comp_i_sprites() {}
|
||||
// [RZC 24/01/2024] [INFO] Passe de esta merda, de totes formes no anava a implementar-ho...
|
||||
/*
|
||||
const int tamany_comp = 2415;
|
||||
const int tamany_sprites = 968792;
|
||||
var
|
||||
fich : file of byte;
|
||||
i : word;
|
||||
temp : longint;
|
||||
aux : byte;
|
||||
error : boolean;
|
||||
begin
|
||||
temp:=0;
|
||||
error:=false;
|
||||
assign(fich,'datos\comp.dat');
|
||||
{
|
||||
int temp = 0;
|
||||
bool error = false;
|
||||
FILE *fich = fopen("datos/comp.dat", "r");
|
||||
reset(fich);
|
||||
for i:=1 to filesize(fich)-9 do
|
||||
begin
|
||||
@@ -1742,188 +1758,149 @@ begin
|
||||
halt;
|
||||
end;
|
||||
end;
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
void carrega_pantalla(uint8_t num)
|
||||
{
|
||||
if (num == 0)
|
||||
memset(pantalla, 0, 38*29);
|
||||
else
|
||||
{
|
||||
FILE *fich = fopen("datos/comp.dat", "r");
|
||||
fseek(fich, (num-1)*38*29, SEEK_SET);
|
||||
fread(pantalla, 38*29, 1, fich);
|
||||
fclose(fich);
|
||||
}
|
||||
}
|
||||
/*----------------------------------------------------*/
|
||||
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure ini_vars(num_fase:byte);
|
||||
void ini_vars(uint8_t num_fase)
|
||||
{
|
||||
malos_quets = false;
|
||||
sense_rellontge = true;
|
||||
velocitat_pepe = 5;
|
||||
x = pos_ini_x_pepe;
|
||||
y = pos_ini_y_pepe;
|
||||
fletxa_final_fase = false;
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
procedure carrega_pantalla(num:byte);
|
||||
var
|
||||
fich : file of byte;
|
||||
i,j,k : byte;
|
||||
temp : byte;
|
||||
if (num_fase == 0)
|
||||
vides = 0;
|
||||
else if (num_fase == 1)
|
||||
vides = vides_de_pepe;
|
||||
else
|
||||
vides = vides; // Super util
|
||||
|
||||
begin
|
||||
if num = 0 then for i:=1 to 38 do for j:=1 to 29 do pantalla[i,j]:=0
|
||||
else begin
|
||||
|
||||
Assign(fich,'datos/comp.dat');
|
||||
Reset(fich);
|
||||
|
||||
for k:=1 to num do
|
||||
begin
|
||||
for i:=1 to 38 do
|
||||
begin
|
||||
for j:=1 to 29 do
|
||||
begin
|
||||
read(fich,temp);
|
||||
pantalla[i,j] := temp;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
Close(fich);
|
||||
|
||||
end;
|
||||
|
||||
end;
|
||||
/*----------------------------------------------------*/
|
||||
|
||||
begin
|
||||
malos_quets := false;
|
||||
sense_rellontge:=true;
|
||||
velocitat_pepe := 5;
|
||||
x:=pos_ini_x_pepe;
|
||||
y:=pos_ini_y_pepe;
|
||||
fletxa_final_fase:=false;
|
||||
if num_fase=0 then vides:=0
|
||||
else if num_fase=1 then vides:=vides_de_pepe
|
||||
else vides:=vides;
|
||||
pintura:=max_pintura;
|
||||
en_casa:=true;
|
||||
final_fase:=false;
|
||||
rellontge.viu := false;
|
||||
rellontge.temps := 0;
|
||||
temps := 0;
|
||||
pintura = max_pintura;
|
||||
en_casa = true;
|
||||
final_fase = false;
|
||||
rellontge.viu = false;
|
||||
rellontge.temps = 0;
|
||||
temps = 0;
|
||||
|
||||
carrega_pantalla(num_fase);
|
||||
|
||||
case num_fase of
|
||||
switch (num_fase)
|
||||
{
|
||||
case 0: total_blocs_per_pintar = blocs_fase_0; break;
|
||||
case 1: total_blocs_per_pintar = blocs_fase_1; break;
|
||||
case 2: total_blocs_per_pintar = blocs_fase_2; break;
|
||||
case 3: total_blocs_per_pintar = blocs_fase_3; break;
|
||||
case 4: total_blocs_per_pintar = blocs_fase_4; break;
|
||||
case 5: total_blocs_per_pintar = blocs_fase_5; break;
|
||||
case 6: total_blocs_per_pintar = blocs_fase_6; break;
|
||||
case 7: total_blocs_per_pintar = blocs_fase_7; break;
|
||||
case 8: total_blocs_per_pintar = blocs_fase_8; break;
|
||||
case 9: total_blocs_per_pintar = blocs_fase_9; break;
|
||||
case 10: total_blocs_per_pintar = blocs_fase_10; break;
|
||||
}
|
||||
blocs_per_pintar = total_blocs_per_pintar;
|
||||
temps = 0;
|
||||
velocitat_joc = 1;
|
||||
no_queden_vides = false;
|
||||
naiximent = false;
|
||||
map = false;
|
||||
|
||||
0 : total_blocs_per_pintar:=blocs_fase_0;
|
||||
// ini malos
|
||||
for (int i=0; i<max_malos; ++i) malo[i].viu = false;
|
||||
malo[0].dibuix = d_malo1;
|
||||
malo[1].dibuix = d_malo2;
|
||||
malo[2].dibuix = num_fase == ultima_fase ? pepe_malo : d_malo3;
|
||||
}
|
||||
|
||||
1 : total_blocs_per_pintar:=blocs_fase_1;
|
||||
|
||||
2 : total_blocs_per_pintar:=blocs_fase_2;
|
||||
|
||||
3 : total_blocs_per_pintar:=blocs_fase_3;
|
||||
|
||||
4 : total_blocs_per_pintar:=blocs_fase_4;
|
||||
|
||||
5 : total_blocs_per_pintar:=blocs_fase_5;
|
||||
|
||||
6 : total_blocs_per_pintar:=blocs_fase_6;
|
||||
|
||||
7 : total_blocs_per_pintar:=blocs_fase_7;
|
||||
|
||||
8 : total_blocs_per_pintar:=blocs_fase_8;
|
||||
|
||||
9 : total_blocs_per_pintar:=blocs_fase_9;
|
||||
|
||||
10 : total_blocs_per_pintar:=blocs_fase_10;
|
||||
|
||||
end;
|
||||
blocs_per_pintar:=total_blocs_per_pintar;
|
||||
temps:=0;
|
||||
velocitat_joc:=1;
|
||||
no_queden_vides:=false;
|
||||
naiximent:=false;
|
||||
map:=false;
|
||||
|
||||
/* ini malos */
|
||||
if num_fase=ultima_fase then
|
||||
begin
|
||||
for i:=1 to max_malos do
|
||||
begin
|
||||
malo[i].viu:=false;
|
||||
end;
|
||||
malo[1].dibuix:=d_malo1;
|
||||
malo[2].dibuix:=d_malo2;
|
||||
malo[3].dibuix:=pepe_malo;
|
||||
end
|
||||
else begin
|
||||
for i:=1 to max_malos do
|
||||
begin
|
||||
malo[i].viu:=false;
|
||||
end;
|
||||
malo[1].dibuix:=d_malo1;
|
||||
malo[2].dibuix:=d_malo2;
|
||||
malo[3].dibuix:=d_malo3;
|
||||
end;
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure ini_matrius;
|
||||
begin
|
||||
void ini_matrius()
|
||||
{
|
||||
// fondos
|
||||
path[1] = PEPE01;
|
||||
path[2] = PEPE02;
|
||||
path[3] = PEPE03;
|
||||
path[4] = PEPE04;
|
||||
path[5] = PEPE05;
|
||||
path[6] = PEPE06;
|
||||
path[7] = PEPE07;
|
||||
path[8] = PEPE08;
|
||||
path[9] = PEPE09;
|
||||
path[10] = PEPE10;
|
||||
path[11] = PEPE11;
|
||||
path[12] = ULT_FASE;
|
||||
path[13] = TIME;
|
||||
path[14] = FONS_NIT;
|
||||
|
||||
/* fondos */
|
||||
path[1]:=pepe01;
|
||||
path[2]:=pepe02;
|
||||
path[3]:=pepe03;
|
||||
path[4]:=pepe04;
|
||||
path[5]:=pepe05;
|
||||
path[6]:=pepe06;
|
||||
path[7]:=pepe07;
|
||||
path[8]:=pepe08;
|
||||
path[9]:=pepe09;
|
||||
path[10]:=pepe10;
|
||||
path[11]:=pepe11;
|
||||
path[12]:=ult_fase;
|
||||
path[13]:=time;
|
||||
path[14]:=fons_nit;
|
||||
// matriu de numeros
|
||||
numero[0] = num0;
|
||||
numero[1] = num1;
|
||||
numero[2] = num2;
|
||||
numero[3] = num3;
|
||||
numero[4] = num4;
|
||||
numero[5] = num5;
|
||||
numero[6] = num6;
|
||||
numero[7] = num7;
|
||||
numero[8] = num8;
|
||||
numero[9] = num9;
|
||||
|
||||
/* matriu de numeros */
|
||||
numero[0]:=num0;
|
||||
numero[1]:=num1;
|
||||
numero[2]:=num2;
|
||||
numero[3]:=num3;
|
||||
numero[4]:=num4;
|
||||
numero[5]:=num5;
|
||||
numero[6]:=num6;
|
||||
numero[7]:=num7;
|
||||
numero[8]:=num8;
|
||||
numero[9]:=num9;
|
||||
numero_G[0] = num_0;
|
||||
numero_G[1] = num_1;
|
||||
numero_G[2] = num_2;
|
||||
numero_G[3] = num_3;
|
||||
numero_G[4] = num_4;
|
||||
numero_G[5] = num_5;
|
||||
numero_G[6] = num_6;
|
||||
numero_G[7] = num_7;
|
||||
numero_G[8] = num_8;
|
||||
numero_G[9] = num_9;
|
||||
numero_G[10] = num_11;
|
||||
|
||||
numero_G[0]:=num_0;
|
||||
numero_G[1]:=num_1;
|
||||
numero_G[2]:=num_2;
|
||||
numero_G[3]:=num_3;
|
||||
numero_G[4]:=num_4;
|
||||
numero_G[5]:=num_5;
|
||||
numero_G[6]:=num_6;
|
||||
numero_G[7]:=num_7;
|
||||
numero_G[8]:=num_8;
|
||||
numero_G[9]:=num_9;
|
||||
numero_G[10]:=num_11;
|
||||
load_records();
|
||||
}
|
||||
|
||||
load_records;
|
||||
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure pinta_marcadors;
|
||||
var i,j : word;
|
||||
begin
|
||||
|
||||
/* pintura */
|
||||
for i:=pos_esq_m_p to pos_dreta_m_p do
|
||||
for j:= (pos_base_m_p-(max_pintura div tamany_m_p)) to pos_base_m_p do
|
||||
void pinta_marcadors()
|
||||
{
|
||||
// pintura
|
||||
for (int i=pos_esq_m_p; i<=pos_dreta_m_p; ++i)
|
||||
for (int j=(pos_base_m_p-(max_pintura / tamany_m_p)); j<=pos_base_m_p; ++j)
|
||||
putpixel(i, j, color_marcador_pintura_fondo, vaddr);
|
||||
for i:=pos_esq_m_p to pos_dreta_m_p do
|
||||
for j:= (pos_base_m_p-(pintura div tamany_m_p)) to pos_base_m_p do
|
||||
|
||||
for (int i=pos_esq_m_p; i<=pos_dreta_m_p; ++i)
|
||||
for (int j=(pos_base_m_p-(pintura / tamany_m_p)); j<=pos_base_m_p; ++j)
|
||||
putpixel(i, j, color_marcador_pintura, vaddr);
|
||||
if pintura=0 then
|
||||
for i:=pos_esq_m_p to pos_dreta_m_p do
|
||||
for j:= (pos_base_m_p-(pintura div tamany_m_p)) to pos_base_m_p do
|
||||
|
||||
putpixel(i,(pos_base_m_p),color_marcador_pintura_fondo,vaddr);
|
||||
if (pintura==0)
|
||||
for (int i=pos_esq_m_p; i<=pos_dreta_m_p; ++i)
|
||||
for (int j=(pos_base_m_p-(pintura / tamany_m_p)); j<=pos_base_m_p; ++j)
|
||||
putpixel(i, pos_base_m_p, color_marcador_pintura_fondo, vaddr);
|
||||
|
||||
|
||||
if num_fase>0 then
|
||||
begin
|
||||
/* vides */
|
||||
if (num_fase>0)
|
||||
{
|
||||
// vides
|
||||
pinta_number(numero_G[vides], 255, 268, 169, vaddr);
|
||||
|
||||
/* punts */
|
||||
i:=265;
|
||||
j:=73;
|
||||
// punts
|
||||
const int i = 265;
|
||||
const int j = 73;
|
||||
|
||||
pinta_number(numero_G[punts], color_fondo_marcador_punts, i, j, vaddr);
|
||||
pinta_number(numero_G[punts], color_fondo_marcador_punts, i+6, j, vaddr);
|
||||
@@ -1933,169 +1910,153 @@ begin
|
||||
pinta_number(numero_G[punts], color_fondo_marcador_punts, i+30, j, vaddr);
|
||||
pinta_number(numero_G[punts], color_fondo_marcador_punts, i+36, j, vaddr);
|
||||
|
||||
pinta_number(numero_G[punts div 1000000],255,i,j,vaddr);
|
||||
pinta_number(numero_G[(punts mod 1000000) div 100000],255,i+6,j,vaddr);
|
||||
pinta_number(numero_G[((punts mod 1000000) mod 100000) div 10000],255,i+12,j,vaddr);
|
||||
pinta_number(numero_G[(((punts mod 1000000) mod 100000) mod 10000) div 1000],255,i+18,j,vaddr);
|
||||
pinta_number(numero_G[((((punts mod 1000000) mod 100000) mod 10000) mod 1000) div 100],255,i+24,j,vaddr);
|
||||
pinta_number(numero_G[(((((punts mod 1000000) mod 100000) mod 10000) mod 1000) mod 100) div 10],255,i+30,j,vaddr);
|
||||
pinta_number(numero_G[(((((punts mod 1000000) mod 100000) mod 10000) mod 100) mod 10)],255,i+36,j,vaddr);
|
||||
pinta_number(numero_G[punts / 1000000], 255, i, j, vaddr);
|
||||
pinta_number(numero_G[(punts % 1000000) / 100000], 255, i+6, j, vaddr);
|
||||
pinta_number(numero_G[((punts % 1000000) % 100000) / 10000], 255, i+12, j, vaddr);
|
||||
pinta_number(numero_G[(((punts % 1000000) % 100000) % 10000) / 1000], 255, i+18, j, vaddr);
|
||||
pinta_number(numero_G[((((punts % 1000000) % 100000) % 10000) % 1000) / 100], 255, i+24, j, vaddr);
|
||||
pinta_number(numero_G[(((((punts % 1000000) % 100000) % 10000) % 1000) % 100) / 10], 255, i+30, j, vaddr);
|
||||
pinta_number(numero_G[(((((punts % 1000000) % 100000) % 10000) % 100) % 10)], 255, i+36, j, vaddr);
|
||||
}
|
||||
}
|
||||
|
||||
/* blocs */
|
||||
/*pinta(numero[blocs_per_pintar],239,i,60,vaddr);
|
||||
pinta(numero[blocs_per_pintar],239,i+4,60,vaddr);
|
||||
pinta(numero[blocs_per_pintar],239,i+8,60,vaddr);
|
||||
pinta(numero[blocs_per_pintar],239,i+12,60,vaddr);
|
||||
|
||||
pinta(numero[blocs_per_pintar div 1000],255,i,60,vaddr);
|
||||
pinta(numero[((blocs_per_pintar mod 1000) div 100)],255,i+4,60,vaddr);
|
||||
pinta(numero[(((blocs_per_pintar mod 1000) mod 100) div 10)],255,i+8,60,vaddr);
|
||||
pinta(numero[(((blocs_per_pintar mod 1000) mod 100) mod 10)],255,i+12,60,vaddr);*/
|
||||
|
||||
/* altaveu */
|
||||
/*if amb_so then
|
||||
begin
|
||||
pinta_number(altaveu_on,255,1,189,vaddr);
|
||||
end
|
||||
else begin
|
||||
pinta_number(altaveu_off,255,1,189,vaddr);
|
||||
end;*/
|
||||
/* mapa */
|
||||
|
||||
end;
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure ini_pantalla;
|
||||
void ini_pantalla()
|
||||
var i,j : word;
|
||||
i_int:integer;
|
||||
offset : word;
|
||||
VirscrFase : Ptr_pantalla;
|
||||
vaddrFase : Word;
|
||||
|
||||
begin
|
||||
{
|
||||
uint8_t *vaddrFase = (uint8_t*)malloc(64000); // 6400???
|
||||
|
||||
getmem(virscrFase,6400);
|
||||
vaddrFase:=seg(virscrFase^);
|
||||
|
||||
load_mif(fases,vaddr);
|
||||
load_mif(FASES,vaddr);
|
||||
Cls32(0, vaddrFase);
|
||||
offset:=((num_fase div 6)*160)+((((num_fase-1) mod 5)*40)*320);
|
||||
offset = ((num_fase / 6)*160)+((((num_fase-1) % 5)*40)*320);
|
||||
PutSprite(vaddr, vaddrFase, offset, 160, 40, 0, 0);
|
||||
|
||||
if not(mode_nocturne) then
|
||||
begin
|
||||
if num_fase>0 then load_mif(path[random(max_fondos_story)+1],vaddr2)
|
||||
else load_mif(path[13],vaddr2);
|
||||
end
|
||||
else load_mif(path[14],vaddr2);
|
||||
if (!mode_nocturne)
|
||||
{
|
||||
if (num_fase>0)
|
||||
load_mif(path[(rand()%max_fondos_story)+1], vaddr2);
|
||||
else
|
||||
load_mif(path[13], vaddr2);
|
||||
}
|
||||
else
|
||||
load_mif(path[14], vaddr2);
|
||||
|
||||
if (num_fase=ultima_fase) and not(mode_nocturne) then load_mif(path[12],vaddr2);
|
||||
if ((num_fase==ultima_fase) && !mode_nocturne) load_mif(path[12], vaddr2);
|
||||
|
||||
// pinta numero de fase
|
||||
if ( (num_fase>0) && (num_fase<10) ) pinta_number(numero_G[num_fase], 255, 1, 1, vaddr2);
|
||||
|
||||
/* pinta numero de fase */
|
||||
if (num_fase>0) and (num_fase<10) then pinta_number(numero_G[num_fase],255,1,1,vaddr2);
|
||||
// pinta les pareds
|
||||
for (int i=0; i<38; ++i)
|
||||
for (int j=0; j<29; ++j)
|
||||
if (pantalla[i,j]==es_una_paret) pinta(dib_pared, 255, (i*6)+4, (j+1)*6, vaddr2);
|
||||
|
||||
/* pinta les pareds */
|
||||
for i:=1 to 38 do
|
||||
for j:=1 to 29 do
|
||||
if pantalla[i,j]=es_una_paret then pinta(dib_pared,255,(i*6)+4,(j+1)*6,vaddr2)
|
||||
/*put_matrix(pepe,color_pared,(i*6)+4,(j+1)*6,6,6,vaddr2)*/;
|
||||
|
||||
/* pinta a Rosita i a la presó */
|
||||
if num_fase=ultima_fase then
|
||||
begin
|
||||
// pinta a Rosita i a la presó
|
||||
if (num_fase==ultima_fase)
|
||||
{
|
||||
pinta(rosita, 255, 16, 96, vaddr2);
|
||||
pinta(preso, 255, 22, 96, vaddr2);
|
||||
for i:=97 to 102 do putpixel(16,i,237,vaddr2);
|
||||
for (int i=97; i<=102; ++i) putpixel(16, i, 237, vaddr2);
|
||||
putpixel(17, 97, 237, vaddr2);
|
||||
putpixel(22, 97, 237, vaddr2);
|
||||
putpixel(17, 102, 237, vaddr2);
|
||||
putpixel(22, 102, 237, vaddr2);
|
||||
end;
|
||||
}
|
||||
|
||||
|
||||
/* pinta el marcador de pintura */
|
||||
for i:=pos_esq_m_p to pos_dreta_m_p do
|
||||
for j:= (pos_base_m_p-(pintura div tamany_m_p)) to pos_base_m_p do
|
||||
begin
|
||||
// pinta el marcador de pintura
|
||||
for (int i=pos_esq_m_p; i<=pos_dreta_m_p; ++i)
|
||||
for (int j=(pos_base_m_p-(pintura / tamany_m_p)); j<=pos_base_m_p; ++j)
|
||||
{
|
||||
putpixel(i, j, color_marcador_pintura, vaddr2);
|
||||
putpixel(pos_esq_m_p-1, j, color_borde_m_p, vaddr2);
|
||||
putpixel(pos_dreta_m_p+1, j, color_borde_m_p, vaddr2);
|
||||
putpixel(i,(pos_base_m_p-(max_pintura div tamany_m_p)-1),color_borde_m_p,vaddr2);
|
||||
putpixel(i, (pos_base_m_p-(max_pintura / tamany_m_p)-1), color_borde_m_p, vaddr2);
|
||||
putpixel(i, (pos_base_m_p+1), color_borde_m_p, vaddr2);
|
||||
end;
|
||||
}
|
||||
|
||||
/* coloca la fase */
|
||||
// coloca la fase
|
||||
getpaleta(paleta);
|
||||
blackout;
|
||||
blackout();
|
||||
cls32(0, vaddr);
|
||||
PutBloc(vaddr2, 0, vaddr, 249, 200, 0, 0);
|
||||
volcar32(vaddr, VGA);
|
||||
fadeup(paleta, 0);
|
||||
|
||||
/* posa el marcador */
|
||||
For j:=0 to 49 do
|
||||
begin
|
||||
i:=j shl 1;
|
||||
// posa el marcador
|
||||
for (int j=0; j<=49; ++j)
|
||||
{
|
||||
const int i = j << 1;
|
||||
PutBloc(vaddr2, 248+((99-i)*320), vaddr, 72, i+1, 248, 0);
|
||||
PutBloc(vaddr2, 32248, vaddr, 72, i+1, 248, 199-i);
|
||||
PutBloc(vaddr2, 0, vaddr, 249, 200, 0, 0);
|
||||
espera_VGA;
|
||||
espera_VGA();
|
||||
volcar32(vaddr, VGA);
|
||||
end;
|
||||
}
|
||||
|
||||
/* posa el lletrero de fase X */
|
||||
if story_mode_mode then
|
||||
for i_int:=-40 to 80 do
|
||||
begin
|
||||
// posa el lletrero de fase X
|
||||
if (story_mode_mode)
|
||||
for (int i=-40; i<=80; ++i)
|
||||
{
|
||||
volcar32(vaddr2, vaddr);
|
||||
if i_int<20 then Put_Sprite_ICE_esquerra(vaddrFase,vaddr,0,160,40,i_int shl 2,80)
|
||||
else Put_Sprite_ICE_dreta(vaddrFase,vaddr,0,160,40,i_int shl 2,80);
|
||||
if i_int=14 then delay(2000);
|
||||
espera_VGA;
|
||||
if (i<20)
|
||||
Put_Sprite_ICE_esquerra(vaddrFase, vaddr, 0, 160, 40, i << 2, 80);
|
||||
else
|
||||
Put_Sprite_ICE_dreta(vaddrFase, vaddr, 0, 160, 40, i << 2, 80);
|
||||
|
||||
if (i==14) delay(2000);
|
||||
espera_VGA();
|
||||
Volcar32(vaddr, VGA);
|
||||
end;
|
||||
}
|
||||
free(vaddrFase);
|
||||
}
|
||||
|
||||
Freemem(virscrFase,6400);
|
||||
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure level_complete;
|
||||
var i,temps,temps2 : word;
|
||||
begin
|
||||
|
||||
if midi then begin StopMIDI; unloadmidi; midi:=false; end;
|
||||
if not(mode_nocturne) then
|
||||
begin
|
||||
load_mif(done01,vaddr);
|
||||
espera_vga;
|
||||
void level_complete()
|
||||
{
|
||||
if (midi)
|
||||
{
|
||||
StopMIDI();
|
||||
unloadmidi();
|
||||
midi = false;
|
||||
}
|
||||
if (!mode_nocturne)
|
||||
{
|
||||
load_mif(DONE01, vaddr);
|
||||
espera_vga();
|
||||
volcar32(vaddr, VGA);
|
||||
ini_midi(musica_canvi_fase);
|
||||
if midi then Playmidi;
|
||||
|
||||
Gettime(h,m,s,c);
|
||||
temps:=h*3600+m*60+s;
|
||||
Repeat
|
||||
Gettime(h,m,s,c);
|
||||
temps2:=h*3600+m*60+s;
|
||||
until /*(QteclaPuls) or*/ ((temps2-temps)>=4);
|
||||
if (midi) Playmidi();
|
||||
|
||||
const uint32_t t = SDL_GetTicks() + 4000;
|
||||
do {} while( SDL_GetTicks() < t );
|
||||
borrat_de_pantalla(vaddr);
|
||||
end
|
||||
else begin
|
||||
load_mif(done05,vaddr);
|
||||
espera_vga;
|
||||
}
|
||||
else
|
||||
{
|
||||
load_mif(DONE05, vaddr);
|
||||
espera_vga();
|
||||
volcar32(vaddr, VGA);
|
||||
ini_midi(musica_canvi_fase_n);
|
||||
if midi then Playmidi;
|
||||
if midi then repeat until not(playing)
|
||||
else for i:=0 to 300 do espera_VGA;
|
||||
if (midi) Playmidi();
|
||||
if (midi)
|
||||
do {} while(playing);
|
||||
else
|
||||
for (int i=0; i<=300; ++i) espera_VGA();
|
||||
borrat_de_pantalla(vaddr);
|
||||
if midi then begin StopMIDI; unloadmidi; midi:=false; end;
|
||||
if (midi)
|
||||
{
|
||||
StopMIDI();
|
||||
unloadmidi();
|
||||
midi = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end;
|
||||
|
||||
end;
|
||||
/*──────────────────────────────────────────────────────────────────────────*/
|
||||
procedure volcat_de_pantalla;
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user