SBTIMER.H
资源名称:泡泡龙源代码.zip [点击查看]
上传用户:junwei_58
上传日期:2007-05-15
资源大小:79k
文件大小:1k
源码类别:
其他智力游戏
开发平台:
Visual C++
- #ifndef SBTIMER_H
- #define SBTIMER_H
- //#pragma inline // Use only when TASM was installed.
- #include <stdio.h>
- #include <dos.h>
- #include <conio.h>
- #define OldTimerInt 103
- unsigned Counter;
- long unsigned HSec;
- void interrupt (*oldtim)(...);
- /*
- void SetTimer(void interrupt (*Rout)(...),unsigned Freq){
- int ICnt;
- asm cli;
- ICnt = (int)(1193180l/Freq);
- outportb(0x43,0x36);
- outportb(0x40,ICnt&255);
- outportb(0x40,ICnt>>8);
- oldtim = getvect(8);
- setvect(8,Rout);
- asm sti;
- }
- void RestoreTimer(){
- asm cli;
- outportb(0x43,0x36);
- outportb(0x40,0);
- outportb(0x40,0);
- setvect(8,oldtim);
- asm sti;
- }
- void interrupt NewTimer(...){
- struct REGPACK R;
- ++HSec;
- if(--Counter == 0){
- intr(OldTimerInt,&R);
- Counter = 100/18;
- }
- else outportb(0x20,0x20);
- } */
- #endif