summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms9900
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-12-04 07:02:45 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-12-04 07:02:45 +0100
commit0c56ac848dd0eba359500d444ecbb51f215ff5b9 (patch)
treead3444449470cec94ccaffd174c5a4d1bc90d1e1 /src/devices/cpu/tms9900
parent68f961927a156c47cb444c1f66258a89342d0205 (diff)
clang-modernize part 3
Diffstat (limited to 'src/devices/cpu/tms9900')
-rw-r--r--src/devices/cpu/tms9900/9900dasm.cpp6
-rw-r--r--src/devices/cpu/tms9900/ti990_10.cpp6
-rw-r--r--src/devices/cpu/tms9900/tms9900.cpp38
-rw-r--r--src/devices/cpu/tms9900/tms9995.cpp28
4 files changed, 39 insertions, 39 deletions
diff --git a/src/devices/cpu/tms9900/9900dasm.cpp b/src/devices/cpu/tms9900/9900dasm.cpp
index 5daf4a88310..2e2883611c2 100644
--- a/src/devices/cpu/tms9900/9900dasm.cpp
+++ b/src/devices/cpu/tms9900/9900dasm.cpp
@@ -213,7 +213,7 @@ static const description_t descriptions[144+3+1] =
{ "liim", format_liim,/*ps_tms9940*/0 }, { "dca", format_6, /*ps_tms9940*/0 },
{ "dcs", format_6, /*ps_tms9940*/0 },
- { NULL, illegal, ps_any }
+ { nullptr, illegal, ps_any }
};
@@ -484,11 +484,11 @@ unsigned Dasm9900 (char *buffer, unsigned pc, int model_id, const UINT8 *oprom,
format = descriptions[opc].format;
/* bl and blwp instructions are subroutines */
- if (mnemonic != NULL && mnemonic[0] == 'b' && mnemonic[1] == 'l')
+ if (mnemonic != nullptr && mnemonic[0] == 'b' && mnemonic[1] == 'l')
dasmflags = DASMFLAG_STEP_OVER;
/* b *r11 and rtwp are returns */
- else if (opc == 0x045b || (mnemonic != NULL && strcmp(mnemonic, "rtwp") == 0))
+ else if (opc == 0x045b || (mnemonic != nullptr && strcmp(mnemonic, "rtwp") == 0))
dasmflags = DASMFLAG_STEP_OUT;
switch (format)
diff --git a/src/devices/cpu/tms9900/ti990_10.cpp b/src/devices/cpu/tms9900/ti990_10.cpp
index b6cd8d32d41..c336d5e689a 100644
--- a/src/devices/cpu/tms9900/ti990_10.cpp
+++ b/src/devices/cpu/tms9900/ti990_10.cpp
@@ -45,8 +45,8 @@ ti990_10_device::ti990_10_device(const machine_config &mconfig, const char *tag,
: cpu_device(mconfig, TI990_10, "TI990/10 CPU", tag, owner, clock, "ti990_10_cpu", __FILE__),
m_program_config("program", ENDIANNESS_BIG, 16, 16),
m_io_config("cru", ENDIANNESS_BIG, 8, 12),
- m_prgspace(NULL),
- m_cru(NULL)
+ m_prgspace(nullptr),
+ m_cru(nullptr)
{
}
@@ -92,7 +92,7 @@ const address_space_config *ti990_10_device::memory_space_config(address_spacenu
return &m_io_config;
default:
- return NULL;
+ return nullptr;
}
}
diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp
index 0029d9cf392..71f177809eb 100644
--- a/src/devices/cpu/tms9900/tms9900.cpp
+++ b/src/devices/cpu/tms9900/tms9900.cpp
@@ -172,8 +172,8 @@ tms99xx_device::tms99xx_device(const machine_config &mconfig, device_type type,
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_program_config("program", ENDIANNESS_BIG, databus_width, prg_addr_bits),
m_io_config("cru", ENDIANNESS_BIG, 8, cru_addr_bits),
- m_prgspace(NULL),
- m_cru(NULL),
+ m_prgspace(nullptr),
+ m_cru(nullptr),
m_prgaddr_mask((1<<prg_addr_bits)-1),
m_cruaddr_mask((1<<cru_addr_bits)-1),
m_clock_out_line(*this),
@@ -234,14 +234,14 @@ void tms99xx_device::device_start()
build_command_lookup_table();
- m_program = NULL;
+ m_program = nullptr;
}
void tms99xx_device::device_stop()
{
int k = 0;
if (TRACE_SETUP) logerror("tms99xx: Deleting lookup tables\n");
- while (m_lotables[k]!=NULL) delete[] m_lotables[k++];
+ while (m_lotables[k]!=nullptr) delete[] m_lotables[k++];
}
/*
@@ -398,7 +398,7 @@ const address_space_config *tms99xx_device::memory_space_config(address_spacenum
return &m_io_config;
default:
- return NULL;
+ return nullptr;
}
}
@@ -1053,8 +1053,8 @@ void tms99xx_device::build_command_lookup_table()
lookup_entry* table = m_command_lookup_table;
for (int j=0; j < 16; j++)
{
- table[j].entry = NULL;
- table[j].next_digit = NULL;
+ table[j].entry = nullptr;
+ table[j].next_digit = nullptr;
}
do
@@ -1069,15 +1069,15 @@ void tms99xx_device::build_command_lookup_table()
while (bitcount < format_mask_len[inst->format])
{
// Descend
- if (table[cmdindex].next_digit == NULL)
+ if (table[cmdindex].next_digit == nullptr)
{
if (TRACE_SETUP) logerror("tms99xx: create new table at bitcount=%d for index=%d\n", bitcount, cmdindex);
table[cmdindex].next_digit = new lookup_entry[16];
m_lotables[k++] = table[cmdindex].next_digit;
for (int j=0; j < 16; j++)
{
- table[cmdindex].next_digit[j].next_digit = NULL;
- table[cmdindex].next_digit[j].entry = NULL;
+ table[cmdindex].next_digit[j].next_digit = nullptr;
+ table[cmdindex].next_digit[j].entry = nullptr;
}
}
else
@@ -1107,7 +1107,7 @@ void tms99xx_device::build_command_lookup_table()
i++;
} while (inst->opcode != 0xf000);
- m_lotables[k++] = NULL;
+ m_lotables[k++] = nullptr;
if (TRACE_SETUP) logerror("tms99xx: Allocated %d tables\n", k);
}
@@ -1155,7 +1155,7 @@ void tms99xx_device::execute_run()
do
{
// Only when last instruction has completed
- if (m_program == NULL)
+ if (m_program == nullptr)
{
if (m_load_state)
{
@@ -1175,7 +1175,7 @@ void tms99xx_device::execute_run()
}
}
- if (m_program == NULL && m_idle_state)
+ if (m_program == nullptr && m_idle_state)
{
if (TRACE_WAIT) logerror("tms99xx: idle state\n");
pulse_clock(1);
@@ -1191,7 +1191,7 @@ void tms99xx_device::execute_run()
// A HOLD request is signalled through the input line HOLD.
// The hold state will be entered with the next non-memory access cycle.
if (m_hold_state &&
- (m_program==NULL ||
+ (m_program==nullptr ||
(m_program[MPC] != IAQ &&
m_program[MPC] != MEMORY_READ && m_program[MPC] != MEMORY_WRITE &&
m_program[MPC] != REG_READ && m_program[MPC] != REG_WRITE)))
@@ -1217,7 +1217,7 @@ void tms99xx_device::execute_run()
set_wait_state(false);
m_check_ready = false;
- if (m_program==NULL) m_op = IAQ;
+ if (m_program==nullptr) m_op = IAQ;
else
{
m_op = m_program[MPC];
@@ -1417,7 +1417,7 @@ void tms99xx_device::decode(UINT16 inst)
{
index = (opcode >> 12) & 0x000f;
if (TRACE_MICRO) logerror("tms99xx: Check next hex digit of instruction %x\n", index);
- if (table[index].next_digit != NULL)
+ if (table[index].next_digit != nullptr)
{
table = table[index].next_digit;
opcode = opcode << 4;
@@ -1425,14 +1425,14 @@ void tms99xx_device::decode(UINT16 inst)
else complete = true;
}
decoded = table[index].entry;
- if (decoded == NULL)
+ if (decoded == nullptr)
{
// not found
logerror("tms99xx: Illegal opcode %04x\n", inst);
IR = 0;
// This will cause another instruction acquisition in the next machine cycle
// with an asserted IAQ line (can be used to indicate this illegal opcode detection).
- m_program = NULL;
+ m_program = nullptr;
}
else
{
@@ -1661,7 +1661,7 @@ void tms99xx_device::command_completed()
if (cycles > 0 && cycles < 10000) logerror(" %d cycles", cycles);
logerror("\n");
}
- m_program = NULL;
+ m_program = nullptr;
}
/*
diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp
index ae9248fd82d..e40cfd94280 100644
--- a/src/devices/cpu/tms9900/tms9995.cpp
+++ b/src/devices/cpu/tms9900/tms9995.cpp
@@ -183,8 +183,8 @@ tms9995_device::tms9995_device(const machine_config &mconfig, const char *tag, d
PC_debug(0),
m_program_config("program", ENDIANNESS_BIG, 8, 16),
m_io_config("cru", ENDIANNESS_BIG, 8, 16),
- m_prgspace(NULL),
- m_cru(NULL),
+ m_prgspace(nullptr),
+ m_cru(nullptr),
m_external_operation(*this),
m_iaq_line(*this),
m_clock_out_line(*this),
@@ -205,8 +205,8 @@ tms9995_device::tms9995_device(const machine_config &mconfig, device_type type,
PC_debug(0),
m_program_config("program", ENDIANNESS_BIG, 8, 16),
m_io_config("cru", ENDIANNESS_BIG, 8, 16),
- m_prgspace(NULL),
- m_cru(NULL),
+ m_prgspace(nullptr),
+ m_cru(nullptr),
m_external_operation(*this),
m_iaq_line(*this),
m_clock_out_line(*this),
@@ -276,7 +276,7 @@ void tms9995_device::device_stop()
{
int k = 0;
if (TRACE_CONFIG) logerror("%s: Deleting lookup tables\n", tag());
- while (m_lotables[k]!=NULL) delete[] m_lotables[k++];
+ while (m_lotables[k]!=nullptr) delete[] m_lotables[k++];
}
/*
@@ -446,7 +446,7 @@ const address_space_config *tms9995_device::memory_space_config(address_spacenum
return &m_io_config;
default:
- return NULL;
+ return nullptr;
}
}
@@ -1142,8 +1142,8 @@ void tms9995_device::build_command_lookup_table()
lookup_entry* table = m_command_lookup_table;
for (int j=0; j < 16; j++)
{
- table[j].entry = NULL;
- table[j].next_digit = NULL;
+ table[j].entry = nullptr;
+ table[j].next_digit = nullptr;
}
do
@@ -1158,15 +1158,15 @@ void tms9995_device::build_command_lookup_table()
while (bitcount < format_mask_len[inst->format])
{
// Descend
- if (table[cmdindex].next_digit == NULL)
+ if (table[cmdindex].next_digit == nullptr)
{
if (TRACE_EMU) logerror("tms9995: create new table at bitcount=%d for index=%d\n", bitcount, cmdindex);
table[cmdindex].next_digit = new lookup_entry[16];
m_lotables[k++] = table[cmdindex].next_digit;
for (int j=0; j < 16; j++)
{
- table[cmdindex].next_digit[j].next_digit = NULL;
- table[cmdindex].next_digit[j].entry = NULL;
+ table[cmdindex].next_digit[j].next_digit = nullptr;
+ table[cmdindex].next_digit[j].entry = nullptr;
}
}
else
@@ -1196,7 +1196,7 @@ void tms9995_device::build_command_lookup_table()
i++;
} while (inst->opcode != 0xf000);
- m_lotables[k++] = NULL;
+ m_lotables[k++] = nullptr;
if (TRACE_EMU) logerror("tms9995: Allocated %d tables\n", k);
}
@@ -1401,7 +1401,7 @@ void tms9995_device::decode(UINT16 inst)
{
index = (opcode >> 12) & 0x000f;
if (TRACE_EMU) logerror("tms9995: Check next hex digit of instruction %x\n", index);
- if (table[index].next_digit != NULL)
+ if (table[index].next_digit != nullptr)
{
table = table[index].next_digit;
opcode = opcode << 4;
@@ -1409,7 +1409,7 @@ void tms9995_device::decode(UINT16 inst)
else complete = true;
}
decoded = table[index].entry;
- if (decoded == NULL)
+ if (decoded == nullptr)
{
// not found
logerror("tms9995: Undefined opcode %04x at logical address %04x, will trigger MID\n", inst, PC);