1: /* unofficial gameplaySP kai
2: *
3: * Copyright (C) 2006 Exophase <exophase@gmail.com>
4: * Copyright (C) 2007 takka <takka@tfact.net>
5: *
6: * This program is free software; you can redistribute it and/or
7: * modify it under the terms of the GNU General Public License as
8: * published by the Free Software Foundation; either version 2 of
9: * the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19: */
20:
21: #ifndef VIDEO_H
22: #define VIDEO_H
23:
24: #define FONT_WIDTH 6
25: #define FONT_HEIGHT 10
26:
27: void update_scanline();
28: void update_screen();
29: void init_video();
30: void video_resolution_large();
31: void video_resolution_small();
32: void print_string(char *str, u16 fg_color, u16 bg_color, u32 x, u32 y);
33: void print_string_pad(char *str, u16 fg_color, u16 bg_color, u32 x, u32 y, u32 pad);
34: void print_string_ext(char *str, u16 fg_color, u16 bg_color, u32 x, u32 y, void *_dest_ptr, u32 pitch, u32 pad);
35: void clear_screen(u16 color);
36: void blit_to_screen(u16 *src, u32 w, u32 h, u32 x, u32 y);
37: u16 *copy_screen();
38: void flip_screen();
39: void video_read_mem_savestate(FILE_TAG_TYPE savestate_file);
40: void video_write_mem_savestate(FILE_TAG_TYPE savestate_file);
41: void video_read_savestate(FILE_TAG_TYPE savestate_file);
42:
43: void debug_screen_clear();
44: void debug_screen_start();
45: void debug_screen_end();
46: void debug_screen_printf(const char *format, ...);
47: void debug_screen_printl(const char *format, ...);
48: void debug_screen_newline(u32 count);
49: void debug_screen_update();
50:
51: extern u32 frame_speed;
52:
53: extern s32 affine_reference_x[2];
54: extern s32 affine_reference_y[2];
55:
56: typedef void (* tile_render_function)(u32 layer_number, u32 start, u32 end,
57: void *dest_ptr);
58: typedef void (* bitmap_render_function)(u32 start, u32 end, void *dest_ptr);
59:
60: typedef struct
61: {
62: tile_render_function normal_render_base;
63: tile_render_function normal_render_transparent;
64: tile_render_function alpha_render_base;
65: tile_render_function alpha_render_transparent;
66: tile_render_function color16_render_base;
67: tile_render_function color16_render_transparent;
68: tile_render_function color32_render_base;
69: tile_render_function color32_render_transparent;
70: } tile_layer_render_struct;
71:
72: typedef struct
73: {
74: bitmap_render_function normal_render;
75: } bitmap_layer_render_struct;
76:
77: typedef enum
78: {
79: unscaled,
80: scaled_aspect,
81: fullscreen,
82: } video_scale_type;
83:
84: typedef enum
85: {
86: filter_nearest,
87: filter_bilinear
88: } video_filter_type;
89:
90: extern u16 *screen_address;
91: extern u32 screen_pitch;
92: extern u32 screen_width;
93: extern u32 screen_height;
94: extern u32 screen_width2;
95: extern u32 screen_height2;
96:
97: extern u32 screen_scale;
98: extern u32 current_scale;
99: extern u32 screen_filter;
100:
101: void set_gba_resolution_small(video_scale_type scale);
102: void set_gba_resolution_large();
103:
104: #endif
105: