annotate musashi/m68kcpu.c @ 1778:30b5952fd32e mame_interp

Get latency between interrupt latch and interrupt acceptance working with Musashi
author Michael Pavone <pavone@retrodev.com>
date Wed, 13 Mar 2019 22:01:22 -0700
parents ddcd59a6122e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1 // license:BSD-3-Clause
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 // copyright-holders:Karl Stenerud
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
3 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
4 /* ========================= LICENSING & COPYRIGHT ======================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
5 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
6
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7 #if 0
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 static const char copyright_notice[] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 "MUSASHI\n"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 "Version 4.95 (2012-02-19)\n"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
11 "A portable Motorola M68xxx/CPU32/ColdFire processor emulation engine.\n"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 "Copyright Karl Stenerud. All rights reserved.\n"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 ;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
14 #endif
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
15
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
16
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
17 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
18 /* ================================= NOTES ================================ */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
19 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
20
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
21
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
22
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
23 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
24 /* ================================ INCLUDES ============================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
25 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
26
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
27 #include "m68kcpu.h"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
28 #include "m68kops.h"
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
29 #include <stdlib.h>
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
30 #include <string.h>
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
31
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
32
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
33 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
34 /* ================================= DATA ================================= */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
35 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
36
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
37 /* Used by shift & rotate instructions */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
38 const uint8_t m68ki_shift_8_table[65] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
39 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
40 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
41 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
42 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
43 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
44 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
45 0xff, 0xff, 0xff, 0xff, 0xff
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
46 };
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
47 const uint16_t m68ki_shift_16_table[65] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
48 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
49 0x0000, 0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
50 0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
51 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
52 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
53 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
54 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
55 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
56 0xffff, 0xffff
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
57 };
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
58 const uint32_t m68ki_shift_32_table[65] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
59 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
60 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, 0xf0000000, 0xf8000000,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
61 0xfc000000, 0xfe000000, 0xff000000, 0xff800000, 0xffc00000, 0xffe00000,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
62 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000, 0xffff8000,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
63 0xffffc000, 0xffffe000, 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
64 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0, 0xfffffff8,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
65 0xfffffffc, 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
66 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
67 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
68 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
69 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
70 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
71 };
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
72
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
73
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
74 /* Number of clock cycles to use for exception processing.
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
75 * I used 4 for any vectors that are undocumented for processing times.
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
76 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
77 const uint8_t m68ki_exception_cycle_table[7][256] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
78 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
79 { /* 000 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
80 40, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
81 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
82 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
83 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
84 34, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
85 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
86 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
87 34, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
88 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
89 34, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
90 4, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
91 4, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
92 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
93 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
94 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
95 44, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
96 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
97 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
98 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
99 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
100 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
101 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
102 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
103 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
104 44, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
105 44, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
106 44, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
107 44, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
108 44, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
109 44, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
110 44, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
111 44, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
112 34, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
113 34, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
114 34, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
115 34, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
116 34, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
117 34, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
118 34, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
119 34, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
120 34, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
121 34, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
122 34, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
123 34, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
124 34, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
125 34, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
126 34, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
127 34, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
128 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
129 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
130 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
131 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
132 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
133 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
134 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
135 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
136 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
137 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
138 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
139 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
140 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
141 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
142 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
143 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
144 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
145 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
146 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
147 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
148 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
149 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
150 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
151 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
152 { /* 010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
153 40, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
154 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
155 126, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
156 126, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
157 38, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
158 44, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
159 44, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
160 34, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
161 38, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
162 38, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
163 4, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
164 4, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
165 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
166 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
167 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
168 44, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
169 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
170 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
171 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
172 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
173 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
174 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
175 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
176 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
177 46, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
178 46, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
179 46, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
180 46, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
181 46, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
182 46, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
183 46, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
184 46, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
185 38, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
186 38, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
187 38, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
188 38, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
189 38, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
190 38, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
191 38, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
192 38, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
193 38, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
194 38, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
195 38, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
196 38, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
197 38, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
198 38, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
199 38, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
200 38, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
201 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
202 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
203 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
204 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
205 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
206 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
207 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
208 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
209 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
210 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
211 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
212 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
213 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
214 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
215 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
216 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
217 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
218 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
219 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
220 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
221 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
222 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
223 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
224 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
225 { /* 020 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
226 4, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
227 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
228 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
229 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
230 20, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
231 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
232 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
233 20, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
234 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
235 25, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
236 20, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
237 20, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
238 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
239 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
240 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
241 30, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
242 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
243 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
244 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
245 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
246 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
247 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
248 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
249 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
250 30, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
251 30, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
252 30, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
253 30, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
254 30, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
255 30, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
256 30, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
257 30, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
258 20, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
259 20, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
260 20, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
261 20, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
262 20, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
263 20, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
264 20, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
265 20, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
266 20, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
267 20, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
268 20, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
269 20, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
270 20, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
271 20, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
272 20, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
273 20, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
274 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
275 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
276 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
277 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
278 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
279 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
280 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
281 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
282 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
283 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
284 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
285 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
286 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
287 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
288 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
289 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
290 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
291 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
292 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
293 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
294 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
295 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
296 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
297 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
298 { /* 030 - not correct */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
299 4, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
300 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
301 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
302 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
303 20, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
304 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
305 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
306 20, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
307 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
308 25, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
309 20, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
310 20, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
311 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
312 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
313 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
314 30, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
315 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
316 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
317 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
318 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
319 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
320 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
321 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
322 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
323 30, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
324 30, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
325 30, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
326 30, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
327 30, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
328 30, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
329 30, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
330 30, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
331 20, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
332 20, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
333 20, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
334 20, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
335 20, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
336 20, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
337 20, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
338 20, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
339 20, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
340 20, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
341 20, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
342 20, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
343 20, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
344 20, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
345 20, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
346 20, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
347 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
348 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
349 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
350 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
351 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
352 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
353 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
354 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
355 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
356 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
357 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
358 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
359 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
360 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
361 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
362 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
363 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
364 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
365 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
366 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
367 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
368 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
369 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
370 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
371 { /* 040 */ // TODO: these values are not correct
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
372 4, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
373 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
374 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
375 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
376 20, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
377 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
378 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
379 20, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
380 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
381 25, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
382 20, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
383 20, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
384 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
385 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
386 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
387 30, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
388 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
389 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
390 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
391 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
392 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
393 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
394 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
395 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
396 30, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
397 30, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
398 30, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
399 30, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
400 30, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
401 30, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
402 30, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
403 30, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
404 20, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
405 20, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
406 20, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
407 20, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
408 20, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
409 20, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
410 20, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
411 20, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
412 20, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
413 20, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
414 20, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
415 20, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
416 20, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
417 20, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
418 20, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
419 20, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
420 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
421 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
422 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
423 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
424 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
425 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
426 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
427 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
428 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
429 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
430 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
431 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
432 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
433 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
434 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
435 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
436 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
437 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
438 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
439 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
440 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
441 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
442 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
443 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
444 { /* CPU32 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
445 4, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
446 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
447 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
448 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
449 20, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
450 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
451 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
452 20, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
453 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
454 25, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
455 20, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
456 20, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
457 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
458 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
459 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
460 30, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
461 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
462 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
463 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
464 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
465 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
466 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
467 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
468 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
469 30, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
470 30, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
471 30, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
472 30, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
473 30, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
474 30, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
475 30, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
476 30, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
477 20, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
478 20, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
479 20, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
480 20, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
481 20, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
482 20, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
483 20, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
484 20, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
485 20, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
486 20, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
487 20, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
488 20, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
489 20, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
490 20, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
491 20, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
492 20, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
493 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
494 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
495 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
496 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
497 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
498 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
499 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
500 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
501 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
502 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
503 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
504 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
505 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
506 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
507 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
508 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
509 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
510 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
511 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
512 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
513 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
514 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
515 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
516 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
517 { /* ColdFire - not correct */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
518 4, /* 0: Reset - Initial Stack Pointer */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
519 4, /* 1: Reset - Initial Program Counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
520 50, /* 2: Bus Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
521 50, /* 3: Address Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
522 20, /* 4: Illegal Instruction */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
523 38, /* 5: Divide by Zero */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
524 40, /* 6: CHK */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
525 20, /* 7: TRAPV */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
526 34, /* 8: Privilege Violation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
527 25, /* 9: Trace */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
528 20, /* 10: 1010 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
529 20, /* 11: 1111 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
530 4, /* 12: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
531 4, /* 13: Coprocessor Protocol Violation (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
532 4, /* 14: Format Error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
533 30, /* 15: Uninitialized Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
534 4, /* 16: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
535 4, /* 17: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
536 4, /* 18: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
537 4, /* 19: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
538 4, /* 20: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
539 4, /* 21: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
540 4, /* 22: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
541 4, /* 23: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
542 30, /* 24: Spurious Interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
543 30, /* 25: Level 1 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
544 30, /* 26: Level 2 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
545 30, /* 27: Level 3 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
546 30, /* 28: Level 4 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
547 30, /* 29: Level 5 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
548 30, /* 30: Level 6 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
549 30, /* 31: Level 7 Interrupt Autovector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
550 20, /* 32: TRAP #0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
551 20, /* 33: TRAP #1 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
552 20, /* 34: TRAP #2 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
553 20, /* 35: TRAP #3 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
554 20, /* 36: TRAP #4 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
555 20, /* 37: TRAP #5 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
556 20, /* 38: TRAP #6 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
557 20, /* 39: TRAP #7 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
558 20, /* 40: TRAP #8 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
559 20, /* 41: TRAP #9 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
560 20, /* 42: TRAP #10 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
561 20, /* 43: TRAP #11 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
562 20, /* 44: TRAP #12 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
563 20, /* 45: TRAP #13 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
564 20, /* 46: TRAP #14 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
565 20, /* 47: TRAP #15 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
566 4, /* 48: FP Branch or Set on Unknown Condition (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
567 4, /* 49: FP Inexact Result (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
568 4, /* 50: FP Divide by Zero (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
569 4, /* 51: FP Underflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
570 4, /* 52: FP Operand Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
571 4, /* 53: FP Overflow (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
572 4, /* 54: FP Signaling NAN (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
573 4, /* 55: FP Unimplemented Data Type (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
574 4, /* 56: MMU Configuration Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
575 4, /* 57: MMU Illegal Operation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
576 4, /* 58: MMU Access Level Violation Error (unemulated) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
577 4, /* 59: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
578 4, /* 60: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
579 4, /* 61: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
580 4, /* 62: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
581 4, /* 63: RESERVED */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
582 /* 64-255: User Defined */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
583 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
584 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
585 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
586 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
587 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
588 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
589 },
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
590 };
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
591
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
592 const uint8_t m68ki_ea_idx_cycle_table[64] =
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
593 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
595 0, /* ..01.000 no memory indirect, base nullptr */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
596 5, /* ..01..01 memory indirect, base nullptr, outer nullptr */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
597 7, /* ..01..10 memory indirect, base nullptr, outer 16 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
598 7, /* ..01..11 memory indirect, base nullptr, outer 32 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
599 0, 5, 7, 7, 0, 5, 7, 7, 0, 5, 7, 7,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
600 2, /* ..10.000 no memory indirect, base 16 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
601 7, /* ..10..01 memory indirect, base 16, outer nullptr */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
602 9, /* ..10..10 memory indirect, base 16, outer 16 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
603 9, /* ..10..11 memory indirect, base 16, outer 32 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
604 0, 7, 9, 9, 0, 7, 9, 9, 0, 7, 9, 9,
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
605 6, /* ..11.000 no memory indirect, base 32 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
606 11, /* ..11..01 memory indirect, base 32, outer nullptr */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
607 13, /* ..11..10 memory indirect, base 32, outer 16 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
608 13, /* ..11..11 memory indirect, base 32, outer 32 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
609 0, 11, 13, 13, 0, 11, 13, 13, 0, 11, 13, 13
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
610 };
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
611
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
612
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
613
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
614 /***************************************************************************
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
615 CPU STATE DESCRIPTION
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
616 ***************************************************************************/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
617
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
618 #define MASK_ALL (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_EC030 | CPU_TYPE_030 | CPU_TYPE_EC040 | CPU_TYPE_040 | CPU_TYPE_FSCPU32 )
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
619 #define MASK_24BIT_SPACE (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010 | CPU_TYPE_EC020)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
620 #define MASK_32BIT_SPACE (CPU_TYPE_020 | CPU_TYPE_EC030 | CPU_TYPE_030 | CPU_TYPE_EC040 | CPU_TYPE_040 | CPU_TYPE_FSCPU32 )
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
621 #define MASK_010_OR_LATER (CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_030 | CPU_TYPE_EC030 | CPU_TYPE_040 | CPU_TYPE_EC040 | CPU_TYPE_FSCPU32 )
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
622 #define MASK_020_OR_LATER (CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_EC030 | CPU_TYPE_030 | CPU_TYPE_EC040 | CPU_TYPE_040 | CPU_TYPE_FSCPU32 )
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
623 #define MASK_030_OR_LATER (CPU_TYPE_030 | CPU_TYPE_EC030 | CPU_TYPE_040 | CPU_TYPE_EC040)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
624 #define MASK_040_OR_LATER (CPU_TYPE_040 | CPU_TYPE_EC040)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
625
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
626
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
627
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
628 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
629 /* ================================= API ================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
630 /* ======================================================================== */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
631
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
632
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
633
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
634 void m68k_cpu_execute(m68000_base_device *this)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
635 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
636 //this->initial_cycles = this->remaining_cycles;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
637
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
638 /* eat up any reset cycles */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
639 /*if (this->reset_cycles) {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
640 int rc = this->reset_cycles;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
641 this->reset_cycles = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
642 this->remaining_cycles -= rc;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
643
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
644 if (this->remaining_cycles <= 0) return;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
645 }*/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
646
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
647 /* See if interrupts came in */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
648 m68ki_check_interrupts(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
649
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
650 /* Make sure we're not stopped */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
651 if(!this->stopped)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
652 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
653 /* Return point if we had an address error */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
654 /*check_address_error:
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
655 if (this->m_address_error==1)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
656 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
657 this->m_address_error = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
658 try {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
659 m68ki_exception_address_error(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
660 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
661 catch(int error)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
662 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
663 if (error==10)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
664 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
665 this->m_address_error = 1;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
666 REG_PPC(this) = REG_PC(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
667 goto check_address_error;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
668 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
669 else
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
670 throw;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
671 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
672 if(stopped)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
673 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
674 if (remaining_cycles > 0)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
675 remaining_cycles = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
676 return;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
677 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
678 }*/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
679
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
680
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
681 /* Main loop. Keep going until we run out of clock cycles */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
682 while (this->c.current_cycle < this->c.target_cycle)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
683 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
684 /* Set tracing accodring to T1. (T0 is done inside instruction) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
685 m68ki_trace_t1(this); /* auto-disable (see m68kcpu.h) */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
686
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
687 /* Record previous program counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
688 REG_PPC(this) = REG_PC(this);
1774
ddcd59a6122e Remove debug printf
Michael Pavone <pavone@retrodev.com>
parents: 1770
diff changeset
689
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
690
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
691 this->run_mode = RUN_MODE_NORMAL;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
692 /* Read an instruction and call its handler */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
693 this->ir = m68ki_read_imm_16(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
694 this->jump_table[this->ir](this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
695 this->c.current_cycle += this->cyc_instruction[this->ir];
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
696
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
697 /*}
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
698 catch (int error)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
699 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
700 if (error==10)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
701 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
702 m_address_error = 1;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
703 goto check_address_error;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
704 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
705 else
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
706 throw;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
707 }*/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
708
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
709
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
710 /* Trace m68k_exception, if necessary */
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
711 m68ki_exception_if_trace(this); /* auto-disable (see m68kcpu.h) */
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
712 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
713
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
714 /* set previous PC to current PC for the next entry into the loop */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
715 REG_PPC(this) = REG_PC(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
716 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
717 else if (this->c.current_cycle < this->c.target_cycle)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
718 this->c.current_cycle = this->c.target_cycle;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
719 this->c.status = m68ki_get_sr(this) >> 8;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
720 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
721
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
722
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
723
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
724 void m68k_init_cpu_common(m68000_base_device *this)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
725 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
726 static uint32_t emulation_initialized = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
727
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
728
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
729 /* The first call to this function initializes the opcode handler jump table */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
730 if(!emulation_initialized)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
731 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
732 m68ki_build_opcode_table();
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
733 emulation_initialized = 1;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
734 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
735
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
736
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
737
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
738 //m_icountptr = &remaining_cycles;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
739 this->c.current_cycle = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
740
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
741 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
742
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
743 void m68k_reset_cpu(m68000_base_device *this)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
744 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
745
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
746
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
747 /* Clear all stop levels and eat up all remaining cycles */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
748 this->stopped = 0;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
749
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
750 this->run_mode = RUN_MODE_BERR_AERR_RESET;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
751 /* Go to supervisor mode */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
752 m68ki_set_sm_flag(this, SFLAG_SET | MFLAG_CLEAR);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
753
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
754 /* Invalidate the prefetch queue */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
755 /* Set to arbitrary number since our first fetch is from 0 */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
756 this->pref_addr = 0x1000;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
757
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
758 /* Read the initial stack pointer and program counter */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
759 m68ki_jump(this, 0);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
760 REG_SP(this) = m68ki_read_imm_32(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
761 REG_PC(this) = m68ki_read_imm_32(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
762 m68ki_jump(this, REG_PC(this));
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
763
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
764 this->run_mode = RUN_MODE_NORMAL;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
765
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
766 this->c.current_cycle += this->cyc_exception[EXCEPTION_RESET];
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
767
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
768 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
769
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
770 /****************************************************************************
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
771 * 8-bit data memory interface
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
772 ****************************************************************************/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
773
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
774 uint8_t m68ki_read_8(m68000_base_device *m68k, uint32_t address)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
775 {
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
776 address &= 0xFFFFFF;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
777 uint32_t base = address >> 16;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
778 if (m68k->read_pointers[base]) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
779 uint8_t *chunk = m68k->read_pointers[base];
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
780 return chunk[(address ^ 1) & 0xFFFF];
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
781 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
782 return read_byte(address, (void **)m68k->c.mem_pointers, &m68k->c.options->gen, &m68k->c);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
783 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
784
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
785 void m68ki_write_8(m68000_base_device *m68k, uint32_t address, uint8_t value)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
786 {
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
787 address &= 0xFFFFFF;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
788 uint32_t base = address >> 16;
1770
a81db00e171a Fix a couple bugs in the integration of Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1508
diff changeset
789 if (m68k->write_pointers[base]) {
a81db00e171a Fix a couple bugs in the integration of Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1508
diff changeset
790 uint8_t *chunk = m68k->write_pointers[base];
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
791 chunk[(address ^ 1) & 0xFFFF] = value;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
792 return;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
793 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
794 write_byte(address, value, (void **)m68k->c.mem_pointers, &m68k->c.options->gen, &m68k->c);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
795 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
796
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
797 /****************************************************************************
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
798 * 16-bit data memory interface
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
799 ****************************************************************************/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
800
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
801 uint16_t m68ki_read_16(m68000_base_device *m68k, uint32_t address)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
802 {
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
803 address &= 0xFFFFFF;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
804 uint32_t base = address >> 16;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
805 if (m68k->read_pointers[base]) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
806 uint16_t *chunk = m68k->read_pointers[base];
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
807 return chunk[address >> 1 & 0x7FFF];
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
808 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
809 return read_word(address, (void **)m68k->c.mem_pointers, &m68k->c.options->gen, &m68k->c);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
810 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
811
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
812 void m68ki_write_16(m68000_base_device *m68k, uint32_t address, uint16_t value)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
813 {
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
814 address &= 0xFFFFFF;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
815 uint32_t base = address >> 16;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
816 if (m68k->write_pointers[base]) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
817 uint16_t *chunk = m68k->read_pointers[base];
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
818 chunk[address >> 1 & 0x7FFF] = value;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
819 return;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
820 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
821 write_word(address, value, (void **)m68k->c.mem_pointers, &m68k->c.options->gen, &m68k->c);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
822 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
823
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
824
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
825 /****************
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
826 CPU Inits
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
827 ****************/
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
828
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
829
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
830 void m68k_init_cpu_m68000(m68000_base_device *this)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
831 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
832 m68k_init_cpu_common(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
833
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
834 this->cpu_type = CPU_TYPE_000;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
835 // dasm_type = M68K_CPU_TYPE_68000;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
836
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
837 this->sr_mask = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
838 this->jump_table = m68ki_instruction_jump_table[0];
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
839 uint8_t *tmp = malloc(sizeof(m68ki_cycles[0]));
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
840 for (uint32_t i = 0; i < sizeof(m68ki_cycles[0]); i++)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
841 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
842 tmp[i] = m68ki_cycles[0][i] * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
843 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
844 this->cyc_instruction = tmp;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
845 tmp = malloc(sizeof(m68ki_exception_cycle_table[0]));
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
846 for (uint32_t i = 0; i < sizeof(m68ki_exception_cycle_table[0]); i++)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
847 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
848 tmp[i] = m68ki_exception_cycle_table[0][i] * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
849 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
850 this->cyc_exception = tmp;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
851 this->cyc_bcc_notake_b = -2 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
852 this->cyc_bcc_notake_w = 2 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
853 this->cyc_dbcc_f_noexp = -2 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
854 this->cyc_dbcc_f_exp = 2 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
855 this->cyc_scc_r_true = 2 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
856 this->cyc_movem_w = 2;// * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
857 this->cyc_movem_l = 3;// * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
858 this->cyc_shift = 1;// * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
859 this->cyc_reset = 132 * this->c.options->gen.clock_divider;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
860 this->int_mask = 7 << 8;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
861 this->c.status = m68ki_get_sr(this) >> 8;
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
862 for (uint32_t address = 0; address < (24*1024*1024); address += 64*1024)
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
863 {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
864 this->read_pointers[address >> 16] = NULL;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
865 this->write_pointers[address >> 16] = NULL;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
866 memmap_chunk const *chunk = find_map_chunk(address, &this->c.options->gen, 0, NULL);
1770
a81db00e171a Fix a couple bugs in the integration of Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1508
diff changeset
867 if (!chunk || chunk->end < (address + 64*1024) || (chunk->flags & (MMAP_ONLY_ODD | MMAP_ONLY_EVEN)) || !chunk->buffer) {
1508
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
868 continue;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
869 }
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
870 void *ptr = get_native_pointer(address, (void **)this->c.mem_pointers, &this->c.options->gen);
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
871 if (!ptr) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
872 continue;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
873 }
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
874 if (chunk->flags & MMAP_READ) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
875 this->read_pointers[address >> 16] = ptr;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
876 }
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
877 if (chunk->flags & MMAP_WRITE) {
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
878 this->write_pointers[address >> 16] = ptr;
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
879 }
2e57910fd641 More efficient memory access when using MAME interpreters
Michael Pavone <pavone@retrodev.com>
parents: 1507
diff changeset
880 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
881 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
882
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
883 /* Service an interrupt request and start exception processing */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
884 void m68ki_exception_interrupt(m68000_base_device *this, uint32_t int_level)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
885 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
886 uint32_t vector;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
887 uint32_t sr;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
888 uint32_t new_pc;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
889
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
890 if(CPU_TYPE_IS_000(this->cpu_type))
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
891 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
892 this->instr_mode = INSTRUCTION_NO;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
893 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
894
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
895 /* Turn off the stopped state */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
896 this->stopped &= ~STOP_LEVEL_STOP;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
897
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
898 /* If we are halted, don't do anything */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
899 if(this->stopped)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
900 return;
1778
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
901
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
902 if (this->c.int_pending == 255) {
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
903 this->c.int_pending = int_level;
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
904 return;
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
905 } else {
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
906 int_level = this->c.int_pending;
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
907 }
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
908
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
909 /* Acknowledge the interrupt */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
910 this->c.int_ack = int_level;
1778
30b5952fd32e Get latency between interrupt latch and interrupt acceptance working with Musashi
Michael Pavone <pavone@retrodev.com>
parents: 1774
diff changeset
911 this->c.int_pending = 255;
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
912
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
913 vector = M68K_INT_ACK_AUTOVECTOR;//int_ack_callback(*this, int_level);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
914
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
915 /* Get the interrupt vector */
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
916 if(vector == M68K_INT_ACK_AUTOVECTOR) {
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
917 /* Use the autovectors. This is the most commonly used implementation */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
918 vector = EXCEPTION_INTERRUPT_AUTOVECTOR+int_level;
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
919 uint32_t e_clock = this->c.current_cycle / this->c.options->gen.clock_divider;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
920 this->c.current_cycle += ((9-4) + e_clock % 10) * this->c.options->gen.clock_divider;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
921 } else if(vector == M68K_INT_ACK_SPURIOUS)
1506
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
922 /* Called if no devices respond to the interrupt acknowledge */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
923 vector = EXCEPTION_SPURIOUS_INTERRUPT;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
924 else if(vector > 255)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
925 return;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
926
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
927 /* Start exception processing */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
928 sr = m68ki_init_exception(this);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
929
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
930 /* Set the interrupt mask to the level of the one being serviced */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
931 this->int_mask = int_level<<8;
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
932
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
933 /* Get the new PC */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
934 new_pc = m68ki_read_32(this, (vector<<2) /*+ vbr*/);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
935
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
936 /* If vector is uninitialized, call the uninitialized interrupt vector */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
937 if(new_pc == 0)
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
938 new_pc = m68ki_read_32(this, (EXCEPTION_UNINITIALIZED_INTERRUPT<<2) /*+ vbr*/);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
939
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
940 /* Generate a stack frame */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
941 m68ki_stack_frame_0000(this, REG_PC(this), sr, vector);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
942 if(this->m_flag && CPU_TYPE_IS_EC020_PLUS(this->cpu_type))
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
943 {
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
944 /* Create throwaway frame */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
945 m68ki_set_sm_flag(this, this->s_flag); /* clear M */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
946 sr |= 0x2000; /* Same as SR in master stack frame except S is forced high */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
947 m68ki_stack_frame_0001(this, REG_PC(this), sr, vector);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
948 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
949
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
950 m68ki_jump(this, new_pc);
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
951
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
952 /* Defer cycle counting until later */
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
953 this->c.current_cycle += this->cyc_exception[vector];
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
954 }
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
955
ded16f3d7eb4 Super hacky integration of the version of Musashi from MAME
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
956