-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvideo_sf2000.h
105 lines (79 loc) · 2.58 KB
/
video_sf2000.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef __SF2000_VIDEO_H
#define __SF2000_VIDEO_H
#ifdef __cplusplus
extern "C" {
#endif
#include "file/config_file.h"
#define HLD_DEV_TYPE_DIS 0x10f0000
enum tvsystem {
PAL = 0, // C implies this but ALi have it specified anyway
NTSC,
RGB_LCD = 0x16 // LINE_800x480_60 hacked for RGB output by HiChip
};
struct vp_init_info; // all of it's rather large thus better patched in-place
extern void get_vp_init_low_lcd_para(struct vp_init_info *);
// is_lcd is named switch_flag in debug printf (it's redunant btw)
extern void switch_lcd_or_tv(BOOL is_lcd, enum tvsystem tvsys);
/* enum DIS_RGB_CLOCK in libviddrv.a. Do note them renaming from
https://git.maschath.de/ignatz/hcrtos/-/blob/main/board/hc15xx/common/dts/sf2000_min.dts#L592
(device tree is likely an older effort, pasting the driver's source verbatim) */
enum VPO_RGB_CLOCK {
VPO_RGB_CLOCK_6_6M = 8,
VPO_RGB_CLOCK_9M = 9
};
#define VPO_IO_GET_OUT_MODE 3
extern int vpo_ioctl(HANDLE, uint32_t, uintptr_t);
#define HLD_DEV_TYPE_OSD 0x1030000
struct osdrect {
uint16_t u_left;
uint16_t u_top;
uint16_t u_width;
uint16_t u_height;
};
enum osdcolor_mode {
OSD_HD_RGB565 = 5,
OSD_HD_ARGB8888 = 10 // currently unused (needs a run_emulator_menu hook)
};
struct osdpara {
enum osdcolor_mode e_mode;
uint8_t u_galpha_enable;
uint8_t u_galpha;
uint8_t u_pallette_sel; // sic
uint8_t u_rotate; // hangs the driver; needs serious research to fix
uint8_t u_flip_v;
uint8_t u_flip_h;
};
struct osd_vscr {
struct osdrect v_r;
const void *lpb_scr;
uint8_t b_block_id;
BOOL update_pending;
uint8_t b_color_mode; // implies enum osdcolor_mode. ALi's fav bad practice
uint8_t b_draw_mode;
};
extern int osddrv_open(HANDLE, void *);
extern int osddrv_close(HANDLE);
extern int osddrv_3x_create_region(HANDLE, uint8_t, struct osdrect *, struct osdpara *);
extern int osddrv_3x_region_write(HANDLE, uint8_t, struct osd_vscr *, struct osdrect *);
#define OSD_SET_SCALE_MODE 0x0B
#define OSD_SCALE_DUPLICATE 0
#define OSD_SCALE_FILTER 1
#define OSD_SCALE_WITH_PARAM 0x0C
struct osd_scale_param {
uint16_t tv_sys; // implies enum tvsystem (NOT enum TV_SYS_TYPE)
uint16_t h_div;
uint16_t v_div;
uint16_t h_mul;
uint16_t v_mul;
};
extern int osddrv_scale(HANDLE, uint32_t, uintptr_t);
extern void st7789v_caset_raset(unsigned start_column, unsigned start_row);
extern void st7789v_ramwr(void);
extern void run_osd_region_write(const void *, uint16_t, uint16_t, uint16_t);
extern void run_screen_write(const void *, int width, int height, uint pitch);
void video_options(config_file_t *config);
void video_cleanup(void);
#ifdef __cplusplus
}
#endif
#endif