summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/i386
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-12-17 11:10:30 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-12-17 11:10:30 +0100
commit174720a64ddeed98078139dc0e4dd7aed15f91d4 (patch)
treeb22e4fb4f1a210751cadc5aa01d73113b8e9857f /src/devices/cpu/i386
parentbe38cd71bb958d651ba91db8db439edc9c31b21e (diff)
removed auto_bitmap_ind*_alloc and auto_bitmap_rgb32_alloc and replaced with std::unique_ptr (nw)
auto_alloc_array to unique_ptr Added make_unique_clear
Diffstat (limited to 'src/devices/cpu/i386')
-rw-r--r--src/devices/cpu/i386/cycles.h1
-rw-r--r--src/devices/cpu/i386/i386.cpp43
-rw-r--r--src/devices/cpu/i386/i386.h5
3 files changed, 25 insertions, 24 deletions
diff --git a/src/devices/cpu/i386/cycles.h b/src/devices/cpu/i386/cycles.h
index a04e54da8e0..62b6da2a80a 100644
--- a/src/devices/cpu/i386/cycles.h
+++ b/src/devices/cpu/i386/cycles.h
@@ -333,7 +333,6 @@ enum X86_CYCLES
};
-#define X86_NUM_CPUS 4
#define CPU_CYCLES_I386 0
#define CPU_CYCLES_I486 1
#define CPU_CYCLES_PENTIUM 2
diff --git a/src/devices/cpu/i386/i386.cpp b/src/devices/cpu/i386/i386.cpp
index 9017ffbaea7..77623b8f7d4 100644
--- a/src/devices/cpu/i386/i386.cpp
+++ b/src/devices/cpu/i386/i386.cpp
@@ -2769,9 +2769,6 @@ void i386_device::i386_protected_mode_iret(int operand32)
#include "cycles.h"
-static UINT8 *cycle_table_rm[X86_NUM_CPUS];
-static UINT8 *cycle_table_pm[X86_NUM_CPUS];
-
#define CYCLES_NUM(x) (m_cycles -= (x))
void i386_device::CYCLES(int x)
@@ -2817,8 +2814,8 @@ void i386_device::build_cycle_table()
int i, j;
for (j=0; j < X86_NUM_CPUS; j++)
{
- cycle_table_rm[j] = auto_alloc_array(machine(), UINT8, CYCLES_NUM_OPCODES);
- cycle_table_pm[j] = auto_alloc_array(machine(), UINT8, CYCLES_NUM_OPCODES);
+ cycle_table_rm[j] = std::make_unique<UINT8[]>(CYCLES_NUM_OPCODES);
+ cycle_table_pm[j] = std::make_unique<UINT8[]>(CYCLES_NUM_OPCODES);
for (i=0; i < sizeof(x86_cycle_table)/sizeof(X86_CYCLE_TABLE); i++)
{
@@ -3300,8 +3297,8 @@ void i386_device::device_start()
i386_common_init(32);
build_opcode_table(OP_I386);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I386];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I386];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I386].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I386].get();
register_state_i386();
}
@@ -3983,8 +3980,8 @@ void i486_device::device_start()
build_opcode_table(OP_I386 | OP_FPU | OP_I486);
build_x87_opcode_table();
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I486];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I486];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_I486].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_I486].get();
register_state_i386_x87();
}
@@ -4042,8 +4039,8 @@ void pentium_device::device_start()
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM);
build_x87_opcode_table();
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get();
}
void pentium_device::device_reset()
@@ -4116,8 +4113,8 @@ void mediagx_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_CYRIX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_MEDIAGX];
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_MEDIAGX];
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_MEDIAGX].get();
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_MEDIAGX].get();
}
void mediagx_device::device_reset()
@@ -4181,8 +4178,8 @@ void pentium_pro_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium_pro_device::device_reset()
@@ -4256,8 +4253,8 @@ void pentium_mmx_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_MMX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium_mmx_device::device_reset()
@@ -4329,8 +4326,8 @@ void pentium2_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium2_device::device_reset()
@@ -4396,8 +4393,8 @@ void pentium3_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX | OP_SSE);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium3_device::device_reset()
@@ -4465,8 +4462,8 @@ void pentium4_device::device_start()
build_x87_opcode_table();
build_opcode_table(OP_I386 | OP_FPU | OP_I486 | OP_PENTIUM | OP_PPRO | OP_MMX | OP_SSE | OP_SSE2);
- m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
- m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM]; // TODO: generate own cycle tables
+ m_cycle_table_rm = cycle_table_rm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
+ m_cycle_table_pm = cycle_table_pm[CPU_CYCLES_PENTIUM].get(); // TODO: generate own cycle tables
}
void pentium4_device::device_reset()
diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h
index 60eea10264d..ed2cf432ee3 100644
--- a/src/devices/cpu/i386/i386.h
+++ b/src/devices/cpu/i386/i386.h
@@ -22,6 +22,7 @@
#define MCFG_I386_SMIACT(_devcb) \
i386_device::set_smiact(*device, DEVCB_##_devcb);
+#define X86_NUM_CPUS 4
class i386_device : public cpu_device
{
@@ -68,6 +69,10 @@ protected:
address_space_config m_program_config;
address_space_config m_io_config;
+ std::unique_ptr<UINT8[]> cycle_table_rm[X86_NUM_CPUS];
+ std::unique_ptr<UINT8[]> cycle_table_pm[X86_NUM_CPUS];
+
+
union I386_GPR {
UINT32 d[8];
UINT16 w[16];