annotate dvdread/cmd_print.c @ 27076:3dccfe530193

cosmetic: give coherent indentation
author ben
date Fri, 20 Jun 2008 20:07:36 +0000
parents fe3043a8552c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24048
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
1 /* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
2 /*
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
3 * Copyright (C) 2000, 2001, 2002, 2003 Martin Norbäck, Håkan Hjort
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
4 *
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
8 * (at your option) any later version.
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
9 *
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
13 * GNU General Public License for more details.
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
14 *
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
18 */
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
19
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
20 #include "config.h"
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
21
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
22 #include <stdio.h>
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
23 #include <ctype.h>
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
24
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
25 #if defined(HAVE_INTTYPES_H)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
26 #include <inttypes.h>
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
27 #elif defined(HAVE_STDINT_H)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
28 #include <stdint.h>
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
29 #endif
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
30
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
31 #include "cmd_print.h"
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
32
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
33
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
34 typedef struct
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
35 {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
36 uint8_t bits[8];
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
37 uint8_t examined[8];
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
38 } cmd_t;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
39
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
40
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
41 static const char *cmp_op_table[] = {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
42 NULL, "&", "==", "!=", ">=", ">", "<=", "<"
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
43 };
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
44 static const char *set_op_table[] = {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
45 NULL, "=", "<->", "+=", "-=", "*=", "/=", "%=", "rnd", "&=", "|=", "^="
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
46 };
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
47
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
48 static const char *link_table[] = {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
49 "LinkNoLink", "LinkTopC", "LinkNextC", "LinkPrevC",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
50 NULL, "LinkTopPG", "LinkNextPG", "LinkPrevPG",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
51 NULL, "LinkTopPGC", "LinkNextPGC", "LinkPrevPGC",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
52 "LinkGoUpPGC", "LinkTailPGC", NULL, NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
53 "RSM"
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
54 };
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
55
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
56 static const char *system_reg_table[] = {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
57 "Menu Description Language Code",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
58 "Audio Stream Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
59 "Sub-picture Stream Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
60 "Angle Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
61 "Title Track Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
62 "VTS Title Track Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
63 "VTS PGC Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
64 "PTT Number for One_Sequential_PGC_Title",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
65 "Highlighted Button Number",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
66 "Navigation Timer",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
67 "Title PGC Number for Navigation Timer",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
68 "Audio Mixing Mode for Karaoke",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
69 "Country Code for Parental Management",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
70 "Parental Level",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
71 "Player Configurations for Video",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
72 "Player Configurations for Audio",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
73 "Initial Language Code for Audio",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
74 "Initial Language Code Extension for Audio",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
75 "Initial Language Code for Sub-picture",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
76 "Initial Language Code Extension for Sub-picture",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
77 "Player Regional Code",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
78 "Reserved 21",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
79 "Reserved 22",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
80 "Reserved 23"
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
81 };
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
82
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
83 static const char *system_reg_abbr_table[] = {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
84 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
85 "ASTN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
86 "SPSTN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
87 "AGLN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
88 "TTN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
89 "VTS_TTN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
90 "TT_PGCN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
91 "PTTN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
92 "HL_BTNN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
93 "NVTMR",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
94 "NV_PGCN",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
95 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
96 "CC_PLT",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
97 "PLT",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
98 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
99 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
100 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
101 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
102 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
103 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
104 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
105 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
106 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
107 NULL,
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
108 };
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
109
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
110
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
111
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
112 static unsigned int bits(cmd_t *cmd, int byte, int bit, int count) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
113 unsigned int val = 0;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
114 unsigned int bit_mask;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
115
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
116 while(count--) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
117 if(bit > 7) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
118 bit = 0;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
119 byte++;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
120 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
121 bit_mask = 0x01 << (7-bit);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
122 val <<= 1;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
123 if((cmd->bits[byte]) & bit_mask)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
124 val |= 1;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
125 cmd->examined[byte] |= bit_mask;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
126 bit++;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
127 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
128 return val;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
129 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
130
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
131
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
132 static void print_system_reg(unsigned int reg) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
133 if(reg < sizeof(system_reg_abbr_table) / sizeof(char *))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
134 fprintf(stdout, system_reg_table[reg]);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
135 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
136 fprintf(stdout, " WARNING: Unknown system register ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
137 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
138
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
139 static void print_reg(unsigned int reg) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
140 if(reg & 0x80)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
141 print_system_reg(reg & 0x7f);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
142 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
143 if(reg < 16)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
144 fprintf(stdout, "g[%u]", reg);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
145 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
146 fprintf(stdout, " WARNING: Unknown general register ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
147 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
148
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
149 static void print_cmp_op(unsigned int op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
150 if(op < sizeof(cmp_op_table) / sizeof(char *) && cmp_op_table[op] != NULL)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
151 fprintf(stdout, " %s ", cmp_op_table[op]);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
152 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
153 fprintf(stdout, " WARNING: Unknown compare op ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
154 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
155
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
156 static void print_set_op(unsigned int op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
157 if(op < sizeof(set_op_table) / sizeof(char *) && set_op_table[op] != NULL)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
158 fprintf(stdout, " %s ", set_op_table[op]);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
159 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
160 fprintf(stdout, " WARNING: Unknown set op ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
161 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
162
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
163 static void print_reg_or_data(cmd_t *cmd, unsigned int immediate, int byte) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
164 if(immediate) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
165 int i = bits(cmd,byte,0,16);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
166
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
167 fprintf(stdout, "0x%x", i);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
168 if(isprint(i & 0xff) && isprint((i>>8) & 0xff))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
169 fprintf(stdout, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
170 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
171 print_reg(bits(cmd,byte + 1,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
172 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
173 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
174
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
175 static void print_reg_or_data_2(cmd_t *cmd, unsigned int immediate, int byte) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
176 if(immediate)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
177 fprintf(stdout, "0x%x", bits(cmd,byte,1,7));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
178 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
179 fprintf(stdout, "g[%u]", bits(cmd,byte,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
180 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
181
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
182 static void print_if_version_1(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
183 unsigned int op = bits(cmd,1,1,3);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
184
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
185 if(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
186 fprintf(stdout, "if (");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
187 print_reg(bits(cmd,3,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
188 print_cmp_op(op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
189 print_reg_or_data(cmd,bits(cmd,1,0,1), 4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
190 fprintf(stdout, ") ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
191 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
192 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
193
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
194 static void print_if_version_2(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
195 unsigned int op = bits(cmd,1,1,3);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
196
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
197 if(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
198 fprintf(stdout, "if (");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
199 print_reg(bits(cmd,6,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
200 print_cmp_op(op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
201 print_reg(bits(cmd,7,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
202 fprintf(stdout, ") ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
203 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
204 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
205
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
206 static void print_if_version_3(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
207 unsigned int op = bits(cmd,1,1,3);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
208
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
209 if(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
210 fprintf(stdout, "if (");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
211 print_reg(bits(cmd,2,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
212 print_cmp_op(op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
213 print_reg_or_data(cmd,bits(cmd,1,0,1), 6);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
214 fprintf(stdout, ") ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
215 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
216 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
217
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
218 static void print_if_version_4(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
219 unsigned int op = bits(cmd,1,1,3);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
220
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
221 if(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
222 fprintf(stdout, "if (");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
223 print_reg(bits(cmd,1,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
224 print_cmp_op(op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
225 print_reg_or_data(cmd,bits(cmd,1,0,1), 4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
226 fprintf(stdout, ") ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
227 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
228 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
229
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
230 static void print_if_version_5(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
231 unsigned int op = bits(cmd,1,1,3);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
232
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
233 if(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
234 fprintf(stdout, "if (");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
235 print_reg(bits(cmd,4,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
236 print_cmp_op(op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
237 print_reg(bits(cmd,5,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
238 fprintf(stdout, ") ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
239 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
240 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
241
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
242 static void print_special_instruction(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
243 unsigned int op = bits(cmd,1,4,4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
244
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
245 switch(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
246 case 0: // NOP
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
247 fprintf(stdout, "Nop");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
248 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
249 case 1: // Goto line
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
250 fprintf(stdout, "Goto %u", bits(cmd,7,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
251 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
252 case 2: // Break
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
253 fprintf(stdout, "Break");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
254 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
255 case 3: // Parental level
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
256 fprintf(stdout, "SetTmpPML %u, Goto %u",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
257 bits(cmd,6,4,4), bits(cmd,7,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
258 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
259 default:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
260 fprintf(stdout, "WARNING: Unknown special instruction (%u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
261 bits(cmd,1,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
262 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
263 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
264
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
265 static void print_linksub_instruction(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
266 unsigned int linkop = bits(cmd,7,3,5);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
267 unsigned int button = bits(cmd,6,0,6);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
268
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
269 if(linkop < sizeof(link_table)/sizeof(char *) && link_table[linkop] != NULL)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
270 fprintf(stdout, "%s (button %u)", link_table[linkop], button);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
271 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
272 fprintf(stdout, "WARNING: Unknown linksub instruction (%u)", linkop);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
273 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
274
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
275 static void print_link_instruction(cmd_t *cmd, int optional) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
276 unsigned int op = bits(cmd,1,4,4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
277
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
278 if(optional && op)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
279 fprintf(stdout, ", ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
280
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
281 switch(op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
282 case 0:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
283 if(!optional)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
284 fprintf(stdout, "WARNING: NOP (link)!");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
285 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
286 case 1:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
287 print_linksub_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
288 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
289 case 4:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
290 fprintf(stdout, "LinkPGCN %u", bits(cmd,6,1,15));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
291 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
292 case 5:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
293 fprintf(stdout, "LinkPTT %u (button %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
294 bits(cmd,6,6,10), bits(cmd,6,0,6));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
295 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
296 case 6:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
297 fprintf(stdout, "LinkPGN %u (button %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
298 bits(cmd,7,1,7), bits(cmd,6,0,6));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
299 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
300 case 7:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
301 fprintf(stdout, "LinkCN %u (button %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
302 bits(cmd,7,0,8), bits(cmd,6,0,6));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
303 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
304 default:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
305 fprintf(stdout, "WARNING: Unknown link instruction");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
306 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
307 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
308
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
309 static void print_jump_instruction(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
310 switch(bits(cmd,1,4,4)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
311 case 1:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
312 fprintf(stdout, "Exit");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
313 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
314 case 2:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
315 fprintf(stdout, "JumpTT %u", bits(cmd,5,1,7));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
316 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
317 case 3:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
318 fprintf(stdout, "JumpVTS_TT %u", bits(cmd,5,1,7));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
319 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
320 case 5:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
321 fprintf(stdout, "JumpVTS_PTT %u:%u", bits(cmd,5,1,7), bits(cmd,2,6,10));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
322 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
323 case 6:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
324 switch(bits(cmd,5,0,2)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
325 case 0:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
326 fprintf(stdout, "JumpSS FP");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
327 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
328 case 1:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
329 fprintf(stdout, "JumpSS VMGM (menu %u)", bits(cmd,5,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
330 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
331 case 2:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
332 fprintf(stdout, "JumpSS VTSM (vts %u, title %u, menu %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
333 bits(cmd,4,0,8), bits(cmd,3,0,8), bits(cmd,5,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
334 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
335 case 3:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
336 fprintf(stdout, "JumpSS VMGM (pgc %u)", bits(cmd,2,1,15));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
337 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
338 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
339 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
340 case 8:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
341 switch(bits(cmd,5,0,2)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
342 case 0:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
343 fprintf(stdout, "CallSS FP (rsm_cell %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
344 bits(cmd,4,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
345 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
346 case 1:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
347 fprintf(stdout, "CallSS VMGM (menu %u, rsm_cell %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
348 bits(cmd,5,4,4), bits(cmd,4,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
349 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
350 case 2:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
351 fprintf(stdout, "CallSS VTSM (menu %u, rsm_cell %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
352 bits(cmd,5,4,4), bits(cmd,4,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
353 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
354 case 3:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
355 fprintf(stdout, "CallSS VMGM (pgc %u, rsm_cell %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
356 bits(cmd,2,1,15), bits(cmd,4,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
357 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
358 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
359 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
360 default:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
361 fprintf(stdout, "WARNING: Unknown Jump/Call instruction");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
362 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
363 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
364
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
365 static void print_system_set(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
366 int i;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
367
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
368 switch(bits(cmd,0,4,4)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
369 case 1: // Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
370 for(i = 1; i <= 3; i++) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
371 if(bits(cmd,2+i,0,1)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
372 print_system_reg((unsigned int)i);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
373 fprintf(stdout, " = ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
374 print_reg_or_data_2(cmd,bits(cmd,0,3,1), 2 + i);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
375 fprintf(stdout, " ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
376 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
377 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
378 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
379 case 2: // Set system reg 9 & 10 (Navigation timer, Title PGC number)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
380 print_system_reg(9);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
381 fprintf(stdout, " = ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
382 print_reg_or_data(cmd,bits(cmd,0,3,1), 2);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
383 fprintf(stdout, " ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
384 print_system_reg(10);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
385 fprintf(stdout, " = %u", bits(cmd,5,0,8)); // ??
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
386 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
387 case 3: // Mode: Counter / Register + Set
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
388 fprintf(stdout, "SetMode ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
389 if(bits(cmd,5,0,1))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
390 fprintf(stdout, "Counter ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
391 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
392 fprintf(stdout, "Register ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
393 print_reg(bits(cmd,5,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
394 print_set_op(0x1); // '='
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
395 print_reg_or_data(cmd,bits(cmd,0,3,1), 2);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
396 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
397 case 6: // Set system reg 8 (Highlighted button)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
398 print_system_reg(8);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
399 if(bits(cmd,0,3,1)) // immediate
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
400 fprintf(stdout, " = 0x%x (button no %u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
401 bits(cmd,4,0,16), bits(cmd,4,0,6));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
402 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
403 fprintf(stdout, " = g[%u]", bits(cmd,5,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
404 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
405 default:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
406 fprintf(stdout, "WARNING: Unknown system set instruction (%u)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
407 bits(cmd,0,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
408 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
409 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
410
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
411 static void print_set_version_1(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
412 unsigned int set_op = bits(cmd,0,4,4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
413
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
414 if(set_op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
415 print_reg(bits(cmd,3,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
416 print_set_op(set_op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
417 print_reg_or_data(cmd,bits(cmd,0,3,1), 4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
418 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
419 fprintf(stdout, "NOP");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
420 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
421 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
422
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
423 static void print_set_version_2(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
424 unsigned int set_op = bits(cmd,0,4,4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
425
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
426 if(set_op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
427 print_reg(bits(cmd,1,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
428 print_set_op(set_op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
429 print_reg_or_data(cmd,bits(cmd,0,3,1), 2);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
430 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
431 fprintf(stdout, "NOP");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
432 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
433 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
434
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
435 static void print_set_version_3(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
436 unsigned int set_op = bits(cmd,0,4,4);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
437
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
438 if(set_op) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
439 print_reg(bits(cmd,1,4,4));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
440 print_set_op(set_op);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
441 if(bits(cmd,0,3,1)) { // print_reg_or_data
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
442 unsigned int i = bits(cmd,2,0,16);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
443
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
444 fprintf(stdout, "0x%x", i);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
445 if(isprint(i & 0xff) && isprint((i>>8) & 0xff))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
446 fprintf(stdout, " (\"%c%c\")",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
447 (char)((i>>8) & 0xff), (char)(i & 0xff));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
448 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
449 print_reg(bits(cmd,2,0,8));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
450 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
451 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
452 fprintf(stdout, "NOP");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
453 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
454 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
455
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
456 static void print_command(cmd_t *cmd) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
457 switch(bits(cmd,0,0,3)) { /* three first bits */
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
458 case 0: // Special instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
459 print_if_version_1(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
460 print_special_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
461 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
462 case 1: // Jump/Call or Link instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
463 if(bits(cmd,0,3,1)) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
464 print_if_version_2(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
465 print_jump_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
466 } else {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
467 print_if_version_1(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
468 print_link_instruction(cmd,0); // must be pressent
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
469 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
470 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
471 case 2: // Set System Parameters instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
472 print_if_version_2(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
473 print_system_set(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
474 print_link_instruction(cmd,1); // either 'if' or 'link'
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
475 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
476 case 3: // Set General Parameters instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
477 print_if_version_3(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
478 print_set_version_1(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
479 print_link_instruction(cmd,1); // either 'if' or 'link'
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
480 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
481 case 4: // Set, Compare -> LinkSub instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
482 print_set_version_2(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
483 fprintf(stdout, ", ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
484 print_if_version_4(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
485 print_linksub_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
486 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
487 case 5: // Compare -> (Set and LinkSub) instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
488 if(bits(cmd,0,3,1))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
489 print_if_version_5(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
490 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
491 print_if_version_1(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
492 fprintf(stdout, "{ ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
493 print_set_version_3(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
494 fprintf(stdout, ", ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
495 print_linksub_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
496 fprintf(stdout, " }");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
497 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
498 case 6: // Compare -> Set, always LinkSub instructions
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
499 if(bits(cmd,0,3,1))
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
500 print_if_version_5(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
501 else
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
502 print_if_version_1(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
503 fprintf(stdout, "{ ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
504 print_set_version_3(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
505 fprintf(stdout, " } ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
506 print_linksub_instruction(cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
507 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
508 default:
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
509 fprintf(stdout, "WARNING: Unknown instruction type (%i)",
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
510 bits(cmd,0,0,3));
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
511 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
512 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
513
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
514 void cmdPrint_mnemonic(vm_cmd_t *command) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
515 int i, extra_bits;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
516 cmd_t cmd;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
517
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
518 for(i = 0; i < 8; i++) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
519 cmd.bits[i] = command->bytes[i];
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
520 cmd.examined[i] = 0;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
521 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
522
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
523 print_command(&cmd);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
524
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
525 // Check if there still are bits set that were not examined
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
526 extra_bits = 0;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
527 for(i = 0; i < 8; i++)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
528 if(cmd.bits[i] & ~ cmd.examined[i]) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
529 extra_bits = 1;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
530 break;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
531 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
532 if(extra_bits) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
533 fprintf(stdout, " [WARNING, unknown bits:");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
534 for(i = 0; i < 8; i++)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
535 fprintf(stdout, " %02x", cmd.bits[i] & ~ cmd.examined[i]);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
536 fprintf(stdout, "]");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
537 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
538 }
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
539
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
540 void cmdPrint_CMD(int row, vm_cmd_t *command) {
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
541 int i;
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
542
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
543 fprintf(stdout, "(%03d) ", row + 1);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
544 for(i = 0; i < 8; i++)
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
545 fprintf(stdout, "%02x ", command->bytes[i]);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
546 fprintf(stdout, "| ");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
547
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
548 cmdPrint_mnemonic(command);
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
549 fprintf(stdout, "\n");
fe3043a8552c 1000l: Forgot to add new files, *sigh*.
diego
parents:
diff changeset
550 }