📄 vbe.h
字号:
void (*set_volume)(int voice, int vol);
void (*set_pitch)(int voice, int note, int bend);
void (*set_pan)(int voice, int pan);
void (*set_vibrato)(int voice, int amount);
} MIDI_DRIVER;
#define MIDI_NONE 0
#define MIDI_OPL2 1
#define MIDI_OPL3 2
#define MIDI_2XOPL2 3
////////////////////////////////////////////////////////////////////////////
typedef struct MIDI_TRACK /* a track in the MIDI file */
{
unsigned char *pos; /* position in track data */
long timer; /* time until next event */
unsigned char running_status; /* last MIDI event */
} MIDI_TRACK;
typedef struct MIDI_CHANNEL /* a MIDI channel */
{
int patch; /* current sound */
int volume; /* volume controller */
int pan; /* pan position */
int pitch_bend; /* pitch bend position */
int new_volume; /* cached volume change */
int new_pitch_bend; /* cached pitch bend */
int note[128][MIDI_LAYERS]; /* status of each note */
} MIDI_CHANNEL;
typedef struct MIDI_VOICE /* a voice on the soundcard */
{
int channel; /* MIDI channel */
int note; /* note (-1 = off) */
int volume; /* note velocity */
int time; /* when note was triggered */
} MIDI_VOICE;
typedef struct WAITING_NOTE /* a stored note-on request */
{
int channel;
int note;
int volume;
} WAITING_NOTE;
typedef struct PATCH_TABLE /* GM -> external synth */
{
int bank1; /* controller #0 */
int bank2; /* controller #32 */
int prog; /* program change */
int pitch; /* pitch shift */
} PATCH_TABLE;
char screen_write=-1;
unsigned char WHITE=1,_COLOR;
static char grp_err[255];
BITMAP *screen=NULL;
PALETTE SystemPal;
Mouse grp_mouse;
unsigned char KEY[128];
unsigned short lk_dsp_ver=0;
short lk_sb_port=0x220;
#define SCREEN_W (screen->w-1)
#define SCREEN_H (screen->h-1)
short bmp_FPS=0,bmp_Count=0;
//--------------------------VESA 2.0 FUNC------------------------------------------------
_WCRTLINK extern char vesa_2l_init(short mode);
_WCRTLINK extern char DpmiRealMalloc(unsigned short Size, unsigned short *Segment, unsigned short *Selector);
_WCRTLINK extern char DpmiRealFree(unsigned short Selector);
_WCRTLINK extern char DpmiRealInt386x(unsigned char IntNO, RMInfo *RealRegs);
_WCRTLINK extern unsigned long DPMIPhysicalToLinear(unsigned long physAddr, unsigned long limit);
_WCRTLINK extern unsigned long DPMIGetSelectorBase(unsigned short Selector);
_WCRTLINK extern char DPMISetSelectorLimit(unsigned short Selector, unsigned long limit);
_WCRTLINK extern void *DPMIPhysicalAddr(unsigned long base, unsigned long limit);
_WCRTLINK extern char GetVesaInfo(void); // 取VESA显示卡信息
_WCRTLINK extern char GetVesaModeInfo(unsigned short mode); // 取VESA显示卡指定模式信息
_WCRTLINK extern char SetVesaMode(short mode); // 设置显示模式
_WCRTLINK extern unsigned short GetVesaMode(void); // 取当前的显示模式
//--------------------------Beauty FUNC------------------------------------
_WCRTLINK extern inline void setwritemode(char mode);
_WCRTLINK extern inline void putpixel( BITMAP *bitmap,int x,int y,unsigned char col=_COLOR);
_WCRTLINK extern inline void setstyleline(unsigned char mode);
_WCRTLINK extern inline void destroy_bitmap( BITMAP *bitmap);
_WCRTLINK extern inline void draw_sprite(BITMAP *source,BITMAP *dest,int x,int y);
_WCRTLINK extern inline void GetRgb(unsigned char Index, RGB *rgb);
_WCRTLINK extern inline void SetRgb(unsigned char Index, RGB *rgb);
_WCRTLINK extern inline void Refresh();
_WCRTLINK extern inline void clear(BITMAP *bitmap);
_WCRTLINK extern inline void clear_to_color(BITMAP *bitmap,unsigned char col);
_WCRTLINK extern inline void clear_xy(BITMAP *bmp,int x,int y,int w,int h,unsigned char col=0);
_WCRTLINK extern inline unsigned char getpixel( BITMAP *bitmap,int x,int y);
_WCRTLINK extern inline unsigned char get_color(char r,char g,char b);
_WCRTLINK extern unsigned char Mix(unsigned char souCol,unsigned char desCol,float num);
_WCRTLINK extern void Mix_blit(BITMAP *bmp,BITMAP *mask,BITMAP *bmp2,int x,int y);
_WCRTLINK extern inline unsigned char bmp_mask_color(BITMAP *bitmap);
_WCRTLINK extern void grp_exit();
_WCRTLINK extern void set_palette(char *file);
_WCRTLINK extern char LoadHzk();
_WCRTLINK extern char LoadHzk24();
_WCRTLINK extern char load_font();
_WCRTLINK extern unsigned short readclock();
_WCRTLINK extern void line( BITMAP *bitmap,int left,int top,int right,int bottom,unsigned char color=_COLOR);
_WCRTLINK extern void hline( BITMAP *bitmap ,int x,int y,int x1,unsigned char col=_COLOR);
_WCRTLINK extern void vline( BITMAP *bitmap ,int x,int y,int x1,unsigned char col=_COLOR);
_WCRTLINK extern BITMAP *create_bitmap(int width,int height,unsigned char MskCol=0);
_WCRTLINK extern BITMAP *load_pcx(char *file,char bloot=FALSE);
_WCRTLINK extern BITMAP *load_bmp(char *name);
_WCRTLINK extern BITMAP *load_gif(char *filename,char bloot=FALSE);
_WCRTLINK extern BITMAP *load_bitmap(char *file,char bloot=TRUE);
_WCRTLINK extern void OutText( BITMAP *bitmap,int x,int y,char *str,...);
_WCRTLINK extern void textout( BITMAP *bitmap1,char *Str,int x,int y,unsigned char col=_COLOR);
_WCRTLINK extern void barA( BITMAP *bitmap,int x,int y,int x1,int y1,unsigned char col=_COLOR);
_WCRTLINK extern void rectfill( BITMAP *bitmap,int x,int y,int x1,int y1,unsigned char col=_COLOR);
_WCRTLINK extern void rect( BITMAP *bitmap1,int x,int y,int top,int bom,unsigned char col=_COLOR);
_WCRTLINK extern void ellipse( BITMAP *bitmap,int x_center,int y_center,int x_radius,int y_radius,unsigned char col=_COLOR);
_WCRTLINK extern void circle( BITMAP *bitmap,int x_center,int y_center,int radius,unsigned char col=_COLOR);
_WCRTLINK extern void circlefill( BITMAP *bitmap,int x,int y,int radius,unsigned char col=_COLOR);
_WCRTLINK extern void getimage( BITMAP *bitmap1,int x,int y,int x1,int y1, BITMAP *bitmap);
_WCRTLINK extern void putimage( BITMAP *destDirect,int x,int y,BITMAP *surDirect);
_WCRTLINK extern void bmp_read_line(BITMAP *bitmap,int y,unsigned char *buf);
_WCRTLINK extern void bmp_write_line(BITMAP *bitmap,int y,unsigned char *buf);
_WCRTLINK extern void bmp_read_width(BITMAP *bitmap,int width,int y,unsigned char *buf);
_WCRTLINK extern void bmp_write_width(BITMAP *bitmap,int width,int y,unsigned char *buf);
_WCRTLINK extern void VRputimage( BITMAP *bitmap1,int x,int y,int top,int bom,BITMAP *bitmap);
_WCRTLINK extern void bitmap_copy(BITMAP *bmp,BITMAP *p);
_WCRTLINK extern char ReadPcx(char *file,BITMAP *bitmap);
_WCRTLINK extern char ReadBmp(char *name,BITMAP *bitmap);
_WCRTLINK extern char grp_init(int mode);
_WCRTLINK extern void Alph_init();
_WCRTLINK extern inline char is_same_bitmap(BITMAP *s,BITMAP *d);
_WCRTLINK extern inline char is_linear_bitmap(BITMAP *bitmap);
_WCRTLINK extern void Disappear(int time);
_WCRTLINK extern void Appear(int time);
_WCRTLINK extern void LightLow(unsigned char light,unsigned char time=0);
_WCRTLINK extern void LightUp(unsigned char light,unsigned char time=0);
_WCRTLINK extern void blit( BITMAP *bitmap,BITMAP *desDirect,int x,int y,int x1,int y1,int w,int h);
_WCRTLINK extern void CloseHzk();
_WCRTLINK extern void Show_Err();
_WCRTLINK extern int random(int x);
//----------------------------New Add------------------------
_WCRTLINK extern void ScaleImage(BITMAP *bitmap,BITMAP *bmp,int x,int y);
_WCRTLINK extern void SizeImage(BITMAP *bitmap,BITMAP *bmp,int x,int y,int w,int h);
_WCRTLINK extern void box3d(BITMAP *bitmap,int x,int y,int x1,int y1,int width,unsigned char col=_COLOR);
_WCRTLINK extern void show24(BITMAP *bitmap,char *p,int x,int y,unsigned char color=_COLOR);
_WCRTLINK extern inline short getbit(unsigned char c,short n);
_WCRTLINK extern void setChinaLen(int len=0);
_WCRTLINK extern void clean_bitmap(BITMAP *bmp,unsigned char);
//-----------------------------------------------------------
_WCRTLINK extern void masked_blit(BITMAP *dest,BITMAP *source,int x,int y,int x1,int y1,int w,int h);
_WCRTLINK extern BITMAP *create_rle_sprite(char *file);
_WCRTLINK extern void draw_sprite_vh_flip(BITMAP *source,BITMAP *dest,int x,int y);
_WCRTLINK extern void draw_sprite_v_flip(BITMAP *source,BITMAP *dest,int x,int y);
_WCRTLINK extern void draw_sprite_h_flip(BITMAP *source,BITMAP *dest,int x,int y);
_WCRTLINK extern void draw_rle_sprite(BITMAP *source,BITMAP *sprite,int x,int y);
_WCRTLINK extern void Clearkey();
_WCRTLINK extern void set_time(int time);
_WCRTLINK extern void ling(BITMAP *bitmap,int top,int x,int y,int width,int bom,unsigned char col=_COLOR);
_WCRTLINK extern void poly(BITMAP *bmp,int num,int *points,unsigned char color=_COLOR);
//------------------------------------------------------------------------
_WCRTLINK extern char WritePortC(unsigned char value);
_WCRTLINK extern unsigned char ReadPortC();
_WCRTLINK extern short ResetDsp(short data);
_WCRTLINK extern short GetDspVersion();
_WCRTLINK extern void MixerWrite(short reg,short data);
_WCRTLINK extern short MixerRead(short reg);
_WCRTLINK extern short SetMixer(int digi_volume, int midi_volume);
_WCRTLINK extern short GetBlasterEnv(short *sb_port,short *sb_dma8,short *sb_dma16,short *sb_irq);
_WCRTLINK extern void FMWrite(unsigned short reg,unsigned char data);
_WCRTLINK extern unsigned char FMRead();
_WCRTLINK extern void FMInit();
_WCRTLINK extern void FMSound(short frequency,short block);
_WCRTLINK extern void FMSoundOff(short frequency,short block);
_WCRTLINK extern void FM(short frequency,short block);
#pragma intrinsic(FMInit,FMRead,FM,AutoDetect);
_WCRTLINK extern char MidiInit(char driver);
_WCRTLINK extern char MidiRest();
_WCRTLINK extern void FM_load_map(int choice,int drums);
_WCRTLINK extern int FM_load_ibk(char *filename, int drums);
_WCRTLINK extern MIDI *LoadMidi(char *fname);
_WCRTLINK extern void DestroyMidi(MIDI*);
_WCRTLINK extern int MidiPlay(MIDI *midi, int loop);
_WCRTLINK extern void StopMidi();
_WCRTLINK extern void MidiPause();
_WCRTLINK extern int MidiSeek(int target);
_WCRTLINK extern void MidiResume();
#pragma intrinsic(MidiInit);
////////////////////////////////////////////////////////////////////////////
_WCRTLINK extern int midi_init(char driver);
_WCRTLINK extern void midi_exit();
//-------------------------------------------------------------------
_WCRTLINK extern char *grp_dos_alloc(int size,short *selector);
_WCRTLINK extern void grp_dos_free(short selector);
_WCRTLINK extern void grp_mem_lock(void *mem,unsigned short size);
_WCRTLINK extern void grp_mem_unlock(void *mem,unsigned short size);
_WCRTLINK extern char grp_dma_alloc(int size,long *phy,short *selector);
_WCRTLINK extern char grp_dma_free(int size,long phy,short selector);
_WCRTLINK extern void grp_dma_start(char channel,unsigned long addr,short size,char auto_init,char input);
_WCRTLINK extern void grp_dma_stop(char channel);
_WCRTLINK extern long grp_dma_todo(char channel);
_WCRTLINK extern char snd_init(short addr=-1,short irq=-1,short dma=-1);
_WCRTLINK extern void snd_rest();
_WCRTLINK extern void snd_play(Voc *buf,int sample);
_WCRTLINK extern Voc *load_voc(char *file);
//---------------------------------------------------------------------------
_WCRTLINK extern char mouse_init();
_WCRTLINK extern void set_mouse_range(int x,int y,int x1,int y1);
_WCRTLINK extern inline void mouse_reset();
_WCRTLINK extern inline void hide_mouse();
_WCRTLINK extern inline void show_mouse();
_WCRTLINK extern void set_mouse_cursor(unsigned char mouse[16][16]);
_WCRTLINK extern char mouse_xy(short x,short y,short x1,short y1);
//---------------------------------------------------------------------------
_WCRTLINK extern void timer_init();
_WCRTLINK extern void timer_uninstall();
_WCRTLINK extern long getclock(char swit); // 0: 1.19MHz 1:200Hz the same
_WCRTLINK extern char install_int_ex(void (*proc)(void),int speed);
_WCRTLINK extern char install_int(void (*proc)(void),int speed);
_WCRTLINK extern void remove_int(void (*proc)(void));
#pragma intrinsic(install_int_ex,install_int,remove_int);
//---------------------------------------------------------------------------
_WCRTLINK extern void setkeyspeed();
_WCRTLINK extern void clear_keybuf();
_WCRTLINK extern void key_init();
_WCRTLINK extern char keypressed();
_WCRTLINK extern short readkey();
_WCRTLINK extern void simulate_pressed(char keyy);
//-------------------------------Windows Func---------------------------------
extern void winbar(BITMAP *bmp,short x,short y,short x1,short y1,short mode);
extern void winbox(BITMAP *bmp,short x,short y,short x1,short y1,short mode);
extern void winc(BITMAP *bmp,short x,short y,short x1,short y1,char *s);
#ifdef __cplusplus
};
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -