CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/GPU/Debugger/GECommandTable.h
Views: 1401
1
// Copyright (c) 2022- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include "GPU/ge_constants.h"
21
22
enum class GECmdFormat {
23
DATA, // Just regular data.
24
DATA16, // Data, but only 16 bits of it used.
25
DATA8, // 8 bits value (alpha, etc.)
26
NONE, // Should have no arguments or value.
27
RELATIVE_ADDR, // 24 bits added to base + offset.
28
PRIM, // 16 bits count, 3 bits type.
29
BEZIER, // 8 bits ucount, 8 bits vcount.
30
SPLINE, // 8 bits ucount, 8 bits vcount, 2 bits utype, 2 bits vtype.
31
JUMP, // Like RELATIVE_ADDR, but lower 2 bits ignored.
32
SIGNAL, // 16 bits data, 8 bits signal type.
33
HIGH_ADDR_ONLY, // 16 bits ignored, 8 bits for a high address.
34
LOW_ADDR_ONLY, // 24 bits low address.
35
LOW_ADDR, // 24 bits low address.
36
HIGH_ADDR, // 16 bits ignored, 8 bits for a high address.
37
VERTEX_TYPE, // 24-bits of vtype flags (complex.)
38
OFFSET_ADDR, // 24 bits become the high bits of offset.
39
X10_Y10, // 10 bits X, 10 bits Y.
40
FLAG, // 1 bit on/off.
41
BONE_NUM, // 7 bits number.
42
MATRIX_NUM, // 4 bits number.
43
FLOAT, // 24 bits float data.
44
PATCH_DIVISION, // 8 bits divisionu, 8 bits divisionv.
45
PATCH_PRIM, // 2 bits primitive type.
46
SUBPIXEL_COORD, // 4 bits subpixel, 12 bits integer value.
47
MATERIAL_UPDATE, // 3 bits colors to update.
48
RGB, // 24 bits RGB color.
49
LIGHT_TYPE, // 8 bits computation (2 bits), 2 bits type.
50
STRIDE, // 11 bits.
51
STRIDE_HIGH_ADDR, // 11 bits stride, 5 ignored, 8 bits high address.
52
TEX_SIZE, // 4 bits width power, 4 bits ignored, 4 bits height power.
53
TEX_MAP_MODE, // 8 bits mode (2 bits), 2 bits matrix factor.
54
TEX_LIGHT_SRC, // 8 bits lightu (2 bits), 2 bits lightv.
55
TEX_MODE, // 8 bits swizzle (1 bit), 8 bits separate clut4 (1 bit), 3 bits max level.
56
TEX_FORMAT, // 4 bits format.
57
TEX_FILTER, // 3 bits minify mode, 5 bits ignored, 1 bit magnify mode.
58
TEX_CLAMP, // 1 bit clampu, 7 bits ignored, 1 bit clampv.
59
TEX_LEVEL_MODE, // 2 bits mode, 15 bits ignored, 4.4 (8 bits) bias.
60
TEX_FUNC, // 3 bits function, 5 bits ignored, 1 bit use alpha, 7 bits ignored, 1 bit double color.
61
CLUT_BLOCKS, // 6 bits block count.
62
CLUT_FORMAT, // 2 bits format, 5 bits shift, 1 bit ignored, 8 bits mask, 5 bits base.
63
CLEAR_MODE, // 1 bit on, 7 bits ignored, 3 bits aspect.
64
COLOR_TEST_FUNC, // 2 bits test function.
65
ALPHA_TEST, // 3 bits function, 5 bits ignored, 8 bits ref, 8 bits mask.
66
STENCIL_OP, // 8 bits sfail (3 bits), 8 bits zfail (3 bits), 8 bits zpass (3 bits.)
67
DEPTH_TEST_FUNC, // 3 bits function.
68
BLEND_MODE, // 4 bits srcfactor, 4 bits dstfactor, 3 bits equation.
69
DITHER_ROW, // 4 s.3.0 fixed point dither offsets.
70
LOGIC_OP, // 4 bits logic operation.
71
ALPHA_PRIM, // 8 bits alpha, 3 bits primitive type, 1 bit antialias, 6 bit clip?, 1 bit shading, 1 bit cullenable, 1 bit cullface, 1 bit tex enable, 1 bit fog, 1 bit dither.
72
};
73
74
struct GECmdInfo {
75
GECommand reg;
76
const char *name;
77
GECmdFormat fmt;
78
};
79
80
bool GECmdInfoByName(const char *name, GECmdInfo &info);
81
GECmdInfo GECmdInfoByCmd(GECommand reg);
82
83