summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/imagedev
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/imagedev
parent68f961927a156c47cb444c1f66258a89342d0205 (diff)
clang-modernize part 3
Diffstat (limited to 'src/devices/imagedev')
-rw-r--r--src/devices/imagedev/bitbngr.h2
-rw-r--r--src/devices/imagedev/cassette.cpp16
-rw-r--r--src/devices/imagedev/chd_cd.cpp22
-rw-r--r--src/devices/imagedev/diablo.cpp30
-rw-r--r--src/devices/imagedev/flopdrv.cpp44
-rw-r--r--src/devices/imagedev/floppy.cpp46
-rw-r--r--src/devices/imagedev/harddriv.cpp36
-rw-r--r--src/devices/imagedev/mfmhd.cpp52
-rw-r--r--src/devices/imagedev/midiin.cpp12
-rw-r--r--src/devices/imagedev/midiin.h2
-rw-r--r--src/devices/imagedev/midiout.cpp8
-rw-r--r--src/devices/imagedev/midiout.h2
-rw-r--r--src/devices/imagedev/printer.h2
-rw-r--r--src/devices/imagedev/snapquik.cpp12
-rw-r--r--src/devices/imagedev/snapquik.h2
15 files changed, 144 insertions, 144 deletions
diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h
index 4c3b3e5b9d1..f2a486a04a7 100644
--- a/src/devices/imagedev/bitbngr.h
+++ b/src/devices/imagedev/bitbngr.h
@@ -29,7 +29,7 @@ public:
virtual bool must_be_loaded() const { return 0; }
virtual bool is_reset_on_load() const { return 0; }
virtual const char *file_extensions() const { return ""; }
- virtual const option_guide *create_option_guide() const { return NULL; }
+ virtual const option_guide *create_option_guide() const { return nullptr; }
void output(UINT8 data);
UINT32 input(void *buffer, UINT32 length);
diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp
index 0df32b0ef9d..e6485b05523 100644
--- a/src/devices/imagedev/cassette.cpp
+++ b/src/devices/imagedev/cassette.cpp
@@ -31,7 +31,7 @@ const device_type CASSETTE = &device_creator<cassette_image_device>;
cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, CASSETTE, "Cassette", tag, owner, clock, "cassette_image", __FILE__),
device_image_interface(mconfig, *this),
- m_cassette(NULL),
+ m_cassette(nullptr),
m_state(CASSETTE_STOPPED),
m_position(0),
m_position_time(0),
@@ -40,9 +40,9 @@ cassette_image_device::cassette_image_device(const machine_config &mconfig, cons
m_speed(0),
m_direction(0),
m_formats(cassette_default_formats),
- m_create_opts(NULL),
+ m_create_opts(nullptr),
m_default_state(CASSETTE_PLAY),
- m_interface(NULL)
+ m_interface(nullptr)
{
}
@@ -250,7 +250,7 @@ void cassette_image_device::seek(double time, int origin)
void cassette_image_device::device_start()
{
/* set to default state */
- m_cassette = NULL;
+ m_cassette = nullptr;
m_state = m_default_state;
m_value = 0;
}
@@ -266,7 +266,7 @@ bool cassette_image_device::call_load()
int cassette_flags;
const char *extension;
int is_writable;
- device_image_interface *image = NULL;
+ device_image_interface *image = nullptr;
interface(image);
if ((has_been_created()) || (length() == 0))
@@ -284,7 +284,7 @@ bool cassette_image_device::call_load()
is_writable = !is_readonly();
cassette_flags = is_writable ? (CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT) : CASSETTE_FLAG_READONLY;
std::string fname;
- if (software_entry()==NULL) {
+ if (software_entry()==nullptr) {
extension = filetype();
} else {
fname = m_mame_file->filename();
@@ -355,7 +355,7 @@ void cassette_image_device::call_unload()
/* close out the cassette */
cassette_close(m_cassette);
- m_cassette = NULL;
+ m_cassette = nullptr;
/* set to default state, but only change the UI state */
change_state(CASSETTE_STOPPED, CASSETTE_MASK_UISTATE);
@@ -392,7 +392,7 @@ void cassette_image_device::call_display()
y = 0.5f;
cassette_device_iterator iter(device().machine().root_device());
- for (dev = iter.first(); dev != NULL && strcmp( dev->tag(), device().tag() ); dev = iter.next())
+ for (dev = iter.first(); dev != nullptr && strcmp( dev->tag(), device().tag() ); dev = iter.next())
y += 1;
y *= device().machine().ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER;
diff --git a/src/devices/imagedev/chd_cd.cpp b/src/devices/imagedev/chd_cd.cpp
index ca7898d14cd..83845d026b8 100644
--- a/src/devices/imagedev/chd_cd.cpp
+++ b/src/devices/imagedev/chd_cd.cpp
@@ -29,18 +29,18 @@ const device_type CDROM = &device_creator<cdrom_image_device>;
cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__),
device_image_interface(mconfig, *this),
- m_cdrom_handle(NULL),
- m_extension_list(NULL),
- m_interface(NULL)
+ m_cdrom_handle(nullptr),
+ m_extension_list(nullptr),
+ m_interface(nullptr)
{
}
cdrom_image_device::cdrom_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_image_interface(mconfig, *this),
- m_cdrom_handle(NULL),
- m_extension_list(NULL),
- m_interface(NULL)
+ m_cdrom_handle(nullptr),
+ m_extension_list(nullptr),
+ m_interface(nullptr)
{
}
//-------------------------------------------------
@@ -80,13 +80,13 @@ void cdrom_image_device::device_start()
{
// try to locate the CHD from a DISK_REGION
chd_file *chd = get_disk_handle( machine(), owner()->tag() );
- if( chd != NULL )
+ if( chd != nullptr )
{
m_cdrom_handle = cdrom_open( chd );
}
else
{
- m_cdrom_handle = NULL;
+ m_cdrom_handle = nullptr;
}
}
@@ -101,12 +101,12 @@ void cdrom_image_device::device_stop()
bool cdrom_image_device::call_load()
{
chd_error err = (chd_error)0;
- chd_file *chd = NULL;
+ chd_file *chd = nullptr;
if (m_cdrom_handle)
cdrom_close(m_cdrom_handle);
- if (software_entry() == NULL)
+ if (software_entry() == nullptr)
{
if (strstr(m_image_name.c_str(), ".chd") && is_loaded()) {
err = m_self_chd.open( *image_core_file() ); /* CDs are never writeable */
@@ -141,7 +141,7 @@ void cdrom_image_device::call_unload()
{
assert(m_cdrom_handle);
cdrom_close(m_cdrom_handle);
- m_cdrom_handle = NULL;
+ m_cdrom_handle = nullptr;
if( m_self_chd.opened() )
m_self_chd.close();
}
diff --git a/src/devices/imagedev/diablo.cpp b/src/devices/imagedev/diablo.cpp
index d7d499ec523..9982463fd08 100644
--- a/src/devices/imagedev/diablo.cpp
+++ b/src/devices/imagedev/diablo.cpp
@@ -32,11 +32,11 @@ const device_type DIABLO = &device_creator<diablo_image_device>;
diablo_image_device::diablo_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, DIABLO, "Diablo", tag, owner, clock, "diablo_image", __FILE__),
device_image_interface(mconfig, *this),
- m_chd(NULL),
- m_hard_disk_handle(NULL),
+ m_chd(nullptr),
+ m_hard_disk_handle(nullptr),
m_device_image_load(device_image_load_delegate()),
m_device_image_unload(device_image_func_delegate()),
- m_interface(NULL)
+ m_interface(nullptr)
{
}
@@ -73,17 +73,17 @@ const option_guide *diablo_image_device::create_option_guide() const
void diablo_image_device::device_start()
{
- m_chd = NULL;
+ m_chd = nullptr;
// try to locate the CHD from a DISK_REGION
chd_file *handle = get_disk_handle(machine(), tag());
- if (handle != NULL)
+ if (handle != nullptr)
{
m_hard_disk_handle = hard_disk_open(handle);
}
else
{
- m_hard_disk_handle = NULL;
+ m_hard_disk_handle = nullptr;
}
}
@@ -151,15 +151,15 @@ void diablo_image_device::call_unload()
m_device_image_unload(*this);
}
- if (m_hard_disk_handle != NULL)
+ if (m_hard_disk_handle != nullptr)
{
hard_disk_close(m_hard_disk_handle);
- m_hard_disk_handle = NULL;
+ m_hard_disk_handle = nullptr;
}
m_origchd.close();
m_diffchd.close();
- m_chd = NULL;
+ m_chd = nullptr;
}
/*-------------------------------------------------
@@ -209,13 +209,13 @@ int diablo_image_device::internal_load_dsk()
{
chd_error err = CHDERR_NONE;
- m_chd = NULL;
+ m_chd = nullptr;
if (m_hard_disk_handle)
hard_disk_close(m_hard_disk_handle);
/* open the CHD file */
- if (software_entry() != NULL)
+ if (software_entry() != nullptr)
{
m_chd = get_disk_handle(device().machine(), device().subtag("harddriv").c_str());
}
@@ -240,18 +240,18 @@ int diablo_image_device::internal_load_dsk()
}
}
- if (m_chd != NULL)
+ if (m_chd != nullptr)
{
/* open the hard disk file */
m_hard_disk_handle = hard_disk_open(m_chd);
- if (m_hard_disk_handle != NULL)
+ if (m_hard_disk_handle != nullptr)
return IMAGE_INIT_PASS;
}
/* if we had an error, close out the CHD */
m_origchd.close();
m_diffchd.close();
- m_chd = NULL;
+ m_chd = nullptr;
seterror(IMAGE_ERROR_UNSPECIFIED, chd_file::error_string(err));
return IMAGE_INIT_FAIL;
@@ -266,7 +266,7 @@ int diablo_image_device::internal_load_dsk()
chd_file *diablo_image_device::get_chd_file()
{
- chd_file *result = NULL;
+ chd_file *result = nullptr;
hard_disk_file *hd_file = get_hard_disk_file();
if (hd_file)
result = hard_disk_get_chd(hd_file);
diff --git a/src/devices/imagedev/flopdrv.cpp b/src/devices/imagedev/flopdrv.cpp
index ed4063ecc00..4bfa045dae9 100644
--- a/src/devices/imagedev/flopdrv.cpp
+++ b/src/devices/imagedev/flopdrv.cpp
@@ -124,7 +124,7 @@ void legacy_floppy_image_device::floppy_drive_init()
{
/* initialise flags */
m_flags = 0;
- m_index_pulse_callback = NULL;
+ m_index_pulse_callback = nullptr;
m_index_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(legacy_floppy_image_device::floppy_drive_index_callback),this));
m_idx = 0;
@@ -138,7 +138,7 @@ void legacy_floppy_image_device::floppy_drive_init()
/* default RPM */
m_rpm = 300;
- m_controller = NULL;
+ m_controller = nullptr;
m_floppy_drive_type = FLOPPY_TYPE_REGULAR;
}
@@ -425,7 +425,7 @@ int legacy_floppy_image_device::internal_floppy_device_load(int create_format, o
int floppy_flags, i;
const char *extension;
- device_image_interface *image = NULL;
+ device_image_interface *image = nullptr;
interface(image); /* figure out the floppy options */
floppy_options = ((floppy_interface*)static_config())->formats;
@@ -478,7 +478,7 @@ legacy_floppy_image_device *floppy_get_device(running_machine &machine,int drive
case 2 : return machine.device<legacy_floppy_image_device>(FLOPPY_2);
case 3 : return machine.device<legacy_floppy_image_device>(FLOPPY_3);
}
- return NULL;
+ return nullptr;
}
int legacy_floppy_image_device::floppy_get_drive_type()
@@ -504,7 +504,7 @@ legacy_floppy_image_device *floppy_get_device_by_type(running_machine &machine,i
cnt++;
}
}
- return NULL;
+ return nullptr;
}
int floppy_get_drive(device_t *image)
@@ -672,7 +672,7 @@ READ_LINE_MEMBER( legacy_floppy_image_device::floppy_dskchg_r )
/* 2-sided disk */
READ_LINE_MEMBER( legacy_floppy_image_device::floppy_twosid_r )
{
- if (m_floppy == NULL)
+ if (m_floppy == nullptr)
return ASSERT_LINE;
else
return !floppy_get_heads_per_disk(m_floppy);
@@ -710,20 +710,20 @@ legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mco
m_dskchg(0),
m_drive_id(0),
m_active(0),
- m_config(NULL),
+ m_config(nullptr),
m_flags(0),
m_max_track(0),
m_num_sides(0),
m_current_track(0),
- m_index_timer(NULL),
- m_index_pulse_callback(NULL),
+ m_index_timer(nullptr),
+ m_index_pulse_callback(nullptr),
m_rpm(0.0f),
m_id_index(0),
- m_controller(NULL),
- m_floppy(NULL),
+ m_controller(nullptr),
+ m_floppy(nullptr),
m_track(0),
- m_load_proc(NULL),
- m_unload_proc(NULL),
+ m_load_proc(nullptr),
+ m_unload_proc(nullptr),
m_floppy_drive_type(0)
{
memset(&m_extension_list,0,sizeof(m_extension_list));
@@ -744,20 +744,20 @@ legacy_floppy_image_device::legacy_floppy_image_device(const machine_config &mco
m_dskchg(0),
m_drive_id(0),
m_active(0),
- m_config(NULL),
+ m_config(nullptr),
m_flags(0),
m_max_track(0),
m_num_sides(0),
m_current_track(0),
- m_index_timer(NULL),
- m_index_pulse_callback(NULL),
+ m_index_timer(nullptr),
+ m_index_pulse_callback(nullptr),
m_rpm(0.0f),
m_id_index(0),
- m_controller(NULL),
- m_floppy(NULL),
+ m_controller(nullptr),
+ m_floppy(nullptr),
m_track(0),
- m_load_proc(NULL),
- m_unload_proc(NULL),
+ m_load_proc(nullptr),
+ m_unload_proc(nullptr),
m_floppy_drive_type(0)
{
memset(&m_extension_list,0,sizeof(m_extension_list));
@@ -839,7 +839,7 @@ bool legacy_floppy_image_device::call_create(int format_type, option_resolution
bool legacy_floppy_image_device::call_load()
{
- int retVal = internal_floppy_device_load(-1, NULL);
+ int retVal = internal_floppy_device_load(-1, nullptr);
if (retVal==IMAGE_INIT_PASS) {
/* if we have one of our hacky unload procs, call it */
if (m_load_proc)
@@ -869,7 +869,7 @@ void legacy_floppy_image_device::call_unload()
m_unload_proc(*this);
floppy_close(m_floppy);
- m_floppy = NULL;
+ m_floppy = nullptr;
/* disk changed */
m_dskchg = CLEAR_LINE;
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 22a0b03ceec..319e000e626 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -121,13 +121,13 @@ const floppy_format_type floppy_image_device::default_floppy_formats[] = {
FLOPPY_TD0_FORMAT,
FLOPPY_CQM_FORMAT,
FLOPPY_DSK_FORMAT,
- NULL
+ nullptr
};
floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__),
device_slot_interface(mconfig, *this),
- formats(NULL),
+ formats(nullptr),
m_enable_sound(false)
{
}
@@ -168,11 +168,11 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_image_interface(mconfig, *this),
device_slot_card_interface(mconfig, *this),
- input_format(NULL),
- output_format(NULL),
- image(NULL),
- fif_list(NULL),
- index_timer(NULL),
+ input_format(nullptr),
+ output_format(nullptr),
+ image(nullptr),
+ fif_list(nullptr),
+ index_timer(nullptr),
tracks(0),
sides(0),
form_factor(0),
@@ -187,7 +187,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
image_dirty(false),
ready_counter(0),
m_make_sound(false),
- m_sound_out(NULL)
+ m_sound_out(nullptr)
{
extension_list[0] = '\0';
m_err = IMAGE_ERROR_INVALIDIMAGE;
@@ -204,7 +204,7 @@ floppy_image_device::~floppy_image_device()
format = format->next;
delete tmp_format;
}
- fif_list = NULL;
+ fif_list = nullptr;
}
void floppy_image_device::setup_load_cb(load_cb cb)
@@ -235,7 +235,7 @@ void floppy_image_device::setup_wpt_cb(wpt_cb cb)
void floppy_image_device::set_formats(const floppy_format_type *formats)
{
extension_list[0] = '\0';
- fif_list = NULL;
+ fif_list = nullptr;
for(int cnt=0; formats[cnt]; cnt++)
{
// allocate a new format
@@ -369,7 +369,7 @@ floppy_image_format_t *floppy_image_device::identify(std::string filename)
file_error err = zippath_fopen(filename.c_str(), OPEN_FLAG_READ, fd, revised_path);
if(err) {
seterror(IMAGE_ERROR_INVALIDIMAGE, "Unable to open the image file");
- return 0;
+ return nullptr;
}
io_generic io;
@@ -377,7 +377,7 @@ floppy_image_format_t *floppy_image_device::identify(std::string filename)
io.procs = &corefile_ioprocs_noclose;
io.filler = 0xff;
int best = 0;
- floppy_image_format_t *best_format = 0;
+ floppy_image_format_t *best_format = nullptr;
for(floppy_image_format_t *format = fif_list; format; format = format->next) {
int score = format->identify(&io, form_factor);
if(score > best) {
@@ -398,7 +398,7 @@ bool floppy_image_device::call_load()
io.procs = &image_ioprocs;
io.filler = 0xff;
int best = 0;
- floppy_image_format_t *best_format = 0;
+ floppy_image_format_t *best_format = nullptr;
for(floppy_image_format_t *format = fif_list; format; format = format->next) {
int score = format->identify(&io, form_factor);
if(score > best) {
@@ -415,7 +415,7 @@ bool floppy_image_device::call_load()
image = global_alloc(floppy_image(tracks, sides, form_factor));
best_format->load(&io, form_factor, image);
- output_format = is_readonly() ? 0 : best_format;
+ output_format = is_readonly() ? nullptr : best_format;
revolution_start_time = mon ? attotime::never : machine().time();
revolution_count = 0;
@@ -427,7 +427,7 @@ bool floppy_image_device::call_load()
if (!cur_wpt_cb.isnull())
cur_wpt_cb(this, wpt);
- wpt = is_readonly() || (output_format == 0);
+ wpt = is_readonly() || (output_format == nullptr);
if (!cur_wpt_cb.isnull())
cur_wpt_cb(this, wpt);
@@ -451,7 +451,7 @@ void floppy_image_device::call_unload()
if(image_dirty)
commit_image();
global_free(image);
- image = 0;
+ image = nullptr;
}
wpt = 1; // disk sleeve is covering the sensor
@@ -478,7 +478,7 @@ void floppy_image_device::call_unload()
bool floppy_image_device::call_create(int format_type, option_resolution *format_options)
{
image = global_alloc(floppy_image(tracks, sides, form_factor));
- output_format = 0;
+ output_format = nullptr;
// search for a suitable format based on the extension
for(floppy_image_format_t *i = fif_list; i; i = i->next)
@@ -495,7 +495,7 @@ bool floppy_image_device::call_create(int format_type, option_resolution *format
}
// did we find a suitable format?
- if (output_format == 0)
+ if (output_format == nullptr)
{
seterror(IMAGE_ERROR_INVALIDIMAGE, "Unable to identify the image format");
return IMAGE_INIT_FAIL;
@@ -946,7 +946,7 @@ ui_menu_control_floppy_image::ui_menu_control_floppy_image(running_machine &mach
fcnt++;
format_array = global_alloc_array(floppy_image_format_t *, fcnt);
- input_format = output_format = 0;
+ input_format = output_format = nullptr;
input_filename = output_filename = "";
}
@@ -959,7 +959,7 @@ void ui_menu_control_floppy_image::do_load_create()
{
floppy_image_device *fd = static_cast<floppy_image_device *>(image);
if(input_filename.compare("")==0) {
- int err = fd->create(output_filename.c_str(), 0, NULL);
+ int err = fd->create(output_filename.c_str(), nullptr, nullptr);
if (err != 0) {
machine().popmessage("Error: %s", fd->error());
return;
@@ -1104,7 +1104,7 @@ void ui_menu_control_floppy_image::handle()
floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__),
- m_sound(NULL),
+ m_sound(nullptr),
m_is525(false),
m_sampleindex_motor_start(0),
m_sampleindex_motor_loop(0),
@@ -1149,7 +1149,7 @@ void floppy_sound_device::device_start()
m_step_playback_state = 0; // 0 == currently not playing, > 0 = playing one of the step samples from start to end
m_motor_on = false;
- m_is525 = strstr(tag(), "525") != NULL;
+ m_is525 = strstr(tag(), "525") != nullptr;
if (m_is525)
{
m_sampleindex_motor_start = 2;
@@ -1310,7 +1310,7 @@ static const char *const floppy_sample_names[] =
"floppy_525_step3",
"floppy_525_step4",
"floppy_525_step5",
- 0
+ nullptr
};
#define FLOPSPK "flopsndout"
diff --git a/src/devices/imagedev/harddriv.cpp b/src/devices/imagedev/harddriv.cpp
index bc39d53e4b3..8b0ea459be5 100644
--- a/src/devices/imagedev/harddriv.cpp
+++ b/src/devices/imagedev/harddriv.cpp
@@ -41,11 +41,11 @@ const device_type HARDDISK = &device_creator<harddisk_image_device>;
harddisk_image_device::harddisk_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, HARDDISK, "Harddisk", tag, owner, clock, "harddisk_image", __FILE__),
device_image_interface(mconfig, *this),
- m_chd(NULL),
- m_hard_disk_handle(NULL),
+ m_chd(nullptr),
+ m_hard_disk_handle(nullptr),
m_device_image_load(device_image_load_delegate()),
m_device_image_unload(device_image_func_delegate()),
- m_interface(NULL)
+ m_interface(nullptr)
{
}
@@ -55,11 +55,11 @@ harddisk_image_device::harddisk_image_device(const machine_config &mconfig, cons
harddisk_image_device::harddisk_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_image_interface(mconfig, *this),
- m_chd(NULL),
- m_hard_disk_handle(NULL),
+ m_chd(nullptr),
+ m_hard_disk_handle(nullptr),
m_device_image_load(device_image_load_delegate()),
m_device_image_unload(device_image_func_delegate()),
- m_interface(NULL)
+ m_interface(nullptr)
{
}
@@ -96,17 +96,17 @@ const option_guide *harddisk_image_device::create_option_guide() const
void harddisk_image_device::device_start()
{
- m_chd = NULL;
+ m_chd = nullptr;
// try to locate the CHD from a DISK_REGION
chd_file *handle = get_disk_handle(machine(), tag());
- if (handle != NULL)
+ if (handle != nullptr)
{
m_hard_disk_handle = hard_disk_open(handle);
}
else
{
- m_hard_disk_handle = NULL;
+ m_hard_disk_handle = nullptr;
}
}
@@ -175,15 +175,15 @@ void harddisk_image_device::call_unload()
m_device_image_unload(*this);
}
- if (m_hard_disk_handle != NULL)
+ if (m_hard_disk_handle != nullptr)
{
hard_disk_close(m_hard_disk_handle);
- m_hard_disk_handle = NULL;
+ m_hard_disk_handle = nullptr;
}
m_origchd.close();
m_diffchd.close();
- m_chd = NULL;
+ m_chd = nullptr;
}
/*-------------------------------------------------
@@ -233,13 +233,13 @@ int harddisk_image_device::internal_load_hd()
{
chd_error err = CHDERR_NONE;
- m_chd = NULL;
+ m_chd = nullptr;
if (m_hard_disk_handle)
hard_disk_close(m_hard_disk_handle);
/* open the CHD file */
- if (software_entry() != NULL)
+ if (software_entry() != nullptr)
{
m_chd = get_disk_handle(device().machine(), device().subtag("harddriv").c_str());
}
@@ -264,18 +264,18 @@ int harddisk_image_device::internal_load_hd()
}
}
- if (m_chd != NULL)
+ if (m_chd != nullptr)
{
/* open the hard disk file */
m_hard_disk_handle = hard_disk_open(m_chd);
- if (m_hard_disk_handle != NULL)
+ if (m_hard_disk_handle != nullptr)
return IMAGE_INIT_PASS;
}
/* if we had an error, close out the CHD */
m_origchd.close();
m_diffchd.close();
- m_chd = NULL;
+ m_chd = nullptr;
seterror(IMAGE_ERROR_UNSPECIFIED, chd_file::error_string(err));
return IMAGE_INIT_FAIL;
@@ -290,7 +290,7 @@ int harddisk_image_device::internal_load_hd()
chd_file *harddisk_image_device::get_chd_file()
{
- chd_file *result = NULL;
+ chd_file *result = nullptr;
hard_disk_file *hd_file = get_hard_disk_file();
if (hd_file)
result = hard_disk_get_chd(hd_file);
diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp
index e1cccc6f660..bc8987d7b0f 100644
--- a/src/devices/imagedev/mfmhd.cpp
+++ b/src/devices/imagedev/mfmhd.cpp
@@ -310,10 +310,10 @@ std::string mfm_harddisk_device::tts(const attotime &t)
mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source),
device_slot_card_interface(mconfig, *this),
- m_index_timer(NULL),
- m_spinup_timer(NULL),
- m_seek_timer(NULL),
- m_cache_timer(NULL),
+ m_index_timer(nullptr),
+ m_spinup_timer(nullptr),
+ m_seek_timer(nullptr),
+ m_cache_timer(nullptr),
m_precomp_cyl(0),
m_redwc_cyl(0),
m_encoding(),
@@ -327,7 +327,7 @@ mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_t
m_autotruncation(false),
m_recalibrated(false),
m_step_line(),
- m_format(NULL)
+ m_format(nullptr)
{
m_spinupms = 10000;
m_cachelines = 5;
@@ -337,7 +337,7 @@ mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_t
m_cell_size = 100;
m_rpm = 3600; // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec)
m_trackimage_size = (int)((60000000000ULL / (m_rpm * m_cell_size)) / 16 + 1);
- m_cache = NULL;
+ m_cache = nullptr;
// We will calculate default values from the time specs later.
m_seeknext_time = 0;
m_maxseek_time = 0;
@@ -382,7 +382,7 @@ void mfm_harddisk_device::device_reset()
void mfm_harddisk_device::device_stop()
{
- if (m_cache!=NULL) global_free(m_cache);
+ if (m_cache!=nullptr) global_free(m_cache);
}
/*
@@ -404,7 +404,7 @@ bool mfm_harddisk_device::call_load()
std::string metadata;
chd_file* chdfile = get_chd_file();
- if (chdfile==NULL)
+ if (chdfile==nullptr)
{
logerror("%s: chdfile is null\n", tag());
return IMAGE_INIT_FAIL;
@@ -523,7 +523,7 @@ void mfm_harddisk_device::call_unload()
mfmhd_layout_params* params = m_format->get_current_params();
mfmhd_layout_params* oldparams = m_format->get_initial_params();
- if (m_cache!=NULL)
+ if (m_cache!=nullptr)
{
m_cache->cleanup();
@@ -814,7 +814,7 @@ bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT1
{
UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head);
- if (track==NULL)
+ if (track==nullptr)
{
// What shall we do in this case?
throw emu_fatalerror("Cannot read CHD image");
@@ -853,7 +853,7 @@ bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, UINT
{
UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head);
- if (track==NULL)
+ if (track==nullptr)
{
// What shall we do in this case?
throw emu_fatalerror("Cannot read CHD image");
@@ -970,8 +970,8 @@ const device_type MFMHD_ST251 = &device_creator<mfm_hd_st251_device>;
// ===========================================================
mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine):
- m_mfmhd(NULL),
- m_tracks(NULL),
+ m_mfmhd(nullptr),
+ m_tracks(nullptr),
m_machine(machine)
{
}
@@ -981,7 +981,7 @@ mfmhd_trackimage_cache::~mfmhd_trackimage_cache()
mfmhd_trackimage* current = m_tracks;
if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache destroy\n", m_mfmhd->tag());
- while (current != NULL)
+ while (current != nullptr)
{
global_free_array(current->encdata);
mfmhd_trackimage* currenttmp = current->next;
@@ -994,7 +994,7 @@ void mfmhd_trackimage_cache::write_back_one()
{
mfmhd_trackimage* current = m_tracks;
- while (current != NULL)
+ while (current != nullptr)
{
if (current->dirty)
{
@@ -1013,7 +1013,7 @@ void mfmhd_trackimage_cache::cleanup()
if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache cleanup\n", m_mfmhd->tag());
// Still dirty?
- while (current != NULL)
+ while (current != nullptr)
{
if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", m_mfmhd->tag(), current->cylinder, current->head);
if (current->dirty)
@@ -1047,7 +1047,7 @@ void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int
chd_error state;
mfmhd_trackimage* previous;
- mfmhd_trackimage* current = NULL;
+ mfmhd_trackimage* current = nullptr;
m_mfmhd = mfmhd;
@@ -1077,9 +1077,9 @@ void mfmhd_trackimage_cache::init(mfm_harddisk_device* mfmhd, int tracksize, int
head = 0;
cylinder++;
}
- current->next = NULL;
+ current->next = nullptr;
- if (previous != NULL)
+ if (previous != nullptr)
previous->next = current;
else
// Head
@@ -1100,7 +1100,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
{
// Search the cached track images
mfmhd_trackimage* current = m_tracks;
- mfmhd_trackimage* previous = NULL;
+ mfmhd_trackimage* previous = nullptr;
chd_error state = CHDERR_NONE;
@@ -1109,13 +1109,13 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
while (state == CHDERR_NONE)
{
// A simple linear search
- while (current != NULL)
+ while (current != nullptr)
{
if (current->cylinder == cylinder && current->head == head)
{
// found it
// move it to the front of the chain for LRU
- if (previous != NULL)
+ if (previous != nullptr)
{
previous->next = current->next; // pull out here
current->next = m_tracks; // put the previous head into the next field
@@ -1126,7 +1126,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
else
{
// Don't lose the pointer to the next tail
- if (current->next != NULL) previous = current;
+ if (current->next != nullptr) previous = current;
current = current->next;
}
}
@@ -1152,7 +1152,7 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
current->head = head;
}
// If we are here we have a CHD error.
- return NULL;
+ return nullptr;
}
// ================================================================
@@ -1163,7 +1163,7 @@ mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, co
m_encoding(),
m_spinupms(0),
m_cachesize(0),
- m_format(NULL)
+ m_format(nullptr)
{
}
@@ -1187,7 +1187,7 @@ void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int c
void mfm_harddisk_connector::device_config_complete()
{
mfm_harddisk_device *dev = get_device();
- if (dev != NULL)
+ if (dev != nullptr)
{
dev->set_encoding(m_encoding);
dev->set_spinup_time(m_spinupms);
diff --git a/src/devices/imagedev/midiin.cpp b/src/devices/imagedev/midiin.cpp
index 8d32dbcba27..ae5bdb81eb8 100644
--- a/src/devices/imagedev/midiin.cpp
+++ b/src/devices/imagedev/midiin.cpp
@@ -26,8 +26,8 @@ midiin_device::midiin_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__),
device_image_interface(mconfig, *this),
device_serial_interface(mconfig, *this),
- m_midi(NULL),
- m_timer(NULL),
+ m_midi(nullptr),
+ m_timer(nullptr),
m_input_cb(*this),
m_xmit_read(0),
m_xmit_write(0),
@@ -43,7 +43,7 @@ void midiin_device::device_start()
{
m_input_cb.resolve_safe();
m_timer = timer_alloc(0);
- m_midi = NULL;
+ m_midi = nullptr;
m_timer->enable(false);
}
@@ -81,7 +81,7 @@ void midiin_device::device_timer(emu_timer &timer, device_timer_id id, int param
UINT8 buf[8192*4];
int bytesRead;
- if (m_midi == NULL) {
+ if (m_midi == nullptr) {
return;
}
@@ -110,7 +110,7 @@ bool midiin_device::call_load(void)
if (!m_midi->open_input(filename()))
{
global_free(m_midi);
- m_midi = NULL;
+ m_midi = nullptr;
return IMAGE_INIT_FAIL;
}
@@ -131,7 +131,7 @@ void midiin_device::call_unload(void)
global_free(m_midi);
}
m_timer->enable(false);
- m_midi = NULL;
+ m_midi = nullptr;
}
void midiin_device::tra_complete()
diff --git a/src/devices/imagedev/midiin.h b/src/devices/imagedev/midiin.h
index d8cc99eb0aa..42c6873cb4f 100644
--- a/src/devices/imagedev/midiin.h
+++ b/src/devices/imagedev/midiin.h
@@ -43,7 +43,7 @@ public:
virtual bool is_reset_on_load() const { return 0; }
virtual const char *file_extensions() const { return "mid"; }
virtual bool core_opens_image_file() const { return FALSE; }
- virtual const option_guide *create_option_guide() const { return NULL; }
+ virtual const option_guide *create_option_guide() const { return nullptr; }
protected:
// device-level overrides
diff --git a/src/devices/imagedev/midiout.cpp b/src/devices/imagedev/midiout.cpp
index 33e6d911294..a8651c40b49 100644
--- a/src/devices/imagedev/midiout.cpp
+++ b/src/devices/imagedev/midiout.cpp
@@ -26,7 +26,7 @@ midiout_device::midiout_device(const machine_config &mconfig, const char *tag, d
: device_t(mconfig, MIDIOUT, "MIDI Out image device", tag, owner, clock, "midiout", __FILE__),
device_image_interface(mconfig, *this),
device_serial_interface(mconfig, *this),
- m_midi(NULL)
+ m_midi(nullptr)
{
}
@@ -36,7 +36,7 @@ midiout_device::midiout_device(const machine_config &mconfig, const char *tag, d
void midiout_device::device_start()
{
- m_midi = NULL;
+ m_midi = nullptr;
}
void midiout_device::device_reset()
@@ -72,7 +72,7 @@ bool midiout_device::call_load(void)
if (!m_midi->open_output(filename()))
{
global_free(m_midi);
- m_midi = NULL;
+ m_midi = nullptr;
return IMAGE_INIT_FAIL;
}
@@ -89,7 +89,7 @@ void midiout_device::call_unload(void)
{
m_midi->close();
global_free(m_midi);
- m_midi = NULL;
+ m_midi = nullptr;
}
}
diff --git a/src/devices/imagedev/midiout.h b/src/devices/imagedev/midiout.h
index 5ac4d7c3ed4..d6da8c732c2 100644
--- a/src/devices/imagedev/midiout.h
+++ b/src/devices/imagedev/midiout.h
@@ -46,7 +46,7 @@ public:
virtual bool is_reset_on_load() const { return 0; }
virtual const char *file_extensions() const { return "mid"; }
virtual bool core_opens_image_file() const { return FALSE; }
- virtual const option_guide *create_option_guide() const { return NULL; }
+ virtual const option_guide *create_option_guide() const { return nullptr; }
virtual void tx(UINT8 state) { rx_w(state); }
diff --git a/src/devices/imagedev/printer.h b/src/devices/imagedev/printer.h
index 8e6ca051fdc..ccd388d6663 100644
--- a/src/devices/imagedev/printer.h
+++ b/src/devices/imagedev/printer.h
@@ -42,7 +42,7 @@ public:
virtual bool must_be_loaded() const { return 0; }
virtual bool is_reset_on_load() const { return 0; }
virtual const char *file_extensions() const { return "prn"; }
- virtual const option_guide *create_option_guide() const { return NULL; }
+ virtual const option_guide *create_option_guide() const { return nullptr; }
// specific implementation
diff --git a/src/devices/imagedev/snapquik.cpp b/src/devices/imagedev/snapquik.cpp
index 81d4049edbb..a3c55ff4064 100644
--- a/src/devices/imagedev/snapquik.cpp
+++ b/src/devices/imagedev/snapquik.cpp
@@ -21,22 +21,22 @@ const device_type SNAPSHOT = &device_creator<snapshot_image_device>;
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SNAPSHOT, "Snapshot", tag, owner, clock, "snapshot_image", __FILE__),
device_image_interface(mconfig, *this),
- m_file_extensions(NULL),
- m_interface(NULL),
+ m_file_extensions(nullptr),
+ m_interface(nullptr),
m_delay_seconds(0),
m_delay_attoseconds(0),
- m_timer(NULL)
+ m_timer(nullptr)
{
}
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_image_interface(mconfig, *this),
- m_file_extensions(NULL),
- m_interface(NULL),
+ m_file_extensions(nullptr),
+ m_interface(nullptr),
m_delay_seconds(0),
m_delay_attoseconds(0),
- m_timer(NULL)
+ m_timer(nullptr)
{
}
//-------------------------------------------------
diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h
index a9e186ba2bd..5ef6f1dc191 100644
--- a/src/devices/imagedev/snapquik.h
+++ b/src/devices/imagedev/snapquik.h
@@ -37,7 +37,7 @@ public:
virtual bool is_reset_on_load() const { return 0; }
virtual const char *image_interface() const { return m_interface; }
virtual const char *file_extensions() const { return m_file_extensions; }
- virtual const option_guide *create_option_guide() const { return NULL; }
+ virtual const option_guide *create_option_guide() const { return nullptr; }
TIMER_CALLBACK_MEMBER(process_snapshot_or_quickload);
void set_handler(snapquick_load_delegate load, const char *ext, seconds_t sec) { m_load = load; m_file_extensions = ext; m_delay_seconds = sec; };