const int shift_table[16] = { -0x80, -0x40, -0x20, -0x10, -0x8, -0x4, -0x2, - 0x1, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; static unsigned int_count, cur_len; void interrupt new_isr() { static unsigned int a_xs[160]; static unsigned char a_xc[160]; static int xcount = 319; static unsigned int *xs = a_xs; static unsigned char *xc = a_xc; static unsigned char far *screenpos; if (!skip) { if(int_count >= cur_len) { int_count = 0; accum = 0x80; i++; _CH = playlist[i]; if (_CH == 0) { _CH = *playlist; i = 0; } MemoryPointer = patterns[_CH]; cur_len = lengths[_CH]; } int_count++; cc = *(MemoryPointer++); accum -= shift_table[(cc >> 4) & 0x0f]; cb = (((accum) < 0) ? 0 : ((accum) > 255) ? 255 : accum); skip = 1; } else { accum -= shift_table[cc & 0x0f]; cb = (((accum) < 0) ? 0 : ((accum) > 255) ? 255 : accum); skip = 0; } asm { mov ax, cb mov cx, dev cmp cx, 0 jne no_soundblaster mov bl, al mov dx, out_port } sbloop1: asm { in al, dx test al, 80h jnz sbloop1 mov al, 10h out dx, al } sbloop2: asm { in al, dx test al, 80h jnz sbloop2 mov al, bl } no_soundblaster: asm { mov dx, out_port out dx, al } if (timer_pos++ == 440) { timer_pos = 0; old_isr(); } else { asm mov al, 20h asm out 20h, al } if (osc) { if (xcount >= 319) { xs = a_xs; xc = a_xc; xcount = 0; } if (*xc != 15 && *xs) pixel(xcount,*xs) = *xc; *xs = (cb >> 3) + 166; screenpos = (char far *) 0xA0000000L + xcount + (*xs << 8) + (*xs << 6); *xc = *screenpos; if (*xc != 15) *screenpos = 9; xc++; xs++; xcount += 2; } } /* New ISR */