FMMUSIC.H
资源名称:泡泡龙源代码.zip [点击查看]
上传用户:junwei_58
上传日期:2007-05-15
资源大小:79k
文件大小:1k
源码类别:
其他智力游戏
开发平台:
Visual C++
- #ifndef FMMUSIC_H
- #define FMMUSIC_H
- typedef enum {
- _R= 0,
- _C= 262, _Ch= 277,
- _D= 294, _Dh= 311,
- _E= 330,
- _F= 349, _Fh= 370,
- _G= 392, _Gh= 415,
- _A= 440, _Ah= 466,
- _B= 494,
- }Note;
- #ifdef EXTERN
- #undef EXTERN
- #endif
- #define EXTERN extern
- #ifdef FMMUSIC_C
- #undef EXTERN
- #define EXTERN
- #else
- extern Note notetable[];
- extern int timetable[];
- #endif
- #define FM_PORT 0x388
- enum {
- _4_0=384,
- _2_0=192,
- _1_1=96,
- _1_2=48,
- _1_4=24,
- _1_8=12,
- _1_16=6,
- _1_32=3,
- };
- typedef struct{
- int note:10; // 0~12 ,0 is stop ,1 is doe, 2 is #doe ...
- int octave:3; //
- int time;
- }FMMusicNote;
- EXTERN FMMusicNote far *music;
- EXTERN int length;
- #ifdef __cplusplus
- extern "C"{
- #endif
- void WriteFM(char reg,char data);
- char ReadFM();
- int FMready();
- void FMSound(int freq,char block);
- void FMSoundOFF(int freq,char block);
- void delayFM(int time);
- void initPiano();
- #ifdef __cplusplus
- }
- #endif
- #endif