From 807911e523bf0e840c97b8b477d88d707b1af43c Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 25 Jan 2024 21:55:20 +0100 Subject: [PATCH] - Fins la linea 3308 --- pepe2000_utf8.cpp | 1478 +++++++++++++++++++++++---------------------- 1 file changed, 754 insertions(+), 724 deletions(-) diff --git a/pepe2000_utf8.cpp b/pepe2000_utf8.cpp index 5875dac..22e3736 100644 --- a/pepe2000_utf8.cpp +++ b/pepe2000_utf8.cpp @@ -3110,805 +3110,835 @@ void time_attack() } /*──────────────────────────────────────────────────────────────────────────*/ -procedure menu_joc; -var -temps,temps2 : word; -pos,pos_dif,pos_m,cord_y : byte; -i,j,a_on_pinte_el_marc : word; -aux : byte; -tecla_incorrecta : boolean; -i_int:integer; -dib_aux : word; -percentatge : byte; +void menu_joc() +/*var + temps,temps2 : word; + pos,pos_dif,pos_m,cord_y : byte; + i,j,a_on_pinte_el_marc : word; + aux : byte; + tecla_incorrecta : boolean; + i_int:integer; + dib_aux : word; + percentatge : byte; +*/ + void ini_estreles() + { + cls32(0, vaddr); + for (int i=0; i<10; ++i) + { + estreles[i].x = rand()%290; + estreles[i].y = 1; + estreles[i].velocitat = rand()%3+1; + } + } -procedure ini_estreles; -var i : byte; -begin - cls32(0,vaddr); - for i:=1 to 10 do - begin - estreles[i].x:=random(290); - estreles[i].y:=1; - estreles[i].velocitat:=random(3)+1; - end; -end; + void fondo_estreles(uint8_t *from, uint8_t *where) + { + for (int i=0; i<10; ++i) + { + if ( (estreles[i].y + estreles[i].velocitat) > 191 ) + { + estreles[i].x = rand()%290; + estreles[i].y = 1; + estreles[i].velocitat = rand()%3+1; + } + else + estreles[i].y = estreles[i].y + (estreles[i].velocitat); + Putsprite(from, where, 26747, 9, 8, estreles[i].x, estreles[i].y); + } + } + + + void actualitza_options(uint8_t *from, uint8_t *where) + { + cls32(0, vaddr2); + + for (int i=0; i<=3; ++i) + for (int j=0; j<=5; ++j) + Putsprite(vaddr, where, 48000, 50, 50, j*50, i*50); + + fondo_estreles(vaddr, vaddr2); + + Putsprite(from, where, 30400, 165, 28, 70, 5); + + Putsprite(from, where, 39733, 116, 18, 22, 43); + if ( amb_so ) + Putsprite(from, where, 40492, 25, 17, 149, 45) + else + Putsprite(from, where, 39557, 28, 20, 150, 42); + + Putsprite(from, where, 57332, 113, 19, 20, 81); + if (GM) + Putsprite(from, where, 51573, 107, 17, 141, 81) + else + Putsprite(from, where, 51684, 130, 20, 141, 81); + + Putsprite(from, where, 45172, 39, 20, 22, 61); + switch (volumen) + { + case 0 : Putsprite(from, where, 45551, 32, 18, 70, 62); break; + case 1 : Putsprite(from, where, 45580, 16, 18, 70, 62); break; + case 2 : Putsprite(from, where, 45596, 16, 18, 70, 62); break; + case 3 : Putsprite(from, where, 45611, 16, 18, 70, 62); break; + case 4 : Putsprite(from, where, 45626, 16, 18, 70, 62); break; + case 5 : Putsprite(from, where, 45642, 16, 18, 70, 62); break; + case 6 : Putsprite(from, where, 45658, 16, 18, 70, 62); break; + case 7 : Putsprite(from, where, 45673, 16, 18, 70, 62); break; + case 8 : Putsprite(from, where, 45689, 16, 18, 70, 62); break; + case 9 : Putsprite(from, where, 45705, 14, 18, 71, 62); break; + case 10 : Putsprite(from, where, 45720, 40, 18, 70, 62); break; + } + + Putsprite(from, where, 21673, 84, 73, 22, 117); + + Putsprite(vaddr, vaddr2, tecla_amunt_dib, 21, 21, 135, 110); + Putsprite(vaddr, vaddr2, tecla_avall_dib, 21, 21, 135, 131); + Putsprite(vaddr, vaddr2, tecla_esquerra_dib, 21, 21, 135, 152); + Putsprite(vaddr, vaddr2, tecla_dreta_dib, 21, 21, 135, 173); + + // fletxes i ESC + Putsprite(vaddr, vaddr2, 31527, 47, 24, 238, 172); + + // Complet + percentatge + Putsprite(vaddr, vaddr2, 58405, 70, 17, 200, 120); + Putsprite(vaddr, vaddr2, percentatge*29, 29, 14, 220, 142); + + Pinta_number(fletxa3, 255, 13, cord_y, vaddr2); + } + + void pinta_marcs(uint16_t posicio) + { + volcar32(vaddr, vaddr2); + for (int i=posicio; i<=posicio+75; ++i) + { + putpixel(i, 11, 15, vaddr2); + putpixel(i, 12, 15, vaddr2); + putpixel(i, 90, 15, vaddr2); + putpixel(i, 91, 15, vaddr2); + } + for (int i=11; i<=91; ++i) + { + putpixel(posicio, i, 15, vaddr2); + putpixel(posicio+1, i, 15, vaddr2); + putpixel(posicio+74, i, 15, vaddr2); + putpixel(posicio+75, i, 15, vaddr2); + } + + if (mode_nocturne) + { + if (mode_Dream_Tour == Dream_tour) pinta_number_zoom(2, tick, 255, 216, 143, vaddr2); + } + else + if ( (pos==1) || (pos==3) ) + { + if (mode_easy == pepe_facil) pinta_number_zoom(2, tick, 255, 216, 118, vaddr2); + if (mode_normal == pepe_normal) pinta_number_zoom(2, tick, 255, 216, 143, vaddr2); + if (mode_hard == pepe_dificil) pinta_number_zoom(2, tick, 255, 216, 168, vaddr2); + } + else + { + if (mode_easy_r == rosita_facil) pinta_number_zoom(2, tick, 255, 216, 118, vaddr2); + if (mode_normal_r == rosita_normal) pinta_number_zoom(2, tick, 255, 216, 143, vaddr2); + if (mode_hard_r == rosita_dificil) pinta_number_zoom(2, tick, 255, 216, 168, vaddr2); + } + + if (pos_dif == 1) pinta_number(fletxa, 255, 98, 118, vaddr2); + if (pos_dif == 2) pinta_number(fletxa, 255, 98, 143, vaddr2); + if (pos_dif == 3) pinta_number(fletxa, 255, 98, 168, vaddr2); + + espera_VGA(); + volcar32(vaddr2, VGA); + } + + void desp_marc(uint8_t direccio) + { + switch (direccio) + { + case Left: + if (pos == 3) + { + i = 219; + while (i > 136) + { + pinta_marcs(i); + i = i - 3; + if (i < 137) pinta_marcs(137); + } + } + else + if (pos == 2) + { + i=137; + while (i > 54) + { + pinta_marcs(i); + i = i - 3; + if (i < 55) pinta_marcs(55); + } + } + break; + + case Right: + if (pos == 1) + { + i=55; + while (i < 138) + { + pinta_marcs(i); + i = i + 3; + if (i > 137) pinta_marcs(137); + } + } + else + if (pos == 2) + { + i=137; + while (i < 220) + { + pinta_marcs(i); + i = i + 3; + if (i > 219) pinta_marcs(219); + } + } + break; + } + } -procedure fondo_estreles(from,where:word); -var - i,a,b : byte; begin - for i:=1 to 10 do - begin - if (estreles[i].y + estreles[i].velocitat) > 191 then - begin - estreles[i].x := random(290); - estreles[i].y := 1; - estreles[i].velocitat := random(3) + 1; - end - else estreles[i].y := estreles[i].y + (estreles[i].velocitat); - Putsprite(from,where,26747,9,8,estreles[i].x,estreles[i].y); - end; -end; + time_attack_mode:=false; + story_mode_mode:=false; -procedure actualitza_options(from,where:word); -var i,j:byte; -begin + percentatge:=0; - cls32(0,vaddr2); + if mode_easy=pepe_facil then inc(percentatge); + if mode_normal=pepe_normal then inc(percentatge); + if mode_hard=pepe_dificil then inc(percentatge); + if mode_easy_r=rosita_facil then inc(percentatge); + if mode_normal_r=rosita_normal then inc(percentatge); + if mode_hard_r=rosita_dificil then inc(percentatge); + if mode_Dream_tour=Dream_tour then inc(percentatge); - for i:=0 to 3 do - for j:=0 to 5 do Putsprite(vaddr,where,48000,50,50,j*50,i*50); + if mode_nocturne then + load_mif(menu_nit,vaddr) + else + load_mif(menu,vaddr); - fondo_estreles(vaddr,vaddr2); + load_mif(menu_s,vaddr2); + espera_vga; + volcar32(vaddr,VGA); - Putsprite(from,where,30400,165,28,70,5); + if not(mode_nocturne) then + begin + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + ini_midi(musica_title); + if midi then Playmidi; + end + else + begin + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + ini_midi(musica_nit); + if midi then Playmidi; + if not(midi) then ini_midi(musica_nit); + if (not(Playing)) and (midi) then PlayMidi; + end; - Putsprite(from,where,39733,116,18,22,43); - if amb_so then Putsprite(from,where,40492,25,17,149,45) - else Putsprite(from,where,39557,28,20,150,42); - - Putsprite(from,where,57332,113,19,20,81); - if GM then Putsprite(from,where,51573,107,17,141,81) - else Putsprite(from,where,51684,130,20,141,81); - - Putsprite(from,where,45172,39,20,22,61); - case volumen of - - 0 : Putsprite(from,where,45551,32,18,70,62); - 1 : Putsprite(from,where,45580,16,18,70,62); - 2 : Putsprite(from,where,45596,16,18,70,62); - 3 : Putsprite(from,where,45611,16,18,70,62); - 4 : Putsprite(from,where,45626,16,18,70,62); - 5 : Putsprite(from,where,45642,16,18,70,62); - 6 : Putsprite(from,where,45658,16,18,70,62); - 7 : Putsprite(from,where,45673,16,18,70,62); - 8 : Putsprite(from,where,45689,16,18,70,62); - 9 : Putsprite(from,where,45705,14,18,71,62); - 10 : Putsprite(from,where,45720,40,18,70,62); - end; - - Putsprite(from,where,21673,84,73,22,117); - - Putsprite(vaddr,vaddr2,tecla_amunt_dib,21,21,135,110); - Putsprite(vaddr,vaddr2,tecla_avall_dib,21,21,135,131); - Putsprite(vaddr,vaddr2,tecla_esquerra_dib,21,21,135,152); - Putsprite(vaddr,vaddr2,tecla_dreta_dib,21,21,135,173); - - /* fletxes i ESC */ - Putsprite(vaddr,vaddr2,31527,47,24,238,172); - - /* Complet + percentatge */ - Putsprite(vaddr,vaddr2,58405,70,17,200,120); - Putsprite(vaddr,vaddr2,percentatge*29,29,14,220,142); - - Pinta_number(fletxa3,255,13,cord_y,vaddr2); - -end; - - procedure pinta_marcs(posicio:word); - var - i : word; - begin - volcar32(vaddr,vaddr2); - for i:=posicio to posicio+75 do + i:=320; + if not(mode_nocturne) then + while (i>20) do begin - putpixel(i,11,15,vaddr2); - putpixel(i,12,15,vaddr2); - putpixel(i,90,15,vaddr2); - putpixel(i,91,15,vaddr2); - end; - for i:=11 to 91 do - begin - putpixel(posicio,i,15,vaddr2); - putpixel(posicio+1,i,15,vaddr2); - putpixel(posicio+74,i,15,vaddr2); - putpixel(posicio+75,i,15,vaddr2); + espera_VGA; + volcar32(vaddr,VGA); + Put_Sprite_ICE_dreta(vaddr2,VGA,16983,142,26,i,53); + dec(i,10); + if i=20 then Put_Sprite_ICE_dreta(vaddr2,vaddr,16983,142,26,i,53); end; - if mode_nocturne then - begin - if mode_Dream_Tour=Dream_tour then pinta_number_zoom(2,tick,255,216,143,vaddr2); - end - else if (pos=1) or (pos=3) then - begin - if mode_easy=pepe_facil then pinta_number_zoom(2,tick,255,216,118,vaddr2); - if mode_normal=pepe_normal then pinta_number_zoom(2,tick,255,216,143,vaddr2); - if mode_hard=pepe_dificil then pinta_number_zoom(2,tick,255,216,168,vaddr2); - end - else begin - if mode_easy_r=rosita_facil then pinta_number_zoom(2,tick,255,216,118,vaddr2); - if mode_normal_r=rosita_normal then pinta_number_zoom(2,tick,255,216,143,vaddr2); - if mode_hard_r=rosita_dificil then pinta_number_zoom(2,tick,255,216,168,vaddr2); - end; - - if pos_dif=1 then pinta_number(fletxa,255,98,118,vaddr2); - if pos_dif=2 then pinta_number(fletxa,255,98,143,vaddr2); - if pos_dif=3 then pinta_number(fletxa,255,98,168,vaddr2); - - espera_VGA; - volcar32(vaddr2,VGA); - end; - - procedure desp_marc(direccio:byte); - begin - case direccio of - - Left: if pos=3 then - begin - i:=219; - while i>136 do - begin - pinta_marcs(i); - i:=i-3; - if i<137 then pinta_marcs(137); - end; - end - else if pos=2 then - begin - i:=137; - while i>54 do - begin - pinta_marcs(i); - i:=i-3; - if i<55 then pinta_marcs(55); - end; - end; - - Right:if pos=1 then - begin - i:=55; - while i<138 do - begin - pinta_marcs(i); - i:=i+3; - if i>137 then pinta_marcs(137); - end; - end - else if pos=2 then - begin - i:=137; - while i<220 do - begin - pinta_marcs(i); - i:=i+3; - if i>219 then pinta_marcs(219); - end; - end; - - end; - end; - begin - - time_attack_mode:=false; - story_mode_mode:=false; - - percentatge:=0; - - if mode_easy=pepe_facil then inc(percentatge); - if mode_normal=pepe_normal then inc(percentatge); - if mode_hard=pepe_dificil then inc(percentatge); - if mode_easy_r=rosita_facil then inc(percentatge); - if mode_normal_r=rosita_normal then inc(percentatge); - if mode_hard_r=rosita_dificil then inc(percentatge); - if mode_Dream_tour=Dream_tour then inc(percentatge); - - if mode_nocturne then load_mif(menu_nit,vaddr) - else load_mif(menu,vaddr); - load_mif(menu_s,vaddr2); - espera_vga; - volcar32(vaddr,VGA); - - - if not(mode_nocturne) then - begin - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - ini_midi(musica_title); - if midi then Playmidi; - end - else begin - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - ini_midi(musica_nit); - if midi then Playmidi; - if not(midi) then ini_midi(musica_nit); - if (not(Playing)) and (midi) then PlayMidi; - end; - - i:=320; - if not(mode_nocturne) then - while (i>20) do - begin + i:=320; + while (i>20) do + begin espera_VGA; volcar32(vaddr,VGA); - Put_Sprite_ICE_dreta(vaddr2,VGA,16983,142,26,i,53); + if not(mode_nocturne) then + Put_Sprite_ICE_dreta(vaddr2,VGA,28822,132,25,i,90) + else + Put_Sprite_ICE_dreta(vaddr2,VGA,28958,132,25,i,90); dec(i,10); - if i=20 then Put_Sprite_ICE_dreta(vaddr2,vaddr,16983,142,26,i,53); - end; + if i=20 then + if not(mode_nocturne) then + Put_Sprite_ICE_dreta(vaddr2,vaddr,28822,132,25,i,90) + else + Put_Sprite_ICE_dreta(vaddr2,vaddr,28958,132,25,i,90); + end; - i:=320; - while (i>20) do - begin - espera_VGA; - volcar32(vaddr,VGA); - if not(mode_nocturne) then Put_Sprite_ICE_dreta(vaddr2,VGA,28822,132,25,i,90) - else Put_Sprite_ICE_dreta(vaddr2,VGA,28958,132,25,i,90); - dec(i,10); - if i=20 then if not(mode_nocturne) then Put_Sprite_ICE_dreta(vaddr2,vaddr,28822,132,25,i,90) - else Put_Sprite_ICE_dreta(vaddr2,vaddr,28958,132,25,i,90); - end; - - i:=320; - while (i>20) do - begin + i:=320; + while (i>20) do + begin espera_VGA; volcar32(vaddr,VGA); Put_Sprite_ICE_dreta(vaddr2,VGA,40982,152,24,i,128); dec(i,10); if i=20 then Put_Sprite_ICE_dreta(vaddr2,vaddr,40982,152,24,i,128); - end; + end; - i:=320; - while (i>20) do - begin + i:=320; + while (i>20) do + begin espera_VGA; volcar32(vaddr,VGA); Put_Sprite_ICE_dreta(vaddr2,VGA,52182,103,30,i,163); dec(i,10); if i=20 then Put_Sprite_ICE_dreta(vaddr2,vaddr,52182,103,30,i,163); - end; + end; - i_int:=-35; - while (i_int<15) do - begin + i_int:=-35; + while (i_int<15) do + begin espera_VGA; volcar32(vaddr,VGA); espera_VGA; Put_Sprite_ICE_dalt(vaddr2,VGA,5463,133,33,23,i_int); inc(i_int,10); if i_int=15 then Put_Sprite_ICE_dalt(vaddr2,vaddr,5463,133,33,23,i_int); - end; + end; + + espera_VGA; + volcar32(vaddr, VGA); + + gettime(h,m,s,c); + temps:=h*3600+m*60+s; + eixir_del_joc:=false; + pos_m:=2; + pinta_number(fletxa2,255,13,100,VGA); + cord_y:=100; - espera_VGA; - volcar32(vaddr,VGA); + repeat - gettime(h,m,s,c); - temps:=h*3600+m*60+s; - eixir_del_joc:=false; - pos_m:=2; - pinta_number(fletxa2,255,13,100,VGA); - cord_y:=100; - repeat + if (not(playing)) then + if (mode_nocturne) then + begin + ini_midi(musica_nit); + if midi then PlayMIDI; + end + else + begin + ini_midi(musica_title); + if midi then PlayMIDI; + end; - if (not(playing)) then - if (mode_nocturne) then begin ini_midi(musica_nit); if midi then PlayMIDI; end - else begin ini_midi(musica_title); if midi then PlayMIDI; end; + gettime(h,m,s,c); + temps2:=h*3600+m*60+s; - gettime(h,m,s,c); - temps2:=h*3600+m*60+s; + if (TeclaPuls(KeyArrowDown)) and (pos_m<4) then + begin + inc(pos_m); + case pos_m of + 1:cord_y:=62; + 2:cord_y:=100; + 3:cord_y:=138; + 4:cord_y:=174; + end; + volcar32(vaddr,vaddr2); + pinta_number(fletxa2,255,13,cord_y,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + gettime(h,m,s,c); + temps:=h*3600+m*60+s; + temps2:=h*3600+m*60+s+1; + Play_WAV (sample[so_fletxa]); + repeat until not(TeclaPuls(KeyArrowDown)); + end; - if (TeclaPuls(KeyArrowDown)) and (pos_m<4) then - begin - inc(pos_m); - case pos_m of - 1:cord_y:=62; - 2:cord_y:=100; - 3:cord_y:=138; - 4:cord_y:=174; - end; - volcar32(vaddr,vaddr2); - pinta_number(fletxa2,255,13,cord_y,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - gettime(h,m,s,c); - temps:=h*3600+m*60+s; - temps2:=h*3600+m*60+s+1; - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowDown)); - end; + if (TeclaPuls(KeyArrowUp)) and (pos_m>1) then + begin + dec(pos_m); + if (mode_nocturne) and (pos_m=1) then pos_m:=2; + case pos_m of + 1:cord_y:=62; + 2:cord_y:=100; + 3:cord_y:=138; + 4:cord_y:=174; + end; + volcar32(vaddr,vaddr2); + pinta_number(fletxa2,255,13,cord_y,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + gettime(h,m,s,c); + temps:=h*3600+m*60+s; + temps2:=h*3600+m*60+s+1; + Play_WAV (sample[so_fletxa]); + repeat until not(TeclaPuls(KeyArrowUp)); + end; - if (TeclaPuls(KeyArrowUp)) and (pos_m>1) then - begin - dec(pos_m); - if (mode_nocturne) and (pos_m=1) then pos_m:=2; - case pos_m of - 1:cord_y:=62; - 2:cord_y:=100; - 3:cord_y:=138; - 4:cord_y:=174; - end; - volcar32(vaddr,vaddr2); - pinta_number(fletxa2,255,13,cord_y,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - gettime(h,m,s,c); - temps:=h*3600+m*60+s; - temps2:=h*3600+m*60+s+1; - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowUp)); - end; + volcar32(vaddr,vaddr2); + if (temps2 mod 2)=0 then + pinta_number(fletxa2,255,13,cord_y,vaddr2) + else + pinta_number(fletxa2,255,15,cord_y,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); - volcar32(vaddr,vaddr2); - if (temps2 mod 2)=0 then pinta_number(fletxa2,255,13,cord_y,vaddr2) - else pinta_number(fletxa2,255,15,cord_y,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); + until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)) or ((temps2-temps)>=10); - until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)) or ((temps2-temps)>=10); + if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); - if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); + if teclapuls(keyESC) then + begin + pos_m:=5; + StopMIDI; + power_off(vaddr); + eixir_del_joc:=true; + end; - if teclapuls(keyESC) then - begin - pos_m:=5; - StopMIDI; - power_off(vaddr); - eixir_del_joc:=true; - end; - if (Temps2-temps)>=10 then - begin - pos_m:=5; - fadedown(0,0,0,0); - escriu_records(10); - titol_del_joc; - end; + if (Temps2-temps)>=10 then + begin + pos_m:=5; + fadedown(0,0,0,0); + escriu_records(10); + titol_del_joc; + end; - /* TIME ATTACK */ - if (pos_m=1) and (not(mode_nocturne)) then - begin - time_attack_mode:=true; - fadedown(0,0,0,1); - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - time_attack; - end; + // TIME ATTACK + if (pos_m=1) and (not(mode_nocturne)) then + begin + time_attack_mode:=true; + fadedown(0,0,0,1); + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + time_attack; + end; - /* PEPE VELL */ - if (pos_m=3) then + // PEPE VELL + if (pos_m=3) then + begin + fadedown(0,0,0,1); + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + pepe_text; + end; + + // STORY MODE + if (pos_m=2) then + begin + borrat_de_pantalla(vaddr); + repeat until not(TeclaPuls(KeyENTER)); + story_mode_mode:=true; + rosita_selected:=false; + amic_selected:=false; + + if (mode_nocturne) then + load_mif(select_n,vaddr) + else + load_mif(select,vaddr); + + if not(mode_rosita=rosita_enabled) then begin - fadedown(0,0,0,1); - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - pepe_text; + for i:=137 to 212 do + for j:=11 to 91 do putpixel(i,j,0,vaddr); + putpixel(145,19,14,vaddr); + putpixel(197,44,14,vaddr); + putpixel(149,78,14,vaddr); + putpixel(194,77,14,vaddr); + putpixel(172,54,14,vaddr); + putpixel(198,65,14,vaddr); + putpixel(177,38,9,vaddr); + putpixel(169,82,9,vaddr); + putpixel(183,12,9,vaddr); + putpixel(139,37,9,vaddr); + putpixel(211,81,9,vaddr); + end; + if not(mode_amic=job_enabled) then + begin + for i:=219 to 294 do + for j:=11 to 91 do putpixel(i,j,0,vaddr); + putpixel(228,65,14,vaddr); + putpixel(290,26,14,vaddr); + putpixel(264,63,14,vaddr); + putpixel(284,85,14,vaddr); + putpixel(262,13,14,vaddr); + putpixel(239,46,14,vaddr); + putpixel(266,74,9,vaddr); + putpixel(264,21,9,vaddr); + putpixel(248,84,9,vaddr); + putpixel(279,87,9,vaddr); + putpixel(254,39,9,vaddr); + end; + espera_vga; + volcar32(vaddr,vga); + pinta_marcs(55); + pos:=1; + if mode_nocturne then pos_dif:=0 else pos_dif:=1; + a_on_pinte_el_marc:=55; + get_color(15,R,G,B); + i:=0; G:=0; B:=0; + repeat + i:=(i+1) mod 127; + i_int:=(63-i); + B:=ABS(i_int); + G:=B; + set_color(15,R,G,B); + if (not(playing)) and (midi) then PlayMIDI; + + if (TeclaPuls(KeyArrowLeft)) and (pos>1) then + if not(mode_nocturne) then + begin + desp_marc(Left); + dec(pos); + end; + + if (TeclaPuls(KeyArrowRight)) and (pos<3) then + if not(mode_nocturne) then + begin + if (pos=1) and (mode_rosita=99) then + begin + desp_marc(Right); + inc(pos); + end + else + if (pos=2) and (mode_amic=199) then + begin + desp_marc(Right); + inc(pos); + end; + end; + + if (TeclaPuls(KeyArrowDown)) and (pos_dif<3) and not(mode_nocturne) then + begin + inc(pos_dif); + pinta_marcs(a_on_pinte_el_marc); + Play_WAV (sample[so_fletxa]); + repeat until not(TeclaPuls(KeyArrowDown)); + end; + + if (TeclaPuls(KeyArrowUp)) and (pos_dif>1) and not(mode_nocturne) then + begin + dec(pos_dif); + pinta_marcs(a_on_pinte_el_marc); + Play_WAV (sample[so_fletxa]); + repeat until not(TeclaPuls(KeyArrowUp)); + end; + + if pos=2 then + if mode_rosita=99 then + begin + pinta_marcs(137); + a_on_pinte_el_marc:=137; + end; + + if pos=3 then + if mode_amic=199 then + begin + pinta_marcs(219); + a_on_pinte_el_marc:=219; + end; + + if pos=1 then + begin + pinta_marcs(55); + a_on_pinte_el_marc:=55; + end; + + until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)); + + if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); + + if TeclaPuls(KeyESC) then pos:=4; + + if pos_dif=1 then dificultat:=facil; + if pos_dif=2 then dificultat:=normal; + if pos_dif=3 then dificultat:=dificil; + + if mode_nocturne then dificultat:=normal; + + if pos=1 then + begin + amic_selected:=false; + rosita_selected:=false; + color_pintura:=162; + color_marcador_pintura:=162; end; - /* STORY MODE */ - if (pos_m=2) then - begin - borrat_de_pantalla(vaddr); - repeat until not(TeclaPuls(KeyENTER)); - story_mode_mode:=true; - rosita_selected:=false; - amic_selected:=false; - if (mode_nocturne) then load_mif(select_n,vaddr) - else load_mif(select,vaddr); - if not(mode_rosita=rosita_enabled) then - begin - for i:=137 to 212 do - for j:=11 to 91 do putpixel(i,j,0,vaddr); - putpixel(145,19,14,vaddr); - putpixel(197,44,14,vaddr); - putpixel(149,78,14,vaddr); - putpixel(194,77,14,vaddr); - putpixel(172,54,14,vaddr); - putpixel(198,65,14,vaddr); - putpixel(177,38,9,vaddr); - putpixel(169,82,9,vaddr); - putpixel(183,12,9,vaddr); - putpixel(139,37,9,vaddr); - putpixel(211,81,9,vaddr); - end; - if not(mode_amic=job_enabled) then - begin - for i:=219 to 294 do - for j:=11 to 91 do putpixel(i,j,0,vaddr); - putpixel(228,65,14,vaddr); - putpixel(290,26,14,vaddr); - putpixel(264,63,14,vaddr); - putpixel(284,85,14,vaddr); - putpixel(262,13,14,vaddr); - putpixel(239,46,14,vaddr); - putpixel(266,74,9,vaddr); - putpixel(264,21,9,vaddr); - putpixel(248,84,9,vaddr); - putpixel(279,87,9,vaddr); - putpixel(254,39,9,vaddr); - end; - espera_vga; - volcar32(vaddr,vga); - pinta_marcs(55); - pos:=1; - if mode_nocturne then pos_dif:=0 else pos_dif:=1; - a_on_pinte_el_marc:=55; - get_color(15,R,G,B); - i:=0; G:=0; B:=0; - repeat - i:=(i+1) mod 127; - i_int:=(63-i); - B:=ABS(i_int); - G:=B; - set_color(15,R,G,B); - if (not(playing)) and (midi) then PlayMIDI; + if pos=2 then + begin + amic_selected:=false; + rosita_selected:=true; + color_pintura:=199; + color_marcador_pintura:=199; + end; + if pos=3 then + begin + amic_selected:=true; + rosita_selected:=false; + color_pintura:=48; + color_marcador_pintura:=48; + end; - if (TeclaPuls(KeyArrowLeft)) and (pos>1) then - if not(mode_nocturne) then - begin - desp_marc(Left); - dec(pos); - end; - if (TeclaPuls(KeyArrowRight)) and (pos<3) then - if not(mode_nocturne) then - begin - if (pos=1) and (mode_rosita=99) then - begin - desp_marc(Right); - inc(pos); - end - else if (pos=2) and (mode_amic=199) then - begin - desp_marc(Right); - inc(pos); - end; - end; + if pos=4 then + borrat_de_pantalla(vaddr) + else + fadedown(0,0,0,0); - if (TeclaPuls(KeyArrowDown)) and (pos_dif<3) and - not(mode_nocturne) then - begin - inc(pos_dif); - pinta_marcs(a_on_pinte_el_marc); - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowDown)); - end; + if not(pos=4) then + begin + if (midi) and not(mode_nocturne) then begin StopMIDI; unloadmidi; midi:=false; end; + Story_mode; + end; + end; - if (TeclaPuls(KeyArrowUp)) and (pos_dif>1) and - not(mode_nocturne) then - begin - dec(pos_dif); - pinta_marcs(a_on_pinte_el_marc); - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowUp)); - end; + // opcions + if (pos_m=4) then + begin - if pos=2 then - if mode_rosita=99 then - begin - pinta_marcs(137); - a_on_pinte_el_marc:=137; - end; + ini_estreles; - if pos=3 then - if mode_amic=199 then - begin - pinta_marcs(219); - a_on_pinte_el_marc:=219; - end; + pos_m:=1; - if pos=1 then - begin - pinta_marcs(55); - a_on_pinte_el_marc:=55; - end; - - until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)); - - if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); - - if TeclaPuls(KeyESC) then pos:=4; - - if pos_dif=1 then dificultat:=facil; - if pos_dif=2 then dificultat:=normal; - if pos_dif=3 then dificultat:=dificil; - - if mode_nocturne then dificultat:=normal; - - if pos=1 then - begin - amic_selected:=false; - rosita_selected:=false; - color_pintura:=162; - color_marcador_pintura:=162; - end; - - if pos=2 then - begin - amic_selected:=false; - rosita_selected:=true; - color_pintura:=199; - color_marcador_pintura:=199; - end; - - if pos=3 then - begin - amic_selected:=true; - rosita_selected:=false; - color_pintura:=48; - color_marcador_pintura:=48; - end; - - if pos=4 then borrat_de_pantalla(vaddr) - else fadedown(0,0,0,0); - - if not(pos=4) then - begin - if (midi) and not(mode_nocturne) then begin StopMIDI; unloadmidi; midi:=false; end; - Story_mode; - end; - end; - - /* opcions */ - if (pos_m=4) then - begin - - ini_estreles; - - pos_m:=1; - - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - ini_midi(musica_options); - if midi then Playmidi; - - cord_y := 47; - load_mif(options,vaddr); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - - repeat - - if (not(playing)) and (midi) then PlayMIDI; - - if (TeclaPuls(KeyArrowDown)) and (pos_m<7) then - begin - inc(pos_m); - case pos_m of - 1:cord_y:=47; - 2:cord_y:=65; - 3:cord_y:=83; - - 4:cord_y:=122; - 5:cord_y:=140; - 6:cord_y:=158; - 7:cord_y:=176; - - end; - Play_WAV (sample[so_fletxa]); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until not(TeclaPuls(KeyArrowDown)); - end; - - if (TeclaPuls(KeyArrowUp)) and (pos_m>1) then - begin - dec(pos_m); - case pos_m of - 1:cord_y:=47; - 2:cord_y:=65; - 3:cord_y:=83; - - 4:cord_y:=122; - 5:cord_y:=140; - 6:cord_y:=158; - 7:cord_y:=176; - - end; - Play_WAV (sample[so_fletxa]); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until not(TeclaPuls(KeyArrowUp)); - end; - - - if (TeclaPuls(KeyArrowRight)) then - begin - if (pos_m=1) then begin - amb_so:=/*not(amb_so);*/false; - if Puerto=255 then amb_so:=false; - /*if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; - if amb_so then arxius_wav(amb_so);*/ - end - else if (pos_m=2) then begin if volumen<10 then inc(volumen) end - else if (pos_m=3) then GM:=not(GM); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until not(QTeclaPuls); - end; - - if (TeclaPuls(KeyArrowLeft)) then - begin - if (pos_m=1) then begin - amb_so:=/*not(amb_so);*/false; - if Puerto=255 then amb_so:=false; - /*if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; - if amb_so then arxius_wav(amb_so);*/ - end - else if (pos_m=2) then begin if volumen>0 then dec(volumen) end - else if (pos_m=3) then GM:=not(GM); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until not(QTeclaPuls); - end; - - if ((TeclaPuls(KeyENTER))) and (pos_m>3) then - begin - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - Play_WAV (sample[so_enter]); - until not(TeclaPuls(KeyENTER)); - aux := 0; - dib_aux := 23781; - actualitza_options(vaddr,vaddr2); - case pos_m of - - 4 : begin - tecla_amunt:=aux; - tecla_amunt_dib := dib_aux; - end; - 5 : begin - tecla_avall:=aux; - tecla_avall_dib := dib_aux; - end; - 6 : begin - tecla_esquerra:=aux; - tecla_esquerra_dib := dib_aux; - end; - 7 : begin - tecla_dreta:=aux; - tecla_dreta_dib := dib_aux; - end; - - - end; - espera_VGA; - volcar32(vaddr2,VGA); - repeat - tecla_incorrecta:=true; - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until Qteclapuls; - aux:=AgarrarTecla; - repeat - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - until not(QTeclaPuls); - - case aux of - - KeyA,KeyB,KeyC,KeyD,KeyE,KeyF,KeyG,KeyH,KeyI,KeyJ,KeyK,KeyL,KeyM,KeyN, - KeyO,KeyP,KeyQ,KeyR,KeyS,KeyT,KeyU,KeyV,KeyW,KeyX,KeyY,KeyZ, - KeyArrowUp,KeyArrowDown,KeyArrowLeft,KeyArrowRight : tecla_incorrecta:=false; - - else tecla_incorrecta:=true; - - end; - - until (not(tecla_incorrecta)); - - case aux of - - KeyA : dib_aux := 4485; - KeyB : dib_aux := 4509; - KeyC : dib_aux := 4533; - KeyD : dib_aux := 4557; - KeyE : dib_aux := 4581; - KeyF : dib_aux := 4605; - KeyG : dib_aux := 4629; - KeyH : dib_aux := 4653; - KeyI : dib_aux := 4677; - KeyJ : dib_aux := 4702; - KeyK : dib_aux := 4726; - KeyL : dib_aux := 4750; - KeyM : dib_aux := 4774; - KeyN : dib_aux := 14085; - KeyO : dib_aux := 14109; - KeyP : dib_aux := 14133; - KeyQ : dib_aux := 14157; - KeyR : dib_aux := 14181; - KeyS : dib_aux := 14205; - KeyT : dib_aux := 14229; - KeyU : dib_aux := 14253; - KeyV : dib_aux := 14277; - KeyW : dib_aux := 14302; - KeyX : dib_aux := 14326; - KeyY : dib_aux := 14350; - KeyZ : dib_aux := 14374; - KeyArrowUp : dib_aux := 23709; - KeyArrowDown : dib_aux := 23685; - KeyArrowLeft : dib_aux := 23757; - KeyArrowRight : dib_aux := 23733; - - end; - - case pos_m of - - 4 : begin - tecla_amunt:=aux; - tecla_amunt_dib := dib_aux; - end; - 5 : begin - tecla_avall:=aux; - tecla_avall_dib := dib_aux; - end; - 6 : begin - tecla_esquerra:=aux; - tecla_esquerra_dib := dib_aux; - end; - 7 : begin - tecla_dreta:=aux; - tecla_dreta_dib := dib_aux; - end; - - end; - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); - end; + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + ini_midi(musica_options); + if midi then Playmidi; + cord_y := 47; + load_mif(options,vaddr); actualitza_options(vaddr,vaddr2); espera_VGA; volcar32(vaddr2,VGA); + repeat - until TeclaPuls(KeyESC); + if (not(playing)) and (midi) then PlayMIDI; - borrat_de_pantalla(vaddr2); + if (TeclaPuls(KeyArrowDown)) and (pos_m<7) then + begin + inc(pos_m); + case pos_m of + 1:cord_y:=47; + 2:cord_y:=65; + 3:cord_y:=83; + 4:cord_y:=122; + 5:cord_y:=140; + 6:cord_y:=158; + 7:cord_y:=176; + end; + Play_WAV (sample[so_fletxa]); + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until not(TeclaPuls(KeyArrowDown)); + end; - if midi then begin StopMIDI; unloadmidi; midi:=false; end; + if (TeclaPuls(KeyArrowUp)) and (pos_m>1) then + begin + dec(pos_m); + case pos_m of + 1:cord_y:=47; + 2:cord_y:=65; + 3:cord_y:=83; + 4:cord_y:=122; + 5:cord_y:=140; + 6:cord_y:=158; + 7:cord_y:=176; + end; + Play_WAV (sample[so_fletxa]); + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until not(TeclaPuls(KeyArrowUp)); + end; - save_cfg; + if (TeclaPuls(KeyArrowRight)) then + begin + if (pos_m=1) then + begin + amb_so:=/*not(amb_so);*/false; + if Puerto=255 then amb_so:=false; + /*if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; + if amb_so then arxius_wav(amb_so);*/ + end + else + if (pos_m=2) then + begin + if volumen<10 then + inc(volumen) + end + else + if (pos_m=3) then GM:=not(GM); + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until not(QTeclaPuls); + end; - end; + if (TeclaPuls(KeyArrowLeft)) then + begin + if (pos_m=1) then + begin + amb_so:=/*not(amb_so);*/false; + if Puerto=255 then amb_so:=false; + /*if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; + if amb_so then arxius_wav(amb_so);*/ + end + else + if (pos_m=2) then + begin + if volumen>0 then dec(volumen) + end + else + if (pos_m=3) then GM:=not(GM); + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until not(QTeclaPuls); + end; + + if ((TeclaPuls(KeyENTER))) and (pos_m>3) then + begin + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + Play_WAV (sample[so_enter]); + until not(TeclaPuls(KeyENTER)); + aux := 0; + dib_aux := 23781; + actualitza_options(vaddr,vaddr2); + + case pos_m of + 4 : begin + tecla_amunt:=aux; + tecla_amunt_dib := dib_aux; + end; + 5 : begin + tecla_avall:=aux; + tecla_avall_dib := dib_aux; + end; + 6 : begin + tecla_esquerra:=aux; + tecla_esquerra_dib := dib_aux; + end; + 7 : begin + tecla_dreta:=aux; + tecla_dreta_dib := dib_aux; + end; + end; + + espera_VGA; + volcar32(vaddr2,VGA); + repeat + tecla_incorrecta:=true; + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until Qteclapuls; + aux:=AgarrarTecla; + repeat + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + until not(QTeclaPuls); + + case aux of + KeyA,KeyB,KeyC,KeyD,KeyE,KeyF,KeyG,KeyH,KeyI,KeyJ,KeyK,KeyL,KeyM,KeyN, + KeyO,KeyP,KeyQ,KeyR,KeyS,KeyT,KeyU,KeyV,KeyW,KeyX,KeyY,KeyZ, + KeyArrowUp,KeyArrowDown,KeyArrowLeft,KeyArrowRight : tecla_incorrecta:=false; + else + tecla_incorrecta:=true; + end; + + until (not(tecla_incorrecta)); + + case aux of + KeyA : dib_aux := 4485; + KeyB : dib_aux := 4509; + KeyC : dib_aux := 4533; + KeyD : dib_aux := 4557; + KeyE : dib_aux := 4581; + KeyF : dib_aux := 4605; + KeyG : dib_aux := 4629; + KeyH : dib_aux := 4653; + KeyI : dib_aux := 4677; + KeyJ : dib_aux := 4702; + KeyK : dib_aux := 4726; + KeyL : dib_aux := 4750; + KeyM : dib_aux := 4774; + KeyN : dib_aux := 14085; + KeyO : dib_aux := 14109; + KeyP : dib_aux := 14133; + KeyQ : dib_aux := 14157; + KeyR : dib_aux := 14181; + KeyS : dib_aux := 14205; + KeyT : dib_aux := 14229; + KeyU : dib_aux := 14253; + KeyV : dib_aux := 14277; + KeyW : dib_aux := 14302; + KeyX : dib_aux := 14326; + KeyY : dib_aux := 14350; + KeyZ : dib_aux := 14374; + KeyArrowUp : dib_aux := 23709; + KeyArrowDown : dib_aux := 23685; + KeyArrowLeft : dib_aux := 23757; + KeyArrowRight : dib_aux := 23733; + end; + + case pos_m of + 4 : begin + tecla_amunt:=aux; + tecla_amunt_dib := dib_aux; + end; + 5 : begin + tecla_avall:=aux; + tecla_avall_dib := dib_aux; + end; + 6 : begin + tecla_esquerra:=aux; + tecla_esquerra_dib := dib_aux; + end; + 7 : begin + tecla_dreta:=aux; + tecla_dreta_dib := dib_aux; + end; + end; + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + end; + + actualitza_options(vaddr,vaddr2); + espera_VGA; + volcar32(vaddr2,VGA); + + until TeclaPuls(KeyESC); + + borrat_de_pantalla(vaddr2); + + if midi then begin StopMIDI; unloadmidi; midi:=false; end; + + save_cfg; + + end; end; /*──────────────────────────────────────────────────────────────────────────*/ /*──────────────────────────────────────────────────────────────────────────*/ int main(int argc, char *argv[]) { - comprobar_comp_i_sprites(); randomize();