gpu_neon: gpu info reads, some bugfixes
[pcsx_rearmed.git] / plugins / gpu_neon / gpu.h
... / ...
CommitLineData
1/*
2 * (C) GraÅžvydas "notaz" Ignotas, 2011
3 *
4 * This work is licensed under the terms of any of these licenses
5 * (at your option):
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
9 */
10
11#include <stdint.h>
12
13#define CMD_BUFFER_LEN 1024
14
15struct psx_gpu {
16 uint16_t vram[1024 * 512];
17 uint16_t guard[1024 * 512]; // overdraw guard
18 uint32_t cmd_buffer[CMD_BUFFER_LEN];
19 uint32_t regs[16];
20 union {
21 uint32_t reg;
22 struct {
23 uint32_t tx:4; // 0 texture page
24 uint32_t ty:1;
25 uint32_t abr:2;
26 uint32_t tp:2; // 7 t.p. mode (4,8,15bpp)
27 uint32_t dtd:1; // 9 dither
28 uint32_t dfe:1;
29 uint32_t md:1; // 11 set mask bit when drawing
30 uint32_t me:1; // 12 no draw on mask
31 uint32_t unkn:3;
32 uint32_t width1:1; // 16
33 uint32_t width0:2;
34 uint32_t dheight:1; // 19 double height
35 uint32_t video:1; // 20 NTSC,PAL
36 uint32_t rgb24:1;
37 uint32_t interlace:1; // 22 interlace on
38 uint32_t blanking:1; // 23 display not enabled
39 uint32_t unkn2:2;
40 uint32_t busy:1; // 26 !busy drawing
41 uint32_t img:1; // 27 ready to DMA image data
42 uint32_t com:1; // 28 ready for commands
43 uint32_t dma:2; // 29 off, ?, to vram, from vram
44 uint32_t lcf:1; // 31
45 };
46 } status;
47 uint32_t gp0;
48 uint32_t ex_regs[8];
49 struct {
50 int hres, vres;
51 int x, y, w, h;
52 int x1, x2;
53 int y1, y2;
54 } screen;
55 struct {
56 int x, y, w, h;
57 int offset;
58 } dma;
59 int cmd_len;
60 const uint32_t *lcf_hc;
61 uint32_t zero;
62 struct {
63 uint32_t fb_dirty:1;
64 } state;
65 struct {
66 uint32_t enabled:1;
67 uint32_t active:1;
68 uint32_t frame_ready:1;
69 const int *advice;
70 } frameskip;
71};
72
73extern struct psx_gpu gpu;
74
75extern const unsigned char cmd_lengths[256];
76
77void do_cmd_list(uint32_t *list, int count);
78
79int vout_init(void);
80int vout_finish(void);