Advertisement
jacknpoe

DROPS 2 (shapes&columns like game)

Oct 19th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 41.43 KB | None | 0 0
  1. //
  2. //
  3. // ********************************************************************
  4. // **********                                                **********
  5. // ********** DROPS 2 - ZICAU SOFTWARE LIMITADA - ITAJAI, SC **********
  6. // **********                                                **********
  7. // ********************************************************************
  8. //
  9. //   Esta versao e' apenas uma BETA (BETA-1). Para maiores informacoes,
  10. //
  11. // contate a 'ZiCau Soft'  -  Fone: ------------- (falar com jacknpoe).
  12. //
  13. //
  14. // OBS. 20/OUT/2013 > ESTA VERSÃO E' DE 1994 E NO MOMENTO:
  15. // -NÃO IRÁ COMPILAR A NÃO SER SE A BIBLIOTECA conio.h E ALGUMAS OPÇÕES
  16. // ESTIVEREM MARCADAS P/ COMPATIBILIZAÇÃO COM OS COMPILADORES MODERNOS
  17. // -SE COMPILAR, NÃO IRÁ RODAR NOS SISTEMAS OPERACIONAIS ATUAIS,  SENDO
  18. // NECESSÁRIO WINDOWS XP OU ANTERIOR
  19. // -SE RODAR, PRECISARÁ DO ARQUIVO drops2.dat COM AS IMAGENS DO JOGO
  20. //
  21.  
  22.  
  23. #include <fcntl.h>
  24. #include <string.h>
  25. #include <stdlib.h>
  26. #include <conio.h>
  27. #include <dos.h>
  28.  
  29. #define S_IREAD 0x0100
  30. #define S_IWRITE 0x0080
  31.  
  32. union REGS cau;
  33.  
  34. struct peca
  35. {
  36.     char primeira;
  37.     char segunda;
  38.     char terceira;
  39. } peca1, peca_prox;
  40.  
  41. struct game
  42. {
  43.     char vidas;
  44.     char fase;
  45.     int  pecas;
  46.     long escore;
  47.     long melhor;
  48.     char proximo;
  49.     int  passo;
  50. } jogo;
  51.  
  52. struct hi_score
  53. {
  54.     char n_jogador[ 11];
  55.     char dificuldade;
  56.     long n_pontos;
  57. } melhores[ 10];
  58.  
  59. int acum;
  60.  
  61. char troquei_ints = 0;
  62. char sem_placa = 0;
  63. char erro_arq = 0;
  64. char sem_memo = 0;
  65. char deixou_tempo = 0;
  66.  
  67. int far *end_teclado = (int far *) 0x417;
  68.  
  69. char estado_som = 0;
  70. char estado_antigo;
  71. int  contador_efeito, tam_efeito, contador_musica, tam_musica;
  72. int far *pt_efeito, *pt_musica;
  73.  
  74. char opt_cza = 1, opt_som = 0, opt_eft = 0, opt_cfg = 0;
  75.  
  76. char x_peca, y_peca, estilo = 0;
  77.  
  78. char menu_opt = 0, m_o_opt = 0, dif_opt = 1, vid_opt = 3, pec_opt = 0, ant_pec_opt = 0;
  79.  
  80. char ftemp[ 10][ 20];
  81. char fosso[ 12][ 21];
  82. char c_cfg[ 3];
  83. char far *alfa=NULL, *zicau=NULL, *simp=NULL, *alfa12=NULL, *dropsii=NULL;
  84. char mensagem[] = "APRESENTA";
  85. char gameover[] = "FIM DE JOGO";
  86. char highmess[] = "GALERIA DOS RECORDES";
  87. char versaobeta[] = "VERS~AO BETA-1";
  88. char nronovo[]  = "      ";
  89. char editar[]   = "          ";
  90. unsigned char m_o_x[] = { 94, 130,  40 };
  91. unsigned char m_o_y[] = { 32, 112, 204 };
  92. unsigned char m_o_xy[]= { 76, 104, 144, 196 };
  93. unsigned char m_cfg[] = { 82, 124, 118 };
  94. int  efect[] = { 440, 880, 440, 880, 1760};
  95. char *nomes[] = { "BONHAM....","BURTON....","COBAIN....","HENDRIX...","JOPLIN....",
  96.                   "LENNON....","MARLEY....","MORRISON..","PRESLEY...","SEIXAS...." };
  97. char b_dificuldade[] = { 2, 2, 2, 1, 1, 1, 0, 0, 0, 0};
  98. long b_pontos[] = { 100000, 90000, 80000, 70000, 60000,
  99.                   50000, 40000, 30000, 20000, 10000};
  100. char *digite[] = { "VOC^E ENTROU NA", "DIGITE SEU NOME:" };
  101. char *menu[] = { "COME€A", "OP€~OES", "CONFIG", "D.O.S." };
  102. char *config[] = { "MONOCROM@ATICO", "M@USICA", "EFEITOS" };
  103. char *simnao[] = { "SIM", "N~AO" };
  104. char *opcoes[] = { "DIFICULDADE", "VIDAS", "PE€AS",
  105.                    "F@ACIL", "NORMAL", "DIF@ICIL",
  106.                    "l", "ll", "lll", "llll" };
  107. char *escore[] = { "VIDAS", "ESCORE", "MELHOR", "FASE", "PE€AS", "PR@OX." };
  108. char *staff[] = { "INSPIRADO EM ORIGINAL DE", "ALEXEY PAJITNOV", "",
  109.                   "PROJETADO POR", "RICARDO ERICK REB^ELO", "",
  110.                   "PROGRAMADO POR", "RICARDO ERICK REB^ELO", "",
  111.                   "M@USICAS E EFEITOS DE", "JOMAR MILIOLI GOUDINHO", "",
  112.                   "GR@AFICOS POR", "RICARDO ERICK REB^ELO", "JOMAR MILIOLI GOUDINHO",
  113.                   "PRODUZIDO NA", "ZICAU SOFTWARE LTDA.", "" };
  114.  
  115.  
  116. // ***********************************************************
  117. // ***************                             ***************
  118. // *************** Rotinas e variaveis de INTs ***************
  119. // ***************                             ***************
  120. // ***********************************************************
  121.  
  122.  
  123. unsigned int  estado_tecla[4];
  124. unsigned int  tempo_tecla[4];
  125. unsigned int  press_tecla[4];
  126. unsigned int  hora_real = 0;
  127. unsigned char auxiliar;
  128. unsigned char scancode;
  129.  
  130. void interrupt (*velha_int_09h)();
  131. void interrupt (*velha_int_1ch)();
  132. void interrupt (*velha_int_1bh)();
  133.  
  134. void interrupt nova_int_1bh()
  135. {
  136. }
  137.  
  138. void interrupt nova_int_09h()
  139. {
  140.     scancode = inportb( 0x60);
  141.     switch (scancode)
  142.     {
  143.         case  72: { if( estado_tecla[0] == 0) press_tecla[0] = 1;
  144.                     estado_tecla[0] = 1; }
  145.                     break;
  146.         case 200: { estado_tecla[0] = 0;
  147.                     tempo_tecla[0] = 0; }
  148.                     break;
  149.         case  77: { if( estado_tecla[1] == 0) press_tecla[1] = 1;
  150.                     estado_tecla[1] = 1; }
  151.                     break;
  152.         case 205: { estado_tecla[1] = 0;
  153.                     tempo_tecla[1] = 0; }
  154.                     break;
  155.         case  80: { if( estado_tecla[2] == 0) press_tecla[2] = 1;
  156.                     estado_tecla[2] = 1; }
  157.                     break;
  158.         case 208: { estado_tecla[2] = 0;
  159.                     tempo_tecla[2] = 0; }
  160.                     break;
  161.         case  75: { if( estado_tecla[3] == 0) press_tecla[3] = 1;
  162.                     estado_tecla[3] = 1; }
  163.                     break;
  164.         case 203: { estado_tecla[3] = 0;
  165.                     tempo_tecla[3] = 0; }
  166.                     break;
  167.     }
  168.     if( ( ( ( scancode > 70) & ( scancode < 82)) | ( ( scancode > 198) & ( scancode < 210))) | scancode == 225)
  169.     {
  170.         auxiliar = inportb( 0x61);
  171.         outportb( 0x61, auxiliar | 0x80);
  172.         outportb( 0x61, auxiliar);
  173.         outportb( 0x20, 0x20);
  174.     }
  175.     else (*velha_int_09h)();
  176. }
  177.  
  178. void interrupt nova_int_1ch()
  179. {
  180.     hora_real++;
  181.     if( estado_som == 0)
  182.         nosound();
  183.     else
  184.     {
  185.         if( estado_som == 2)
  186.         {
  187.             if( pt_efeito[ contador_efeito] > 0)
  188.                 sound( pt_efeito[ contador_efeito]);
  189.             else
  190.                 nosound();
  191.             contador_efeito++;
  192.             if( contador_efeito == tam_efeito)
  193.                 estado_som = estado_antigo;
  194.         }
  195.         else
  196.             if( pt_musica[ contador_musica] > 0)
  197.                 sound( pt_musica[ contador_musica]);
  198.             else
  199.                 nosound();
  200.         contador_musica++;
  201.         if( contador_musica == tam_musica)
  202.             contador_musica = 0;
  203.     }
  204.  
  205.     if( estado_tecla[0] == 1)
  206.     {
  207.         tempo_tecla[0] += 1;
  208.         if( tempo_tecla[0] > 11)
  209.         {
  210.             tempo_tecla[0] -= 12;
  211.             press_tecla[0] = 1;
  212.         }
  213.     }
  214.     if( estado_tecla[1] == 1)
  215.     {
  216.         tempo_tecla[1] += 1;
  217.         if( tempo_tecla[1] > 8)
  218.         {
  219.             tempo_tecla[1] -= 9;
  220.             press_tecla[1] = 1;
  221.         }
  222.     }
  223.     if( estado_tecla[2] == 1)
  224.     {
  225.         tempo_tecla[2] += 1;
  226.         if( tempo_tecla[2] > 11)
  227.         {
  228.             tempo_tecla[2] -= 12;
  229.             press_tecla[2] = 1;
  230.         }
  231.     }
  232.     if( estado_tecla[3] == 1)
  233.     {
  234.         tempo_tecla[3] += 1;
  235.         if( tempo_tecla[3] > 8)
  236.         {
  237.             tempo_tecla[3] -= 9;
  238.             press_tecla[3] = 1;
  239.         }
  240.     }
  241.  
  242.     (*velha_int_1ch)();
  243. }
  244.  
  245.  
  246. // ***********************************************************
  247. // ***************                             ***************
  248. // *************** Biblioteca Grafica para VGA ***************
  249. // ***************                             ***************
  250. // ***********************************************************
  251.  
  252.  
  253. unsigned char far *vga_ini = (unsigned char far *) 0xa0000000L;
  254.  
  255. unsigned char asc_to_alfa[ 60] = { 32, 65, 66, 67, 68, 69, 70, 71, 72, 73,
  256.                                    74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
  257.                                    84, 85, 86, 87, 88, 89, 90,128, 45, 48,
  258.                                    49, 50, 51, 52, 53, 54, 55, 56, 57, 46,
  259.                                    44, 58, 33, 63, 64, 94,126, 96, 59, 34,
  260.                                    39, 40, 41, 61, 36, 47, 38,112,120,108 };
  261.  
  262. char detecta_vga( void)
  263. {
  264.     cau.x.ax = 0x1a00;
  265.     int86 ( 0x10, &cau, &cau );
  266.     if( cau.h.al != 0x1a ) return ( 0 );
  267.     if( ( cau.h.bl == 0x08 ) || ( cau.h.bl == 0x0c ) ) return ( 1 );
  268.     return ( 2 );
  269. }
  270.  
  271. void cor( unsigned char cor1, char cor2, char cor3, char cor4)
  272. {
  273.     cau.x.ax= 0x1010;
  274.     cau.h.dh= cor2;
  275.     cau.h.ch= cor3;
  276.     cau.h.cl= cor4;
  277.     cau.x.bx= cor1;
  278.     int86(0x10,&cau,&cau);
  279. }
  280.  
  281. void vga( void)
  282. {
  283.     cau.h.ah= 0;
  284.     cau.h.al= 0x13;
  285.     int86(0x10,&cau,&cau);
  286. }
  287.  
  288. void sobe( char y)
  289. {
  290.     cau.h.ah = 6;
  291.     cau.h.al = 1;
  292.     cau.h.bh = 0;
  293.     cau.h.ch = y;
  294.     cau.h.cl = 16;
  295.     cau.h.dh = y + 4;
  296.     cau.h.dl = 23;
  297.     int86(0x10,&cau,&cau);
  298. }
  299.  
  300. void desce( char y)
  301. {
  302.     cau.h.ah = 7;
  303.     cau.h.al = 1;
  304.     cau.h.bh = 0;
  305.     cau.h.ch = y;
  306.     cau.h.cl = 15;
  307.     cau.h.dh = y + 1;
  308.     cau.h.dl = 24;
  309.     int86(0x10,&cau,&cau);
  310. }
  311.  
  312. void closevga(void)
  313. {
  314.     cau.h.ah= 0;
  315.     cau.h.al= 0x3;
  316.     int86(0x10,&cau,&cau);
  317. }
  318.  
  319. void barra(int x, int y, int tx, int ty, unsigned char color)
  320. {
  321.     register unsigned passox = 0, passoy = 0;
  322.     unsigned inicial, passo;
  323.     inicial = x + y * 320;
  324.     passo = 320 - tx;
  325.     while(passoy < ty)
  326.     {
  327.         while(passox < tx)
  328.         {
  329.             *(vga_ini + inicial) = color;
  330.             inicial++;
  331.             passox++;
  332.         }
  333.         passox = 0;
  334.         inicial += passo;
  335.         passoy++;
  336.     }
  337. }
  338.  
  339. void bitmap( int x, int y, unsigned char far *pt_bitmap)
  340. {
  341.     register unsigned char passox = 0, passoy = 0;
  342.     register unsigned inicial;
  343.     inicial = x + y * 320;
  344.     while(passoy < 8)
  345.     {
  346.         while(passox < 8)
  347.         {
  348.             *(vga_ini + inicial) = *pt_bitmap;
  349.             inicial++;
  350.             pt_bitmap++;
  351.             passox++;
  352.         }
  353.         passox = 0;
  354.         inicial += 312;
  355.         passoy++;
  356.     }
  357. }
  358.  
  359. void m_bitmap( int x, int y, unsigned char far *pt_bitmap)
  360. {
  361.     register unsigned char passox = 0, passoy = 0;
  362.     register unsigned inicial;
  363.     inicial = x + y * 320;
  364.     while(passoy < 8)
  365.     {
  366.         while(passox < 8)
  367.         {
  368.             if(!(*pt_bitmap == 0)) *(vga_ini + inicial) = *pt_bitmap;
  369.             inicial++;
  370.             pt_bitmap++;
  371.             passox++;
  372.         }
  373.         passox = 0;
  374.         inicial += 312;
  375.         passoy++;
  376.     }
  377. }
  378.  
  379. void m_bitmapc( int x, int y, unsigned char far *pt_bitmap, unsigned char cor)
  380. {
  381.     register unsigned char passox = 0, passoy = 0;
  382.     register unsigned inicial;
  383.     inicial = x + y * 320;
  384.     cor-=1;
  385.     while(passoy < 8)
  386.     {
  387.         while(passox < 8)
  388.         {
  389.             if(!(*pt_bitmap == 0)) *(vga_ini + inicial) = cor - passoy / 2;
  390.             inicial++;
  391.             pt_bitmap++;
  392.             passox++;
  393.         }
  394.         passox = 0;
  395.         inicial += 312;
  396.         passoy++;
  397.     }
  398. }
  399.  
  400. void m_bitmap12( int x, int y, unsigned char far *pt_bitmap)
  401. {
  402.     register unsigned char passox = 0, passoy = 0;
  403.     register unsigned inicial;
  404.     inicial = x + y * 320;
  405.     while(passoy < 12)
  406.     {
  407.         while(passox < 12)
  408.         {
  409.             if(!(*pt_bitmap == 0)) *(vga_ini + inicial) = *pt_bitmap;
  410.             inicial++;
  411.             pt_bitmap++;
  412.             passox++;
  413.         }
  414.         passox = 0;
  415.         inicial += 308;
  416.         passoy++;
  417.     }
  418. }
  419.  
  420. void m_bitmap12c( int x, int y, unsigned char far *pt_bitmap, unsigned char cor)
  421. {
  422.     register unsigned char passox = 0, passoy = 0;
  423.     register unsigned inicial;
  424.     inicial = x + y * 320;
  425.     while(passoy < 12)
  426.     {
  427.         while(passox < 12)
  428.         {
  429.             if(!(*pt_bitmap == 0)) *(vga_ini + inicial) = cor - passoy / 2;
  430.             inicial++;
  431.             pt_bitmap++;
  432.             passox++;
  433.         }
  434.         passox = 0;
  435.         inicial += 308;
  436.         passoy++;
  437.     }
  438. }
  439.  
  440. void palheta_cor(void)
  441. {
  442.     register char a;
  443.     char forte, fraco, correcao;
  444.     for(a=1;a<13;a++)
  445.     {
  446.         forte = (double) a * 5.25 + .5;
  447.         fraco = (double) a * 2.625 + .5;
  448.         correcao = (double) a * .984375 + .5;
  449.         cor(a+ 63,forte,0,0);
  450.         cor(a+ 75,0,forte,0);
  451.         cor(a+ 87,correcao,correcao,forte);
  452.         cor(a+ 99,forte,forte,0);
  453.         cor(a+111,forte,0,forte);
  454.         cor(a+123,0,forte,forte);
  455.         cor(a+135,forte,fraco,0);
  456.         cor(a+147,fraco,forte,0);
  457.         cor(a+159,forte,forte,fraco);
  458.         cor(a+171,forte,0,fraco);
  459.         cor(a+183,forte,fraco,forte);
  460.         cor(a+195,fraco,0,forte);
  461.         cor(a+207,fraco,forte,forte);
  462.         cor(a+219,0,forte,fraco);
  463.         cor(a+231,0,fraco,forte);
  464.         cor(a+243,0,0,0);
  465.     }
  466. }
  467.  
  468. void palheta(void)
  469. {
  470.     register char a;
  471.     for(a=0;a<64;a++) cor(a,a,a,a);
  472.     palheta_cor();
  473. }
  474.  
  475. void gray_scale( void)
  476. {
  477.     cau.x.ax = 0x101b;
  478.     cau.x.bx = 64;
  479.     cau.x.cx = 180;
  480.     int86(0x10,&cau,&cau);
  481. }
  482.  
  483. char transf(unsigned char caracter)
  484. {
  485.     register unsigned char passo = -1;
  486.     while(!((passo++)==59))
  487.     {
  488.         if( caracter == asc_to_alfa[ passo]) return ( passo + 1);
  489.     }
  490.     return( 1);
  491. }
  492.  
  493. void converte(unsigned char *texto)
  494. {
  495.     register unsigned char tam, passo = -1;
  496.     tam = strlen( texto);
  497.     tam--;
  498.     while(!((passo++)==tam)) texto[ passo] = transf( texto [ passo]);
  499. }
  500.  
  501. int put_text( int x, unsigned char y, unsigned char *texto, unsigned char *alfabeto)
  502. {
  503.     register unsigned char tam, passo = -1;
  504.     unsigned desloc;
  505.     tam = strlen( texto);
  506.     tam--;
  507.     while(!((passo++)==tam))
  508.     {
  509.         if( texto[ passo] > 44 & texto[ passo] < 50)
  510.         {
  511.             desloc = ( texto[ passo] - 1) * 64;
  512.             m_bitmap( x, y - 4, &alfabeto[ desloc]);
  513.         }
  514.         else
  515.         {
  516.             desloc = ( texto[ passo] - 1) * 64;
  517.             m_bitmap( x, y, &alfabeto[ desloc]);
  518.             x = x + 8;
  519.         }
  520.     }
  521.     return( x);
  522. }
  523.  
  524. int put_textc( int x, unsigned char y, unsigned char *texto, unsigned char *alfabeto, unsigned char cor)
  525. {
  526.     register unsigned char tam, passo = -1;
  527.     unsigned desloc;
  528.     tam = strlen( texto);
  529.     tam--;
  530.     while(!((passo++)==tam))
  531.     {
  532.         if( texto[ passo] > 44 & texto[ passo] < 50)
  533.         {
  534.             desloc = ( texto[ passo] - 1) * 64;
  535.             m_bitmapc( x, y - 4, &alfabeto[ desloc], cor);
  536.         }
  537.         else
  538.         {
  539.             desloc = ( texto[ passo] - 1) * 64;
  540.             m_bitmapc( x, y, &alfabeto[ desloc], cor);
  541.             x = x + 8;
  542.         }
  543.     }
  544.     return( x);
  545. }
  546.  
  547. int put_text12( int x, unsigned char y, unsigned char *texto, unsigned char *alfabeto)
  548. {
  549.     register unsigned char tam, passo = -1;
  550.     unsigned desloc;
  551.     tam = strlen( texto);
  552.     tam--;
  553.     while(!((passo++)==tam))
  554.     {
  555.         if( texto[ passo] > 44 & texto[ passo] < 50)
  556.         {
  557.             desloc = ( texto[ passo] - 1) * 144;
  558.             m_bitmap12( x, y - 5, &alfabeto[ desloc]);
  559.         }
  560.         else
  561.         {
  562.             desloc = ( texto[ passo] - 1) * 144;
  563.             m_bitmap12( x, y, &alfabeto[ desloc]);
  564.             x = x + 12;
  565.         }
  566.     }
  567.     return( x);
  568. }
  569.  
  570. int put_text12c( int x, unsigned char y, unsigned char *texto, unsigned char *alfabeto, unsigned char cor)
  571. {
  572.     register unsigned char tam, passo = -1;
  573.     unsigned desloc;
  574.     tam = strlen( texto);
  575.     tam--;
  576.     while(!((passo++)==tam))
  577.     {
  578.         if( texto[ passo] > 44 & texto[ passo] < 50)
  579.         {
  580.             desloc = ( texto[ passo] - 1) * 144;
  581.             m_bitmap12c( x, y - 5, &alfabeto[ desloc], cor);
  582.         }
  583.         else
  584.         {
  585.             desloc = ( texto[ passo] - 1) * 144;
  586.             m_bitmap12c( x, y, &alfabeto[ desloc], cor);
  587.             x = x + 12;
  588.         }
  589.     }
  590.     return( x);
  591. }
  592.  
  593. char tam_text( unsigned char *texto)
  594. {
  595.     register unsigned char tam, passo = -1;
  596.     int total = 0;
  597.     tam = strlen( texto);
  598.     tam--;
  599.     while(!((passo++)==tam)) if( texto[ passo] < 45 | texto[ passo] > 49) total++;
  600.     return total;
  601. }
  602.  
  603. void put_peca( int x, int y, struct peca pecas)
  604. {
  605.     bitmap( x, y, &alfa[ 3840 + pecas.primeira * 64 + estilo * 64]);
  606.     bitmap( x, y + 8, &alfa[ 3840 + pecas.segunda * 64 + estilo * 64]);
  607.     bitmap( x, y + 16, &alfa[ 3840 + pecas.terceira * 64 + estilo * 64]);
  608. }
  609.  
  610. void quadro( void)
  611. {
  612.     register char a = -1;
  613.     while(!((a++)==39))
  614.     {
  615.         bitmap( a * 8, 0, &alfa[ 4352]);
  616.         bitmap( a * 8, 192, &alfa[ 4352]);
  617.     }
  618.     a = 0;
  619.     while(!((a++)==23))
  620.     {
  621.         bitmap( 0, a * 8, &alfa[ 4352]);
  622.         bitmap( 312, a * 8, &alfa[ 4352]);
  623.     }
  624. }
  625.  
  626. void r_quadro( void)
  627. {
  628.     register unsigned char passoy = 0;
  629.     register unsigned passox = 0, inicial = 2568;
  630.     while(passoy < 184)
  631.     {
  632.         while(passox < 304)
  633.         {
  634.             *(vga_ini + inicial) = 0;
  635.             inicial++;
  636.             passox++;
  637.         }
  638.         passox = 0;
  639.         inicial += 16;
  640.         passoy++;
  641.     }
  642. }
  643.  
  644. void m_escore( void)
  645. {
  646.     char string[ 8];
  647.     char s = 7;
  648.     long score;
  649.     score = jogo.escore;
  650.     while( 1)
  651.     {
  652.         s--;
  653.         string[ s] = 30 + (score % 10);
  654.         score = score / 10;
  655.         if( score == 0) break;
  656.     }
  657.     string[ 7] = 0;
  658.     barra( 32, 96, 56, 8, 0);
  659.     put_text( 32 + s * 8, 96, &string[ s], alfa);
  660. }
  661.  
  662. void m_melhor( void)
  663. {
  664.     char string[ 8];
  665.     char s = 7;
  666.     long score;
  667.     score = jogo.melhor;
  668.     while( 1)
  669.     {
  670.         s--;
  671.         string[ s] = 30 + (score % 10);
  672.         score = score / 10;
  673.         if( score == 0) break;
  674.     }
  675.     string[ 7] = 0;
  676.     barra( 32, 160, 56, 8, 0);
  677.     put_text( 32 + s * 8, 160, &string[ s], alfa);
  678. }
  679.  
  680. void m_proximo( void)
  681. {
  682.     put_peca( 280, 144, peca_prox);
  683. }
  684.  
  685. void m_pecas( void)
  686. {
  687.     char string[ 8];
  688.     char s = 7;
  689.     int score;
  690.     score = jogo.pecas;
  691.     while( 1)
  692.     {
  693.         s--;
  694.         string[ s] = 30 + (score % 10);
  695.         score = score / 10;
  696.         if( score == 0) break;
  697.     }
  698.     string[ 7] = 0;
  699.     barra( 264, 96, 24, 8, 0);
  700.     put_text( 232 + s * 8, 96, &string[ s], alfa);
  701. }
  702.  
  703. void m_vidas( void)
  704. {
  705.     char string[ 5];
  706.     char s = -1;
  707.     while(!((s++)==3)) string[ s] = 60;
  708.     string[ 4] = 0;
  709.     s = 4 - jogo.vidas;
  710.     barra( 56, 40, 32, 8, 0);
  711.     put_text( 56 + s * 8, 40, &string[ s], alfa);
  712. }
  713.  
  714. void m_fase( void)
  715. {
  716.     char string[ 8];
  717.     char s = 7;
  718.     char score;
  719.     score = jogo.fase;
  720.     while( 1)
  721.     {
  722.         s--;
  723.         string[ s] = 30 + (score % 10);
  724.         score = score / 10;
  725.         if( score == 0) break;
  726.     }
  727.     string[ 7] = 0;
  728.     barra( 272, 40, 16, 8, 0);
  729.     put_text( 232 + s * 8, 40, &string[ s], alfa);
  730. }
  731.  
  732. void g_quadro( void)
  733. {
  734.     register char a = 1;
  735.     unsigned char *point;
  736.     point = &alfa[ 4288];
  737.     r_quadro();
  738.     while(!((a++)==12))
  739.     {
  740.         bitmap( a * 8, 16, point);
  741.         bitmap( a * 8, 56, point);
  742.         bitmap( a * 8, 72, point);
  743.         bitmap( a * 8, 112, point);
  744.         bitmap( a * 8, 128, point);
  745.         bitmap( a * 8, 176, point);
  746.         bitmap( a * 8 + 200, 16, point);
  747.         bitmap( a * 8 + 200, 56, point);
  748.         bitmap( a * 8 + 200, 72, point);
  749.         bitmap( a * 8 + 200, 112, point);
  750.         bitmap( a * 8 + 200, 128, point);
  751.         bitmap( a * 8 + 200, 176, point);
  752.     }
  753.     a = 2;
  754.     while(!((a++)==6))
  755.     {
  756.         bitmap( 16, a * 8, point);
  757.         bitmap( 96, a * 8, point);
  758.         bitmap( 216, a * 8, point);
  759.         bitmap( 296, a * 8, point);
  760.     }
  761.     a = 9;
  762.     while(!((a++)==13))
  763.     {
  764.         bitmap( 16, a * 8, point);
  765.         bitmap( 96, a * 8, point);
  766.         bitmap( 216, a * 8, point);
  767.         bitmap( 296, a * 8, point);
  768.     }
  769.     a = 16;
  770.     while(!((a++)==21))
  771.     {
  772.         bitmap( 16, a * 8, point);
  773.         bitmap( 96, a * 8, point);
  774.         bitmap( 216, a * 8, point);
  775.         bitmap( 296, a * 8, point);
  776.     }
  777.     point = &alfa[ 4416];
  778.     a = 1;
  779.     while(!((a++)==22))
  780.     {
  781.         bitmap( 112, a * 8, point);
  782.         bitmap( 200, a * 8, point);
  783.     }
  784.     a = 14;
  785.     while(!((a++)==24)) bitmap( a * 8, 176, point);
  786.     put_text( 32, 32, escore[ 0], alfa);
  787.     put_text( 32, 88, escore[ 1], alfa);
  788.     put_text( 32, 144, escore[ 2], alfa);
  789.     put_text( 36, 152, escore[ 1], alfa);
  790.     put_text( 232, 32, escore[ 3], alfa);
  791.     put_text( 232, 88, escore[ 4], alfa);
  792.     put_text( 232, 144, escore[ 5], alfa);
  793.  
  794.     m_vidas();
  795.     m_escore();
  796.     m_melhor();
  797.     m_pecas();
  798.     m_fase();
  799. }
  800.  
  801.  
  802. // ******************************************************************
  803. // ***************                                    ***************
  804. // *************** Rotinas de Manipulacao de Arquivos ***************
  805. // ***************                                    ***************
  806. // ******************************************************************
  807.  
  808.  
  809. void grava_arquivo( void)
  810. {
  811.     int arc;
  812.     arc = open( "drops2.sav", O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);
  813.     write( arc, &opt_cza, 1);
  814.     write( arc, &opt_som, 1);
  815.     write( arc, &opt_eft, 1);
  816.     write( arc, melhores, 160);
  817.     close( arc);
  818. }
  819.  
  820. void preenche( void)
  821. {
  822.     char t;
  823.     for( t = 0; t < 10; t++)
  824.     {
  825.         melhores[t].dificuldade = b_dificuldade[t];
  826.         melhores[t].n_pontos    = b_pontos[t];
  827.         strcpy( melhores[t].n_jogador, nomes[t]);
  828.     }
  829.     grava_arquivo();
  830. }
  831.  
  832. void le_arquivo( void)
  833. {
  834.     int arc;
  835.     arc = open( "drops2.sav", O_RDONLY | O_BINARY);
  836.     if( arc == -1)
  837.         preenche();
  838.     else
  839.     {
  840.         read( arc, &opt_cza, 1);
  841.         read( arc, &opt_som, 1);
  842.         read( arc, &opt_eft, 1);
  843.         if( read( arc, melhores, 160) != 160) preenche();
  844.         close( arc);
  845.     }
  846. }
  847.  
  848. void get_dat( void)
  849. {
  850.     int arc;
  851.     arc = open( "drops2.dat", O_RDONLY | O_BINARY);
  852.     if( arc == -1)
  853.     {
  854.         erro_arq = 1;
  855.         exit( 1);
  856.     }
  857.     if( (unsigned int) read( arc, alfa, 39424) != 39424)
  858.     {
  859.         erro_arq = 1;
  860.         exit( 1);
  861.     }
  862.     close( arc);
  863. }
  864.  
  865.  
  866. // Rotina extra que n„o pode ser colocada mais abaixo
  867.  
  868.  
  869. int lbuffer( void)
  870. {
  871.     int rt = 0;
  872.     while( kbhit())
  873.     {
  874.         rt = 1;
  875.         getch();
  876.  
  877.     }
  878.     return rt;
  879. }
  880.  
  881.  
  882. // ******************************************************************
  883. // ***************                                    ***************
  884. // *************** Biblioteca de Manipulacao de Tempo ***************
  885. // ***************                                    ***************
  886. // ******************************************************************
  887.  
  888.  
  889. long tempo_antigo, tempo_fixado;
  890. char extrapola;
  891.  
  892. long get_time( void)
  893. {
  894.     return( hora_real);
  895. }
  896.  
  897. void reseta( int tempo)
  898. {
  899.     extrapola = 0;
  900.     tempo_antigo = get_time();
  901.     tempo_fixado = tempo_antigo + tempo;
  902.     if(tempo_fixado > 65535L)
  903.     {
  904.         tempo_fixado -= 65536L;
  905.         extrapola = 1;
  906.     }
  907. }
  908.  
  909. void time_delay( int tempo)
  910. {
  911.     long tempo_atual;
  912.     while( 1)
  913.     {
  914.         tempo_atual = get_time();
  915.         if( extrapola == 0)
  916.         {
  917.             if( ( tempo_atual < tempo_antigo) | ( tempo_atual >= tempo_fixado))
  918.             {
  919.                 reseta( tempo);
  920.                 return;
  921.             }
  922.         }
  923.         else
  924.         {
  925.             if( ( tempo_atual < tempo_antigo) & ( tempo_atual >= tempo_fixado))
  926.             {
  927.                 reseta( tempo);
  928.                 return;
  929.             }
  930.         }
  931.     }
  932. }
  933.  
  934. void time_delay2( int tempo)
  935. {
  936.     long tempo_atual;
  937.     while( 1)
  938.     {
  939.         lbuffer();
  940.         tempo_atual = get_time();
  941.         if( extrapola == 0)
  942.         {
  943.             if( ( tempo_atual < tempo_antigo) | ( tempo_atual >= tempo_fixado))
  944.             {
  945.                 reseta( tempo);
  946.                 return;
  947.             }
  948.         }
  949.         else
  950.         {
  951.             if( ( tempo_atual < tempo_antigo) & ( tempo_atual >= tempo_fixado))
  952.             {
  953.                 reseta( tempo);
  954.                 return;
  955.             }
  956.         }
  957.     }
  958. }
  959.  
  960. int time_loop( void)
  961. {
  962.     long tempo_atual;
  963.     tempo_atual = get_time();
  964.     if( extrapola == 0)
  965.     {
  966.         if( ( tempo_atual < tempo_antigo) | ( tempo_atual >= tempo_fixado))
  967.             return( 1);
  968.     }
  969.     else
  970.     {
  971.         if( ( tempo_atual < tempo_antigo) & ( tempo_atual >= tempo_fixado))
  972.             return( 1);
  973.     }
  974.     return( 0);
  975. }
  976.  
  977. void espere( int tempo)
  978. {
  979.     reseta( tempo);
  980.     time_delay2( tempo);
  981. }
  982.  
  983.  
  984. // *****************************************************************
  985. // ***************                                   ***************
  986. // *************** Biblioteca de Manipulacao de Sons ***************
  987. // ***************                                   ***************
  988. // *****************************************************************
  989.  
  990.  
  991. void seta_som_mudo( void)
  992. {
  993.     estado_som = 0;
  994. }
  995.  
  996. void seta_musica( int far *nova_musica, int novo_tam)
  997. {
  998.     contador_musica = 0;
  999.     tam_musica = novo_tam;
  1000.     pt_musica = nova_musica;
  1001.     estado_som = 1;
  1002. }
  1003.  
  1004. void seta_efeito( int far *novo_efeito, int novo_tam)
  1005. {
  1006.     if( estado_som != 2)
  1007.         estado_antigo = estado_som;
  1008.     contador_efeito = 0;
  1009.     tam_efeito = novo_tam;
  1010.     pt_efeito = novo_efeito;
  1011.     estado_som = 2;
  1012. }
  1013.  
  1014.  
  1015. // ****************************************
  1016. // *************** Programa ***************
  1017. // ****************************************
  1018.  
  1019.  
  1020. void mostra_staff( void)
  1021. {
  1022.     register unsigned char passo = -1, tam;
  1023.     lbuffer();
  1024.     reseta( 64);
  1025.     while(!((passo++)==5))
  1026.     {
  1027.         tam = tam_text( staff[ passo * 3]);
  1028.         put_text( 160 - 4 * tam, 60, staff[ passo * 3], simp);
  1029.         while(!(time_loop())) if( lbuffer()) return;
  1030.         reseta( 32);
  1031.         tam = tam_text( staff[ passo * 3 + 1]);
  1032.         put_text12c( 160 - 6 * tam, 84, staff[ passo * 3 + 1], alfa12, 243);
  1033.         while(!(time_loop())) if( lbuffer()) return;
  1034.         reseta( 160);
  1035.         tam = tam_text( staff[ passo * 3 + 2]);
  1036.         put_text12c( 160 - 6 * tam, 104, staff[ passo * 3 + 2], alfa12, 243);
  1037.         while(!(time_loop())) if( lbuffer()) return;
  1038.         reseta( 64);
  1039.         barra( 28, 56, 264, 60, 0);
  1040.     }
  1041. }
  1042.  
  1043. void mostra_melhores( void)
  1044. {
  1045.     char t,s;
  1046.     long temp;
  1047.     r_quadro();
  1048.     reseta( 640);
  1049.     lbuffer();
  1050.     put_text12( 40, 19, highmess, alfa12);
  1051.     for( t=0; t<10; t++)
  1052.     {
  1053.         put_text12c( 24, 43+t*14, melhores[t].n_jogador, alfa12, 75+t*12);
  1054.         temp = melhores[t].n_pontos;
  1055.         for( s=6; s>0; s--)
  1056.         {
  1057.             nronovo[s-1] = 30+(temp%10);
  1058.             temp/=10;
  1059.         }
  1060.         put_text12c( 156, 43+t*14, nronovo, alfa12, 75+t*12);
  1061.         s = melhores[t].dificuldade;
  1062.         put_textc( 248-s*4, 47+t*14, opcoes[3+s], alfa, 75+t*12);
  1063.     }
  1064.     while( time_loop() == 0)
  1065.         if( lbuffer() ) return;
  1066. }
  1067.  
  1068. void pede_nome( char ver)
  1069. {
  1070.     char n_char=0,t=1;
  1071.     int x;
  1072.     r_quadro();
  1073.     lbuffer();
  1074.     strcpy( editar, "((((((((((");
  1075.     put_text12( 76, 28, digite[0], alfa12);
  1076.     put_text12( 40, 48, highmess, alfa12);
  1077.     put_text12c( 64, 84, digite[1], alfa12, 243);
  1078.     put_text12c( 100, 112, editar, alfa12, 75+ver*12);
  1079.     while( t)
  1080.     {
  1081.         x=getch();
  1082.         if( x == 0)
  1083.         {
  1084.             x=getch();
  1085.             x=0;
  1086.         }
  1087.         if( x>96 && x<123) x-=32;
  1088.         if( x>64 && x<91)
  1089.         {
  1090.             if( n_char<10) n_char++;
  1091.             barra( 88+n_char*12,112,12,12,0);
  1092.             editar[n_char-1]=x-63;
  1093.             put_text12c( 100, 112, editar, alfa12, 75+ver*12);
  1094.         }
  1095.         if( x==8 && n_char>0)
  1096.         {
  1097.             n_char--;
  1098.             barra( 100+n_char*12,112,12,12,0);
  1099.             editar[n_char]=40;
  1100.             put_text12c( 100, 112, editar, alfa12, 75+ver*12);
  1101.         }
  1102.         if( x == 13) t=0;
  1103.     }
  1104.     strcpy( melhores[ver].n_jogador, editar);
  1105. }
  1106.  
  1107. void verifica_recorde( void)
  1108. {
  1109.     char ver=10,t;
  1110.     for( t=9; t>=0; t--)
  1111.         if( melhores[t].n_pontos < jogo.escore) ver = t;
  1112.     if( ver < 9)
  1113.         for( t=9; t>ver; t--)
  1114.             melhores[t]=melhores[t-1];
  1115.     if( ver < 10)
  1116.     {
  1117.         pede_nome(ver);
  1118.         melhores[ver].dificuldade=dif_opt;
  1119.         melhores[ver].n_pontos=jogo.escore;
  1120.         grava_arquivo();
  1121.         mostra_melhores();
  1122.         seta_som_mudo();
  1123.     }
  1124. }
  1125.  
  1126. void zera_matriz( void)
  1127. {
  1128.     register char a = -1, b = 0;
  1129.     while(!((a++)==19))
  1130.     {
  1131.         while(!((b++)==10)) fosso[ b][ a] = 8;
  1132.         b = 0;
  1133.     }
  1134. }
  1135.  
  1136. void init_matriz( void)
  1137. {
  1138.     register char a = -1, b = -1;
  1139.     while(!((a++)==20))
  1140.     {
  1141.         while(!((b++)==11)) fosso[ b][ a] = 7;
  1142.         b = -1;
  1143.     }
  1144.     zera_matriz();
  1145. }
  1146.  
  1147. void seta_18( void)
  1148. {
  1149.     outportb( 0x41, 0xB6);
  1150.     outportb( 0x40, 0xFF);
  1151.     outportb( 0x40, 0xFF);
  1152. }
  1153.  
  1154. void seta_64( void)
  1155. {
  1156.     outportb( 0x41, 0xB6);
  1157.     outportb( 0x40, 0xD3);
  1158.     outportb( 0x40, 0x48);
  1159. }
  1160.  
  1161. void inicializa( void)
  1162. {
  1163.     register char a = -1;
  1164.  
  1165.     if( detecta_vga() == 0 )
  1166.     {
  1167.         sem_placa = 1;
  1168.         exit( 1);
  1169.     }
  1170.  
  1171.     while(!((a++)==17)) converte( staff[ a]);
  1172.     a = -1;
  1173.     while(!((a++)==5)) converte( escore[ a]);
  1174.     a = -1;
  1175.     while(!((a++)==3)) converte( menu[ a]);
  1176.     a = -1;
  1177.     while(!((a++)==9)) converte( opcoes[ a]);
  1178.     a = -1;
  1179.     while(!((a++)==9)) converte( nomes[ a]);
  1180.     a = -1;
  1181.     while(!((a++)==1)) converte( digite[ a]);
  1182.     a = -1;
  1183.     while(!((a++)==2)) converte( config[ a]);
  1184.     a = -1;
  1185.     while(!((a++)==1)) converte( simnao[ a]);
  1186.     a = -1;
  1187.  
  1188.     while(!((a++)==3))
  1189.     {
  1190.         estado_tecla[ a] = 0;
  1191.         press_tecla[ a]  = 0;
  1192.     }
  1193.  
  1194.     le_arquivo();
  1195.  
  1196.     init_matriz();
  1197.     converte( mensagem);
  1198.     converte( gameover);
  1199.     converte( highmess);
  1200.     converte( versaobeta);
  1201.     jogo.proximo = 1;
  1202.     jogo.melhor = melhores[0].n_pontos;
  1203.  
  1204.     alfa = malloc( 39424);
  1205.     if( alfa==NULL)
  1206.     {
  1207.         sem_memo=0;
  1208.         exit(1);
  1209.     }
  1210.     zicau = &alfa[ 8512];
  1211.     simp = &zicau[ 2048];
  1212.     alfa12 = &simp[ 3840];
  1213.     dropsii = &alfa12[ 8640];
  1214.  
  1215.     get_dat();
  1216.  
  1217.     randomize();
  1218.     vga();
  1219.     palheta();
  1220.     if( opt_cza==0) gray_scale();
  1221.  
  1222.     seta_64();
  1223.     velha_int_09h = getvect( 0x09);
  1224.     velha_int_1ch = getvect( 0x1c);
  1225.     velha_int_1bh = getvect( 0x1b);
  1226.     troquei_ints = 1;
  1227.     setvect( 0x1c, nova_int_1ch);
  1228.     setvect( 0x09, nova_int_09h);
  1229.     setvect( 0x1b, nova_int_1bh);
  1230. }
  1231.  
  1232. void m_zicau( void)
  1233. {
  1234.     register char a = -1, b = -1;
  1235.     while(!((a++)==3))
  1236.     {
  1237.         while(!((b++)==7))
  1238.         {
  1239.             bitmap( 128 + b * 8, 56 + a * 8, &zicau[ (b + a * 8) * 64]);
  1240.         }
  1241.         b = -1;
  1242.     }
  1243.     reseta( 128);
  1244.     time_delay( 6);
  1245.     cor( 56, 0, 0, 0);
  1246.     put_text( 125, 104, mensagem, alfa);
  1247.     a = -1;
  1248.     while(!((a++)==6))
  1249.     {
  1250.         b = 8 * ( a + 1);
  1251.         cor( 56, b, b, b);
  1252.         time_delay( 6);
  1253.     }
  1254.     espere( 128);
  1255.     a = -1;
  1256.     reseta( 3);
  1257.     while(!((a++)==11))
  1258.     {
  1259.         b = 6 - a;
  1260.         if( b < 0) b = 0;
  1261.         sobe( b);
  1262.         b = 13 + a;
  1263.         if( b == 24) b = 23;
  1264.         desce( b);
  1265.         time_delay( 3);
  1266.     }
  1267. }
  1268.  
  1269. char bateu( unsigned char x, char y)
  1270. {
  1271.     if( fosso[ x][ y + 3] == 8) return( 0);
  1272.     return( 1);
  1273. }
  1274.  
  1275. void cola( unsigned char x, unsigned char y)
  1276. {
  1277.     fosso[ x][ y] = peca1.primeira;
  1278.     fosso[ x][ y + 1] = peca1.segunda;
  1279.     fosso[ x][ y + 2] = peca1.terceira;
  1280. }
  1281.  
  1282. void tire( unsigned int x, unsigned char y)
  1283. {
  1284.     barra( x, y, 8, 24, 0);
  1285. }
  1286.  
  1287. void tir1( unsigned int x, unsigned char y)
  1288. {
  1289.     barra( x, y, 8, 8, 0);
  1290. }
  1291.  
  1292. void sorteia( struct peca *p_peca)
  1293. {
  1294.     p_peca[ 0].primeira = random( 7);
  1295.     while( ( p_peca[ 0].segunda = random( 7) ) == p_peca[ 0].primeira );
  1296.     while( ( ( p_peca[ 0].terceira = random( 7) ) == p_peca[ 0].primeira )
  1297.          || p_peca[ 0].terceira == p_peca[ 0].segunda );
  1298. }
  1299.  
  1300. void vira( void)
  1301. {
  1302.     char temp;
  1303.     temp = peca1.terceira;
  1304.     peca1.terceira = peca1.segunda;
  1305.     peca1.segunda = peca1.primeira;
  1306.     peca1.primeira = temp;
  1307. }
  1308.  
  1309. void d_teclas( void)
  1310. {
  1311.     char y;
  1312.     if( press_tecla[ 0] == 1)
  1313.     {
  1314.         menu_opt = menu_opt - 1 + (menu_opt==0) * 4;
  1315.         for( y=0; y<4; y++)
  1316.             put_text12c( 124, 100+20*y, menu[ y], alfa12, 81+6*(menu_opt==y));
  1317.         press_tecla[ 0] = 0;
  1318.         reseta( 640);
  1319.     }
  1320.     if( press_tecla[ 2] == 1)
  1321.     {
  1322.         menu_opt = menu_opt + 1 - (menu_opt==3) * 4;
  1323.         for( y=0; y<4; y++)
  1324.             put_text12c( 124, 100+20*y, menu[ y], alfa12, 81+6*(menu_opt==y));
  1325.         press_tecla[ 2] = 0;
  1326.         reseta( 640);
  1327.     }
  1328. }
  1329.  
  1330. void m_dropsii( void)
  1331. {
  1332.     unsigned char y;
  1333.     int x, desvio = 5152;
  1334.     unsigned int d_desvio = 0;
  1335.     lbuffer();
  1336.     press_tecla[ 2] = 0;
  1337.     press_tecla[ 0] = 0;
  1338.     deixou_tempo    = 0;
  1339.     for( y=0; y<64; y++)
  1340.     {
  1341.         for( x=0; x<256; x++)
  1342.         {
  1343.             *(vga_ini + desvio) = dropsii[ d_desvio];
  1344.             d_desvio++;
  1345.             desvio++;
  1346.         }
  1347.         desvio+=64;
  1348.     }
  1349.  
  1350.     put_text12c( 132, 68, versaobeta, alfa12, 111);
  1351.  
  1352.     for( x=9; x<31; x++)
  1353.     {
  1354.         bitmap( x*8,  88, &alfa[ 4288]);
  1355.         bitmap( x*8, 176, &alfa[ 4288]);
  1356.     }
  1357.  
  1358.     for( y=12; y<22; y++)
  1359.     {
  1360.         bitmap( 106, y*8, &alfa[ 4288]);
  1361.         bitmap( 206, y*8, &alfa[ 4288]);
  1362.         bitmap( 104, y*8, &alfa[ 4288]);
  1363.         bitmap( 208, y*8, &alfa[ 4288]);
  1364.     }
  1365.  
  1366.     for( y=0; y<4; y++)
  1367.         put_text12c( 124, 100+20*y, menu[ y], alfa12, 81+6*(menu_opt==y));
  1368.     y = 1;
  1369.     reseta( 640);
  1370.     while( y)
  1371.     {
  1372.         if( kbhit())
  1373.         {
  1374.             x = getch();
  1375.             if( x == 13 || x == 32) y = 0;
  1376.             reseta( 640);
  1377.         }
  1378.         d_teclas();
  1379.         if( time_loop() == 1)
  1380.         {
  1381.             mostra_melhores();
  1382.             seta_som_mudo();
  1383.             deixou_tempo = 1;
  1384.             y = 0;
  1385.         }
  1386.     }
  1387. }
  1388.  
  1389. char get_estilo( char novo_estilo)
  1390. {
  1391.     if( novo_estilo == 0) return( 0);
  1392.     return( 3 + 7 * novo_estilo);
  1393. }
  1394.  
  1395. void m_t_pec( char nro)
  1396. {
  1397.     char n_est, y;
  1398.     n_est = get_estilo( nro);
  1399.     if( nro == pec_opt) barra( 125+16*nro, 117, 14, 62, 16);
  1400.         else barra( 125+16*nro, 117, 14, 62, 0);
  1401.     for( y = 0; y < 7; y++)
  1402.         m_bitmap( 128+16*nro, 120+8*y, &alfa[ 3840 + (y+n_est) * 64]);
  1403. }
  1404.  
  1405.  
  1406. void o_teclas( void)
  1407. {
  1408.     char y;
  1409.     if( press_tecla[ 0] == 1)
  1410.     {
  1411.         m_o_opt = m_o_opt - 1 + (m_o_opt==0) * 3;
  1412.         for( y=0; y<3; y++)
  1413.             put_text12c( m_o_x[y], 24+48*y, opcoes[y], alfa12, 81+6*(m_o_opt==y));
  1414.         press_tecla[ 0] = 0;
  1415.         press_tecla[ 3] = 0;
  1416.         press_tecla[ 1] = 0;
  1417.     }
  1418.     if( press_tecla[ 2] == 1)
  1419.     {
  1420.         m_o_opt = m_o_opt + 1 - (m_o_opt==2) * 3;
  1421.         for( y=0; y<3; y++)
  1422.             put_text12c( m_o_x[y], 24+48*y, opcoes[y], alfa12, 81+6*(m_o_opt==y));
  1423.         press_tecla[ 2] = 0;
  1424.         press_tecla[ 3] = 0;
  1425.         press_tecla[ 1] = 0;
  1426.     }
  1427.     if( m_o_opt == 0)
  1428.     {
  1429.         if( press_tecla[ 1] == 1)
  1430.         {
  1431.             dif_opt = dif_opt + 1 - (dif_opt==2) * 3;
  1432.             for( y=0; y<3; y++)
  1433.                 put_text12c( m_o_y[y], 44, opcoes[y+3], alfa12, 237+6*(dif_opt==y));
  1434.             press_tecla[ 1] = 0;
  1435.         }
  1436.         if( press_tecla[ 3] == 1)
  1437.         {
  1438.             dif_opt = dif_opt - 1 + (dif_opt==0) * 3;
  1439.             for( y=0; y<3; y++)
  1440.                 put_text12c( m_o_y[y], 44, opcoes[y+3], alfa12, 237+6*(dif_opt==y));
  1441.             press_tecla[ 3] = 0;
  1442.         }
  1443.     }
  1444.     if( m_o_opt == 1)
  1445.     {
  1446.         if( press_tecla[ 1] == 1)
  1447.         {
  1448.             vid_opt = vid_opt + 1 - (vid_opt==4) * 4;
  1449.             for( y=0; y<4; y++)
  1450.                 put_text12c( m_o_xy[y], 92, opcoes[y+6], alfa12, 71+76*(vid_opt==y+1));
  1451.             press_tecla[ 1] = 0;
  1452.         }
  1453.         if( press_tecla[ 3] == 1)
  1454.         {
  1455.             vid_opt = vid_opt - 1 + (vid_opt==1) * 4;
  1456.             for( y=0; y<4; y++)
  1457.                 put_text12c( m_o_xy[y], 92, opcoes[y+6], alfa12, 71+76*(vid_opt==y+1));
  1458.             press_tecla[ 3] = 0;
  1459.         }
  1460.     }
  1461.     if( m_o_opt == 2)
  1462.     {
  1463.         if( press_tecla[ 1] == 1)
  1464.         {
  1465.             pec_opt = pec_opt + 1 - (pec_opt==9) * 10;
  1466.             m_t_pec( pec_opt);
  1467.             m_t_pec( ant_pec_opt);
  1468.             estilo = get_estilo( pec_opt);
  1469.             ant_pec_opt = pec_opt;
  1470.             press_tecla[ 1] = 0;
  1471.         }
  1472.         if( press_tecla[ 3] == 1)
  1473.         {
  1474.             pec_opt = pec_opt - 1 + (pec_opt==0) * 10;
  1475.             m_t_pec( pec_opt);
  1476.             m_t_pec( ant_pec_opt);
  1477.             estilo = get_estilo( pec_opt);
  1478.             ant_pec_opt = pec_opt;
  1479.             press_tecla[ 3] = 0;
  1480.         }
  1481.     }
  1482. }
  1483.  
  1484. void cfg_tec( void)
  1485. {
  1486.     char y;
  1487.     if( press_tecla[ 0] == 1)
  1488.     {
  1489.         opt_cfg = opt_cfg - 1 + (opt_cfg==0) * 3;
  1490.         for( y=0; y<3; y++)
  1491.             put_text12c( m_cfg[y], 24+58*y, config[y], alfa12, 81+6*(opt_cfg==y));
  1492.         press_tecla[ 0] = 0;
  1493.         press_tecla[ 3] = 0;
  1494.         press_tecla[ 1] = 0;
  1495.     }
  1496.     if( press_tecla[ 2] == 1)
  1497.     {
  1498.         opt_cfg = opt_cfg + 1 - (opt_cfg==2) * 3;
  1499.         for( y=0; y<3; y++)
  1500.             put_text12c( m_cfg[y], 24+58*y, config[y], alfa12, 81+6*(opt_cfg==y));
  1501.         press_tecla[ 2] = 0;
  1502.         press_tecla[ 3] = 0;
  1503.         press_tecla[ 1] = 0;
  1504.     }
  1505.     if( press_tecla[ 3] == 1)
  1506.     {
  1507.         c_cfg[opt_cfg] = c_cfg[opt_cfg] - 1 + (c_cfg[opt_cfg]==0) * 2;
  1508.         for( y=0; y<2; y++)
  1509.             put_text12c( 112+60*y, 44+58*opt_cfg, simnao[y], alfa12, 237+6*(c_cfg[opt_cfg]==y));
  1510.         press_tecla[ 3] = 0;
  1511.     }
  1512.     if( press_tecla[ 1] == 1)
  1513.     {
  1514.         c_cfg[opt_cfg] = c_cfg[opt_cfg] + 1 - (c_cfg[opt_cfg]==1) * 2;
  1515.         for( y=0; y<2; y++)
  1516.             put_text12c( 112+60*y, 44+58*opt_cfg, simnao[y], alfa12, 237+6*(c_cfg[opt_cfg]==y));
  1517.         press_tecla[ 1] = 0;
  1518.     }
  1519. }
  1520.  
  1521. void m_opcoes( void)
  1522. {
  1523.     unsigned char y;
  1524.     int x;
  1525.  
  1526.     lbuffer();
  1527.     r_quadro();
  1528.     for( y=0; y<4; y++) press_tecla[ y] = 0;
  1529.     for( y=0; y<3; y++)
  1530.         put_text12c( m_o_x[y], 24+48*y, opcoes[y], alfa12, 81+6*(m_o_opt==y));
  1531.     for( y=0; y<3; y++)
  1532.         put_text12c( m_o_y[y], 44, opcoes[y+3], alfa12, 237+6*(dif_opt==y));
  1533.     for( y=0; y<4; y++)
  1534.         put_text12c( m_o_xy[y], 92, opcoes[y+6], alfa12, 71+76*(vid_opt==y+1));
  1535.     for( y=0; y<10; y++)
  1536.         m_t_pec( y);
  1537.     y = 1;
  1538.     while( y)
  1539.     {
  1540.         if( kbhit())
  1541.         {
  1542.             x = getch();
  1543.             if( x == 13 || x == 32) y = 0;
  1544.         }
  1545.         o_teclas();
  1546.     }
  1547. }
  1548.  
  1549. void m_config( void)
  1550. {
  1551.     unsigned char y;
  1552.     int x;
  1553.  
  1554.     c_cfg[0] = opt_cza;
  1555.     c_cfg[1] = opt_som;
  1556.     c_cfg[2] = opt_eft;
  1557.     lbuffer();
  1558.     r_quadro();
  1559.     for( y=0; y<4; y++) press_tecla[ y] = 0;
  1560.     for( y=0; y<3; y++)
  1561.     {
  1562.         put_text12c( m_cfg[y], 24+58*y, config[y], alfa12, 81+6*(opt_cfg==y));
  1563.         for( x=0; x<2; x++)
  1564.             put_text12c( 112+60*x, 44+58*y, simnao[x], alfa12, 237+6*(c_cfg[y]==x));
  1565.     }
  1566.     y = 1;
  1567.     while( y)
  1568.     {
  1569.         if( kbhit())
  1570.         {
  1571.             x = getch();
  1572.             if( x == 13 || x == 32)
  1573.             {
  1574.                 r_quadro();
  1575.                 if( c_cfg[0] != opt_cza)
  1576.                     if( c_cfg[0] == 0)
  1577.                         gray_scale();
  1578.                     else
  1579.                         palheta_cor();
  1580.                 opt_cza = c_cfg[0];
  1581.                 opt_som = c_cfg[1];
  1582.                 opt_eft = c_cfg[2];
  1583.                 grava_arquivo();
  1584.                 y = 0;
  1585.             }
  1586.         }
  1587.         cfg_tec();
  1588.     }
  1589. }
  1590.  
  1591. void m_gameover( void)
  1592. {
  1593.     lbuffer();
  1594.     r_quadro();
  1595.     put_text12c( 160 - 6 * tam_text( gameover), 80, gameover, alfa12, 243);
  1596.     reseta( 192);
  1597.     while(!(time_loop()))
  1598.         if( kbhit())
  1599.         {
  1600.             lbuffer();
  1601.             return;
  1602.         }
  1603. }
  1604.  
  1605. void m_fimdejogo( void)
  1606. {
  1607.     // Fim do jogo Drops II.
  1608. }
  1609.  
  1610. void i_round( void)
  1611. {
  1612.     char string[ 8];
  1613.     char s = 7, r = 1;
  1614.     char score;
  1615.     r_quadro();
  1616.     put_text12c( 136, 66, escore[ 3], alfa12, 111);
  1617.     score = jogo.fase;
  1618.     while( 1)
  1619.     {
  1620.         s--;
  1621.         string[ s] = 30 + (score % 10);
  1622.         score = score / 10;
  1623.         if( score == 0) break;
  1624.     }
  1625.     string[ 7] = 0;
  1626.     if( jogo.fase > 9) r = 2;
  1627.     put_text12c( 160 - r * 6, 94, &string[ s], alfa12, 147);
  1628.     espere( 96);
  1629.     lbuffer();
  1630. }
  1631.  
  1632. int desca( void)
  1633. {
  1634.     register unsigned char t = -1, r = -1;
  1635.     unsigned char s;
  1636.     int total = 0;
  1637.     while(!((r++)==9))
  1638.     {
  1639.         while(!((t++)==19)) ftemp[ r][ t] = fosso[ r + 1][ t];
  1640.         t = -1;
  1641.     }
  1642.     t = -1;
  1643.     r = -1;
  1644.     while(!((r++)==7))
  1645.     {
  1646.         while(!((t++)==19))
  1647.         {
  1648.             if( fosso[ r + 1][ t] == fosso[ r + 2][ t] &&
  1649.                 fosso[ r + 1][ t] == fosso[ r + 3][ t] &&
  1650.                 fosso[ r + 1][ t] < 8)
  1651.             {
  1652.                 ftemp[ r][ t] = 9;
  1653.                 ftemp[ r + 1][ t] = 9;
  1654.                 ftemp[ r + 2][ t] = 9;
  1655.                 barra( 120 + r * 8, 16 + t * 8, 24, 8, 16);
  1656.             }
  1657.         }
  1658.         t = -1;
  1659.     }
  1660.     t = -1;
  1661.     r = -1;
  1662.     while(!((r++)==9))
  1663.     {
  1664.         while(!((t++)==17))
  1665.         {
  1666.             if( fosso[ r + 1][ t] == fosso[ r + 1][ t + 1] &&
  1667.                 fosso[ r + 1][ t] == fosso[ r + 1][ t + 2] &&
  1668.                 fosso[ r + 1][ t] < 8)
  1669.             {
  1670.                 ftemp[ r][ t] = 9;
  1671.                 ftemp[ r][ t + 1] = 9;
  1672.                 ftemp[ r][ t + 2] = 9;
  1673.                 barra( 120 + r * 8, 16 + t * 8, 8, 24, 16);
  1674.             }
  1675.         }
  1676.         t = -1;
  1677.     }
  1678.     t = -1;
  1679.     r = -1;
  1680.     while(!((r++)==7))
  1681.     {
  1682.         while(!((t++)==17))
  1683.         {
  1684.             if( fosso[ r + 1][ t] == fosso[ r + 2][ t + 1] &&
  1685.                 fosso[ r + 1][ t] == fosso[ r + 3][ t + 2] &&
  1686.                 fosso[ r + 1][ t] < 8)
  1687.             {
  1688.                 ftemp[ r][ t] = 9;
  1689.                 ftemp[ r + 1][ t + 1] = 9;
  1690.                 ftemp[ r + 2][ t + 2] = 9;
  1691.                 barra( 120 + r * 8, 16 + t * 8, 8, 8, 16);
  1692.                 barra( 128 + r * 8, 24 + t * 8, 8, 8, 16);
  1693.                 barra( 136 + r * 8, 32 + t * 8, 8, 8, 16);
  1694.             }
  1695.         }
  1696.         t = -1;
  1697.     }
  1698.     t = 1;
  1699.     r = -1;
  1700.     while(!((r++)==7))
  1701.     {
  1702.         while(!((t++)==19))
  1703.         {
  1704.             if( fosso[ r + 1][ t] == fosso[ r + 2][ t - 1] &&
  1705.                 fosso[ r + 1][ t] == fosso[ r + 3][ t - 2] &&
  1706.                 fosso[ r + 1][ t] < 8)
  1707.             {
  1708.                 ftemp[ r][ t] = 9;
  1709.                 ftemp[ r + 1][ t - 1] = 9;
  1710.                 ftemp[ r + 2][ t - 2] = 9;
  1711.                 barra( 120 + r * 8, 16 + t * 8, 8, 8, 16);
  1712.                 barra( 128 + r * 8, 8 + t * 8, 8, 8, 16);
  1713.                 barra( 136 + r * 8, t * 8, 8, 8, 16);
  1714.             }
  1715.         }
  1716.         t = 1;
  1717.     }
  1718.  
  1719.     t = -1;
  1720.     r = -1;
  1721.     while(!((r++)==9))
  1722.     {
  1723.         while(!((t++)==19)) if( ftemp[ r][ t] == 9) total++;
  1724.         t = -1;
  1725.     }
  1726.     if( total == 0) return( 0);
  1727.     t = -1;
  1728.     r = -1;
  1729.     while(!((r++)==9))
  1730.     {
  1731.         while(!((t++)==19))
  1732.         {
  1733.             if( ftemp[ r][ t] == 9)
  1734.             {
  1735.                 s = t + 1;
  1736.                 if( s > 1)
  1737.                 {
  1738.                     while(!((s--)==1)) ftemp[ r][ s] = ftemp[ r][ s - 1];
  1739.                 }
  1740.                 ftemp[ r][ 0] = 8;
  1741.             }
  1742.         }
  1743.         t = -1;
  1744.     }
  1745.     if (!opt_eft) seta_efeito(efect,4);
  1746.     espere( 20);
  1747.     t = -1;
  1748.     r = -1;
  1749.     while(!((r++)==9))
  1750.     {
  1751.         while(!((t++)==19))
  1752.         {
  1753.             if( ftemp[ r][ t] < 8)
  1754.             bitmap( 120 + r * 8, 16 + t * 8, &alfa[ 3840 + ftemp[ r][ t] * 64 + estilo * 64]);
  1755.             else barra( 120 + r * 8, 16 + t * 8, 8, 8, 0);
  1756.             fosso[ r + 1][ t] = ftemp[ r][ t];
  1757.         }
  1758.         t = -1;
  1759.     }
  1760.     reseta( jogo.passo);
  1761.     acum += total;
  1762.     return( 1);
  1763. }
  1764.  
  1765. char teclas( void)
  1766. {
  1767.     char pont;
  1768.     char a1 = NULL;
  1769.     while( kbhit())
  1770.     {
  1771.         a1 = getch();
  1772.     }
  1773.     if( a1 == 32)
  1774.     {
  1775.         pont = y_peca;
  1776.         while( 1)
  1777.         {
  1778.             if( bateu( x_peca, pont)) break;
  1779.             pont++;
  1780.         }
  1781.         tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1782.         y_peca = pont;
  1783.         put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1784.         reseta( 0);
  1785.     }
  1786.     if( a1 == 27) return( 1);
  1787.     if( a1 == 13)
  1788.     {
  1789.         jogo.proximo = 1 + ( jogo.proximo == 1);
  1790.         if( jogo.proximo == 1) m_proximo();
  1791.         else barra( 280, 144, 8, 24, 0);
  1792.     }
  1793.     if( press_tecla[3] == 1)
  1794.     {
  1795.         pont = x_peca - 1;
  1796.         if( bateu( pont, y_peca - 1) == 0)
  1797.         {
  1798.             tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1799.             x_peca = pont;
  1800.             put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1801.         }
  1802.         press_tecla[3] = 0;
  1803.     }
  1804.     if( press_tecla[1]  == 1)
  1805.     {
  1806.         pont = x_peca + 1;
  1807.         if( bateu( pont, y_peca - 1) == 0)
  1808.         {
  1809.             tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1810.             x_peca = pont;
  1811.             put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1812.         }
  1813.         press_tecla[1] = 0;
  1814.     }
  1815.     if( press_tecla[2] == 1)
  1816.     {
  1817.         vira();
  1818.         put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1819.         press_tecla[2] = 0;
  1820.     }
  1821.     if( press_tecla[0] == 1)
  1822.     {
  1823.         vira();
  1824.         vira();
  1825.         put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1826.         press_tecla[0] = 0;
  1827.     }
  1828.     return( 0);
  1829. }
  1830.  
  1831. char rjogo( void)
  1832. {
  1833.     char zerou = 1, tocou = 1;
  1834.  
  1835.     jogo.fase = 0;
  1836.     jogo.escore = 0;
  1837.     jogo.vidas = vid_opt;
  1838.     sorteia( &peca_prox);
  1839.     while( 1)
  1840.     {
  1841.         seta_som_mudo();
  1842.         zera_matriz();
  1843.         jogo.fase++;
  1844.         if( jogo.fase > 10) return( 0);
  1845.         jogo.pecas = 100 + 100 * ( dif_opt == 2);
  1846.         jogo.passo = ( 44 - jogo.fase * 4) * ( 1 + 1 * ( dif_opt == 0));
  1847.         i_round();
  1848.         g_quadro();
  1849.         press_tecla[0]=0;
  1850.         press_tecla[1]=0;
  1851.         press_tecla[2]=0;
  1852.         press_tecla[3]=0;
  1853.         reseta( jogo.passo);
  1854.         while( zerou)
  1855.         {
  1856.             peca1 = peca_prox;
  1857.             sorteia( &peca_prox);
  1858.             x_peca = 5;
  1859.             y_peca = 0;
  1860.             if( jogo.proximo == 1) m_proximo();
  1861.             if(!bateu( x_peca, y_peca - 1))
  1862.             {
  1863.                 while( tocou)
  1864.                 {
  1865.                     put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1866.                     while(!(time_loop())) if( teclas()) return( 2);
  1867.                     reseta( jogo.passo);
  1868.                     if( bateu( x_peca, y_peca))
  1869.                     {
  1870.                         tocou = 0;
  1871.                         cola( x_peca, y_peca);
  1872.                         acum = 0;
  1873.                         while(desca());
  1874.                         if( acum > 0)
  1875.                         {
  1876.                             jogo.pecas -= acum;
  1877.                             if( jogo.pecas < 1)
  1878.                             {
  1879.                                 jogo.pecas = 0;
  1880.                                 zerou = 0;
  1881.                             }
  1882.                             m_pecas();
  1883.                             jogo.escore += acum * 200 - 300;
  1884.                             if( jogo.escore > jogo.melhor)
  1885.                             {
  1886.                                 jogo.melhor = jogo.escore;
  1887.                                 m_melhor();
  1888.                             }
  1889.                             m_escore();
  1890.                         }
  1891.                         else if (!opt_eft) seta_efeito(&efect[3],2);
  1892.                     }
  1893.                     else
  1894.                     {
  1895.                         tir1( 112 + x_peca * 8, 16 + y_peca * 8);
  1896.                         y_peca++;
  1897.                     }
  1898.                 }
  1899.                 tocou = 1;
  1900.             }
  1901.             else
  1902.             {
  1903.                 reseta(32);
  1904.                 put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1905.                 time_delay2( 6);
  1906.                 tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1907.                 time_delay2( 32);
  1908.                 put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1909.                 time_delay2( 6);
  1910.                 tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1911.                 time_delay2( 32);
  1912.                 put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1913.                 time_delay2( 6);
  1914.                 tire( 112 + x_peca * 8, 16 + y_peca * 8);
  1915.                 time_delay2( 32);
  1916.                 put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
  1917.                 time_delay2( 6);
  1918.                 if( jogo.vidas == 1)
  1919.                 {
  1920.                     seta_som_mudo();
  1921.                     return( 1);
  1922.                 }
  1923.                 zera_matriz();
  1924.                 jogo.vidas--;
  1925.                 g_quadro();
  1926.                 lbuffer();
  1927.             }
  1928.             lbuffer();
  1929.         }
  1930.         zerou = 1;
  1931.     }
  1932. }
  1933.  
  1934. void fim_do_programa( void )
  1935. {
  1936.     seta_som_mudo();
  1937.     nosound();
  1938.     seta_18();
  1939.     if( troquei_ints != 0 )
  1940.     {
  1941.         setvect( 0x09, velha_int_09h);
  1942.         setvect( 0x1c, velha_int_1ch);
  1943.         setvect( 0x1b, velha_int_1bh);
  1944.     }
  1945.     closevga();
  1946.     textmode( 3);
  1947.     *end_teclado = 0;
  1948.     if( sem_memo !=0) printf( "\nDROPS II precisa de 130 Kbytes de mem¢ria para rodar.\n\n");
  1949.     if( erro_arq !=0) printf( "\nErro na leitura ou arquivo n„o encontrado!\n\n");
  1950.     if( sem_placa != 0) printf( "\nSua placa de v¡deo n„o suporta o modo gr fico 320x200 com 256 cores.\n\n");
  1951.     if( sem_memo==0 && erro_arq==0 && sem_placa==0)
  1952.         printf( "\nDROPS II - ZICAUSOFT 1995 - Obrigado por jogar.\n\n");
  1953.     delay( 1000);
  1954. }
  1955.  
  1956. void main()
  1957. {
  1958.     char sai_jogo=1;
  1959.     char my_var;
  1960.  
  1961.     atexit( fim_do_programa);
  1962.  
  1963.     inicializa();
  1964.  
  1965.     m_zicau();
  1966.  
  1967.     reseta( 96);
  1968.     time_delay( 0);
  1969.     quadro();
  1970.  
  1971.     mostra_staff();
  1972.  
  1973.     seta_som_mudo();
  1974.  
  1975.     while( sai_jogo)
  1976.     {
  1977.         r_quadro();
  1978.         m_dropsii();
  1979.         if( deixou_tempo == 0)
  1980.         {
  1981.             if( menu_opt == 3) sai_jogo = 0;
  1982.             if( menu_opt == 1) m_opcoes();
  1983.             if( menu_opt == 2) m_config();
  1984.             if( menu_opt == 0)
  1985.             {
  1986.                 my_var = rjogo();
  1987.                 verifica_recorde();
  1988.                 if( my_var == 1) m_gameover();
  1989.                 if( my_var == 0) m_fimdejogo();
  1990.                 seta_som_mudo();
  1991.             }
  1992.         }
  1993.     }
  1994. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement