Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ### A V I S O ###
- // Os códigos abaixo são LEGADOS e feitos "pra funcionar" em momentos de desespero em compiladores antigos e
- // quando não haviam "engines" e documentação sobre o assunto. Não faça isso em casa
- —————————————————————————————————————————————————————————————————————————————————————————————————————————————————
- // ********** DROPS 2 - ZICAU SOFTWARE LIMITADA - ITAJAI, SC - 1994 - em C **********
- —————————————————————————————————————————————————————————————————————————————————————————————————————————————————
- void interrupt nova_int_09h()
- {
- scancode = inportb( 0x60);
- switch (scancode)
- {
- case 72: { if( estado_tecla[0] == 0) press_tecla[0] = 1;
- estado_tecla[0] = 1; }
- break;
- case 200: { estado_tecla[0] = 0;
- tempo_tecla[0] = 0; }
- break;
- case 77: { if( estado_tecla[1] == 0) press_tecla[1] = 1;
- estado_tecla[1] = 1; }
- break;
- case 205: { estado_tecla[1] = 0;
- tempo_tecla[1] = 0; }
- break;
- case 80: { if( estado_tecla[2] == 0) press_tecla[2] = 1;
- estado_tecla[2] = 1; }
- break;
- case 208: { estado_tecla[2] = 0;
- tempo_tecla[2] = 0; }
- break;
- case 75: { if( estado_tecla[3] == 0) press_tecla[3] = 1;
- estado_tecla[3] = 1; }
- break;
- case 203: { estado_tecla[3] = 0;
- tempo_tecla[3] = 0; }
- break;
- }
- if( ( ( ( scancode > 70) & ( scancode < 82)) | ( ( scancode > 198) & ( scancode < 210))) | scancode == 225)
- {
- auxiliar = inportb( 0x61);
- outportb( 0x61, auxiliar | 0x80);
- outportb( 0x61, auxiliar);
- outportb( 0x20, 0x20);
- }
- else (*velha_int_09h)();
- }
- void interrupt nova_int_1ch()
- {
- hora_real++;
- if( estado_tecla[0] == 1)
- {
- tempo_tecla[0] += 1;
- if( tempo_tecla[0] > 11)
- {
- tempo_tecla[0] -= 12;
- press_tecla[0] = 1;
- }
- }
- if( estado_tecla[1] == 1)
- {
- tempo_tecla[1] += 1;
- if( tempo_tecla[1] > 8)
- {
- tempo_tecla[1] -= 9;
- press_tecla[1] = 1;
- }
- }
- if( estado_tecla[2] == 1)
- {
- tempo_tecla[2] += 1;
- if( tempo_tecla[2] > 11)
- {
- tempo_tecla[2] -= 12;
- press_tecla[2] = 1;
- }
- }
- if( estado_tecla[3] == 1)
- {
- tempo_tecla[3] += 1;
- if( tempo_tecla[3] > 8)
- {
- tempo_tecla[3] -= 9;
- press_tecla[3] = 1;
- }
- }
- (*velha_int_1ch)();
- }
- EXEMPLO (MAL FEITO) DE USO:
- if( press_tecla[3] == 1)
- {
- pont = x_peca - 1;
- if( bateu( pont, y_peca - 1) == 0)
- {
- tire( 112 + x_peca * 8, 16 + y_peca * 8);
- x_peca = pont;
- put_peca( 112 + x_peca * 8, 16 + y_peca * 8, peca1);
- }
- press_tecla[3] = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement