VECTOR_MAKE(int, code_globals );
VECTOR_MAKE(char, code_chars );
+uint16_t code_crc;
uint32_t code_entfields;
void code_init() {
prog_section_function empty_function = {0,0,0,0,0,0,0,{0}};
prog_section_statement empty_statement = {0,{0},{0},{0}};
+ prog_section_def empty_def = {0, 0, 0};
int i = 0;
+ code_entfields = 0;
+
/* omit creation of null code */
if (OPTS_FLAG(OMIT_NULL_BYTES))
return;
code_chars_add ('\0');
code_functions_add (empty_function);
code_statements_add(empty_statement);
-
- code_entfields = 0;
+ code_defs_add (empty_def);
+ code_fields_add (empty_def);
}
uint32_t code_genstring(const char *str)
code_header.strings.offset = code_header.globals.offset + (sizeof(int32_t) * code_globals_elements);
code_header.strings.length = code_chars_elements;
code_header.version = 6;
- code_header.crc16 = 0; /* TODO: */
+ if (opts_forcecrc)
+ code_header.crc16 = opts_forced_crc;
+ else
+ code_header.crc16 = code_crc;
code_header.entfield = code_entfields;
if (OPTS_FLAG(DARKPLACES_STRING_TABLE_BUG)) {
util_debug("GEN", " CODE:\n");
for (;;) {
if (code_statements_data[j].opcode != AINSTR_END)
- util_debug("GEN", " %s {0x%05x,0x%05x,0x%05x}\n",
+ util_debug("GEN", " %-12s {% 5i,% 5i,% 5i}\n",
asm_instr[code_statements_data[j].opcode].m,
code_statements_data[j].o1.s1,
code_statements_data[j].o2.s1,