From 2fc6cc22a29a53dc5127eafa2719d11e9bb38c42 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 22 Jan 2004 02:38:13 +0000 Subject: Updated with various bits from espec (memory menu, GUI, etc) --- src/gfx.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'src/gfx.c') diff --git a/src/gfx.c b/src/gfx.c index e7cecb8..ab7768c 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -50,9 +50,6 @@ static const char ident_fh[]=EZX81_FONT_H; #define FALSE 0 #endif -#define SCR_W 320 -#define SCR_H 200 - #define LOCK do \ { \ if (SDL_MUSTLOCK(surface)) \ @@ -171,8 +168,8 @@ void GFXInit(void) if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_VIDEO)) Exit("Failed to init SDL: %s\n",SDL_GetError()); - if (!(surface=SDL_SetVideoMode(SCR_W*scale, - SCR_H*scale, + if (!(surface=SDL_SetVideoMode(GFX_WIDTH*scale, + GFX_HEIGHT*scale, 0, IConfig(CONF_FULLSCREEN) ? SDL_FULLSCREEN : 0))) @@ -182,6 +179,8 @@ void GFXInit(void) SDL_ShowCursor(SDL_DISABLE); SDL_WM_SetCaption("eZX81","eZX81"); + + atexit(SDL_Quit); } @@ -262,6 +261,18 @@ SDL_Event *GFXWaitKey(void) } +void GFXLock(void) +{ + LOCK; +} + + +void GFXUnlock(void) +{ + UNLOCK; +} + + void GFXPlot(int x, int y, Uint32 col) { LOCK; @@ -272,6 +283,12 @@ void GFXPlot(int x, int y, Uint32 col) } +void GFXFastPlot(int x, int y, Uint32 col) +{ + putpixel(x,y,col); +} + + void GFXRect(int x, int y, int w, int h, Uint32 col, int solid) { LOCK; @@ -334,11 +351,11 @@ void GFXPrint(int x, int y, Uint32 col, const char *format, ...) { for(sy=0;sy<8;sy++) { - if (y+sy