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