summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6502/m6502.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-07-03 00:12:44 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-07-03 00:12:44 +0000
commitc70c5fee5a6094c5a1fbd6b25568e57b1d3a8216 (patch)
treeeb0db95e2757f00a708dd4bfbf3ed4af41d943b6 /src/emu/cpu/m6502/m6502.c
parent46e30c4f68c5c92b597d6b3ae9e9037d5e04efe9 (diff)
Created CPU-specific device types for all CPUs, using new macros
DECLARE_LEGACY_CPU_DEVICE and DEFINE_LEGACY_CPU_DEVICE. Changed CPUs to be their own device types, rather than all of type CPU with a special internal subtype. Note that as part of this process I removed the CPU_ prefix from the ALL-CAPS device name, so CPU_Z80 is just plain old Z80 now. This required changing a couple of names like 8080 to I8080 so that there was an alphabetic first character. Added memory interfaces to the list of fast-access interfaces. To do this properly I had to add a separate method to devices which is called immediately after construction, when it is possible to perform dynamic_casts on fully-constructed objects. (This is just internal, no changes necessary to the devices themselves.) Some additional notes: * SH2 and SH4 had typedefs that conflicted with their CPU_-less names so I bulk renamed to structures to sh2_state and sh4_state; RB, feel free to choose alternate names if you don't like 'em * SCSP was caught doing something to the 3rd indexed CPU. Since several systems that use SCSP don't even have 3 CPUs, I had no idea what this was supposed to do, so I changed to it reference "audiocpu" assuming that stv was the assumed target. This is really gross and should be a configuration parameter, not a hard-coded assumption.
Diffstat (limited to 'src/emu/cpu/m6502/m6502.c')
-rw-r--r--src/emu/cpu/m6502/m6502.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index 163a4212d1f..b007c21a5b8 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -87,16 +87,15 @@ struct _m6502_Regs
INLINE m6502_Regs *get_safe_token(running_device *device)
{
assert(device != NULL);
- assert(device->type() == CPU);
- assert(cpu_get_type(device) == CPU_M6502 ||
- cpu_get_type(device) == CPU_M6510 ||
- cpu_get_type(device) == CPU_M6510T ||
- cpu_get_type(device) == CPU_M7501 ||
- cpu_get_type(device) == CPU_M8502 ||
- cpu_get_type(device) == CPU_N2A03 ||
- cpu_get_type(device) == CPU_M65C02 ||
- cpu_get_type(device) == CPU_M65SC02 ||
- cpu_get_type(device) == CPU_DECO16);
+ assert(device->type() == M6502 ||
+ device->type() == M6510 ||
+ device->type() == M6510T ||
+ device->type() == M7501 ||
+ device->type() == M8502 ||
+ device->type() == N2A03 ||
+ device->type() == M65C02 ||
+ device->type() == M65SC02 ||
+ device->type() == DECO16);
return (m6502_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
@@ -967,3 +966,13 @@ CPU_GET_INFO( deco16 )
default: CPU_GET_INFO_CALL(m6502); break;
}
}
+
+DEFINE_LEGACY_CPU_DEVICE(M6502, m6502);
+DEFINE_LEGACY_CPU_DEVICE(M6510, m6510);
+DEFINE_LEGACY_CPU_DEVICE(M6510T, m6510t);
+DEFINE_LEGACY_CPU_DEVICE(M7501, m7501);
+DEFINE_LEGACY_CPU_DEVICE(M8502, m8502);
+DEFINE_LEGACY_CPU_DEVICE(N2A03, n2a03);
+DEFINE_LEGACY_CPU_DEVICE(M65C02, m65c02);
+DEFINE_LEGACY_CPU_DEVICE(M65SC02, m65sc02);
+DEFINE_LEGACY_CPU_DEVICE(DECO16, deco16);