⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grengine.hpp

📁 SNES game emulator. C and asm files.
💻 HPP
字号:
/*  GrEngine.hpp - The declarations for GrEngine.cpp
*/

#define CCOLOR(set,brightness) (((set) << 4) + (brightness))

extern int vidmode;
extern int xres, yres;

extern byte vs [144000];
extern byte snesscreen [65536];

extern boolean waitretrace, leadingedge;
extern byte curcolor;

extern byte width8[128];
extern byte width10[128];

extern boolean fpucopy;

void setvideomode (int mode, boolean qsize);
	// qsize: whether video buffer will be 256x256 (Size in Mode Q)
void testpattern ();
	// Displays a test pattern...
void capturescreen (void);
	// Copies the image in vs into snesscreen.
void clearscreen (int backg = 0);
	// Clears vs.
void copyscreen (void);
	// Copies virtual screen to real screen.
void drawbox (int x1, int y1, int x2, int y2, int color = -1);
void drawpatternbox (int x1, int y1, int x2, int y2, int color = -1, int skip = 1);
	// Draws a box filled with color on the screen.  The second function draws a see-through pattern.
void hline (int y, int x1, int x2, int color = -1);
void vline (int x, int y1, int y2, int color = -1);
void point (int x, int y, int color);
	// Horizontal/vertical lines and single pixels
void drawdottedlinebox (int x1, int y1, int x2, int y2, int c = -1);
	// Focus box.
void setcolor (int c);
int textwidth8 (char *t);
int textwidth10 (char *t);
inline int textwidth (char *t, boolean largefont)
{	return largefont ? textwidth10 (t) : textwidth8 (t); }
void printf8  (int x, int y, char *s, ...);
void printf10 (int x, int y, char *s, ...);
void outtext8 (int x, int y, char *s, boolean focusbox = false);
void outtext10(int x, int y, char *s, boolean focusbox = false);
inline void outtext (int x, int y, char *t, boolean largefont, boolean focusbox = false)
{	if (largefont)
		outtext10 (x, y, t, focusbox);
	else
		outtext8 (x, y, t, focusbox);
}	// Prints stuff on the screen.

/* Custom palette: 16 sets of 16 shades. last 8 shades are more than full brightness.
.  0: All 3 primary colors 
.  1-3: Two p.colors on
.  4-6: One p.color on
.  7-12: One p.color and 1/2 of another.
.  13-15: One p.color and 1/2 of the other two.
*/
extern dword pal [256], custompalette [256], gamepalette [256];
extern byte translationtable [16][16][16];

void setpaletteentry (byte entry, byte r, byte g, byte b);
void setpaletteentry (byte entry, dword rgb);
	// Changes a palette entry.
void initcustompalette (void);
	// Inits the custom palette array and color matching table.
void applycustompalette (void);
	// Changes the screen palette to the custom palette.
void savegamepalette (void);
	// Copies the screen palette array to the game palette array.
void applygamepalette (void);
	// Changes the screen palette to the game palette.
int rgbtocpalette (dword rgb);
	// Finds the closest custom palette entry for a given RGB value.
int findclosestmatch (dword rgb);
	// Searches for an entry in the current palette that is close to
	// the given RGB value.
void setsnespalette (byte entry, word value, byte brightness);
	// Translates a SNES palette value into a PC palette value before changing the palette.
void waitforretrace ();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -