1 /*
2  * This file is part of libbluray
3  * Copyright (C) 2010-2012  Petri Hintukainen <phintuka@users.sourceforge.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library 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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see
17  * <http://www.gnu.org/licenses/>.
18  */
19 
20 #if !defined(_HDMV_INSN_H_)
21 #define _HDMV_INSN_H_
22 
23 /*
24  * instruction groups
25  */
26 
27 typedef enum {
28     INSN_GROUP_BRANCH = 0,
29     INSN_GROUP_CMP    = 1,
30     INSN_GROUP_SET    = 2,
31 } hdmv_insn_grp;
32 
33 /*
34  * BRANCH group
35  */
36 
37 /* BRANCH sub-groups */
38 typedef enum {
39     BRANCH_GOTO   = 0x00,
40     BRANCH_JUMP   = 0x01,
41     BRANCH_PLAY   = 0x02,
42 } hdmv_insn_grp_branch;
43 
44 /* GOTO sub-group */
45 typedef enum {
46     INSN_NOP          = 0x00,
47     INSN_GOTO         = 0x01,
48     INSN_BREAK        = 0x02,
49 } hdmv_insn_goto;
50 
51 /* JUMP sub-group */
52 typedef enum {
53     INSN_JUMP_OBJECT  = 0x00,
54     INSN_JUMP_TITLE   = 0x01,
55     INSN_CALL_OBJECT  = 0x02,
56     INSN_CALL_TITLE   = 0x03,
57     INSN_RESUME       = 0x04,
58 } hdmv_insn_jump;
59 
60 /* PLAY sub-group */
61 typedef enum {
62     INSN_PLAY_PL      = 0x00,
63     INSN_PLAY_PL_PI   = 0x01,
64     INSN_PLAY_PL_PM   = 0x02,
65     INSN_TERMINATE_PL = 0x03,
66     INSN_LINK_PI      = 0x04,
67     INSN_LINK_MK      = 0x05,
68 } hdmv_insn_play;
69 
70 /*
71  * COMPARE group
72  */
73 
74 typedef enum {
75     INSN_BC = 0x01,
76     INSN_EQ = 0x02,
77     INSN_NE = 0x03,
78     INSN_GE = 0x04,
79     INSN_GT = 0x05,
80     INSN_LE = 0x06,
81     INSN_LT = 0x07,
82 } hdmv_insn_cmp;
83 
84 /*
85  * SET group
86  */
87 
88 /* SET sub-groups */
89 typedef enum {
90     SET_SET       = 0x00,
91     SET_SETSYSTEM = 0x01,
92 } hdmv_insn_grp_set;
93 
94 /* SET sub-group */
95 typedef enum {
96     INSN_MOVE   = 0x01,
97     INSN_SWAP   = 0x02,
98     INSN_ADD    = 0x03,
99     INSN_SUB    = 0x04,
100     INSN_MUL    = 0x05,
101     INSN_DIV    = 0x06,
102     INSN_MOD    = 0x07,
103     INSN_RND    = 0x08,
104     INSN_AND    = 0x09,
105     INSN_OR     = 0x0a,
106     INSN_XOR    = 0x0b,
107     INSN_BITSET = 0x0c,
108     INSN_BITCLR = 0x0d,
109     INSN_SHL    = 0x0e,
110     INSN_SHR    = 0x0f,
111 } hdmv_insn_set;
112 
113 /* SETSYSTEM sub-group */
114 typedef enum {
115     INSN_SET_STREAM      = 0x01,
116     INSN_SET_NV_TIMER    = 0x02,
117     INSN_SET_BUTTON_PAGE = 0x03,
118     INSN_ENABLE_BUTTON   = 0x04,
119     INSN_DISABLE_BUTTON  = 0x05,
120     INSN_SET_SEC_STREAM  = 0x06,
121     INSN_POPUP_OFF       = 0x07,
122     INSN_STILL_ON        = 0x08,
123     INSN_STILL_OFF       = 0x09,
124     INSN_SET_OUTPUT_MODE = 0x0a,
125     INSN_SET_STREAM_SS   = 0x0b,
126 
127     INSN_SETSYSTEM_0x10  = 0x10,
128 } hdmv_insn_setsystem;
129 
130 #endif // _HDMV_INSN_H_
131