diff --git a/pepe2000_utf8.cpp b/pepe2000_utf8.cpp index 22e3736..5d19154 100644 --- a/pepe2000_utf8.cpp +++ b/pepe2000_utf8.cpp @@ -3110,17 +3110,6 @@ void time_attack() } /*──────────────────────────────────────────────────────────────────────────*/ -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); @@ -3304,636 +3293,655 @@ void menu_joc() } } +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; +*/ +{ -begin + time_attack_mode = false; + story_mode_mode = false; - time_attack_mode:=false; - story_mode_mode:=false; + percentatge = 0; - percentatge:=0; + if (mode_easy == pepe_facil) percentatge++; + if (mode_normal == pepe_normal) percentatge++; + if (mode_hard == pepe_dificil) percentatge++; + if (mode_easy_r == rosita_facil) percentatge++; + if (mode_normal_r == rosita_normal) percentatge++; + if (mode_hard_r == rosita_dificil) percentatge++; + if (mode_Dream_tour == Dream_tour) percentatge++; - 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) + if (mode_nocturne) + load_mif(menu_nit, vaddr) else - load_mif(menu,vaddr); + 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 - 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; - - 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 - 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; - - 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; - - 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; - - espera_VGA; + load_mif(menu_s, vaddr2); + 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; + if (!mode_nocturne) + { + if (midi) { StopMIDI(); unloadmidi(); midi=false; } + ini_midi(musica_title); + if (midi) Playmidi(); + } + else + { + if (midi) { StopMIDI(); unloadmidi(); midi=false; } + ini_midi(musica_nit); + if (midi) Playmidi(); + if (!midi) ini_midi(musica_nit); + if (!Playing && midi) PlayMidi(); + } + int i = 320; + if (!mode_nocturne) + while (i > 20) + { + espera_VGA(); + volcar32(vaddr, VGA); + Put_Sprite_ICE_dreta(vaddr2, VGA, 16983, 142, 26, i, 53); + dec(i, 10); + if (i == 20) Put_Sprite_ICE_dreta(vaddr2, vaddr, 16983, 142, 26, i, 53); + } - 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; - - 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(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) + i = 320; + while (i > 20) + { + espera_VGA(); + volcar32(vaddr, VGA); + if (!mode_nocturne) + Put_Sprite_ICE_dreta(vaddr2, VGA, 28822, 132, 25, i, 90) else - pinta_number(fletxa2,255,15,cord_y,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); + Put_Sprite_ICE_dreta(vaddr2, VGA, 28958, 132, 25, i, 90); + i-=10; + if (i == 20) + if (!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); + } - until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)) or ((temps2-temps)>=10); + i = 320; + while (i > 20) + { + espera_VGA(); + volcar32(vaddr, VGA); + Put_Sprite_ICE_dreta(vaddr2, VGA, 40982, 152, 24, i, 128); + i-=10; + if (i == 20) Put_Sprite_ICE_dreta(vaddr2, vaddr, 40982, 152, 24, i, 128); + } - if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); + i = 320; + while (i > 20) + { + espera_VGA(); + volcar32(vaddr, VGA); + Put_Sprite_ICE_dreta(vaddr2, VGA, 52182, 103, 30, i, 163); + i-=10; + if (i == 20) Put_Sprite_ICE_dreta(vaddr2, vaddr, 52182, 103, 30, i, 163); + } - if teclapuls(keyESC) then - begin - pos_m:=5; - StopMIDI; + i = -35; + while (i < 15) + { + espera_VGA(); + volcar32(vaddr, VGA); + espera_VGA(); + Put_Sprite_ICE_dalt(vaddr2, VGA, 5463, 133, 33, 23, i); + i+=10; + if (i == 15) Put_Sprite_ICE_dalt(vaddr2, vaddr, 5463, 133, 33, 23, i); + } + + espera_VGA(); + volcar32(vaddr, VGA); + + uint32_t temps = SDL_GetTicks()/1000; + uint32_t temps2; + + eixir_del_joc = false; + pos_m = 2; + pinta_number(fletxa2, 255, 13, 100, VGA); + cord_y = 100; + + + do + { + if (!playing) + if (mode_nocturne) + { + ini_midi(musica_nit); + if (midi) PlayMIDI(); + } + else + { + ini_midi(musica_title); + if (midi) PlayMIDI(); + } + + temps2 = SDL_GetTicks()/1000; + + if ( TeclaPuls(SDL_SCANCODE_DOWN) && (pos_m<4) ) + { + pos_m++; + switch (pos_m) + { + case 1: cord_y = 62; break; + case 2: cord_y = 100; break; + case 3: cord_y = 138; break; + case 4: cord_y = 174; break; + } + volcar32(vaddr, vaddr2); + pinta_number(fletxa2, 255, 13, cord_y, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + + temps = SDL_GetTicks()/1000; + temps2 = temps + 1; + Play_WAV(sample[so_fletxa]); + do {} while (TeclaPuls(SDL_SCANCODE_DOWN)); + } + + if ( TeclaPuls(SDL_SCANCODE_UP) && (pos_m>1) ) + { + pos_m--; + if (mode_nocturne && (pos_m==1)) pos_m = 2; + switch (pos_m) + { + case 1: cord_y = 62; break; + case 2: cord_y = 100; break; + case 3: cord_y = 138; break; + case 4: cord_y = 174; break; + } + volcar32(vaddr, vaddr2); + pinta_number(fletxa2, 255, 13, cord_y, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + + temps = SDL_GetTicks()/1000; + temps2 = temps + 1; + Play_WAV(sample[so_fletxa]); + do {} while (TeclaPuls(SDL_SCANCODE_UP)); + } + + volcar32(vaddr, vaddr2); + if ( (temps2%2)==0 ) + pinta_number(fletxa2, 255, 13, cord_y, vaddr2) + else + pinta_number(fletxa2, 255, 15, cord_y, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + + } while ( !(TeclaPuls(SDL_SCANCODE_RETURN)) && !(TeclaPuls(SDL_SCANCODE_ESCAPE)) && !((temps2-temps)>=10) ); + + if (TeclaPuls(SDL_SCANCODE_RETURN)) Play_WAV(sample[so_enter]); + + if (teclapuls(SDL_SCANCODE_ESCAPE)) + { + pos_m = 5; + StopMIDI(); power_off(vaddr); - eixir_del_joc:=true; - end; + eixir_del_joc = true; + } - if (Temps2-temps)>=10 then - begin - pos_m:=5; + if ( (temps2-temps) >= 10 ) + { + pos_m = 5; fadedown(0,0,0,0); escriu_records(10); - titol_del_joc; - end; + titol_del_joc(); + } // TIME ATTACK - if (pos_m=1) and (not(mode_nocturne)) then - begin - time_attack_mode:=true; + if ( (pos_m == 1) && !mode_nocturne ) + { + time_attack_mode = true; fadedown(0,0,0,1); - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - time_attack; - end; + if (midi) { StopMIDI(); unloadmidi(); midi=false; } + time_attack(); + } // PEPE VELL - if (pos_m=3) then - begin + if ( pos_m == 3 ) + { fadedown(0,0,0,1); - if midi then begin StopMIDI; unloadmidi; midi:=false; end; - pepe_text; - end; + if (midi) { StopMIDI(); unloadmidi(); midi=false; } + pepe_text(); + } // STORY MODE - if (pos_m=2) then - begin + if ( pos_m == 2 ) + { borrat_de_pantalla(vaddr); - repeat until not(TeclaPuls(KeyENTER)); - story_mode_mode:=true; - rosita_selected:=false; - amic_selected:=false; + do {} while (TeclaPuls(SDL_SCANCODE_RETURN)); + story_mode_mode = true; + rosita_selected = false; + amic_selected = false; - if (mode_nocturne) then - load_mif(select_n,vaddr) + if (mode_nocturne) + load_mif(select_n, vaddr) else - load_mif(select,vaddr); + 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); + if ( mode_rosita != rosita_enabled ) + { + for (int i=137; i<=212; ++i) + for (int j=11; j<=91; j++) 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); + } + if ( mode_amic != job_enabled ) + { + for (int i=219; i<=294; ++i) + for (int j=11; j<=91; ++j) 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); + } + 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; + pos = 1; + pos_dif = mode_nocturne ? 0 : 1; + a_on_pinte_el_marc = 55; + get_color(15, R, G, B); + i=0; G=0; B=0; + do + { + i = (i+1)%127; + B = SDL_abs(63-i); + G = B; set_color(15,R,G,B); - if (not(playing)) and (midi) then PlayMIDI; + if ( !playing && midi ) PlayMIDI(); - if (TeclaPuls(KeyArrowLeft)) and (pos>1) then - if not(mode_nocturne) then - begin + if ( TeclaPuls(SDL_SCANCODE_LEFT) && (pos>1) ) + if (!mode_nocturne) + { desp_marc(Left); - dec(pos); - end; + pos--; + } - if (TeclaPuls(KeyArrowRight)) and (pos<3) then - if not(mode_nocturne) then - begin - if (pos=1) and (mode_rosita=99) then - begin + if ( TeclaPuls(SDL_SCANCODE_RIGHT) && (pos<3) ) + if (!mode_nocturne) + { + if ( (pos==1) && (mode_rosita==99) ) + { desp_marc(Right); - inc(pos); - end + pos++; + } else - if (pos=2) and (mode_amic=199) then - begin + if ( (pos==2) && (mode_amic==199) ) + { desp_marc(Right); - inc(pos); - end; - end; + pos++; + } + } - if (TeclaPuls(KeyArrowDown)) and (pos_dif<3) and not(mode_nocturne) then - begin - inc(pos_dif); + if ( TeclaPuls(SDL_SCANCODE_DOWN) && (pos_dif<3) && !mode_nocturne ) + { + pos_dif++; pinta_marcs(a_on_pinte_el_marc); - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowDown)); - end; + Play_WAV(sample[so_fletxa]); + do {} while (TeclaPuls(SDL_SCANCODE_DOWN)); + } - if (TeclaPuls(KeyArrowUp)) and (pos_dif>1) and not(mode_nocturne) then - begin - dec(pos_dif); + if ( TeclaPuls(SDL_SCANCODE_UP) && (pos_dif>1) && !mode_nocturne ) + { + pos_dif--; pinta_marcs(a_on_pinte_el_marc); - Play_WAV (sample[so_fletxa]); - repeat until not(TeclaPuls(KeyArrowUp)); - end; + Play_WAV(sample[so_fletxa]); + do {} while (TeclaPuls(SDL_SCANCODE_UP)); + } - if pos=2 then - if mode_rosita=99 then - begin + if (pos==2) + if (mode_rosita == 99) + { pinta_marcs(137); - a_on_pinte_el_marc:=137; - end; + a_on_pinte_el_marc = 137; + } - if pos=3 then - if mode_amic=199 then - begin + if (pos == 3) + if (mode_amic == 199) + { pinta_marcs(219); - a_on_pinte_el_marc:=219; - end; + a_on_pinte_el_marc = 219; + } - if pos=1 then - begin + if (pos == 1) + { pinta_marcs(55); - a_on_pinte_el_marc:=55; - end; + a_on_pinte_el_marc = 55; + } - until (TeclaPuls(KeyENTER)) or (TeclaPuls(KeyESC)); + } while ( !TeclaPuls(SDL_SCANCODE_RETURN) && !TeclaPuls(SDL_SCANCODE_ESCAPE) ); - if TeclaPuls(KeyENTER) then Play_WAV (sample[so_enter]); + if ( TeclaPuls(SDL_SCANCODE_RETURN) ) Play_WAV(sample[so_enter]); - if TeclaPuls(KeyESC) then pos:=4; + if ( TeclaPuls(SDL_SCANCODE_ESCAPE) ) pos = 4; - if pos_dif=1 then dificultat:=facil; - if pos_dif=2 then dificultat:=normal; - if pos_dif=3 then dificultat:=dificil; + if ( pos_dif == 1 ) dificultat = facil; + if ( pos_dif == 2 ) dificultat = normal; + if ( pos_dif == 3 ) dificultat = dificil; - if mode_nocturne then dificultat:=normal; + if (mode_nocturne) dificultat = normal; - if pos=1 then - begin - amic_selected:=false; - rosita_selected:=false; - color_pintura:=162; - color_marcador_pintura:=162; - end; + if ( pos == 1 ) + { + amic_selected = false; + rosita_selected = false; + color_pintura = 162; + color_marcador_pintura = 162; + } - if pos=2 then - begin - amic_selected:=false; - rosita_selected:=true; - color_pintura:=199; - color_marcador_pintura:=199; - end; + if ( pos == 2 ) + { + amic_selected = false; + rosita_selected = true; + color_pintura = 199; + color_marcador_pintura = 199; + } - if pos=3 then - begin - amic_selected:=true; - rosita_selected:=false; - color_pintura:=48; - color_marcador_pintura:=48; - end; + if ( pos == 3 ) + { + amic_selected = true; + rosita_selected = false; + color_pintura = 48; + color_marcador_pintura = 48; + } - if pos=4 then + if ( pos == 4 ) 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; + if ( pos != 4 ) + { + if (midi && !mode_nocturne) { StopMIDI(); unloadmidi(); midi=false; } + Story_mode(); + } + } // opcions - if (pos_m=4) then - begin + if ( pos_m == 4 ) + { + ini_estreles(); - ini_estreles; + pos_m = 1; - pos_m:=1; - - if midi then begin StopMIDI; unloadmidi; midi:=false; end; + if (midi) { StopMIDI(); unloadmidi(); midi=false; } ini_midi(musica_options); - if midi then Playmidi; + if (midi) Playmidi(); - cord_y := 47; - load_mif(options,vaddr); - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); + cord_y = 47; + load_mif(options, vaddr); + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); - repeat + do + { + if (!playing && midi) PlayMIDI(); - if (not(playing)) and (midi) then PlayMIDI; + if ( TeclaPuls(SDL_SCANCODE_DOWN) && (pos_m<7) ) + { + pos_m++; + switch (pos_m) + { + case 1: cord_y:=47; break; + case 2: cord_y:=65; break; + case 3: cord_y:=83; break; + case 4: cord_y:=122; break; + case 5: cord_y:=140; break; + case 6: cord_y:=158; break; + case 7: cord_y:=176; break; + } + Play_WAV(sample[so_fletxa]); + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (TeclaPuls(SDL_SCANCODE_DOWN)); + } - 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(SDL_SCANCODE_UP) && (pos_m>1) ) + { + pos_m--; + switch (pos_m) + { + case 1: cord_y:=47; break; + case 2: cord_y:=65; break; + case 3: cord_y:=83; break; + case 4: cord_y:=122; break; + case 5: cord_y:=140; break; + case 6: cord_y:=158; break; + case 7: cord_y:=176; break; + } + Play_WAV(sample[so_fletxa]); + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (TeclaPuls(SDL_SCANCODE_UP)); + } - 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 + if (TeclaPuls(SDL_SCANCODE_RIGHT)) + { + if (pos_m == 1) + { + amb_so = false; // not(amb_so); + if (Puerto==255) amb_so = false; + //if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; + //if amb_so then arxius_wav(amb_so); + } else - if (pos_m=2) then - begin - if volumen<10 then - inc(volumen) - end + if (pos_m == 2) + { + if ( volumen < 10 ) volumen++; + } 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 (pos_m ==3) then GM = !GM; - 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 + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (QTeclaPuls()); + } + + if (TeclaPuls(SDL_SCANCODE_LEFT)) + { + if (pos_m == 1) + { + amb_so = false; // not(amb_so); + if (Puerto == 255) amb_so = false; + //if amb_so then InitWAV(Puerto,DMA,IRQ) else EndWav; + //if amb_so then arxius_wav(amb_so); + } else - if (pos_m=2) then - begin - if volumen>0 then dec(volumen) - end + if (pos_m == 2) + { + if ( volumen > 0 ) volumen--; + } 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 ( pos_m == 3) GM = !GM; + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (QTeclaPuls()); + } - 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); + if ( TeclaPuls(SDL_SCANCODE_RETURN) && (pos_m>3) ) + { + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + Play_WAV(sample[so_enter]); + } while (TeclaPuls(SDL_SCANCODE_RETURN)); + 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; + switch (pos_m) + { + case 4: + tecla_amunt = aux; + tecla_amunt_dib = dib_aux; + break; + case 5: + tecla_avall = aux; + tecla_avall_dib = dib_aux; + break; + case 6: + tecla_esquerra = aux; + tecla_esquerra_dib = dib_aux; + break; + case 7: + tecla_dreta = aux; + tecla_dreta_dib = dib_aux; + break; + } - 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); + espera_VGA(); + volcar32(vaddr2, VGA); + do + { + tecla_incorrecta = true; + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (!Qteclapuls()); + aux = AgarrarTecla(); + do + { + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } while (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; + bool tecla_incorrecta = true; + if (aux >= SDL_SCANCODE_A && aux <) SDL_SCANCODE_Z) tecla_incorrecta = false; + if (aux >= SDL_SCANCODE_RIGHT && aux <) SDL_SCANCODE_UP) tecla_incorrecta = false; - until (not(tecla_incorrecta)); + } while (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; + switch (aux) + { + case SDL_SCANCODE_A : dib_aux = 4485; break; + case SDL_SCANCODE_B : dib_aux = 4509; break; + case SDL_SCANCODE_C : dib_aux = 4533; break; + case SDL_SCANCODE_D : dib_aux = 4557; break; + case SDL_SCANCODE_E : dib_aux = 4581; break; + case SDL_SCANCODE_F : dib_aux = 4605; break; + case SDL_SCANCODE_G : dib_aux = 4629; break; + case SDL_SCANCODE_H : dib_aux = 4653; break; + case SDL_SCANCODE_I : dib_aux = 4677; break; + case SDL_SCANCODE_J : dib_aux = 4702; break; + case SDL_SCANCODE_K : dib_aux = 4726; break; + case SDL_SCANCODE_L : dib_aux = 4750; break; + case SDL_SCANCODE_M : dib_aux = 4774; break; + case SDL_SCANCODE_N : dib_aux = 14085; break; + case SDL_SCANCODE_O : dib_aux = 14109; break; + case SDL_SCANCODE_P : dib_aux = 14133; break; + case SDL_SCANCODE_Q : dib_aux = 14157; break; + case SDL_SCANCODE_R : dib_aux = 14181; break; + case SDL_SCANCODE_S : dib_aux = 14205; break; + case SDL_SCANCODE_T : dib_aux = 14229; break; + case SDL_SCANCODE_U : dib_aux = 14253; break; + case SDL_SCANCODE_V : dib_aux = 14277; break; + case SDL_SCANCODE_W : dib_aux = 14302; break; + case SDL_SCANCODE_X : dib_aux = 14326; break; + case SDL_SCANCODE_Y : dib_aux = 14350; break; + case SDL_SCANCODE_Z : dib_aux = 14374; break; + case SDL_SCANCODE_UP : dib_aux = 23709; break; + case SDL_SCANCODE_DOWN : dib_aux = 23685; break; + case SDL_SCANCODE_LEFT : dib_aux = 23757; break; + case SDL_SCANCODE_RIGHT : dib_aux = 23733; break; + } - 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; + switch (pos_m) + { + case 4: + tecla_amunt = aux; + tecla_amunt_dib = dib_aux; + break; + case 5: + tecla_avall = aux; + tecla_avall_dib = dib_aux; + break; + case 6: + tecla_esquerra = aux; + tecla_esquerra_dib = dib_aux; + break; + case 7: + tecla_dreta = aux; + tecla_dreta_dib = dib_aux; + break; + } + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); + } - actualitza_options(vaddr,vaddr2); - espera_VGA; - volcar32(vaddr2,VGA); + actualitza_options(vaddr, vaddr2); + espera_VGA(); + volcar32(vaddr2, VGA); - until TeclaPuls(KeyESC); + } while (!TeclaPuls(SDL_SCANCODE_ESCAPE)); borrat_de_pantalla(vaddr2); - if midi then begin StopMIDI; unloadmidi; midi:=false; end; + if (midi) { StopMIDI(); unloadmidi(); midi=false; } - save_cfg; - - end; -end; + save_cfg(); + } +} /*──────────────────────────────────────────────────────────────────────────*/ /*──────────────────────────────────────────────────────────────────────────*/