integrate M-HT's neon scalers
[gpsp.git] / video.h
CommitLineData
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
23void update_scanline();
24void update_screen();
25void init_video();
26void video_resolution_large();
27void video_resolution_small();
28void print_string(const char *str, u16 fg_color, u16 bg_color,
29 u32 x, u32 y);
30void print_string_pad(const char *str, u16 fg_color, u16 bg_color,
31 u32 x, u32 y, u32 pad);
32void print_string_ext(const char *str, u16 fg_color, u16 bg_color,
42c81190 33 u32 x, u32 y, void *_dest_ptr, u32 pitch, u32 pad,
34 u32 h_offset, u32 height);
2823a4c8 35void clear_screen(u16 color);
36void blit_to_screen(u16 *src, u32 w, u32 h, u32 x, u32 y);
37u16 *copy_screen();
38void flip_screen();
39void video_write_mem_savestate(file_tag_type savestate_file);
40void video_read_savestate(file_tag_type savestate_file);
41
42void debug_screen_clear();
43void debug_screen_start();
44void debug_screen_end();
45void debug_screen_printf(const char *format, ...);
46void debug_screen_printl(const char *format, ...);
47void debug_screen_newline(u32 count);
48void debug_screen_update();
49
50extern u32 frame_speed;
51
ffc30d25 52extern u32 resolution_width, resolution_height;
53
2823a4c8 54extern s32 affine_reference_x[2];
55extern s32 affine_reference_y[2];
56
57typedef void (* tile_render_function)(u32 layer_number, u32 start, u32 end,
58 void *dest_ptr);
59typedef void (* bitmap_render_function)(u32 start, u32 end, void *dest_ptr);
60
61typedef struct
62{
63 tile_render_function normal_render_base;
64 tile_render_function normal_render_transparent;
65 tile_render_function alpha_render_base;
66 tile_render_function alpha_render_transparent;
67 tile_render_function color16_render_base;
68 tile_render_function color16_render_transparent;
69 tile_render_function color32_render_base;
70 tile_render_function color32_render_transparent;
71} tile_layer_render_struct;
72
73typedef struct
74{
75 bitmap_render_function normal_render;
76} bitmap_layer_render_struct;
77
78typedef enum
79{
80 unscaled,
81 scaled_aspect,
4cadce97 82#ifdef WIZ_BUILD
42c81190 83 unscaled_rot,
84 scaled_aspect_rot,
4cadce97 85#elif defined(GP2X_BUILD)
86 fullscreen,
87 scaled_aspect_sw,
88#else
89 fullscreen,
90#endif
2823a4c8 91} video_scale_type;
92
93typedef enum
94{
95 filter_nearest,
96 filter_bilinear
97} video_filter_type;
98
e38fee1b 99typedef enum
100{
101 filter2_none,
102 filter2_scale2x,
103 filter2_scale3x,
104 filter2_eagle2x,
105} video_filter_type2;
106
2823a4c8 107extern video_scale_type screen_scale;
108extern video_scale_type current_scale;
109extern video_filter_type screen_filter;
e38fee1b 110extern video_filter_type2 screen_filter2;
2823a4c8 111
112void set_gba_resolution(video_scale_type scale);
113
114#endif