Mercurial > repos > blastem
annotate disasm.c @ 2224:d8b0244101c4
Fix bad 68K instruction timings revealed by Ti_'s test ROM, except those that involve exception timing
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 05 Sep 2022 00:49:03 -0700 |
parents | 4e27c36f947c |
children | e9bc45dd2eed |
rev | line source |
---|---|
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #include "disasm.h" |
2213
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
2 #include <stdlib.h> |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
3 #include <string.h> |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
4 #include <stddef.h> |
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 label_def *find_label(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 char key[MAX_INT_KEY_SIZE]; |
2207
de3d20e58555
Mostly fix label sorting post-refactor
Michael Pavone <pavone@retrodev.com>
parents:
2206
diff
changeset
|
9 tern_sortable_int_key(address & context->address_mask, key); |
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 return tern_find_ptr(context->labels, key); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 |
2213
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
13 int format_label(char *dst, uint32_t address, disasm_context *context) |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
14 { |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
15 label_def *def = find_label(context, address); |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
16 if (def && def->num_labels) { |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
17 return sprintf(dst, "%s", def->labels[0]); |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
18 } |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
19 return sprintf(dst, "ADR_%X", address); |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
20 } |
53411df7fc71
More 68K disassembler refactoring and fix Windows build failure
Michael Pavone <pavone@retrodev.com>
parents:
2207
diff
changeset
|
21 |
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 label_def *add_find_label(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 char key[MAX_INT_KEY_SIZE]; |
2207
de3d20e58555
Mostly fix label sorting post-refactor
Michael Pavone <pavone@retrodev.com>
parents:
2206
diff
changeset
|
25 tern_sortable_int_key(address & context->address_mask, key); |
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 label_def *def = tern_find_ptr(context->labels, key); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 if (!def) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 def = calloc(1, sizeof(label_def)); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 context->labels = tern_insert_ptr(context->labels, key, def); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 def->full_address = address; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 return def; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 void weak_label(disasm_context *context, const char *name, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 label_def *def = add_find_label(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 if (def->num_labels == def->storage) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 def->storage = def->storage ? def->storage * 2 : 4; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 def->labels = realloc(def->labels, def->storage * sizeof(char*));; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 def->labels[def->num_labels++] = strdup(name); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 void reference(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 label_def *def = add_find_label(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 def->referenced = 1; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 void add_label(disasm_context *context, const char *name, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 { |
2214
7591c67b8d1e
Support for loading symbols in debugger for use during name resolution and disassembly
Michael Pavone <pavone@retrodev.com>
parents:
2213
diff
changeset
|
54 reference(context, address); |
2206
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 weak_label(context, name, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 void visit(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 if (!context->visited) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 uint32_t size = context->address_mask + 1; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
62 size >>= context->visit_preshift; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
63 size >>= 3; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 context->visited = calloc(1, size); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
65 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
66 address &= context->address_mask; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
67 address >>= context->visit_preshift; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
68 context->visited[address >> 3] |= 1 << (address & 7); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
69 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
70 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
71 uint8_t is_visited(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
72 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
73 if (!context->visited) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
74 return 0; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
75 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
76 address &= context->address_mask; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
77 address >>= context->visit_preshift; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
78 return (context->visited[address >> 3] & (1 << (address & 7))) != 0; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
79 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
81 void defer_disasm(disasm_context *context, uint32_t address) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
82 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
83 if (is_visited(context, address) || address & context->invalid_inst_addr_mask) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 return; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
86 context->deferred = defer_address(context->deferred, address, NULL); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
87 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
88 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 void process_m68k_vectors(disasm_context *context, uint16_t *table, uint8_t labels_only) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
90 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
91 static const char* names[] = { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
92 "access_fault", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
93 "address_error", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
94 "illegal_instruction", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
95 "integer_divide_by_zero", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
96 "chk_exception", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
97 "trap_exception", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
98 "privilege_violation", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
99 "trace_exception", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
100 "line_1010_emulator", |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
101 "line_1111_emulator" |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
102 }; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
103 uint32_t address = table[2] << 16 | table[3]; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
104 add_label(context, "start", address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
105 if (!labels_only) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
106 defer_disasm(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
107 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
108 for (int i = 0; i < sizeof(names)/sizeof(*names); i++) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
109 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
110 address = table[i*2+4] << 16 | table[i*2 + 5]; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
111 add_label(context, names[i], address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
112 if (!labels_only) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
113 defer_disasm(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
114 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
115 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
116 char int_name[] = "int_0"; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
117 for (int i = 0; i < 7; i++) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
118 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
119 int_name[4] = '1' + i; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
120 address = table[i*2+50] << 16 | table[i*2 + 51]; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
121 add_label(context, int_name, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
122 if (!labels_only) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
123 defer_disasm(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
124 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
125 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
126 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
127 char trap_name[] = "trap_0"; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
128 for (int i = 0; i < 16; i++) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
129 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
130 trap_name[5] = i < 0xA ? '0' + i : 'a' + i - 0xA; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
131 address = table[i*2+50] << 16 | table[i*2 + 51]; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
132 add_label(context, trap_name, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
133 if (!labels_only) { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
134 defer_disasm(context, address); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
135 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
136 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
137 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
138 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
139 void add_segacd_maincpu_labels(disasm_context *context) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
140 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
141 weak_label(context, "_bios_reset", 0x280); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
142 weak_label(context, "_bios_entry", 0x284); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
143 weak_label(context, "_bios_init", 0x288); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
144 weak_label(context, "_bios_init_sp", 0x28C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
145 weak_label(context, "_bios_vint", 0x290); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
146 weak_label(context, "_bios_set_hint", 0x294); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
147 weak_label(context, "_bios_poll_io", 0x298); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
148 weak_label(context, "_bios_detect_io", 0x29C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
149 weak_label(context, "_bios_clear_vram", 0x2A0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
150 weak_label(context, "_bios_clear_nmtbl", 0x2A4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
151 weak_label(context, "_bios_clear_vsram", 0x2A8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
152 weak_label(context, "_bios_init_vdp", 0x2AC); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
153 weak_label(context, "_bios_vdp_loadregs", 0x2B0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
154 weak_label(context, "_bios_vdp_fill", 0x2B4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
155 weak_label(context, "_bios_clear_vram_range", 0x2B8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
156 weak_label(context, "_bios_clear_vram_range_dma", 0x2BC); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
157 weak_label(context, "_bios_vram_dma_fill", 0x2C0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
158 weak_label(context, "_bios_update_nmtbl", 0x2C4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
159 weak_label(context, "_bios_update_nmtbl_template", 0x2C8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
160 weak_label(context, "_bios_fill_nmtbl", 0x2CC); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
161 weak_label(context, "_bios_vdp_dma", 0x2D0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
162 weak_label(context, "_bios_vdp_dma_wordram", 0x2D4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
163 weak_label(context, "_bios_vdp_display_enable", 0x2D8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
164 weak_label(context, "_bios_vdp_display_disable", 0x2DC); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
165 weak_label(context, "_bios_pal_buffer", 0x2E0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
166 weak_label(context, "_bios_pal_buffer_update", 0x2E4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
167 weak_label(context, "_bios_pal_dma", 0x2E8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
168 weak_label(context, "_bios_gfx_decomp", 0x2EC); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
169 weak_label(context, "_bios_gfx_decomp_ram", 0x2F0); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
170 weak_label(context, "_bios_update_sprites", 0x2F4); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
171 weak_label(context, "_bios_clear_ram", 0x2F8); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
172 weak_label(context, "_bios_display_sprite", 0x300); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
173 weak_label(context, "_bios_wait_vint", 0x304); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
174 weak_label(context, "_bios_wait_vint_flags", 0x308); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
175 weak_label(context, "_bios_dma_sat", 0x30C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
176 weak_label(context, "_bios_set_hint_direct", 0x314); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
177 weak_label(context, "_bios_disable_hint", 0x318); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
178 weak_label(context, "_bios_print", 0x31C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
179 weak_label(context, "_bios_load_user_font", 0x320); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
180 weak_label(context, "_bios_load_bios_font", 0x324); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
181 weak_label(context, "_bios_load_bios_font_default", 0x328); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
182 //TODO: more functions in the middle here |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
183 weak_label(context, "_bios_prng_mod", 0x338); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
184 weak_label(context, "_bios_prng", 0x33C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
185 weak_label(context, "_bios_clear_comm", 0x340); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
186 weak_label(context, "_bios_comm_update", 0x344); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
187 //TODO: more functions in the middle here |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
188 weak_label(context, "_bios_sega_logo", 0x364); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
189 weak_label(context, "_bios_set_vint", 0x368); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
190 //TODO: more functions at the end here |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
191 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
192 weak_label(context, "WORD_RAM", 0x200000); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
193 weak_label(context, "CD_RESET_IFL2", 0xA12000); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
194 weak_label(context, "CD_RESET_IFL2_BYTE", 0xA12001); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
195 weak_label(context, "CD_WRITE_PROTECT", 0xA12002); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
196 weak_label(context, "CD_MEM_MODE", 0xA12003); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
197 weak_label(context, "CDC_CTRL", 0xA12004); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
198 weak_label(context, "HINT_VECTOR", 0xA12006); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
199 weak_label(context, "CDC_HOST_DATA", 0xA12008); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
200 weak_label(context, "STOP_WATCH", 0xA1200C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
201 weak_label(context, "COMM_MAIN_FLAG", 0xA1200E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
202 weak_label(context, "COMM_SUB_FLAG", 0xA1200F); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
203 weak_label(context, "COMM_CMD0", 0xA12010); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
204 weak_label(context, "COMM_CMD1", 0xA12012); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
205 weak_label(context, "COMM_CMD2", 0xA12014); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
206 weak_label(context, "COMM_CMD3", 0xA12016); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
207 weak_label(context, "COMM_CMD4", 0xA12018); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
208 weak_label(context, "COMM_CMD5", 0xA1201A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
209 weak_label(context, "COMM_CMD6", 0xA1201C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
210 weak_label(context, "COMM_CMD7", 0xA1201E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
211 weak_label(context, "COMM_STATUS0", 0xA12020); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
212 weak_label(context, "COMM_STATUS1", 0xA12022); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
213 weak_label(context, "COMM_STATUS2", 0xA12024); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
214 weak_label(context, "COMM_STATUS3", 0xA12026); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
215 weak_label(context, "COMM_STATUS4", 0xA12028); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
216 weak_label(context, "COMM_STATUS5", 0xA1202A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
217 weak_label(context, "COMM_STATUS6", 0xA1202C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
218 weak_label(context, "COMM_STATUS7", 0xA1202E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
219 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
220 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
221 void add_segacd_subcpu_labels(disasm_context *context) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
222 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
223 weak_label(context, "bios_common_work", 0x5E80); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
224 weak_label(context, "_setjmptbl", 0x5F0A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
225 weak_label(context, "_waitvsync", 0x5F10); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
226 weak_label(context, "_buram", 0x5F16); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
227 weak_label(context, "_cdboot", 0x5F1C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
228 weak_label(context, "_cdbios", 0x5F22); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
229 weak_label(context, "_usercall0", 0x5F28); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
230 weak_label(context, "_usercall1", 0x5F2E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
231 weak_label(context, "_usercall2", 0x5F34); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
232 weak_label(context, "_usercall2Address", 0x5F36); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
233 weak_label(context, "_usercall3", 0x5F3A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
234 weak_label(context, "_adrerr", 0x5F40); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
235 weak_label(context, "_adrerrAddress", 0x5F42); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
236 weak_label(context, "_coderr", 0x5F46); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
237 weak_label(context, "_coderrAddress", 0x5F48); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
238 weak_label(context, "_diverr", 0x5F4C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
239 weak_label(context, "_diverrAddress", 0x5F4E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
240 weak_label(context, "_chkerr", 0x5F52); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
241 weak_label(context, "_chkerrAddress", 0x5F54); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
242 weak_label(context, "_trperr", 0x5F58); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
243 weak_label(context, "_trperrAddress", 0x5F5A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
244 weak_label(context, "_spverr", 0x5F5E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
245 weak_label(context, "_spverrAddress", 0x5F60); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
246 weak_label(context, "_trace", 0x5F64); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
247 weak_label(context, "_traceAddress", 0x5F66); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
248 weak_label(context, "_nocod0", 0x5F6A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
249 weak_label(context, "_nocod0Address", 0x5F6C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
250 weak_label(context, "_nocod0", 0x5F70); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
251 weak_label(context, "_nocod0Address", 0x5F72); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
252 weak_label(context, "_slevel1", 0x5F76); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
253 weak_label(context, "_slevel1Address", 0x5F78); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
254 weak_label(context, "_slevel2", 0x5F7C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
255 weak_label(context, "_slevel2Address", 0x5F7E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
256 weak_label(context, "_slevel3", 0x5F82); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
257 weak_label(context, "_slevel3Address", 0x5F84); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
258 weak_label(context, "WORD_RAM_2M", 0x80000); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
259 weak_label(context, "WORD_RAM_1M", 0xC0000); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
260 weak_label(context, "LED_CONTROL", 0xFFFF8000); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
261 weak_label(context, "VERSION_RESET", 0xFFFF8001); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
262 weak_label(context, "MEM_MODE_WORD", 0xFFFF8002); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
263 weak_label(context, "MEM_MODE_BYTE", 0xFFFF8003); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
264 weak_label(context, "CDC_CTRL", 0xFFFF8004); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
265 weak_label(context, "CDC_AR", 0xFFFF8005); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
266 weak_label(context, "CDC_REG_DATA_WORD", 0xFFFF8006); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
267 weak_label(context, "CDC_REG_DATA", 0xFFFF8007); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
268 weak_label(context, "CDC_HOST_DATA", 0xFFFF8008); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
269 weak_label(context, "CDC_DMA_ADDR", 0xFFFF800A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
270 weak_label(context, "STOP_WATCH", 0xFFFF800C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
271 weak_label(context, "COMM_MAIN_FLAG", 0xFFFF800E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
272 weak_label(context, "COMM_SUB_FLAG", 0xFFFF800F); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
273 weak_label(context, "COMM_CMD0", 0xFFFF8010); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
274 weak_label(context, "COMM_CMD1", 0xFFFF8012); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
275 weak_label(context, "COMM_CMD2", 0xFFFF8014); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
276 weak_label(context, "COMM_CMD3", 0xFFFF8016); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
277 weak_label(context, "COMM_CMD4", 0xFFFF8018); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
278 weak_label(context, "COMM_CMD5", 0xFFFF801A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
279 weak_label(context, "COMM_CMD6", 0xFFFF801C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
280 weak_label(context, "COMM_CMD7", 0xFFFF801E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
281 weak_label(context, "COMM_STATUS0", 0xFFFF8020); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
282 weak_label(context, "COMM_STATUS1", 0xFFFF8022); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
283 weak_label(context, "COMM_STATUS2", 0xFFFF8024); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
284 weak_label(context, "COMM_STATUS3", 0xFFFF8026); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
285 weak_label(context, "COMM_STATUS4", 0xFFFF8028); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
286 weak_label(context, "COMM_STATUS5", 0xFFFF802A); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
287 weak_label(context, "COMM_STATUS6", 0xFFFF802C); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
288 weak_label(context, "COMM_STATUS7", 0xFFFF802E); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
289 weak_label(context, "TIMER_WORD", 0xFFFF8030); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
290 weak_label(context, "TIMER", 0xFFFF8031); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
291 weak_label(context, "INT_MASK_WORD", 0xFFFF8032); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
292 weak_label(context, "INT_MASK", 0xFFFF8033); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
293 weak_label(context, "CDD_FADER", 0xFFFF8034); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
294 weak_label(context, "CDD_CTRL_WORD", 0xFFFF8036); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
295 weak_label(context, "CDD_CTRL_BYTE", 0xFFFF8037); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
296 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
297 |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
298 disasm_context *create_68000_disasm(void) |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
299 { |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
300 disasm_context *context = calloc(1, sizeof(disasm_context)); |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
301 context->address_mask = 0xFFFFFF; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
302 context->invalid_inst_addr_mask = 1; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
303 context->visit_preshift = 1; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
304 return context; |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
305 } |
4c265d2f6c88
Minor refactor of 68K disassembler
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
306 |
2216
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
307 disasm_context *create_z80_disasm(void) |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
308 { |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
309 disasm_context *context = calloc(1, sizeof(disasm_context)); |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
310 context->address_mask = 0xFFFF; |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
311 context->invalid_inst_addr_mask = 0; |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
312 context->visit_preshift = 0; |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
313 return context; |
4e27c36f947c
Add disassemble command to debugger
Michael Pavone <pavone@retrodev.com>
parents:
2214
diff
changeset
|
314 } |