1 #ifndef _GFX_H_ 2 #define _GFX_H_ 3 4 #include "sys_dep.h" 5 6 #define WIDTH (360+64) 7 #define HEIGHT 256 8 9 #if defined(NEW_GFX_ENGINE) 10 11 // The extra 32's and 64's are linked to the way the sprite are blitted on screen, which can overlap to near memory 12 // If only one pixel is drawn in the screen, the whole sprite is written, which can eventually overlap unexpected area 13 // A sharper way of doing would probably reduce the amount of needed data from 220kb to 128kb (eventually smaller if restricting 14 // games with hi res to be launched) 15 // XBUF_WIDTH = 536 + 32 + 32 16 // XBUG_HEIGHT = 240 + 64 + 64 17 18 #define XBUF_WIDTH (536 + 32 + 32) 19 #define XBUF_HEIGHT (240 + 64 + 64) 20 21 #else 22 23 #define XBUF_WIDTH (320+64+40) 24 #define XBUF_HEIGHT 240 25 26 #endif 27 28 #include "sprite.h" 29 30 #define textoutshadow(bmp,f,s,x,y,color1,color2,offsetx,offsety) { textout(bmp,f,s,x+offsetx,y+offsety,color2); textout(bmp,f,s,x,y,color1); } 31 // Just a little define to avoid too many keystrokes ;) 32 33 /* 34 * generic_rect - Used to keep calc_fullscreen_aspect gfx lib independant. Currently 35 * used to remap values to an SDL_Rect structure. 36 */ 37 struct generic_rect 38 { 39 unsigned short start_x, start_y; 40 unsigned short end_x, end_y; 41 }; 42 43 typedef struct { 44 typeof(io.VDC[BXR].W) scroll_x; 45 typeof(io.VDC[BYR].W) scroll_y; 46 int scroll_y_diff; 47 typeof(io.VDC[CR].W) cr; 48 } gfx_context; 49 50 #ifdef SDL 51 52 #include <SDL.h> 53 54 extern SDL_Surface *physical_screen; 55 extern SDL_Rect physical_screen_rect; 56 extern SDL_Color olay_cmap[256]; 57 58 #endif 59 60 extern int video_dump_flag; 61 extern int gfx_need_video_mode_change; 62 63 void calc_fullscreen_aspect(unsigned short physical_screen_width, unsigned short physical_screen_height, 64 struct generic_rect *rect, unsigned short pce_screen_width, unsigned short pce_screen_height); 65 void change_pce_screen_height(); 66 67 void save_gfx_context(int slot_number); 68 69 int start_dump_video(); 70 71 void stop_dump_video(); 72 73 void dump_video_frame(); 74 75 UChar Loop6502(); 76 77 #if defined(GFX_DEBUG) 78 void gfx_debug_printf(char *format, ...); 79 #endif 80 81 #endif 82