summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/2d_dsk.h6
-rw-r--r--src/lib/formats/a26_cas.cpp4
-rw-r--r--src/lib/formats/a5105_dsk.h6
-rw-r--r--src/lib/formats/abc800_dsk.h6
-rw-r--r--src/lib/formats/abcfd2_dsk.h6
-rw-r--r--src/lib/formats/ace_tap.cpp10
-rw-r--r--src/lib/formats/adam_cas.cpp4
-rw-r--r--src/lib/formats/adam_dsk.h6
-rw-r--r--src/lib/formats/ami_dsk.h16
-rw-r--r--src/lib/formats/ap2_dsk.cpp42
-rw-r--r--src/lib/formats/ap2_dsk.h40
-rw-r--r--src/lib/formats/ap_dsk35.cpp22
-rw-r--r--src/lib/formats/ap_dsk35.h16
-rw-r--r--src/lib/formats/apf_apt.cpp8
-rw-r--r--src/lib/formats/apollo_dsk.h8
-rw-r--r--src/lib/formats/applix_dsk.h6
-rw-r--r--src/lib/formats/apridisk.h16
-rw-r--r--src/lib/formats/asst128_dsk.h6
-rw-r--r--src/lib/formats/atari_dsk.cpp4
-rw-r--r--src/lib/formats/atom_dsk.h6
-rw-r--r--src/lib/formats/atom_tap.cpp2
-rw-r--r--src/lib/formats/basicdsk.cpp6
-rw-r--r--src/lib/formats/bbc_dsk.h46
-rw-r--r--src/lib/formats/bw12_dsk.h6
-rw-r--r--src/lib/formats/bw2_dsk.h6
-rw-r--r--src/lib/formats/c3040_dsk.h14
-rw-r--r--src/lib/formats/c4040_dsk.h12
-rw-r--r--src/lib/formats/c8280_dsk.h6
-rw-r--r--src/lib/formats/camplynx_cas.cpp6
-rw-r--r--src/lib/formats/camplynx_dsk.h6
-rw-r--r--src/lib/formats/cassimg.cpp26
-rw-r--r--src/lib/formats/cbm_tap.cpp12
-rw-r--r--src/lib/formats/ccvf_dsk.cpp2
-rw-r--r--src/lib/formats/ccvf_dsk.h12
-rw-r--r--src/lib/formats/cd90_640_dsk.h6
-rw-r--r--src/lib/formats/cgen_cas.cpp4
-rw-r--r--src/lib/formats/cgenie_dsk.h10
-rw-r--r--src/lib/formats/coco_cas.cpp4
-rw-r--r--src/lib/formats/comx35_dsk.h6
-rw-r--r--src/lib/formats/concept_dsk.h16
-rw-r--r--src/lib/formats/coupedsk.h16
-rw-r--r--src/lib/formats/cpis_dsk.h6
-rw-r--r--src/lib/formats/cqm_dsk.cpp2
-rw-r--r--src/lib/formats/cqm_dsk.h16
-rw-r--r--src/lib/formats/csw_cas.cpp14
-rw-r--r--src/lib/formats/d64_dsk.cpp2
-rw-r--r--src/lib/formats/d64_dsk.h16
-rw-r--r--src/lib/formats/d71_dsk.h6
-rw-r--r--src/lib/formats/d80_dsk.cpp4
-rw-r--r--src/lib/formats/d80_dsk.h18
-rw-r--r--src/lib/formats/d81_dsk.h8
-rw-r--r--src/lib/formats/d82_dsk.h6
-rw-r--r--src/lib/formats/d88_dsk.cpp4
-rw-r--r--src/lib/formats/d88_dsk.h16
-rw-r--r--src/lib/formats/dcp_dsk.cpp2
-rw-r--r--src/lib/formats/dcp_dsk.h12
-rw-r--r--src/lib/formats/dfi_dsk.h12
-rw-r--r--src/lib/formats/dim_dsk.h16
-rw-r--r--src/lib/formats/dip_dsk.cpp2
-rw-r--r--src/lib/formats/dip_dsk.h12
-rw-r--r--src/lib/formats/dmk_dsk.h16
-rw-r--r--src/lib/formats/dmv_dsk.h6
-rw-r--r--src/lib/formats/dsk_dsk.cpp6
-rw-r--r--src/lib/formats/dsk_dsk.h12
-rw-r--r--src/lib/formats/ep64_dsk.h6
-rw-r--r--src/lib/formats/esq16_dsk.h16
-rw-r--r--src/lib/formats/esq8_dsk.h16
-rw-r--r--src/lib/formats/excali64_dsk.h6
-rw-r--r--src/lib/formats/fc100_cas.cpp4
-rw-r--r--src/lib/formats/fdd_dsk.h12
-rw-r--r--src/lib/formats/fdi_dsk.cpp2
-rw-r--r--src/lib/formats/flex_dsk.h12
-rw-r--r--src/lib/formats/flopimg.cpp58
-rw-r--r--src/lib/formats/flopimg.h8
-rw-r--r--src/lib/formats/fm7_cas.cpp4
-rw-r--r--src/lib/formats/fmsx_cas.cpp2
-rw-r--r--src/lib/formats/fmtowns_dsk.h6
-rw-r--r--src/lib/formats/fsd_dsk.cpp180
-rw-r--r--src/lib/formats/fsd_dsk.h43
-rw-r--r--src/lib/formats/g64_dsk.cpp2
-rw-r--r--src/lib/formats/g64_dsk.h16
-rw-r--r--src/lib/formats/gtp_cas.cpp8
-rw-r--r--src/lib/formats/guab_dsk.h6
-rw-r--r--src/lib/formats/hect_dsk.cpp6
-rw-r--r--src/lib/formats/hect_tap.cpp14
-rw-r--r--src/lib/formats/hector_minidisc.h6
-rw-r--r--src/lib/formats/hxcmfm_dsk.h16
-rw-r--r--src/lib/formats/imageutl.cpp2
-rw-r--r--src/lib/formats/imageutl.h8
-rw-r--r--src/lib/formats/imd_dsk.cpp12
-rw-r--r--src/lib/formats/imd_dsk.h12
-rw-r--r--src/lib/formats/ioprocs.cpp4
-rw-r--r--src/lib/formats/ipf_dsk.cpp9
-rw-r--r--src/lib/formats/ipf_dsk.h12
-rw-r--r--src/lib/formats/iq151_dsk.h6
-rw-r--r--src/lib/formats/itt3030_dsk.h6
-rw-r--r--src/lib/formats/jvc_dsk.h16
-rw-r--r--src/lib/formats/kaypro_dsk.h12
-rw-r--r--src/lib/formats/kc85_dsk.h6
-rw-r--r--src/lib/formats/kc_cas.cpp18
-rw-r--r--src/lib/formats/kim1_cas.cpp8
-rw-r--r--src/lib/formats/lviv_lvt.cpp2
-rw-r--r--src/lib/formats/m20_dsk.h16
-rw-r--r--src/lib/formats/m5_dsk.h6
-rw-r--r--src/lib/formats/mbee_cas.cpp4
-rw-r--r--src/lib/formats/mfi_dsk.cpp4
-rw-r--r--src/lib/formats/mfi_dsk.h16
-rw-r--r--src/lib/formats/mfm_hd.h19
-rw-r--r--src/lib/formats/mm_dsk.h12
-rw-r--r--src/lib/formats/msx_dsk.h6
-rw-r--r--src/lib/formats/mz_cas.cpp4
-rw-r--r--src/lib/formats/nanos_dsk.h6
-rw-r--r--src/lib/formats/nascom_dsk.h6
-rw-r--r--src/lib/formats/naslite_dsk.h8
-rw-r--r--src/lib/formats/nes_dsk.cpp4
-rw-r--r--src/lib/formats/nfd_dsk.h12
-rw-r--r--src/lib/formats/orao_cas.cpp8
-rw-r--r--src/lib/formats/oric_dsk.h16
-rw-r--r--src/lib/formats/oric_tap.cpp2
-rw-r--r--src/lib/formats/p6001_cas.cpp4
-rw-r--r--src/lib/formats/pasti_dsk.cpp8
-rw-r--r--src/lib/formats/pasti_dsk.h12
-rw-r--r--src/lib/formats/pc98_dsk.h6
-rw-r--r--src/lib/formats/pc98fdi_dsk.cpp2
-rw-r--r--src/lib/formats/pc98fdi_dsk.h12
-rw-r--r--src/lib/formats/pc_dsk.cpp2
-rw-r--r--src/lib/formats/pc_dsk.h6
-rw-r--r--src/lib/formats/phc25_cas.cpp4
-rw-r--r--src/lib/formats/pk8020_dsk.h6
-rw-r--r--src/lib/formats/pmd_cas.cpp4
-rw-r--r--src/lib/formats/primoptp.cpp2
-rw-r--r--src/lib/formats/pyldin_dsk.h6
-rw-r--r--src/lib/formats/ql_dsk.h6
-rw-r--r--src/lib/formats/rk_cas.cpp18
-rw-r--r--src/lib/formats/rx50_dsk.h16
-rw-r--r--src/lib/formats/sc3000_bit.cpp2
-rw-r--r--src/lib/formats/sf7000_dsk.h6
-rw-r--r--src/lib/formats/smx_dsk.h6
-rw-r--r--src/lib/formats/sol_cas.cpp4
-rw-r--r--src/lib/formats/sorc_cas.cpp4
-rw-r--r--src/lib/formats/sorc_dsk.cpp4
-rw-r--r--src/lib/formats/sord_cas.cpp2
-rw-r--r--src/lib/formats/spc1000_cas.cpp8
-rw-r--r--src/lib/formats/st_dsk.h28
-rw-r--r--src/lib/formats/svi_cas.cpp2
-rw-r--r--src/lib/formats/svi_dsk.h16
-rw-r--r--src/lib/formats/tandy2k_dsk.h6
-rw-r--r--src/lib/formats/td0_dsk.cpp14
-rw-r--r--src/lib/formats/td0_dsk.h14
-rw-r--r--src/lib/formats/thom_cas.cpp12
-rw-r--r--src/lib/formats/thom_dsk.cpp14
-rw-r--r--src/lib/formats/ti99_dsk.h43
-rw-r--r--src/lib/formats/tiki100_dsk.h6
-rw-r--r--src/lib/formats/trd_dsk.h6
-rw-r--r--src/lib/formats/trs80_dsk.h8
-rw-r--r--src/lib/formats/trs_cas.cpp6
-rw-r--r--src/lib/formats/tvc_cas.cpp2
-rw-r--r--src/lib/formats/tvc_dsk.h6
-rw-r--r--src/lib/formats/tzx_cas.cpp38
-rw-r--r--src/lib/formats/uef_cas.cpp18
-rw-r--r--src/lib/formats/upd765_dsk.cpp4
-rw-r--r--src/lib/formats/upd765_dsk.h10
-rw-r--r--src/lib/formats/vdk_dsk.h16
-rw-r--r--src/lib/formats/vector06_dsk.h6
-rw-r--r--src/lib/formats/vg5k_cas.cpp14
-rw-r--r--src/lib/formats/victor9k_dsk.h16
-rw-r--r--src/lib/formats/vt_cas.cpp8
-rw-r--r--src/lib/formats/wd177x_dsk.cpp2
-rw-r--r--src/lib/formats/wd177x_dsk.h8
-rw-r--r--src/lib/formats/x07_cas.cpp4
-rw-r--r--src/lib/formats/x1_tap.cpp2
-rw-r--r--src/lib/formats/xdf_dsk.h6
-rw-r--r--src/lib/formats/zx81_p.cpp4
173 files changed, 1060 insertions, 836 deletions
diff --git a/src/lib/formats/2d_dsk.h b/src/lib/formats/2d_dsk.h
index ab70b95f21a..95ee8dbbf20 100644
--- a/src/lib/formats/2d_dsk.h
+++ b/src/lib/formats/2d_dsk.h
@@ -20,9 +20,9 @@ class _2d_format : public wd177x_format
public:
_2d_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/a26_cas.cpp b/src/lib/formats/a26_cas.cpp
index 557a128a7af..d13b5270b45 100644
--- a/src/lib/formats/a26_cas.cpp
+++ b/src/lib/formats/a26_cas.cpp
@@ -129,7 +129,7 @@ static int a26_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
}
static int a26_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
- return a26_cas_do_work( NULL, casdata );
+ return a26_cas_do_work( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller a26_legacy_fill_wave = {
@@ -160,7 +160,7 @@ static const struct CassetteFormat a26_cassette_format = {
"a26",
a26_cassette_identify,
a26_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(a26_cassette_formats)
diff --git a/src/lib/formats/a5105_dsk.h b/src/lib/formats/a5105_dsk.h
index 6f987a81199..cfe7a2f6a0e 100644
--- a/src/lib/formats/a5105_dsk.h
+++ b/src/lib/formats/a5105_dsk.h
@@ -17,9 +17,9 @@ class a5105_format : public upd765_format {
public:
a5105_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/abc800_dsk.h b/src/lib/formats/abc800_dsk.h
index 96a15d3817e..28d5e5b01ad 100644
--- a/src/lib/formats/abc800_dsk.h
+++ b/src/lib/formats/abc800_dsk.h
@@ -17,9 +17,9 @@ class abc800_format : public wd177x_format {
public:
abc800_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/abcfd2_dsk.h b/src/lib/formats/abcfd2_dsk.h
index a97e46cb5ed..b9eacfb55ba 100644
--- a/src/lib/formats/abcfd2_dsk.h
+++ b/src/lib/formats/abcfd2_dsk.h
@@ -17,9 +17,9 @@ class abc_fd2_format : public wd177x_format {
public:
abc_fd2_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/ace_tap.cpp b/src/lib/formats/ace_tap.cpp
index 3479d6ba1f5..e247b0803d6 100644
--- a/src/lib/formats/ace_tap.cpp
+++ b/src/lib/formats/ace_tap.cpp
@@ -26,7 +26,7 @@ static int cas_size;
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-INLINE int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
+static inline int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
{
int i = 0;
@@ -48,7 +48,7 @@ INLINE int ace_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
}
-INLINE int ace_tap_silence(INT16 *buffer, int sample_pos, int samples)
+static inline int ace_tap_silence(INT16 *buffer, int sample_pos, int samples)
{
int i = 0;
@@ -64,7 +64,7 @@ INLINE int ace_tap_silence(INT16 *buffer, int sample_pos, int samples)
}
-INLINE int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data)
+static inline int ace_tap_byte(INT16 *buffer, int sample_pos, UINT8 data)
{
int i, samples;
@@ -151,7 +151,7 @@ static int ace_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return ace_handle_tap( NULL, casdata );
+ return ace_handle_tap( nullptr, casdata );
}
@@ -184,7 +184,7 @@ static const struct CassetteFormat ace_tap_format =
"tap",
ace_tap_identify,
ace_tap_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/adam_cas.cpp b/src/lib/formats/adam_cas.cpp
index 54d7427242d..644be2cd0cc 100644
--- a/src/lib/formats/adam_cas.cpp
+++ b/src/lib/formats/adam_cas.cpp
@@ -86,7 +86,7 @@ casserr_t coladam_put_byte(cassette_image *cass, int channel, double *time_index
casserr_t coladam_put_block(cassette_image *cass, int channel, double *time_index, int *prev_sign, int block_index, UINT8 *buffer, int layout_type)
{
int i, checksum_16=0;
- UINT8 header[] = { 0x16, 0x48, 0x45, 0x00, block_index, 0xff, (0xff - block_index), 0x00, 0x80, 0xf4 };
+ UINT8 header[] = { 0x16, 0x48, 0x45, 0x00, static_cast<UINT8>(block_index), 0xff, static_cast<UINT8>(0xff - block_index), 0x00, 0x80, 0xf4 };
casserr_t err;
if (layout_type == TYPE_GW)
{
@@ -204,7 +204,7 @@ static casserr_t coladam_ddp_load( cassette_image *cass )
static const struct CassetteFormat coladam_ddp =
-{ "ddp", coladam_ddp_identify, coladam_ddp_load, NULL /* no save */ };
+{ "ddp", coladam_ddp_identify, coladam_ddp_load, nullptr /* no save */ };
CASSETTE_FORMATLIST_START(coleco_adam_cassette_formats)
CASSETTE_FORMAT(coladam_ddp)
diff --git a/src/lib/formats/adam_dsk.h b/src/lib/formats/adam_dsk.h
index 717c81cbe7f..0f378edcb58 100644
--- a/src/lib/formats/adam_dsk.h
+++ b/src/lib/formats/adam_dsk.h
@@ -17,9 +17,9 @@ class adam_format : public wd177x_format {
public:
adam_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/ami_dsk.h b/src/lib/formats/ami_dsk.h
index 9ee86f059cc..f10ac007d71 100644
--- a/src/lib/formats/ami_dsk.h
+++ b/src/lib/formats/ami_dsk.h
@@ -18,14 +18,14 @@ class adf_format : public floppy_image_format_t
public:
adf_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
static UINT32 g32(const UINT8 *trackbuf, int track_size, int pos);
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp
index 885332882f9..774d4785735 100644
--- a/src/lib/formats/ap2_dsk.cpp
+++ b/src/lib/formats/ap2_dsk.cpp
@@ -232,7 +232,7 @@ static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, i
nibble = (UINT8 *)buffer;
nibble += sector * APPLE2_SMALL_NIBBLE_SIZE;
- disk_decode_nib(sector_buffer, nibble, NULL, NULL, NULL);
+ disk_decode_nib(sector_buffer, nibble, nullptr, nullptr, nullptr);
floppy_write_sector(floppy, head, track, sector, 0, sector_buffer, sizeof(sector_buffer), 0);
}
@@ -249,7 +249,7 @@ static FLOPPY_IDENTIFY(apple2_nib_identify)
{
UINT64 size;
size = floppy_image_size(floppy);
- *vote = (size == APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE) ? 100 : 0;
+ *vote = ((size == APPLE2_TRACK_COUNT * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE) || (size == (APPLE2_TRACK_COUNT + 1) * APPLE2_SECTOR_COUNT * APPLE2_NIBBLE_SIZE)) ? 100 : 0;
return FLOPPY_ERROR_SUCCESS;
}
@@ -264,7 +264,7 @@ static FLOPPY_CONSTRUCT(apple2_nib_construct)
static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
{
- if ((head != 0) || (track < 0) || (track >= APPLE2_TRACK_COUNT))
+ if ((head != 0) || (track < 0) || (track > APPLE2_TRACK_COUNT))
return FLOPPY_ERROR_SEEKERROR;
if (offset != 0)
return FLOPPY_ERROR_UNSUPPORTED;
@@ -276,7 +276,7 @@ static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, in
static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
{
- if ((head != 0) || (track < 0) || (track >= APPLE2_TRACK_COUNT))
+ if ((head != 0) || (track < 0) || (track > APPLE2_TRACK_COUNT))
return FLOPPY_ERROR_SEEKERROR;
if (offset != 0)
return FLOPPY_ERROR_UNSUPPORTED;
@@ -376,14 +376,14 @@ static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, i
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, NULL);
+ err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, nullptr);
if (err)
return err;
track_data = (UINT8 *) track_data_v;
nibble = track_data + (sector * APPLE2_NIBBLE_SIZE);
- if (disk_decode_nib((UINT8 *)buffer, nibble, NULL, NULL, NULL))
+ if (disk_decode_nib((UINT8 *)buffer, nibble, nullptr, nullptr, nullptr))
return FLOPPY_ERROR_INVALIDIMAGE;
return FLOPPY_ERROR_SUCCESS;
@@ -465,7 +465,7 @@ static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head,
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, NULL);
+ err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, nullptr);
if (err)
return err;
track_data = (UINT8 *) track_data_v;
@@ -494,19 +494,19 @@ static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int t
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( apple2 )
- LEGACY_FLOPPY_OPTION( apple2_do, "do,dsk,bin", "Apple ][ DOS order disk image", apple2_dsk_identify, apple2_do_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_do, "do,dsk,bin", "Apple ][ DOS order disk image", apple2_dsk_identify, apple2_do_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple2_po, "po,dsk,bin", "Apple ][ ProDOS order disk image", apple2_dsk_identify, apple2_po_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_po, "po,dsk,bin", "Apple ][ ProDOS order disk image", apple2_dsk_identify, apple2_po_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple2_nib, "dsk,nib", "Apple ][ Nibble order disk image", apple2_nib_identify, apple2_nib_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple2_nib, "dsk,nib", "Apple ][ Nibble order disk image", apple2_nib_identify, apple2_nib_construct, nullptr,
HEADS([1])
TRACKS([35])
SECTORS([16])
@@ -535,7 +535,7 @@ static const UINT8 prodos_skewing[] =
};
-a2_16sect_format::a2_16sect_format() : floppy_image_format_t()
+a2_16sect_format::a2_16sect_format() : floppy_image_format_t(), m_prodos_order(false)
{
}
@@ -774,9 +774,9 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image)
#define DATAGOOD 8
// data postamble is good
#define DATAPOST 16
- for (int i = 0; i < 16; i++) {
+ for (auto & elem : visualgrid) {
for (int j = 0; j < 35; j++) {
- visualgrid[i][j] = 0;
+ elem[j] = 0;
}
}
image->get_actual_geometry(g_tracks, g_heads);
@@ -822,8 +822,8 @@ bool a2_16sect_format::save(io_generic *io, floppy_image *image)
if(hb == 4) {
UINT8 h[11];
- for(int i=0; i<11; i++)
- h[i] = gb(buf, ts, pos, wrap);
+ for(auto & elem : h)
+ elem = gb(buf, ts, pos, wrap);
//UINT8 v2 = gcr6bw_tb[h[2]];
UINT8 vl = gcr4_decode(h[0],h[1]);
UINT8 tr = gcr4_decode(h[2],h[3]);
@@ -1140,9 +1140,9 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image)
#define DATAGOOD 8
// data postamble is good
#define DATAPOST 16
- for (int i = 0; i < 18; i++) {
+ for (auto & elem : visualgrid) {
for (int j = 0; j < 35; j++) {
- visualgrid[i][j] = 0;
+ elem[j] = 0;
}
}
image->get_actual_geometry(g_tracks, g_heads);
@@ -1182,8 +1182,8 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image)
if(hb == 4) {
UINT8 h[11];
- for(int i=0; i<11; i++)
- h[i] = gb(buf, ts, pos, wrap);
+ for(auto & elem : h)
+ elem = gb(buf, ts, pos, wrap);
//UINT8 v2 = gcr6bw_tb[h[2]];
UINT8 vl = gcr4_decode(h[0],h[1]);
UINT8 tr = gcr4_decode(h[2],h[3]);
@@ -1345,8 +1345,8 @@ bool a2_rwts18_format::save(io_generic *io, floppy_image *image)
oldpos=pos;
UINT8 h[7];
// grab exactly 7 bytes: should be Track, Sector, Checksum, AA, FF and FF and the Br0derbund Title ID
- for(int i=0; i<7; i++)
- h[i] = gb(buf, ts, pos, wrap);
+ for(auto & elem : h)
+ elem = gb(buf, ts, pos, wrap);
UINT8 tr = gcr6bw_tb[h[0]];
UINT8 se = gcr6bw_tb[h[1]];
UINT8 chk = gcr6bw_tb[h[2]];
diff --git a/src/lib/formats/ap2_dsk.h b/src/lib/formats/ap2_dsk.h
index a5bd53f0926..19e55e05ff0 100644
--- a/src/lib/formats/ap2_dsk.h
+++ b/src/lib/formats/ap2_dsk.h
@@ -39,14 +39,14 @@ class a2_16sect_format : public floppy_image_format_t
public:
a2_16sect_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
static const desc_e mac_gcr[];
@@ -64,14 +64,14 @@ class a2_rwts18_format : public floppy_image_format_t
public:
a2_rwts18_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
static const desc_e mac_gcr[];
@@ -88,13 +88,13 @@ class a2_edd_format : public floppy_image_format_t
public:
a2_edd_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool supports_save() const override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static UINT8 pick(const UINT8 *data, int pos);
diff --git a/src/lib/formats/ap_dsk35.cpp b/src/lib/formats/ap_dsk35.cpp
index 9efd835120d..ff8cef2e08a 100644
--- a/src/lib/formats/ap_dsk35.cpp
+++ b/src/lib/formats/ap_dsk35.cpp
@@ -488,7 +488,7 @@ static UINT32 apple35_get_offset(floppy_image_legacy *floppy, int head, int trac
static floperr_t apple35_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
UINT32 data_offset;
- data_offset = apple35_get_offset(floppy, head, track, sector, NULL);
+ data_offset = apple35_get_offset(floppy, head, track, sector, nullptr);
if (data_offset == ~0)
{
return FLOPPY_ERROR_SEEKERROR;
@@ -503,7 +503,7 @@ static floperr_t apple35_write_sector(floppy_image_legacy *floppy, int head, int
{
UINT32 data_offset;
- data_offset = apple35_get_offset(floppy, head, track, sector, NULL);
+ data_offset = apple35_get_offset(floppy, head, track, sector, nullptr);
if (data_offset == ~0)
return FLOPPY_ERROR_SEEKERROR;
floppy_image_write(floppy, buffer, data_offset, buflen);
@@ -976,7 +976,7 @@ static floperr_t apple35_diskcopy_headerdecode(floppy_image_legacy *floppy, UINT
static FLOPPY_IDENTIFY(apple35_diskcopy_identify)
{
- *vote = apple35_diskcopy_headerdecode(floppy, NULL, NULL, NULL, NULL, NULL, NULL) ? 0 : 100;
+ *vote = apple35_diskcopy_headerdecode(floppy, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) ? 0 : 100;
return FLOPPY_ERROR_SUCCESS;
}
@@ -1121,7 +1121,7 @@ static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, UINT32 *image_
static FLOPPY_IDENTIFY(apple35_2img_identify)
{
- *vote = apple35_2img_decode(floppy, NULL, NULL, NULL) ? 0 : 100;
+ *vote = apple35_2img_decode(floppy, nullptr, nullptr, nullptr) ? 0 : 100;
return FLOPPY_ERROR_SUCCESS;
}
@@ -1175,12 +1175,12 @@ static FLOPPY_CONSTRUCT(apple35_2img_construct)
LEGACY_FLOPPY_OPTIONS_START( apple35_mac )
- LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dc42,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dc42,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
@@ -1188,17 +1188,17 @@ LEGACY_FLOPPY_OPTIONS_START( apple35_mac )
LEGACY_FLOPPY_OPTIONS_END
LEGACY_FLOPPY_OPTIONS_START( apple35_iigs )
- LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image,po", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_raw, "dsk,img,image,po", "Apple raw 3.5\" disk image", apple35_raw_identify, apple35_raw_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_dc, "dc,dsk,img,image", "Apple DiskCopy disk image", apple35_diskcopy_identify, apple35_diskcopy_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
- LEGACY_FLOPPY_OPTION( apple35_2img, "2img,2mg", "Apple ][gs 2IMG disk image", apple35_2img_identify, apple35_2img_construct, NULL,
+ LEGACY_FLOPPY_OPTION( apple35_2img, "2img,2mg", "Apple ][gs 2IMG disk image", apple35_2img_identify, apple35_2img_construct, nullptr,
HEADS([1]-2)
TRACKS([80])
SECTOR_LENGTH([512])
@@ -1410,8 +1410,8 @@ bool dc42_format::save(io_generic *io, floppy_image *image)
if(hb == 4) {
UINT8 h[7];
- for(int i=0; i<7; i++)
- h[i] = gb(buf, ts, pos, wrap);
+ for(auto & elem : h)
+ elem = gb(buf, ts, pos, wrap);
UINT8 v2 = gcr6bw_tb[h[2]];
UINT8 v3 = gcr6bw_tb[h[3]];
UINT8 tr = gcr6bw_tb[h[0]] | (v2 & 1 ? 0x40 : 0x00);
diff --git a/src/lib/formats/ap_dsk35.h b/src/lib/formats/ap_dsk35.h
index 432eed42d8e..533307e2708 100644
--- a/src/lib/formats/ap_dsk35.h
+++ b/src/lib/formats/ap_dsk35.h
@@ -28,14 +28,14 @@ class dc42_format : public floppy_image_format_t
public:
dc42_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
static const desc_e mac_gcr[];
diff --git a/src/lib/formats/apf_apt.cpp b/src/lib/formats/apf_apt.cpp
index b609a109ef6..f1a333f2c77 100644
--- a/src/lib/formats/apf_apt.cpp
+++ b/src/lib/formats/apf_apt.cpp
@@ -172,14 +172,14 @@ static int apf_apt_calculate_size_in_samples(const UINT8 *bytes, int length)
{
apf_image_size = length;
- return apf_apt_handle_cassette(NULL, bytes);
+ return apf_apt_handle_cassette(nullptr, bytes);
}
static int apf_cpf_calculate_size_in_samples(const UINT8 *bytes, int length)
{
apf_image_size = length;
- return apf_cpf_handle_cassette(NULL, bytes);
+ return apf_cpf_handle_cassette(nullptr, bytes);
}
//*********************************************************************************
@@ -210,7 +210,7 @@ static const struct CassetteFormat apf_cpf_format =
"cas,cpf",
apf_cpf_identify,
apf_cpf_load,
- NULL
+ nullptr
};
//*********************************************************************************
@@ -241,7 +241,7 @@ static const struct CassetteFormat apf_apt_format =
"apt",
apf_apt_identify,
apf_apt_load,
- NULL
+ nullptr
};
//*********************************************************************************
diff --git a/src/lib/formats/apollo_dsk.h b/src/lib/formats/apollo_dsk.h
index 05013d79055..51f9eb4aebc 100644
--- a/src/lib/formats/apollo_dsk.h
+++ b/src/lib/formats/apollo_dsk.h
@@ -17,10 +17,10 @@ class apollo_format : public upd765_format {
public:
apollo_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/applix_dsk.h b/src/lib/formats/applix_dsk.h
index 1a833fa55e6..c56213ade74 100644
--- a/src/lib/formats/applix_dsk.h
+++ b/src/lib/formats/applix_dsk.h
@@ -17,9 +17,9 @@ class applix_format : public wd177x_format {
public:
applix_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/apridisk.h b/src/lib/formats/apridisk.h
index 6eb5fc4617e..4faf756fd5a 100644
--- a/src/lib/formats/apridisk.h
+++ b/src/lib/formats/apridisk.h
@@ -20,14 +20,14 @@ class apridisk_format : public floppy_image_format_t
public:
apridisk_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
-
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
private:
static const int APR_HEADER_SIZE = 128;
diff --git a/src/lib/formats/asst128_dsk.h b/src/lib/formats/asst128_dsk.h
index 32b455fa1f7..b19aab50f27 100644
--- a/src/lib/formats/asst128_dsk.h
+++ b/src/lib/formats/asst128_dsk.h
@@ -17,9 +17,9 @@ class asst128_format : public upd765_format {
public:
asst128_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/atari_dsk.cpp b/src/lib/formats/atari_dsk.cpp
index f5ccd03c952..d73cbf8185f 100644
--- a/src/lib/formats/atari_dsk.cpp
+++ b/src/lib/formats/atari_dsk.cpp
@@ -31,7 +31,7 @@ LEGACY_FLOPPY_OPTIONS_START( atari_only )
"Atari floppy disk image",
atari_dsk_identify,
atari_dsk_construct,
- NULL,
- NULL
+ nullptr,
+ nullptr
)
LEGACY_FLOPPY_OPTIONS_END0
diff --git a/src/lib/formats/atom_dsk.h b/src/lib/formats/atom_dsk.h
index 45187205f1c..7f64810e87c 100644
--- a/src/lib/formats/atom_dsk.h
+++ b/src/lib/formats/atom_dsk.h
@@ -9,9 +9,9 @@ class atom_format : public wd177x_format
public:
atom_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/atom_tap.cpp b/src/lib/formats/atom_tap.cpp
index 06d614a10b3..917500eace1 100644
--- a/src/lib/formats/atom_tap.cpp
+++ b/src/lib/formats/atom_tap.cpp
@@ -138,7 +138,7 @@ const struct CassetteFormat atom_tap_format =
"tap",
atom_tap_identify,
atom_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START( atom_cassette_formats )
diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp
index ee3ed133e91..9c08c97cc2b 100644
--- a/src/lib/formats/basicdsk.cpp
+++ b/src/lib/formats/basicdsk.cpp
@@ -184,7 +184,7 @@ static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, in
{
floperr_t err = FLOPPY_ERROR_SUCCESS;
UINT8 local_buffer[512];
- void *alloc_buffer = NULL;
+ void *alloc_buffer = nullptr;
void *buffer;
UINT32 sector_length;
int sector;
@@ -206,7 +206,7 @@ static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, in
}
else
{
- alloc_buffer = NULL;
+ alloc_buffer = nullptr;
buffer = local_buffer;
}
@@ -245,7 +245,7 @@ static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int hea
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/bbc_dsk.h b/src/lib/formats/bbc_dsk.h
index 28bba03e61b..9378a25ec81 100644
--- a/src/lib/formats/bbc_dsk.h
+++ b/src/lib/formats/bbc_dsk.h
@@ -20,12 +20,12 @@ class bbc_dfs_format : public wd177x_format
public:
bbc_dfs_format();
- virtual int find_size(io_generic *io, UINT32 form_factor);
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual int get_image_offset(const format &f, int head, int track);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual int find_size(io_generic *io, UINT32 form_factor) override;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual int get_image_offset(const format &f, int head, int track) override;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
@@ -36,12 +36,12 @@ class bbc_adfs_format : public wd177x_format
public:
bbc_adfs_format();
- virtual int find_size(io_generic *io, UINT32 form_factor);
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual int get_image_offset(const format &f, int head, int track);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual int find_size(io_generic *io, UINT32 form_factor) override;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual int get_image_offset(const format &f, int head, int track) override;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
@@ -52,12 +52,12 @@ class bbc_dos_format : public wd177x_format
public:
bbc_dos_format();
- virtual int find_size(io_generic *io, UINT32 form_factor);
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual int get_image_offset(const format &f, int head, int track);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual int find_size(io_generic *io, UINT32 form_factor) override;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual int get_image_offset(const format &f, int head, int track) override;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
@@ -68,11 +68,11 @@ class bbc_cpm_format : public wd177x_format
public:
bbc_cpm_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual int get_image_offset(const format &f, int head, int track);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual int get_image_offset(const format &f, int head, int track) override;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/bw12_dsk.h b/src/lib/formats/bw12_dsk.h
index c9455463486..ca43914ffb0 100644
--- a/src/lib/formats/bw12_dsk.h
+++ b/src/lib/formats/bw12_dsk.h
@@ -17,9 +17,9 @@ class bw12_format : public upd765_format {
public:
bw12_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/bw2_dsk.h b/src/lib/formats/bw2_dsk.h
index d5fa5c66187..edf184ca4ae 100644
--- a/src/lib/formats/bw2_dsk.h
+++ b/src/lib/formats/bw2_dsk.h
@@ -17,9 +17,9 @@ class bw2_format : public upd765_format {
public:
bw2_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/c3040_dsk.h b/src/lib/formats/c3040_dsk.h
index cbf320273a8..659b2748571 100644
--- a/src/lib/formats/c3040_dsk.h
+++ b/src/lib/formats/c3040_dsk.h
@@ -17,15 +17,15 @@ class c3040_format : public d64_format {
public:
c3040_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
- virtual int get_sectors_per_track(const format &f, int track) { return c3040_sectors_per_track[track]; }
- virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2);
- virtual int get_gap2(const format &f, int head, int track) { return c3040_gap2[track]; }
- virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size);
+ virtual int get_sectors_per_track(const format &f, int track) override { return c3040_sectors_per_track[track]; }
+ virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override;
+ virtual int get_gap2(const format &f, int head, int track) override { return c3040_gap2[track]; }
+ virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override;
static const format file_formats[];
diff --git a/src/lib/formats/c4040_dsk.h b/src/lib/formats/c4040_dsk.h
index 231b961c765..591fcd42925 100644
--- a/src/lib/formats/c4040_dsk.h
+++ b/src/lib/formats/c4040_dsk.h
@@ -17,14 +17,14 @@ class c4040_format : public d64_format {
public:
c4040_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
- virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2);
- virtual int get_gap2(const format &f, int head, int track) { return c4040_gap2[track]; }
- virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size);
+ virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override;
+ virtual int get_gap2(const format &f, int head, int track) override { return c4040_gap2[track]; }
+ virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override;
static const format file_formats[];
diff --git a/src/lib/formats/c8280_dsk.h b/src/lib/formats/c8280_dsk.h
index eed34f5d846..b30ea667241 100644
--- a/src/lib/formats/c8280_dsk.h
+++ b/src/lib/formats/c8280_dsk.h
@@ -17,9 +17,9 @@ class c8280_format : public wd177x_format {
public:
c8280_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/camplynx_cas.cpp b/src/lib/formats/camplynx_cas.cpp
index a525f18d3cb..15ed26c8201 100644
--- a/src/lib/formats/camplynx_cas.cpp
+++ b/src/lib/formats/camplynx_cas.cpp
@@ -150,7 +150,7 @@ static int camplynx_cassette_calculate_size_in_samples(const UINT8 *bytes, int l
{
camplynx_image_size = length;
- return camplynx_handle_cassette(NULL, bytes);
+ return camplynx_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller lynx48k_legacy_fill_wave =
@@ -200,7 +200,7 @@ static const struct CassetteFormat lynx48k_cassette_image_format =
"tap",
lynx48k_cassette_identify,
lynx48k_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat lynx128k_cassette_image_format =
@@ -208,7 +208,7 @@ static const struct CassetteFormat lynx128k_cassette_image_format =
"tap",
lynx128k_cassette_identify,
lynx128k_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(lynx48k_cassette_formats)
diff --git a/src/lib/formats/camplynx_dsk.h b/src/lib/formats/camplynx_dsk.h
index 96efac0b60b..ccbc7015d5b 100644
--- a/src/lib/formats/camplynx_dsk.h
+++ b/src/lib/formats/camplynx_dsk.h
@@ -17,9 +17,9 @@ class camplynx_format : public wd177x_format {
public:
camplynx_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index 3154def299a..a591de070b1 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -100,7 +100,7 @@ static void cassette_finishinit(casserr_t err, cassette_image *cassette, cassett
if (cassette && (err || !outcassette))
{
cassette_close(cassette);
- cassette = NULL;
+ cassette = nullptr;
}
if (outcassette)
*outcassette = cassette;
@@ -133,7 +133,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
formats = cassette_default_formats;
/* create the cassette object */
- cassette = cassette_init(NULL, file, procs, flags);
+ cassette = cassette_init(nullptr, file, procs, flags);
if (!cassette)
{
err = CASSETTE_ERROR_OUTOFMEMORY;
@@ -141,7 +141,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
}
/* identify the image */
- format = NULL;
+ format = nullptr;
for (i = 0; !format && formats[i]; i++)
{
if (good_format(formats[i], extension, flags))
@@ -150,7 +150,7 @@ casserr_t cassette_open_choices(void *file, const struct io_procs *procs, const
memset(&opts, 0, sizeof(opts));
err = format->identify(cassette, &opts);
if (err == CASSETTE_ERROR_INVALIDIMAGE)
- format = NULL;
+ format = nullptr;
else if (err)
goto done;
}
@@ -189,8 +189,8 @@ casserr_t cassette_open(void *file, const struct io_procs *procs,
{
const struct CassetteFormat *formats[2];
formats[0] = format;
- formats[1] = NULL;
- return cassette_open_choices(file, procs, NULL, formats, flags, outcassette);
+ formats[1] = nullptr;
+ return cassette_open_choices(file, procs, nullptr, formats, flags, outcassette);
}
@@ -207,7 +207,7 @@ casserr_t cassette_create(void *file, const struct io_procs *procs, const struct
return CASSETTE_ERROR_INVALIDIMAGE;
/* is this a good format? */
- if (!good_format(format, NULL, flags))
+ if (!good_format(format, nullptr, flags))
return CASSETTE_ERROR_INVALIDIMAGE;
/* normalize arguments */
@@ -278,8 +278,10 @@ void cassette_close(cassette_image *cassette)
{
if ((cassette->flags & CASSETTE_FLAG_DIRTY) && (cassette->flags & CASSETTE_FLAG_SAVEONEXIT))
cassette_save(cassette);
- for (unsigned int i = 0; i < cassette->blocks.size(); i++)
- global_free(cassette->blocks[i]);
+ for (auto & elem : cassette->blocks)
+ {
+ global_free(elem);
+ }
global_free(cassette);
}
}
@@ -374,7 +376,7 @@ static casserr_t compute_manipulation_ranges(cassette_image *cassette, int chann
static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sample, INT32 **ptr)
{
- *ptr = NULL;
+ *ptr = nullptr;
size_t sample_blocknum = (sample / SAMPLES_PER_BLOCK) * cassette->channels + channel;
size_t sample_index = sample % SAMPLES_PER_BLOCK;
@@ -385,7 +387,7 @@ static casserr_t lookup_sample(cassette_image *cassette, int channel, size_t sam
memset(&cassette->blocks[osize], 0, (cassette->blocks.size()-osize)*sizeof(cassette->blocks[0]));
}
- if (cassette->blocks[sample_blocknum] == NULL)
+ if (cassette->blocks[sample_blocknum] == nullptr)
cassette->blocks[sample_blocknum] = global_alloc(sample_block);
sample_block &block = *cassette->blocks[sample_blocknum];
@@ -763,7 +765,7 @@ casserr_t cassette_read_modulated_data(cassette_image *cassette, int channel, do
casserr_t err;
UINT8 buffer_stack[1024];
UINT8 *buffer;
- UINT8 *alloc_buffer = NULL;
+ UINT8 *alloc_buffer = nullptr;
double delta;
double total_displacement = 0.0;
size_t this_length;
diff --git a/src/lib/formats/cbm_tap.cpp b/src/lib/formats/cbm_tap.cpp
index 23b8a8846ed..1293d3c531d 100644
--- a/src/lib/formats/cbm_tap.cpp
+++ b/src/lib/formats/cbm_tap.cpp
@@ -135,7 +135,7 @@ static int len;
/* This in fact gives the number of samples for half of the pulse */
-INLINE int tap_data_to_samplecount(int data, int frequency)
+static inline int tap_data_to_samplecount(int data, int frequency)
{
// return (int) (0.5 * (0.5 + (((double)CBM_WAV_FREQUENCY / frequency) * (double)data))); // MESS TZX formula
return (int) (0.5 * (((double)CBM_WAV_FREQUENCY / frequency) * (double)((data) + 0.5))); // tap2wav formula
@@ -157,7 +157,7 @@ static void toggle_wave_data(void )
static void cbm_output_wave( INT16 **buffer, int length )
{
- if (buffer == NULL)
+ if (buffer == nullptr)
return;
for( ; length > 0; length-- )
@@ -187,7 +187,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
/* int waveamp_high, waveamp_low; */
/* Log .TAP info but only once */
- if (!(buffer == NULL))
+ if (!(buffer == nullptr))
{
LOG_FORMATS("TAP version : %d\n", version);
LOG_FORMATS("Machine type : %d\n", system);
@@ -204,7 +204,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
}
/* is the .tap file corrupted? */
- if ((data == NULL) || (length <= CBM_HEADER_SIZE))
+ if ((data == nullptr) || (length <= CBM_HEADER_SIZE))
return -1;
@@ -321,7 +321,7 @@ static int cbm_tap_do_work( INT16 **buffer, int length, const UINT8 *data )
static int cbm_tap_to_wav_size( const UINT8 *tapdata, int taplen )
{
- int size = cbm_tap_do_work(NULL, taplen, tapdata);
+ int size = cbm_tap_do_work(nullptr, taplen, tapdata);
len = taplen;
return size;
@@ -364,7 +364,7 @@ static const struct CassetteFormat cbm_tap_cassette_format = {
"tap",
cbm_cassette_identify,
cbm_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/ccvf_dsk.cpp b/src/lib/formats/ccvf_dsk.cpp
index 09119a4b632..8e30dcfff33 100644
--- a/src/lib/formats/ccvf_dsk.cpp
+++ b/src/lib/formats/ccvf_dsk.cpp
@@ -109,7 +109,7 @@ bool ccvf_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
if (byteoffs==78720) break;
hex[0]=line[byte * 2];
hex[1]=line[(byte * 2) + 1];
- bytes[byteoffs++] = strtol(hex, NULL, 16);
+ bytes[byteoffs++] = strtol(hex, nullptr, 16);
}
}
start = end + 1;
diff --git a/src/lib/formats/ccvf_dsk.h b/src/lib/formats/ccvf_dsk.h
index 9577c180c24..671b0c0f88c 100644
--- a/src/lib/formats/ccvf_dsk.h
+++ b/src/lib/formats/ccvf_dsk.h
@@ -32,13 +32,13 @@ public:
ccvf_format();
ccvf_format(const format *formats);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool supports_save() const override;
protected:
const format *formats;
diff --git a/src/lib/formats/cd90_640_dsk.h b/src/lib/formats/cd90_640_dsk.h
index ccf80508047..489942788be 100644
--- a/src/lib/formats/cd90_640_dsk.h
+++ b/src/lib/formats/cd90_640_dsk.h
@@ -20,9 +20,9 @@ class cd90_640_format : public wd177x_format
public:
cd90_640_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/cgen_cas.cpp b/src/lib/formats/cgen_cas.cpp
index d9165441618..5cd4c3e1b0e 100644
--- a/src/lib/formats/cgen_cas.cpp
+++ b/src/lib/formats/cgen_cas.cpp
@@ -111,7 +111,7 @@ static int cgenie_cas_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return cgenie_handle_cas( NULL, casdata );
+ return cgenie_handle_cas( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller cgenie_cas_legacy_fill_wave =
@@ -143,7 +143,7 @@ static const struct CassetteFormat cgenie_cas_format =
"cas",
cgenie_cas_identify,
cgenie_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/cgenie_dsk.h b/src/lib/formats/cgenie_dsk.h
index 1eda22404c5..0cd402225d9 100644
--- a/src/lib/formats/cgenie_dsk.h
+++ b/src/lib/formats/cgenie_dsk.h
@@ -20,13 +20,13 @@ class cgenie_format : public wd177x_format
public:
cgenie_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
- virtual int get_track_dam_fm(const format &f, int head, int track);
- virtual int get_track_dam_mfm(const format &f, int head, int track);
+ virtual int get_track_dam_fm(const format &f, int head, int track) override;
+ virtual int get_track_dam_mfm(const format &f, int head, int track) override;
private:
static const format formats[];
diff --git a/src/lib/formats/coco_cas.cpp b/src/lib/formats/coco_cas.cpp
index e70b28d69c0..d9599aa8c5a 100644
--- a/src/lib/formats/coco_cas.cpp
+++ b/src/lib/formats/coco_cas.cpp
@@ -277,7 +277,7 @@ const struct CassetteFormat coco_cas_format =
"cas",
coco_cas_identify,
coco_cas_load,
- NULL
+ nullptr
};
const struct CassetteFormat alice32_cas_format =
@@ -285,7 +285,7 @@ const struct CassetteFormat alice32_cas_format =
"cas,c10,k7",
coco_cas_identify,
alice32_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/comx35_dsk.h b/src/lib/formats/comx35_dsk.h
index 03a298673e5..1dc91806e3c 100644
--- a/src/lib/formats/comx35_dsk.h
+++ b/src/lib/formats/comx35_dsk.h
@@ -17,9 +17,9 @@ class comx35_format : public wd177x_format {
public:
comx35_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/concept_dsk.h b/src/lib/formats/concept_dsk.h
index 171798c0fc6..87444c31ab0 100644
--- a/src/lib/formats/concept_dsk.h
+++ b/src/lib/formats/concept_dsk.h
@@ -18,14 +18,14 @@ class cc525dsdd_format : public floppy_image_format_t
public:
cc525dsdd_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const desc_e cc_9_desc[];
diff --git a/src/lib/formats/coupedsk.h b/src/lib/formats/coupedsk.h
index 9345ded421a..19f2d7ddac5 100644
--- a/src/lib/formats/coupedsk.h
+++ b/src/lib/formats/coupedsk.h
@@ -18,14 +18,14 @@ class mgt_format : public floppy_image_format_t
public:
mgt_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const floppy_image_format_t::desc_e desc_10[];
};
diff --git a/src/lib/formats/cpis_dsk.h b/src/lib/formats/cpis_dsk.h
index 3879c6a17c6..98d303c85fe 100644
--- a/src/lib/formats/cpis_dsk.h
+++ b/src/lib/formats/cpis_dsk.h
@@ -17,9 +17,9 @@ class cpis_format : public upd765_format {
public:
cpis_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/cqm_dsk.cpp b/src/lib/formats/cqm_dsk.cpp
index 5ecf4da3186..ff191aec56c 100644
--- a/src/lib/formats/cqm_dsk.cpp
+++ b/src/lib/formats/cqm_dsk.cpp
@@ -128,7 +128,7 @@ static floperr_t cqm_read_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/cqm_dsk.h b/src/lib/formats/cqm_dsk.h
index e07577c1e4c..48bc8d5521c 100644
--- a/src/lib/formats/cqm_dsk.h
+++ b/src/lib/formats/cqm_dsk.h
@@ -18,14 +18,14 @@ class cqm_format : public floppy_image_format_t
public:
cqm_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_CQM_FORMAT;
diff --git a/src/lib/formats/csw_cas.cpp b/src/lib/formats/csw_cas.cpp
index 94a45edde1f..336a9dde7cd 100644
--- a/src/lib/formats/csw_cas.cpp
+++ b/src/lib/formats/csw_cas.cpp
@@ -110,9 +110,9 @@ static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen )
d_stream.avail_out = 1;
d_stream.total_out=0;
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.data_type=0;
err = inflateInit( &d_stream );
@@ -218,9 +218,9 @@ static int csw_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes )
d_stream.avail_out = 1;
d_stream.total_out=0;
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.data_type=0;
err = inflateInit( &d_stream );
@@ -300,7 +300,7 @@ static const struct CassetteFormat csw_cassette_format = {
"csw",
csw_cassette_identify,
csw_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(csw_cassette_formats)
diff --git a/src/lib/formats/d64_dsk.cpp b/src/lib/formats/d64_dsk.cpp
index 531ce441b99..b637d44c48c 100644
--- a/src/lib/formats/d64_dsk.cpp
+++ b/src/lib/formats/d64_dsk.cpp
@@ -79,7 +79,7 @@ const int d64_format::speed_zone[] =
0, 0 // 41-42
};
-int d64_format::find_size(io_generic *io, UINT32 form_factor)
+int d64_format::find_size(io_generic *io, UINT32 form_factor) const
{
UINT64 size = io_generic_size(io);
for(int i=0; formats[i].sector_count; i++) {
diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h
index ec99a36251b..c5bef4b3313 100644
--- a/src/lib/formats/d64_dsk.h
+++ b/src/lib/formats/d64_dsk.h
@@ -30,14 +30,14 @@ public:
d64_format();
d64_format(const format *formats);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const { return true; }
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override { return true; }
protected:
enum
@@ -58,7 +58,7 @@ protected:
const format *formats;
- int find_size(io_generic *io, UINT32 form_factor);
+ int find_size(io_generic *io, UINT32 form_factor) const;
virtual int get_physical_track(const format &f, int head, int track);
virtual UINT32 get_cell_size(const format &f, int track);
virtual int get_sectors_per_track(const format &f, int track);
diff --git a/src/lib/formats/d71_dsk.h b/src/lib/formats/d71_dsk.h
index 5dc8a356186..eff2cff2c2a 100644
--- a/src/lib/formats/d71_dsk.h
+++ b/src/lib/formats/d71_dsk.h
@@ -17,9 +17,9 @@ class d71_format : public d64_format {
public:
d71_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
static const format formats[];
diff --git a/src/lib/formats/d80_dsk.cpp b/src/lib/formats/d80_dsk.cpp
index 222ef488544..12ea14ad80f 100644
--- a/src/lib/formats/d80_dsk.cpp
+++ b/src/lib/formats/d80_dsk.cpp
@@ -12,11 +12,11 @@
#include "formats/d80_dsk.h"
-d80_format::d80_format() : d64_format(file_formats)
+d80_format::d80_format() : d64_format(file_formats), formats(nullptr)
{
}
-d80_format::d80_format(const format *_formats) : d64_format(_formats)
+d80_format::d80_format(const format *_formats) : d64_format(_formats), formats(nullptr)
{
}
diff --git a/src/lib/formats/d80_dsk.h b/src/lib/formats/d80_dsk.h
index e48984b2322..d823b85a9bc 100644
--- a/src/lib/formats/d80_dsk.h
+++ b/src/lib/formats/d80_dsk.h
@@ -18,19 +18,19 @@ public:
d80_format();
d80_format(const format *formats);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
const format *formats;
- virtual int get_physical_track(const format &f, int head, int track);
- virtual UINT32 get_cell_size(const format &f, int track);
- virtual int get_sectors_per_track(const format &f, int track);
- virtual int get_disk_id_offset(const format &f);
- virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2);
- virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size);
+ virtual int get_physical_track(const format &f, int head, int track) override;
+ virtual UINT32 get_cell_size(const format &f, int track) override;
+ virtual int get_sectors_per_track(const format &f, int track) override;
+ virtual int get_disk_id_offset(const format &f) override;
+ virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int &current_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) override;
+ virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) override;
static const format file_formats[];
diff --git a/src/lib/formats/d81_dsk.h b/src/lib/formats/d81_dsk.h
index 6ea96c70b17..80c95b2a91d 100644
--- a/src/lib/formats/d81_dsk.h
+++ b/src/lib/formats/d81_dsk.h
@@ -17,11 +17,11 @@ class d81_format : public wd177x_format {
public:
d81_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
- virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index);
+ virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index) override;
private:
static const format formats[];
diff --git a/src/lib/formats/d82_dsk.h b/src/lib/formats/d82_dsk.h
index 8753fc62d0c..8919deee775 100644
--- a/src/lib/formats/d82_dsk.h
+++ b/src/lib/formats/d82_dsk.h
@@ -17,9 +17,9 @@ class d82_format : public d80_format {
public:
d82_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
static const format file_formats[];
diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp
index f8383191e6d..b676db7fd21 100644
--- a/src/lib/formats/d88_dsk.cpp
+++ b/src/lib/formats/d88_dsk.cpp
@@ -319,7 +319,7 @@ FLOPPY_IDENTIFY(d88_dsk_identify)
{
UINT32 size;
- d88_get_header(floppy,&size,NULL,NULL,NULL);
+ d88_get_header(floppy,&size,nullptr,nullptr,nullptr);
if(floppy_image_size(floppy) == size)
{
@@ -517,7 +517,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += size;
} else
- sects[i].data = NULL;
+ sects[i].data = nullptr;
}
build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size));
diff --git a/src/lib/formats/d88_dsk.h b/src/lib/formats/d88_dsk.h
index 5b12f8eb600..2ab8db763f6 100644
--- a/src/lib/formats/d88_dsk.h
+++ b/src/lib/formats/d88_dsk.h
@@ -19,14 +19,14 @@ class d88_format : public floppy_image_format_t
public:
d88_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_D88_FORMAT;
diff --git a/src/lib/formats/dcp_dsk.cpp b/src/lib/formats/dcp_dsk.cpp
index fa805979d7b..4e2c305e6f6 100644
--- a/src/lib/formats/dcp_dsk.cpp
+++ b/src/lib/formats/dcp_dsk.cpp
@@ -205,7 +205,7 @@ bool dcp_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666;
int ssize;
- for (ssize = 0; (128 << ssize) < bps; ssize++);
+ for (ssize = 0; (128 << ssize) < bps; ssize++) {};
desc_pc_sector sects[256];
UINT8 sect_data[65536];
diff --git a/src/lib/formats/dcp_dsk.h b/src/lib/formats/dcp_dsk.h
index d6e169809cf..92e447741f5 100644
--- a/src/lib/formats/dcp_dsk.h
+++ b/src/lib/formats/dcp_dsk.h
@@ -19,13 +19,13 @@ class dcp_format : public floppy_image_format_t
public:
dcp_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DCP_FORMAT;
diff --git a/src/lib/formats/dfi_dsk.h b/src/lib/formats/dfi_dsk.h
index 72de8695ae2..b25278275f3 100644
--- a/src/lib/formats/dfi_dsk.h
+++ b/src/lib/formats/dfi_dsk.h
@@ -10,14 +10,14 @@ class dfi_format : public floppy_image_format_t
public:
dfi_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
// virtual bool save(io_generic *io, floppy_image *image);
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DFI_FORMAT;
diff --git a/src/lib/formats/dim_dsk.h b/src/lib/formats/dim_dsk.h
index c7d4cea0d34..54f84aff471 100644
--- a/src/lib/formats/dim_dsk.h
+++ b/src/lib/formats/dim_dsk.h
@@ -24,14 +24,14 @@ class dim_format : public floppy_image_format_t
public:
dim_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DIM_FORMAT;
diff --git a/src/lib/formats/dip_dsk.cpp b/src/lib/formats/dip_dsk.cpp
index e7c7aa072e9..9e6570f8071 100644
--- a/src/lib/formats/dip_dsk.cpp
+++ b/src/lib/formats/dip_dsk.cpp
@@ -61,7 +61,7 @@ bool dip_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666;
int ssize;
- for (ssize = 0; (128 << ssize) < bps; ssize++);
+ for (ssize = 0; (128 << ssize) < bps; ssize++) {};
desc_pc_sector sects[256];
UINT8 sect_data[65536];
diff --git a/src/lib/formats/dip_dsk.h b/src/lib/formats/dip_dsk.h
index e2ca876dff0..dba5e4afee9 100644
--- a/src/lib/formats/dip_dsk.h
+++ b/src/lib/formats/dip_dsk.h
@@ -19,13 +19,13 @@ class dip_format : public floppy_image_format_t
public:
dip_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DIP_FORMAT;
diff --git a/src/lib/formats/dmk_dsk.h b/src/lib/formats/dmk_dsk.h
index f89fed8f95d..5a2f2f6cb7c 100644
--- a/src/lib/formats/dmk_dsk.h
+++ b/src/lib/formats/dmk_dsk.h
@@ -20,14 +20,14 @@ class dmk_format : public floppy_image_format_t
public:
dmk_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DMK_FORMAT;
diff --git a/src/lib/formats/dmv_dsk.h b/src/lib/formats/dmv_dsk.h
index 31551ffc627..022a6e1e489 100644
--- a/src/lib/formats/dmv_dsk.h
+++ b/src/lib/formats/dmv_dsk.h
@@ -17,9 +17,9 @@ class dmv_format : public upd765_format {
public:
dmv_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp
index 6922071de25..4987a5bb52b 100644
--- a/src/lib/formats/dsk_dsk.cpp
+++ b/src/lib/formats/dsk_dsk.cpp
@@ -162,7 +162,7 @@ static floperr_t dsk_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -179,7 +179,7 @@ static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int he
UINT8 sector_info[0x100];
int pos;
- retVal = get_offset(floppy, head, track, sector_index, FALSE, NULL);
+ retVal = get_offset(floppy, head, track, sector_index, FALSE, nullptr);
offset = dsk_get_track_offset(floppy,head,track);
pos = 0x18 + (sector_index << 3);
floppy_image_read(floppy, sector_info, offset, 0x100);
@@ -419,7 +419,7 @@ bool dsk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += sects[j].actual_size;
} else
- sects[j].data = NULL;
+ sects[j].data = nullptr;
if(extendformat)
pos += sector.data_length;
diff --git a/src/lib/formats/dsk_dsk.h b/src/lib/formats/dsk_dsk.h
index d92784f78e8..fc27c0c5030 100644
--- a/src/lib/formats/dsk_dsk.h
+++ b/src/lib/formats/dsk_dsk.h
@@ -18,13 +18,13 @@ class dsk_format : public floppy_image_format_t
public:
dsk_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_DSK_FORMAT;
diff --git a/src/lib/formats/ep64_dsk.h b/src/lib/formats/ep64_dsk.h
index e6e3fdda21a..47d05594964 100644
--- a/src/lib/formats/ep64_dsk.h
+++ b/src/lib/formats/ep64_dsk.h
@@ -17,9 +17,9 @@ class ep64_format : public wd177x_format {
public:
ep64_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/esq16_dsk.h b/src/lib/formats/esq16_dsk.h
index caf02f7995d..696db98345c 100644
--- a/src/lib/formats/esq16_dsk.h
+++ b/src/lib/formats/esq16_dsk.h
@@ -20,14 +20,14 @@ class esqimg_format : public floppy_image_format_t
public:
esqimg_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const desc_e esq_10_desc[];
diff --git a/src/lib/formats/esq8_dsk.h b/src/lib/formats/esq8_dsk.h
index 4646fcc225c..5fb998bf3b0 100644
--- a/src/lib/formats/esq8_dsk.h
+++ b/src/lib/formats/esq8_dsk.h
@@ -22,14 +22,14 @@ class esq8img_format : public floppy_image_format_t
public:
esq8img_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const desc_e esq_6_desc[];
diff --git a/src/lib/formats/excali64_dsk.h b/src/lib/formats/excali64_dsk.h
index b25698a3ffa..c2800d18875 100644
--- a/src/lib/formats/excali64_dsk.h
+++ b/src/lib/formats/excali64_dsk.h
@@ -17,9 +17,9 @@ class excali64_format : public wd177x_format {
public:
excali64_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/fc100_cas.cpp b/src/lib/formats/fc100_cas.cpp
index 415d3fb01db..01986e789bf 100644
--- a/src/lib/formats/fc100_cas.cpp
+++ b/src/lib/formats/fc100_cas.cpp
@@ -119,7 +119,7 @@ static int fc100_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
fc100_image_size = length;
- return fc100_handle_cassette(NULL, bytes);
+ return fc100_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller fc100_legacy_fill_wave =
@@ -148,7 +148,7 @@ static const struct CassetteFormat fc100_cassette_image_format =
"cas",
fc100_cassette_identify,
fc100_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(fc100_cassette_formats)
diff --git a/src/lib/formats/fdd_dsk.h b/src/lib/formats/fdd_dsk.h
index 9e43479565e..6a7faa57669 100644
--- a/src/lib/formats/fdd_dsk.h
+++ b/src/lib/formats/fdd_dsk.h
@@ -19,13 +19,13 @@ class fdd_format : public floppy_image_format_t
public:
fdd_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_FDD_FORMAT;
diff --git a/src/lib/formats/fdi_dsk.cpp b/src/lib/formats/fdi_dsk.cpp
index 05d3d7807b7..b766671ecb8 100644
--- a/src/lib/formats/fdi_dsk.cpp
+++ b/src/lib/formats/fdi_dsk.cpp
@@ -131,7 +131,7 @@ struct fdi_pulse_track_header
INLINE FUNCTIONS
***************************************************************************/
-INLINE struct fdidsk_tag *get_tag(floppy_image_legacy *floppy)
+static inline struct fdidsk_tag *get_tag(floppy_image_legacy *floppy)
{
return (fdidsk_tag *)floppy_tag(floppy);
}
diff --git a/src/lib/formats/flex_dsk.h b/src/lib/formats/flex_dsk.h
index 95a03a78f15..bade0115c56 100644
--- a/src/lib/formats/flex_dsk.h
+++ b/src/lib/formats/flex_dsk.h
@@ -15,12 +15,12 @@ class flex_format : public floppy_image_format_t {
public:
flex_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool supports_save() const override;
private:
struct sysinfo_sector
diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp
index e66df68cdbc..f8cf7c83780 100644
--- a/src/lib/formats/flopimg.cpp
+++ b/src/lib/formats/flopimg.cpp
@@ -81,11 +81,11 @@ static floppy_image_legacy *floppy_init(void *fp, const struct io_procs *procs,
floppy = (floppy_image_legacy *)malloc(sizeof(floppy_image_legacy));
if (!floppy)
- return NULL;
+ return nullptr;
memset(floppy, 0, sizeof(*floppy));
- floppy->tags = pool_alloc_lib(NULL);
- floppy->tag_data = NULL;
+ floppy->tags = pool_alloc_lib(nullptr);
+ floppy->tag_data = nullptr;
floppy->io.file = fp;
floppy->io.procs = procs;
floppy->io.filler = 0xFF;
@@ -151,7 +151,7 @@ static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, co
if (outfloppy)
{
/* call the format constructor */
- err = floppy_options[best_option].construct(floppy, &floppy_options[best_option], NULL);
+ err = floppy_options[best_option].construct(floppy, &floppy_options[best_option], nullptr);
if (err)
goto done;
@@ -168,7 +168,7 @@ done:
if (floppy && (!outfloppy || err))
{
floppy_close_internal(floppy, FALSE);
- floppy = NULL;
+ floppy = nullptr;
}
if (outoption)
@@ -183,7 +183,7 @@ done:
floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *formats, int *identified_format)
{
- return floppy_open_internal(fp, procs, extension, formats, INT_MAX, FLOPPY_FLAGS_READONLY, NULL, identified_format);
+ return floppy_open_internal(fp, procs, extension, formats, INT_MAX, FLOPPY_FLAGS_READONLY, nullptr, identified_format);
}
@@ -191,7 +191,7 @@ floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *ex
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy)
{
- return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, NULL);
+ return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, nullptr);
}
@@ -199,7 +199,7 @@ floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extens
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension,
const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy)
{
- return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, NULL);
+ return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, nullptr);
}
@@ -231,11 +231,11 @@ static floperr_t option_to_floppy_error(optreserr_t oerr)
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image_legacy **outfloppy)
{
- floppy_image_legacy *floppy = NULL;
+ floppy_image_legacy *floppy = nullptr;
optreserr_t oerr;
floperr_t err;
int heads, tracks, h, t;
- option_resolution *alloc_resolution = NULL;
+ option_resolution *alloc_resolution = nullptr;
assert(format);
@@ -307,7 +307,7 @@ done:
if (err && floppy)
{
floppy_close_internal(floppy, FALSE);
- floppy = NULL;
+ floppy = nullptr;
}
if (outfloppy)
@@ -474,7 +474,7 @@ static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head,
{
/* find out the size of this sector */
if (indexed)
- err = fmt->get_indexed_sector_info(floppy, head, track, sector, NULL, NULL, NULL, &sector_length, NULL);
+ err = fmt->get_indexed_sector_info(floppy, head, track, sector, nullptr, nullptr, nullptr, &sector_length, nullptr);
else
err = fmt->get_sector_length(floppy, head, track, sector, &sector_length);
if (err)
@@ -683,7 +683,7 @@ floperr_t floppy_format_track(floppy_image_legacy *floppy, int head, int track,
{
floperr_t err;
struct FloppyCallbacks *format;
- option_resolution *alloc_resolution = NULL;
+ option_resolution *alloc_resolution = nullptr;
optreserr_t oerr;
/* supported? */
@@ -785,7 +785,7 @@ floperr_t floppy_get_sector_count(floppy_image_legacy *floppy, int head, int tra
do
{
- err = floppy_get_indexed_sector_info(floppy, head, track, sector_index, NULL, NULL, NULL, NULL, NULL);
+ err = floppy_get_indexed_sector_info(floppy, head, track, sector_index, nullptr, nullptr, nullptr, nullptr, nullptr);
if (!err)
sector_index++;
}
@@ -867,7 +867,7 @@ floperr_t floppy_load_track(floppy_image_legacy *floppy, int head, int track, in
error:
if (track_data)
- *track_data = NULL;
+ *track_data = nullptr;
if (track_length)
*track_length = 0;
return err;
@@ -923,7 +923,7 @@ const char *floppy_error(floperr_t err)
};
if ((err < 0) || (err >= ARRAY_LENGTH(error_messages)))
- return NULL;
+ return nullptr;
return error_messages[err];
}
@@ -958,7 +958,7 @@ floppy_image::~floppy_image()
{
}
-void floppy_image::get_maximal_geometry(int &_tracks, int &_heads)
+void floppy_image::get_maximal_geometry(int &_tracks, int &_heads) const
{
_tracks = tracks;
_heads = heads;
@@ -1017,7 +1017,7 @@ const char *floppy_image::get_variant_name(UINT32 form_factor, UINT32 variant)
floppy_image_format_t::floppy_image_format_t()
{
- next = 0;
+ next = nullptr;
}
floppy_image_format_t::~floppy_image_format_t()
@@ -1097,7 +1097,7 @@ bool floppy_image_format_t::type_data_mfm(int type, int p1, const gen_crc_info *
(type == CRC && (crcs[p1].type == CRC_CCITT || crcs[p1].type == CRC_AMIGA));
}
-void floppy_image_format_t::collect_crcs(const desc_e *desc, gen_crc_info *crcs)
+void floppy_image_format_t::collect_crcs(const desc_e *desc, gen_crc_info *crcs) const
{
memset(crcs, 0, MAX_CRC_COUNT * sizeof(*crcs));
for(int i=0; i != MAX_CRC_COUNT; i++)
@@ -1134,7 +1134,7 @@ void floppy_image_format_t::collect_crcs(const desc_e *desc, gen_crc_info *crcs)
for(int i=0; desc[i].type != END; i++)
if(desc[i].type == CRC) {
int j;
- for(j = i+1; desc[j].type != END && type_no_data(desc[j].type); j++);
+ for(j = i+1; desc[j].type != END && type_no_data(desc[j].type); j++) {};
crcs[desc[i].p1].fixup_mfm_clock = type_data_mfm(desc[j].type, desc[j].p1, crcs);
}
}
@@ -1545,7 +1545,7 @@ void floppy_image_format_t::generate_track(const desc_e *desc, int track, int he
case SIZE_ID: {
int size = sect[sector_idx].size;
int id;
- for(id = 0; size > 128; size >>=1, id++);
+ for(id = 0; size > 128; size >>=1, id++) {};
mfm_w(buffer, 8, id);
break;
}
@@ -1553,7 +1553,7 @@ void floppy_image_format_t::generate_track(const desc_e *desc, int track, int he
case SIZE_ID_FM: {
int size = sect[sector_idx].size;
int id;
- for(id = 0; size > 128; size >>=1, id++);
+ for(id = 0; size > 128; size >>=1, id++) {};
fm_w(buffer, 8, id);
break;
}
@@ -1763,8 +1763,8 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, std:
// Also check if all MG values are valid
int transition_count = 0;
- for(unsigned int i=0; i<trackbuf.size(); i++) {
- switch(trackbuf[i] & floppy_image::MG_MASK) {
+ for(auto & elem : trackbuf) {
+ switch(elem & floppy_image::MG_MASK) {
case MG_1:
transition_count++;
break;
@@ -1809,9 +1809,9 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, std:
UINT32 cbit = floppy_image::MG_A;
UINT32 count = 0;
- for(unsigned int i=0; i<trackbuf.size(); i++) {
- UINT32 bit = trackbuf[i] & floppy_image::MG_MASK;
- UINT32 time = trackbuf[i] & floppy_image::TIME_MASK;
+ for(auto & elem : trackbuf) {
+ UINT32 bit = elem & floppy_image::MG_MASK;
+ UINT32 time = elem & floppy_image::TIME_MASK;
if(bit == MG_0) {
count += time;
continue;
@@ -1824,7 +1824,7 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, std:
continue;
}
dest.push_back(cbit | count);
- dest.push_back(trackbuf[i]);
+ dest.push_back(elem);
count = 0;
}
@@ -2184,7 +2184,7 @@ const floppy_image_format_t::desc_e *floppy_image_format_t::atari_st_fcp_get_des
case 11:
return atari_st_fcp_11;
}
- return 0;
+ return nullptr;
}
// Amiga layouts
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index c3e42c5c96d..0f8c1a605a9 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -607,7 +607,7 @@ private:
void fixup_crc_victor_header(std::vector<UINT32> &buffer, const gen_crc_info *crc);
void fixup_crc_victor_data(std::vector<UINT32> &buffer, const gen_crc_info *crc);
void fixup_crcs(std::vector<UINT32> &buffer, gen_crc_info *crcs);
- void collect_crcs(const desc_e *desc, gen_crc_info *crcs);
+ void collect_crcs(const desc_e *desc, gen_crc_info *crcs) const;
int sbit_r(const UINT8 *bitstream, int pos);
int sbit_rp(const UINT8 *bitstream, int &pos, int track_size);
@@ -721,9 +721,9 @@ public:
virtual ~floppy_image();
//! @return the form factor.
- UINT32 get_form_factor() { return form_factor; }
+ UINT32 get_form_factor() const { return form_factor; }
//! @return the variant.
- UINT32 get_variant() { return variant; }
+ UINT32 get_variant() const { return variant; }
//! @param v the variant.
void set_variant(UINT32 v) { variant = v; }
@@ -751,7 +751,7 @@ public:
//! @return the current write splice position.
UINT32 get_write_splice_position(int track, int head, int subtrack = 0) const { return track_array[track*4+subtrack][head].write_splice; }
//! @return the maximal geometry supported by this format.
- void get_maximal_geometry(int &tracks, int &heads);
+ void get_maximal_geometry(int &tracks, int &heads) const;
//! @return the current geometry of the loaded image.
void get_actual_geometry(int &tracks, int &heads);
diff --git a/src/lib/formats/fm7_cas.cpp b/src/lib/formats/fm7_cas.cpp
index b1ce8f397b4..52892fdea2e 100644
--- a/src/lib/formats/fm7_cas.cpp
+++ b/src/lib/formats/fm7_cas.cpp
@@ -65,7 +65,7 @@ static int fm7_cas_to_wav_size (const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return fm7_handle_t77(NULL,casdata);
+ return fm7_handle_t77(nullptr,casdata);
}
/*******************************************************************
@@ -104,7 +104,7 @@ static const struct CassetteFormat fm7_cassette_format = {
"t77",
fm7_cas_identify,
fm7_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(fm7_cassette_formats)
diff --git a/src/lib/formats/fmsx_cas.cpp b/src/lib/formats/fmsx_cas.cpp
index 10a26d2e232..c135880dc79 100644
--- a/src/lib/formats/fmsx_cas.cpp
+++ b/src/lib/formats/fmsx_cas.cpp
@@ -136,7 +136,7 @@ static const struct CassetteFormat fmsx_cas_format =
"tap,cas",
fmsx_cas_identify,
fmsx_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/fmtowns_dsk.h b/src/lib/formats/fmtowns_dsk.h
index ae11ef78961..4bf20990ec9 100644
--- a/src/lib/formats/fmtowns_dsk.h
+++ b/src/lib/formats/fmtowns_dsk.h
@@ -15,9 +15,9 @@ class fmtowns_format : public wd177x_format {
public:
fmtowns_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/fsd_dsk.cpp b/src/lib/formats/fsd_dsk.cpp
new file mode 100644
index 00000000000..bed5a780275
--- /dev/null
+++ b/src/lib/formats/fsd_dsk.cpp
@@ -0,0 +1,180 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro 8271 protected disk image format
+
+ Disk image format
+
+***************************************************************************/
+
+#include "emu.h"
+#include "fsd_dsk.h"
+
+
+/*********************************************************************
+
+ BBC Micro 8271 protected disk image format
+
+ Header:
+ =======
+ Identifier: "FSD" string literal 3 bytes
+ Creator: 5 bytes; date of creation/author
+ Title: Character string (unlimited length; may contain any but null)
+ Title_End: 0x00 byte literal 1 byte
+ Num_Tr: xx 1 byte, number of tracks
+
+ For each track
+ ==============
+ track_num: 1 byte
+ num_sec: 1 byte (00 == unformatted)
+ readable: 1 byte (00 == unreadable, ff ==readable)
+
+ If readable:
+ For each sector
+ ===============
+ Track_ID: 1 byte
+ Head_number: 1 byte
+ Sector_ID: 1 byte
+ reported_size: 1 byte (2^{7+x}; 0 ==>128, 1 ==> 256, 2==>512, 3==>1024 etc)
+ real_size: 1 byte (2^{7+x})
+ error_code: 1 byte (0==No Error, &20==Deleted Data; &0E = Data CRC Error)
+ data: <real_size> bytes
+ Note that error_code matches the OSWORD &7F result byte
+
+ If unreadable:
+ Track_ID: 1 byte
+ Head_number: 1 byte
+ Sector_ID: 1 byte
+ reported_size: 1 byte
+
+ Decoding of the "creator" 5 byte field:
+ =======================================
+ (byte1 byte2 byte3 byte4 byte5)
+
+ Date_DD = (byte1 AND &F8)/8
+ Date_MM = (byte3 AND &0F)
+ Date_YYYY = (byte1 AND &07)*256+byte2
+ Creator_ID = (byte3 AND &F0)/16
+ Release_num = ((byte5 AND &C0)/64)*256 + byte4
+
+*********************************************************************/
+
+fsd_format::fsd_format()
+{
+}
+
+const char *fsd_format::name() const
+{
+ return "fsd";
+}
+
+const char *fsd_format::description() const
+{
+ return "BBC Micro 8271 protected disk image";
+}
+
+const char *fsd_format::extensions() const
+{
+ return "fsd";
+}
+
+bool fsd_format::supports_save() const
+{
+ return false;
+}
+
+int fsd_format::identify(io_generic *io, UINT32 form_factor)
+{
+ UINT8 h[3];
+
+ io_generic_read(io, h, 0, 3);
+ if (memcmp(h, "FSD", 3) == 0) {
+ return 100;
+ }
+ return 0;
+}
+
+bool fsd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
+{
+ UINT64 size = io_generic_size(io);
+ dynamic_buffer img(size);
+ io_generic_read(io, &img[0], 0, size);
+
+ UINT64 pos;
+ std::string title;
+ for(pos=8; pos < size && img[pos] != '\0'; pos++)
+ title += char(img[pos]);
+ pos++;
+
+ if(pos >= size)
+ return false;
+
+ //popmessage("Loading image of '%s'\n", title);
+
+ desc_pc_sector sects[10];
+ UINT8 total_tracks = img[pos++];
+ UINT8 tnum, hnum, snum, ssize, error;
+
+ hnum = 0;
+ //osd_printf_verbose("%d Tracks\n", total_tracks+1);
+ //osd_printf_verbose("Tr.# No.S Sec.# Tr.ID Head# SecID IDsiz REsiz Error\n");
+ for(int curr_track=0; curr_track <= total_tracks; curr_track++)
+ {
+ UINT8 track = img[pos++];
+ UINT8 spt = img[pos++];
+ //osd_printf_verbose("%x %x\n", track, spt);
+ if (spt > 0) // formatted
+ {
+ UINT8 readable = img[pos++];
+ for (int i = 0; i < spt; i++)
+ {
+ tnum = img[pos++]; // logical track
+ hnum = img[pos++]; // head number
+ snum = img[pos++]; // logical sector
+ ssize = img[pos++]; // reported size
+ sects[i].track = tnum;
+ sects[i].head = hnum;
+ sects[i].sector = snum;
+ sects[i].size = ssize;
+ if (readable == 0xff)
+ {
+ sects[i].actual_size = 1 << (img[pos++] + 7);
+ error = img[pos++];
+ sects[i].deleted = (error & 0x20) == 0x20;
+ sects[i].bad_crc = (error & 0x0e) == 0x0e;
+ sects[i].data = &img[pos];
+ pos += sects[i].actual_size;
+ //osd_printf_verbose("Read %x %x %x %x %x %x %x\n", i, sects[i].track, sects[i].head, sects[i].sector, sects[i].size, sects[i].actual_size, error);
+ }
+ else
+ {
+ throw emu_fatalerror("fsd_format: Unsupported unreadable sector on track %d sector %d head %d", track, i, hnum);
+
+ // Unreadable sectors not supported!!
+ //sects[i].track = track;
+ //sects[i].head = 0;
+ //sects[i].sector = i;
+ //sects[i].size = 0;
+ //sects[i].actual_size = 0;
+ //sects[i].deleted = false;
+ //sects[i].bad_crc = false;
+ //sects[i].data = NULL;
+ //osd_printf_verbose("Unread %x %x %x %x %x %x %x\n", i, sects[i].track, sects[i].head, sects[i].sector, sects[i].size, sects[i].actual_size, 0);
+ }
+ }
+ }
+ else // unformatted
+ {
+ sects[0].track = curr_track;
+ sects[0].head = hnum;
+ sects[0].sector = 0;
+ sects[0].size = 0;
+ //osd_printf_verbose("Unform %x %x %x %x %x %x %x\n", 0, sects[0].track, sects[0].head, sects[0].sector, sects[0].size, sects[0].actual_size, 0);
+ }
+ build_wd_track_fm(curr_track, hnum, image, 50000, spt, sects, 10, 40, 10);
+ }
+ return true;
+}
+
+const floppy_format_type FLOPPY_FSD_FORMAT = &floppy_image_format_creator<fsd_format>;
diff --git a/src/lib/formats/fsd_dsk.h b/src/lib/formats/fsd_dsk.h
new file mode 100644
index 00000000000..fdfb6fb3d27
--- /dev/null
+++ b/src/lib/formats/fsd_dsk.h
@@ -0,0 +1,43 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes
+/***************************************************************************
+
+ BBC Micro
+
+ Disk image formats
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __FSD_DSK_H__
+#define __FSD_DSK_H__
+
+#include "flopimg.h"
+#include "wd177x_dsk.h"
+
+/**************************************************************************/
+
+LEGACY_FLOPPY_OPTIONS_EXTERN(fsd);
+
+/**************************************************************************/
+
+
+
+class fsd_format : public floppy_image_format_t
+{
+public:
+ fsd_format();
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+};
+
+extern const floppy_format_type FLOPPY_FSD_FORMAT;
+
+#endif // __FSD_DSK_H__
diff --git a/src/lib/formats/g64_dsk.cpp b/src/lib/formats/g64_dsk.cpp
index 6cbb345adc8..e85b5c34682 100644
--- a/src/lib/formats/g64_dsk.cpp
+++ b/src/lib/formats/g64_dsk.cpp
@@ -108,7 +108,7 @@ bool g64_format::save(io_generic *io, floppy_image *image)
tracks = TRACK_COUNT * heads;
// write header
- UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, tracks, TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 };
+ UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, static_cast<UINT8>(tracks), TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 };
io_generic_write(io, header, POS_SIGNATURE, sizeof(header));
// write tracks
diff --git a/src/lib/formats/g64_dsk.h b/src/lib/formats/g64_dsk.h
index f7f06548ede..ddc12636b7e 100644
--- a/src/lib/formats/g64_dsk.h
+++ b/src/lib/formats/g64_dsk.h
@@ -18,14 +18,14 @@ class g64_format : public floppy_image_format_t {
public:
g64_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const { return true; }
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override { return true; }
protected:
enum
diff --git a/src/lib/formats/gtp_cas.cpp b/src/lib/formats/gtp_cas.cpp
index 1711a0a76b5..4cdb546ea6b 100644
--- a/src/lib/formats/gtp_cas.cpp
+++ b/src/lib/formats/gtp_cas.cpp
@@ -33,7 +33,7 @@ static INT16 len;
static void gtp_output_wave( INT16 **buffer, int length ) {
- if ( buffer == NULL ) {
+ if ( buffer == nullptr ) {
return;
}
@@ -111,7 +111,7 @@ static int gtp_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int size,n;
size = 0;
n = 0;
- if (casdata == NULL) return -1;
+ if (casdata == nullptr) return -1;
while(n<caslen) {
int block_type = casdata[n];
int block_size = casdata[n+2]*256 + casdata[n+1];
@@ -132,7 +132,7 @@ static int gtp_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
int i,size,n;
size = 0;
n = 0;
- if (bytes == NULL) return -1;
+ if (bytes == nullptr) return -1;
while(n<len)
{
int block_type = bytes[n];
@@ -192,7 +192,7 @@ static const struct CassetteFormat gtp_cassette_format = {
"gtp",
gtp_cassette_identify,
gtp_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/guab_dsk.h b/src/lib/formats/guab_dsk.h
index 36280ddd88f..3fe6e2a670e 100644
--- a/src/lib/formats/guab_dsk.h
+++ b/src/lib/formats/guab_dsk.h
@@ -20,9 +20,9 @@ class guab_format : public wd177x_format
public:
guab_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/hect_dsk.cpp b/src/lib/formats/hect_dsk.cpp
index 8dfe445e6e4..4cd36008540 100644
--- a/src/lib/formats/hect_dsk.cpp
+++ b/src/lib/formats/hect_dsk.cpp
@@ -94,7 +94,7 @@ static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct)
}
LEGACY_FLOPPY_OPTIONS_START( hector_disc2 )
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL)
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL)
- LEGACY_FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, nullptr, nullptr)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, nullptr, nullptr)
+ LEGACY_FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, nullptr, nullptr)
LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/hect_tap.cpp b/src/lib/formats/hect_tap.cpp
index 9110f07cc8c..ba79afe1180 100644
--- a/src/lib/formats/hect_tap.cpp
+++ b/src/lib/formats/hect_tap.cpp
@@ -40,7 +40,7 @@ enum
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-INLINE int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
+static inline int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
{
int i = 0;
@@ -62,7 +62,7 @@ INLINE int hector_tap_cycle(INT16 *buffer, int sample_pos, int high, int low)
}
-INLINE int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data)
+static inline int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data)
{
/* Writing an entire byte */
int i, samples;
@@ -81,7 +81,7 @@ INLINE int hector_tap_byte(INT16 *buffer, int sample_pos, UINT8 data)
}
-INLINE int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synchro)
+static inline int hector_tap_synchro(INT16 *buffer, int sample_pos, int nb_synchro)
{
/* Writing an entire byte */
int i, samples;
@@ -217,7 +217,7 @@ static int hector_tap_forth_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen ;
- return hector_handle_forth_tap( NULL, casdata );
+ return hector_handle_forth_tap( nullptr, casdata );
}
/*******************************************************************
@@ -236,7 +236,7 @@ static int hector_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen ;
- return hector_handle_tap( NULL, casdata );//forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ return hector_handle_tap( nullptr, casdata );//forth removed here !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
@@ -291,7 +291,7 @@ static const struct CassetteFormat hector_k7_format =
"k7,cin",
hector_k7_identify,
hector_k7_load,
- NULL
+ nullptr
};
static const struct CassetteFormat hector_k7Forth_format =
@@ -299,7 +299,7 @@ static const struct CassetteFormat hector_k7Forth_format =
"for",
hector_k7forth_identify,
hector_k7forth_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/hector_minidisc.h b/src/lib/formats/hector_minidisc.h
index d850573f2b6..54162508dd8 100644
--- a/src/lib/formats/hector_minidisc.h
+++ b/src/lib/formats/hector_minidisc.h
@@ -20,9 +20,9 @@ class hmd_format : public upd765_format
public:
hmd_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/hxcmfm_dsk.h b/src/lib/formats/hxcmfm_dsk.h
index edaac320d69..63238ab2006 100644
--- a/src/lib/formats/hxcmfm_dsk.h
+++ b/src/lib/formats/hxcmfm_dsk.h
@@ -18,14 +18,14 @@ class mfm_format : public floppy_image_format_t
public:
mfm_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_MFM_FORMAT;
diff --git a/src/lib/formats/imageutl.cpp b/src/lib/formats/imageutl.cpp
index e6386da44c8..2bf17be849c 100644
--- a/src/lib/formats/imageutl.cpp
+++ b/src/lib/formats/imageutl.cpp
@@ -168,7 +168,7 @@ void image_specify_extension(char *buffer, size_t buffer_len, const char *extens
len = strlen(buffer);
/* be aware that extension can be NULL */
- if (extension != NULL)
+ if (extension != nullptr)
{
while(extension[extension_pos] != '\0')
{
diff --git a/src/lib/formats/imageutl.h b/src/lib/formats/imageutl.h
index 8b51adebabf..a2369e8284a 100644
--- a/src/lib/formats/imageutl.h
+++ b/src/lib/formats/imageutl.h
@@ -25,7 +25,7 @@ unsigned short ccitt_crc16_one( unsigned short crc, const unsigned char data );
* Alignment-friendly integer placement
* ----------------------------------------------------------------------- */
-INLINE void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value)
+static inline void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value)
{
UINT8 *byte_ptr = ((UINT8 *) ptr) + offset;
UINT16 val16;
@@ -56,7 +56,7 @@ INLINE void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value
}
}
-INLINE UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size)
+static inline UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size)
{
UINT64 result = 0;
const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset;
@@ -93,7 +93,7 @@ INLINE UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size)
return result;
}
-INLINE void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value)
+static inline void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value)
{
UINT8 *byte_ptr = ((UINT8 *) ptr) + offset;
UINT16 val16;
@@ -124,7 +124,7 @@ INLINE void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value
}
}
-INLINE UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size)
+static inline UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size)
{
UINT64 result = 0;
const UINT8 *byte_ptr = ((const UINT8 *) ptr) + offset;
diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp
index 2d74c87f9ef..8f660b91535 100644
--- a/src/lib/formats/imd_dsk.cpp
+++ b/src/lib/formats/imd_dsk.cpp
@@ -155,7 +155,7 @@ static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , s
return FLOPPY_ERROR_SUCCESS;
}
- UINT8 *buffer = global_alloc_array(UINT8 , size_after_off);
+ auto buffer = global_alloc_array(UINT8 , size_after_off);
// Read the part of file after offset
floppy_image_read(floppy , buffer , offset , size_after_off);
@@ -225,7 +225,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -427,7 +427,7 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
io_generic_read(io, &img[0], 0, size);
UINT64 pos;
- for(pos=0; pos < size && img[pos] != 0x1a; pos++);
+ for(pos=0; pos < size && img[pos] != 0x1a; pos++) {};
pos++;
if(pos >= size)
@@ -453,10 +453,10 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
const UINT8 *snum = &img[pos];
pos += sector_count;
- const UINT8 *tnum = head & 0x80 ? &img[pos] : NULL;
+ const UINT8 *tnum = head & 0x80 ? &img[pos] : nullptr;
if(tnum)
pos += sector_count;
- const UINT8 *hnum = head & 0x40 ? &img[pos] : NULL;
+ const UINT8 *hnum = head & 0x40 ? &img[pos] : nullptr;
if(hnum)
pos += sector_count;
@@ -475,7 +475,7 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sects[i].actual_size = actual_size;
if(stype == 0 || stype > 8) {
- sects[i].data = NULL;
+ sects[i].data = nullptr;
} else {
sects[i].deleted = stype == 3 || stype == 4 || stype == 7 || stype == 8;
diff --git a/src/lib/formats/imd_dsk.h b/src/lib/formats/imd_dsk.h
index a993a061050..5f26de88d75 100644
--- a/src/lib/formats/imd_dsk.h
+++ b/src/lib/formats/imd_dsk.h
@@ -19,13 +19,13 @@ class imd_format : public floppy_image_format_t
public:
imd_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
void fixnum(char *start, char *end) const;
diff --git a/src/lib/formats/ioprocs.cpp b/src/lib/formats/ioprocs.cpp
index 2d75bff8b9f..24f92060a82 100644
--- a/src/lib/formats/ioprocs.cpp
+++ b/src/lib/formats/ioprocs.cpp
@@ -55,7 +55,7 @@ const struct io_procs stdio_ioprocs =
const struct io_procs stdio_ioprocs_noclose =
{
- NULL,
+ nullptr,
stdio_seekproc,
stdio_readproc,
stdio_writeproc,
@@ -109,7 +109,7 @@ const struct io_procs corefile_ioprocs =
const struct io_procs corefile_ioprocs_noclose =
{
- NULL,
+ nullptr,
corefile_seekproc,
corefile_readproc,
corefile_writeproc,
diff --git a/src/lib/formats/ipf_dsk.cpp b/src/lib/formats/ipf_dsk.cpp
index afb4c4ce9f3..e7b8aad9137 100644
--- a/src/lib/formats/ipf_dsk.cpp
+++ b/src/lib/formats/ipf_dsk.cpp
@@ -5,7 +5,8 @@
const floppy_format_type FLOPPY_IPF_FORMAT = &floppy_image_format_creator<ipf_format>;
-ipf_format::ipf_format()
+ipf_format::ipf_format(): tinfos(nullptr), tcount(0), type(0), release(0), revision(0), encoder_type(0),
+encoder_revision(0), origin(0), min_cylinder(0), max_cylinder(0), min_head(0), max_head(0), credit_day(0), credit_time(0)
{
}
@@ -88,7 +89,7 @@ bool ipf_format::parse(dynamic_buffer &data, floppy_image *image)
if(res)
res = generate_tracks(image);
global_free_array(tinfos);
- tinfos = NULL;
+ tinfos = nullptr;
return res;
}
@@ -118,9 +119,9 @@ bool ipf_format::parse_info(const UINT8 *info)
ipf_format::track_info *ipf_format::get_index(UINT32 idx)
{
if(idx > 1000)
- return 0;
+ return nullptr;
if(idx >= tcount) {
- track_info *ti1 = global_alloc_array_clear(track_info, idx+1);
+ auto ti1 = global_alloc_array_clear(track_info, idx+1);
memcpy(ti1, tinfos, tcount*sizeof(tinfos));
global_free_array(tinfos);
tcount = idx+1;
diff --git a/src/lib/formats/ipf_dsk.h b/src/lib/formats/ipf_dsk.h
index f3152e8c5c4..a0a16d36daf 100644
--- a/src/lib/formats/ipf_dsk.h
+++ b/src/lib/formats/ipf_dsk.h
@@ -10,13 +10,13 @@ class ipf_format : public floppy_image_format_t
public:
ipf_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
struct track_info {
diff --git a/src/lib/formats/iq151_dsk.h b/src/lib/formats/iq151_dsk.h
index 9f2b69d7617..472cbaf64f9 100644
--- a/src/lib/formats/iq151_dsk.h
+++ b/src/lib/formats/iq151_dsk.h
@@ -17,9 +17,9 @@ class iq151_format : public upd765_format {
public:
iq151_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/itt3030_dsk.h b/src/lib/formats/itt3030_dsk.h
index a43c9c1cd20..49ee5ed95b3 100644
--- a/src/lib/formats/itt3030_dsk.h
+++ b/src/lib/formats/itt3030_dsk.h
@@ -17,9 +17,9 @@ class itt3030_format : public wd177x_format {
public:
itt3030_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/jvc_dsk.h b/src/lib/formats/jvc_dsk.h
index eaeeefb84aa..244c84a8592 100644
--- a/src/lib/formats/jvc_dsk.h
+++ b/src/lib/formats/jvc_dsk.h
@@ -32,14 +32,14 @@ public:
int header_size;
};
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
-
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
private:
bool parse_header(io_generic *io, int &header_size, int &tracks, int &heads, int &sectors, int &sector_size, int &base_sector_id);
diff --git a/src/lib/formats/kaypro_dsk.h b/src/lib/formats/kaypro_dsk.h
index 589d16fc150..f65b410bcc8 100644
--- a/src/lib/formats/kaypro_dsk.h
+++ b/src/lib/formats/kaypro_dsk.h
@@ -17,9 +17,9 @@ class kayproii_format : public upd765_format {
public:
kayproii_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
@@ -29,9 +29,9 @@ class kaypro2x_format : public upd765_format {
public:
kaypro2x_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
};
diff --git a/src/lib/formats/kc85_dsk.h b/src/lib/formats/kc85_dsk.h
index f13ba7f6a0d..c941a9e7647 100644
--- a/src/lib/formats/kc85_dsk.h
+++ b/src/lib/formats/kc85_dsk.h
@@ -17,9 +17,9 @@ class kc85_format : public upd765_format {
public:
kc85_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/kc_cas.cpp b/src/lib/formats/kc_cas.cpp
index 32d7901cad5..3e3d36e3f8b 100644
--- a/src/lib/formats/kc_cas.cpp
+++ b/src/lib/formats/kc_cas.cpp
@@ -43,7 +43,7 @@ static int kc_image_size;
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-INLINE int kc_cas_cycle(INT16 *buffer, int sample_pos, int len)
+static inline int kc_cas_cycle(INT16 *buffer, int sample_pos, int len)
{
int num_samples = KC_WAV_FREQUENCY / (len * 2);
@@ -63,7 +63,7 @@ INLINE int kc_cas_cycle(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate n samples of silence
********************************************************************/
-INLINE int kc_cas_silence(INT16 *buffer, int sample_pos, int len)
+static inline int kc_cas_silence(INT16 *buffer, int sample_pos, int len)
{
int i = 0;
@@ -78,7 +78,7 @@ INLINE int kc_cas_silence(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate samples for 1 byte
********************************************************************/
-INLINE int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
+static inline int kc_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
{
int samples = 0;
@@ -245,7 +245,7 @@ static int kc_kcc_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_kcc( NULL, casdata );
+ return kc_handle_kcc( nullptr, casdata );
}
@@ -277,7 +277,7 @@ static const struct CassetteFormat kc_kcc_format =
"kcc,kcb",
kc_kcc_identify,
kc_kcc_load,
- NULL
+ nullptr
};
@@ -297,7 +297,7 @@ static int kc_tap_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_tap( NULL, casdata );
+ return kc_handle_tap( nullptr, casdata );
}
@@ -329,7 +329,7 @@ static const struct CassetteFormat kc_tap_format =
"tap,853,854,855,tp2,kcm",
kc_tap_identify,
kc_tap_load,
- NULL
+ nullptr
};
@@ -349,7 +349,7 @@ static int kc_sss_to_wav_size(const UINT8 *casdata, int caslen)
{
kc_image_size = caslen ;
- return kc_handle_sss( NULL, casdata );
+ return kc_handle_sss( nullptr, casdata );
}
@@ -380,7 +380,7 @@ static const struct CassetteFormat kc_sss_format =
"sss",
kc_sss_identify,
kc_sss_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/kim1_cas.cpp b/src/lib/formats/kim1_cas.cpp
index b8527e10462..ed9a1a36a0e 100644
--- a/src/lib/formats/kim1_cas.cpp
+++ b/src/lib/formats/kim1_cas.cpp
@@ -11,7 +11,7 @@
static int cas_size;
-INLINE int kim1_output_signal( INT16 *buffer, int sample_pos, int high )
+static inline int kim1_output_signal( INT16 *buffer, int sample_pos, int high )
{
int sample_count, i, j;
@@ -62,7 +62,7 @@ INLINE int kim1_output_signal( INT16 *buffer, int sample_pos, int high )
}
-INLINE int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte )
+static inline int kim1_output_byte( INT16 *buffer, int sample_pos, UINT8 byte )
{
int i;
int sample_count = 0;
@@ -156,7 +156,7 @@ static int kim1_kim_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return kim1_handle_kim( NULL, casdata );
+ return kim1_handle_kim( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller kim1_kim_legacy_fill_wave =
@@ -188,7 +188,7 @@ static const struct CassetteFormat kim1_kim_format =
"kim,kim1",
kim1_kim_identify,
kim1_kim_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/lviv_lvt.cpp b/src/lib/formats/lviv_lvt.cpp
index ecb1940eb6e..03172f6ac36 100644
--- a/src/lib/formats/lviv_lvt.cpp
+++ b/src/lib/formats/lviv_lvt.cpp
@@ -143,7 +143,7 @@ static const struct CassetteFormat lviv_lvt_image_format =
"lvt,lvr,lv0,lv1,lv2,lv3",
lviv_lvt_identify,
lviv_lvt_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/m20_dsk.h b/src/lib/formats/m20_dsk.h
index e3f8c9cf411..0ed3deda5ef 100644
--- a/src/lib/formats/m20_dsk.h
+++ b/src/lib/formats/m20_dsk.h
@@ -17,14 +17,14 @@ class m20_format : public floppy_image_format_t {
public:
m20_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_M20_FORMAT;
diff --git a/src/lib/formats/m5_dsk.h b/src/lib/formats/m5_dsk.h
index 15b806b6035..08350c61339 100644
--- a/src/lib/formats/m5_dsk.h
+++ b/src/lib/formats/m5_dsk.h
@@ -17,9 +17,9 @@ class m5_format : public upd765_format {
public:
m5_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/mbee_cas.cpp b/src/lib/formats/mbee_cas.cpp
index fe0a2ffbc24..58a8f81232a 100644
--- a/src/lib/formats/mbee_cas.cpp
+++ b/src/lib/formats/mbee_cas.cpp
@@ -224,7 +224,7 @@ static int mbee_tap_calculate_size_in_samples(const UINT8 *bytes, int length)
{
mbee_image_size = length;
- return mbee_handle_tap(NULL, bytes);
+ return mbee_handle_tap(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller mbee_tap_config =
@@ -253,7 +253,7 @@ static const struct CassetteFormat mbee_tap_image_format =
"tap",
mbee_tap_identify,
mbee_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(mbee_cassette_formats)
diff --git a/src/lib/formats/mfi_dsk.cpp b/src/lib/formats/mfi_dsk.cpp
index 043d61b0d3d..b6d0f11e2c7 100644
--- a/src/lib/formats/mfi_dsk.cpp
+++ b/src/lib/formats/mfi_dsk.cpp
@@ -187,8 +187,8 @@ bool mfi_format::save(io_generic *io, floppy_image *image)
int pos = sizeof(header) + (tracks << resolution)*heads*sizeof(entry);
int epos = 0;
- UINT32 *precomp = global_alloc_array(UINT32, max_track_size);
- UINT8 *postcomp = global_alloc_array(UINT8, max_track_size*4 + 1000);
+ auto precomp = global_alloc_array(UINT32, max_track_size);
+ auto postcomp = global_alloc_array(UINT8, max_track_size*4 + 1000);
for(int track=0; track <= (tracks-1) << 2; track += 4 >> resolution)
for(int head=0; head<heads; head++) {
diff --git a/src/lib/formats/mfi_dsk.h b/src/lib/formats/mfi_dsk.h
index c9e26337ca6..dfac913d4c1 100644
--- a/src/lib/formats/mfi_dsk.h
+++ b/src/lib/formats/mfi_dsk.h
@@ -10,14 +10,14 @@ class mfi_format : public floppy_image_format_t
public:
mfi_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
enum {
diff --git a/src/lib/formats/mfm_hd.h b/src/lib/formats/mfm_hd.h
index dfa4d3ffba7..4e583f46db8 100644
--- a/src/lib/formats/mfm_hd.h
+++ b/src/lib/formats/mfm_hd.h
@@ -80,7 +80,7 @@ public:
int headerlen;
int ecctype; // -1 is CRC
- bool sane_rec()
+ bool sane_rec() const
{
return ((interleave > 0 && interleave < 32) && (cylskew >= 0 && cylskew < 32) && (headskew >= 0 && headskew < 32)
&& (write_precomp_cylinder >= -1 && write_precomp_cylinder < 100000)
@@ -93,7 +93,7 @@ public:
write_precomp_cylinder = reduced_wcurr_cylinder = -1;
}
- bool sane_gap()
+ bool sane_gap() const
{
return ((gap1 >= 1 && gap1 < 1000) && (gap2 >= 1 && gap2 < 20) && (gap3 >= 1 && gap3 < 1000)
&& (sync >= 10 && sync < 20)
@@ -105,7 +105,7 @@ public:
gap1 = gap2 = gap3 = sync = headerlen = ecctype = 0;
}
- bool equals_rec(mfmhd_layout_params* other)
+ bool equals_rec(mfmhd_layout_params* other) const
{
return ((interleave == other->interleave) &&
(cylskew == other->cylskew) &&
@@ -114,7 +114,7 @@ public:
(reduced_wcurr_cylinder == other->reduced_wcurr_cylinder));
}
- bool equals_gap(mfmhd_layout_params* other)
+ bool equals_gap(mfmhd_layout_params* other) const
{
return ((gap1 == other->gap1) &&
(gap2 == other->gap2) &&
@@ -146,7 +146,8 @@ enum mfmhd_param_t
class mfmhd_image_format_t
{
public:
- mfmhd_image_format_t() { m_devtag = std::string("mfmhd_image_format_t"); };
+ mfmhd_image_format_t(): m_lastbit(false), m_current_crc(0)
+ { m_devtag = std::string("mfmhd_image_format_t"); };
virtual ~mfmhd_image_format_t() {};
// Load the image.
@@ -195,12 +196,12 @@ class mfmhd_generic_format : public mfmhd_image_format_t
{
public:
mfmhd_generic_format() { m_devtag = std::string("mfmhd_generic_format"); };
- chd_error load(chd_file* chdfile, UINT16* trackimage, int tracksize, int cylinder, int head);
- chd_error save(chd_file* chdfile, UINT16* trackimage, int tracksize, int cylinder, int head);
+ chd_error load(chd_file* chdfile, UINT16* trackimage, int tracksize, int cylinder, int head) override;
+ chd_error save(chd_file* chdfile, UINT16* trackimage, int tracksize, int cylinder, int head) override;
// Yes, we want to save all parameters
- virtual bool save_param(mfmhd_param_t type) { return true; }
- virtual int get_default(mfmhd_param_t type);
+ virtual bool save_param(mfmhd_param_t type) override { return true; }
+ virtual int get_default(mfmhd_param_t type) override;
protected:
virtual UINT8 cylinder_to_ident(int cylinder);
diff --git a/src/lib/formats/mm_dsk.h b/src/lib/formats/mm_dsk.h
index ad72b23d4e9..84b29ab259f 100644
--- a/src/lib/formats/mm_dsk.h
+++ b/src/lib/formats/mm_dsk.h
@@ -17,9 +17,9 @@ class mm1_format : public upd765_format {
public:
mm1_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
@@ -29,9 +29,9 @@ class mm2_format : public upd765_format {
public:
mm2_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/msx_dsk.h b/src/lib/formats/msx_dsk.h
index 94a5411c51a..d776620624d 100644
--- a/src/lib/formats/msx_dsk.h
+++ b/src/lib/formats/msx_dsk.h
@@ -19,9 +19,9 @@ class msx_format: public upd765_format {
public:
msx_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/mz_cas.cpp b/src/lib/formats/mz_cas.cpp
index 154c4ae91c9..3a6b934b882 100644
--- a/src/lib/formats/mz_cas.cpp
+++ b/src/lib/formats/mz_cas.cpp
@@ -306,7 +306,7 @@ static const struct CassetteLegacyWaveFiller mz700_legacy_fill_wave =
fill_wave, /* fill_wave */
1, /* chunk_size */
2 * BYTE_SAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
4400, // sample_frequency (tested ok with MZ-80K, MZ-80A, MZ-700, MZ-800, MZ-1500)
MZ700_WAVESAMPLES_HEADER, /* header_samples */
1 /* trailer_samples */
@@ -333,7 +333,7 @@ static const struct CassetteFormat mz700_cas_format =
"m12,mzf,mzt",
mz700_cas_identify,
mz700_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/nanos_dsk.h b/src/lib/formats/nanos_dsk.h
index 97767aa9a59..5a638a0782a 100644
--- a/src/lib/formats/nanos_dsk.h
+++ b/src/lib/formats/nanos_dsk.h
@@ -17,9 +17,9 @@ class nanos_format : public upd765_format {
public:
nanos_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/nascom_dsk.h b/src/lib/formats/nascom_dsk.h
index 95b1e80e49e..a1c3653cdac 100644
--- a/src/lib/formats/nascom_dsk.h
+++ b/src/lib/formats/nascom_dsk.h
@@ -20,9 +20,9 @@ class nascom_format : public wd177x_format
public:
nascom_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/naslite_dsk.h b/src/lib/formats/naslite_dsk.h
index e9ab87488f0..00f9df1567e 100644
--- a/src/lib/formats/naslite_dsk.h
+++ b/src/lib/formats/naslite_dsk.h
@@ -17,14 +17,14 @@ class naslite_format : public upd765_format {
public:
naslite_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
static const format formats[];
- virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const;
+ virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const override;
};
extern const floppy_format_type FLOPPY_NASLITE_FORMAT;
diff --git a/src/lib/formats/nes_dsk.cpp b/src/lib/formats/nes_dsk.cpp
index 5fc263a5f26..f6560d5f053 100644
--- a/src/lib/formats/nes_dsk.cpp
+++ b/src/lib/formats/nes_dsk.cpp
@@ -69,7 +69,7 @@ LEGACY_FLOPPY_OPTIONS_START( nes_only )
"NES floppy disk image",
nes_dsk_identify,
nes_dsk_construct,
- NULL,
- NULL
+ nullptr,
+ nullptr
)
LEGACY_FLOPPY_OPTIONS_END0
diff --git a/src/lib/formats/nfd_dsk.h b/src/lib/formats/nfd_dsk.h
index 5bf460f9084..005196399ba 100644
--- a/src/lib/formats/nfd_dsk.h
+++ b/src/lib/formats/nfd_dsk.h
@@ -19,13 +19,13 @@ class nfd_format : public floppy_image_format_t
public:
nfd_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_NFD_FORMAT;
diff --git a/src/lib/formats/orao_cas.cpp b/src/lib/formats/orao_cas.cpp
index 9e88119d825..784f9563cc0 100644
--- a/src/lib/formats/orao_cas.cpp
+++ b/src/lib/formats/orao_cas.cpp
@@ -23,7 +23,7 @@ static INT16 wave_data;
static int len;
static void orao_output_wave( INT16 **buffer, int length ) {
- if ( buffer == NULL ) {
+ if ( buffer == nullptr ) {
return;
}
@@ -36,7 +36,7 @@ static int orao_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int i,j,size;
UINT8 b;
- if (casdata == NULL) return -1;
+ if (casdata == nullptr) return -1;
if (caslen <= ORAO_HEADER_SIZE) {
return -1;
}
@@ -59,7 +59,7 @@ static int orao_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
int i,j,size;
UINT8 b;
size = 0;
- if (bytes == NULL) return -1;
+ if (bytes == nullptr) return -1;
for (i=ORAO_HEADER_SIZE;i<len-ORAO_HEADER_SIZE;i++) {
for (j=0;j<8;j++) {
b = (bytes[i] >> j) & 1;
@@ -113,7 +113,7 @@ static const struct CassetteFormat orao_cassette_format = {
"tap",
orao_cassette_identify,
orao_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/oric_dsk.h b/src/lib/formats/oric_dsk.h
index 97bd6e35408..3eeb719eed0 100644
--- a/src/lib/formats/oric_dsk.h
+++ b/src/lib/formats/oric_dsk.h
@@ -17,14 +17,14 @@ class oric_dsk_format : public floppy_image_format_t
{
public:
oric_dsk_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_ORIC_DSK_FORMAT;
diff --git a/src/lib/formats/oric_tap.cpp b/src/lib/formats/oric_tap.cpp
index 9dbf378db9b..ed2a7841076 100644
--- a/src/lib/formats/oric_tap.cpp
+++ b/src/lib/formats/oric_tap.cpp
@@ -513,7 +513,7 @@ static const struct CassetteFormat oric_tap_format =
"tap",
oric_tap_identify,
oric_tap_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/p6001_cas.cpp b/src/lib/formats/p6001_cas.cpp
index a0ce656e4eb..e91e4b40748 100644
--- a/src/lib/formats/p6001_cas.cpp
+++ b/src/lib/formats/p6001_cas.cpp
@@ -50,7 +50,7 @@ static int pc6001_cas_to_wav_size (const UINT8 *casdata, int caslen)
{
cas_size = caslen*8;
- return pc6001_handle_cas(NULL,casdata);
+ return pc6001_handle_cas(nullptr,casdata);
}
/*******************************************************************
@@ -89,7 +89,7 @@ static const struct CassetteFormat pc6001_cassette_format = {
"cas",
pc6001_cas_identify,
pc6001_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(pc6001_cassette_formats)
diff --git a/src/lib/formats/pasti_dsk.cpp b/src/lib/formats/pasti_dsk.cpp
index 6fa53b2590d..78e016991d9 100644
--- a/src/lib/formats/pasti_dsk.cpp
+++ b/src/lib/formats/pasti_dsk.cpp
@@ -90,7 +90,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
io_generic_read(io, &raw_track[0], pos+16, entry_len-16);
- UINT8 *fuzz = fuzz_len ? &raw_track[16*sect] : 0;
+ UINT8 *fuzz = fuzz_len ? &raw_track[16*sect] : nullptr;
UINT8 *bdata = fuzz ? fuzz+fuzz_len : &raw_track[16*sect];
UINT8 *tdata = bdata;
@@ -105,7 +105,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
tsize = tdata[0] | (tdata[1] << 8);
tdata += 2;
} else
- tdata = 0;
+ tdata = nullptr;
if(0) {
printf("Track %2d.%d: el=%d fl=%d sect=%d flags=%04x tlen=%d/%d tnum=%d flags2=%02x sync=%x\n",
@@ -133,7 +133,7 @@ bool pasti_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int s_flags = sh[14] | (sh[15] << 8);
obs.sectors[s].data = bdata + s_off;
- obs.sectors[s].fuzzy_mask = 0;
+ obs.sectors[s].fuzzy_mask = nullptr;
memcpy(obs.sectors[s].id, sh+8, 6);
obs.sectors[s].time_ratio = s_time ? s_time / 16384.0 : 1;
obs.sectors[s].position = s_pos/8-12;
@@ -175,7 +175,7 @@ void pasti_format::wd_generate_unsynced_gap(std::vector<UINT32> &track, const wd
for(int i=tstart; i != tend;) {
unsigned char v = obs.track_data[i];
int j;
- for(j=i+1; j != tend && obs.track_data[j] == v; j++);
+ for(j=i+1; j != tend && obs.track_data[j] == v; j++) {};
int size = j-i;
if(size < 4) {
mfm_w(track, 8, v, cell_size);
diff --git a/src/lib/formats/pasti_dsk.h b/src/lib/formats/pasti_dsk.h
index 0d1165f48b4..fe724fb1fb5 100644
--- a/src/lib/formats/pasti_dsk.h
+++ b/src/lib/formats/pasti_dsk.h
@@ -10,13 +10,13 @@ class pasti_format : public floppy_image_format_t
public:
pasti_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const desc_e xdesc[];
diff --git a/src/lib/formats/pc98_dsk.h b/src/lib/formats/pc98_dsk.h
index 5655d187399..d948b19ddcc 100644
--- a/src/lib/formats/pc98_dsk.h
+++ b/src/lib/formats/pc98_dsk.h
@@ -22,9 +22,9 @@ class pc98_format : public upd765_format
public:
pc98_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/pc98fdi_dsk.cpp b/src/lib/formats/pc98fdi_dsk.cpp
index 83433606400..1e6f1809536 100644
--- a/src/lib/formats/pc98fdi_dsk.cpp
+++ b/src/lib/formats/pc98fdi_dsk.cpp
@@ -63,7 +63,7 @@ bool pc98fdi_format::load(io_generic *io, UINT32 form_factor, floppy_image *imag
int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666;
int ssize;
- for(ssize=0; (128 << ssize) < sector_size; ssize++);
+ for(ssize=0; (128 << ssize) < sector_size; ssize++) {};
desc_pc_sector sects[256];
UINT8 sect_data[65536];
diff --git a/src/lib/formats/pc98fdi_dsk.h b/src/lib/formats/pc98fdi_dsk.h
index c71c4c587fd..05fd1ccc361 100644
--- a/src/lib/formats/pc98fdi_dsk.h
+++ b/src/lib/formats/pc98fdi_dsk.h
@@ -19,13 +19,13 @@ class pc98fdi_format : public floppy_image_format_t
public:
pc98fdi_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_PC98FDI_FORMAT;
diff --git a/src/lib/formats/pc_dsk.cpp b/src/lib/formats/pc_dsk.cpp
index 19e0f21e08e..0ab32aff7b3 100644
--- a/src/lib/formats/pc_dsk.cpp
+++ b/src/lib/formats/pc_dsk.cpp
@@ -134,7 +134,7 @@ static FLOPPY_CONSTRUCT(pc_dsk_construct)
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( pc )
- LEGACY_FLOPPY_OPTION( pc_dsk, "dsk,ima,img,ufi,360", "PC floppy disk image", pc_dsk_identify, pc_dsk_construct, NULL,
+ LEGACY_FLOPPY_OPTION( pc_dsk, "dsk,ima,img,ufi,360", "PC floppy disk image", pc_dsk_identify, pc_dsk_construct, nullptr,
HEADS([1]-2)
TRACKS(40/[80])
SECTORS(8/[9]/10/15/18/36))
diff --git a/src/lib/formats/pc_dsk.h b/src/lib/formats/pc_dsk.h
index f6e1fbc5637..381ad49e99a 100644
--- a/src/lib/formats/pc_dsk.h
+++ b/src/lib/formats/pc_dsk.h
@@ -24,9 +24,9 @@ class pc_format : public upd765_format
public:
pc_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/phc25_cas.cpp b/src/lib/formats/phc25_cas.cpp
index 1253bd98a3a..73dfdb17ff3 100644
--- a/src/lib/formats/phc25_cas.cpp
+++ b/src/lib/formats/phc25_cas.cpp
@@ -144,7 +144,7 @@ static int phc25_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
phc25_image_size = length;
- return phc25_handle_cassette(NULL, bytes);
+ return phc25_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller phc25_legacy_fill_wave =
@@ -173,7 +173,7 @@ static const struct CassetteFormat phc25_cassette_image_format =
"phc",
phc25_cassette_identify,
phc25_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(phc25_cassette_formats)
diff --git a/src/lib/formats/pk8020_dsk.h b/src/lib/formats/pk8020_dsk.h
index 1700530c781..7a9da57651a 100644
--- a/src/lib/formats/pk8020_dsk.h
+++ b/src/lib/formats/pk8020_dsk.h
@@ -20,9 +20,9 @@ class pk8020_format : public wd177x_format
public:
pk8020_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/pmd_cas.cpp b/src/lib/formats/pmd_cas.cpp
index ba5baee1a65..4643eaf9251 100644
--- a/src/lib/formats/pmd_cas.cpp
+++ b/src/lib/formats/pmd_cas.cpp
@@ -181,7 +181,7 @@ static int pmd85_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
pmd85_image_size = length;
- return pmd85_handle_cassette(NULL, bytes);
+ return pmd85_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller pmd85_legacy_fill_wave =
@@ -210,7 +210,7 @@ static const struct CassetteFormat pmd85_cassette_image_format =
"pmd,tap,ptp",
pmd85_cassette_identify,
pmd85_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(pmd85_cassette_formats)
diff --git a/src/lib/formats/primoptp.cpp b/src/lib/formats/primoptp.cpp
index 635f66d25ac..23aab613c29 100644
--- a/src/lib/formats/primoptp.cpp
+++ b/src/lib/formats/primoptp.cpp
@@ -241,7 +241,7 @@ static const struct CassetteFormat primo_ptp_image_format =
"ptp",
primo_ptp_identify,
primo_ptp_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(primo_ptp_format)
diff --git a/src/lib/formats/pyldin_dsk.h b/src/lib/formats/pyldin_dsk.h
index 485a5c1e3fe..9ff5482e974 100644
--- a/src/lib/formats/pyldin_dsk.h
+++ b/src/lib/formats/pyldin_dsk.h
@@ -17,9 +17,9 @@ class pyldin_format : public upd765_format {
public:
pyldin_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/ql_dsk.h b/src/lib/formats/ql_dsk.h
index 7c7f52be852..96003df6984 100644
--- a/src/lib/formats/ql_dsk.h
+++ b/src/lib/formats/ql_dsk.h
@@ -17,9 +17,9 @@ class ql_format : public wd177x_format {
public:
ql_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/rk_cas.cpp b/src/lib/formats/rk_cas.cpp
index 03139e1515d..968b8afdc23 100644
--- a/src/lib/formats/rk_cas.cpp
+++ b/src/lib/formats/rk_cas.cpp
@@ -217,63 +217,63 @@ static const struct CassetteFormat rku_cassette_format = {
"rku",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rk8_cassette_format = {
"rk8",
rk60_cassette_identify,
rk60_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rks_cassette_format = {
"rks",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rko_cassette_format = {
"rko",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkr_cassette_format = {
"rk,rkr",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rka_cassette_format = {
"rka",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkm_cassette_format = {
"rkm",
rk22_cassette_identify,
rk22_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat rkp_cassette_format = {
"rkp",
rk20_cassette_identify,
rk20_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat gam_cassette_format = {
"gam,g16,pki",
gam_cassette_identify,
gam_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(rku_cassette_formats)
diff --git a/src/lib/formats/rx50_dsk.h b/src/lib/formats/rx50_dsk.h
index 2fd09429c9a..37decb2fa09 100644
--- a/src/lib/formats/rx50_dsk.h
+++ b/src/lib/formats/rx50_dsk.h
@@ -22,14 +22,14 @@ class rx50img_format : public floppy_image_format_t
public:
rx50img_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
-
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
static const desc_e rx50_10_desc[];
diff --git a/src/lib/formats/sc3000_bit.cpp b/src/lib/formats/sc3000_bit.cpp
index 2b5fd635db5..f15488bda68 100644
--- a/src/lib/formats/sc3000_bit.cpp
+++ b/src/lib/formats/sc3000_bit.cpp
@@ -98,7 +98,7 @@ const struct CassetteFormat sc3000_bit_format =
"bit",
sc3000_bit_identify,
sc3000_bit_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START( sc3000_cassette_formats )
diff --git a/src/lib/formats/sf7000_dsk.h b/src/lib/formats/sf7000_dsk.h
index df84e36fe22..75f7ff7e314 100644
--- a/src/lib/formats/sf7000_dsk.h
+++ b/src/lib/formats/sf7000_dsk.h
@@ -17,9 +17,9 @@ class sf7000_format : public upd765_format {
public:
sf7000_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/smx_dsk.h b/src/lib/formats/smx_dsk.h
index 0b8aba5ac07..36a3bd251b5 100644
--- a/src/lib/formats/smx_dsk.h
+++ b/src/lib/formats/smx_dsk.h
@@ -17,9 +17,9 @@ class smx_format : public wd177x_format {
public:
smx_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/sol_cas.cpp b/src/lib/formats/sol_cas.cpp
index 26f1bdccf00..1f22cd68a9f 100644
--- a/src/lib/formats/sol_cas.cpp
+++ b/src/lib/formats/sol_cas.cpp
@@ -342,7 +342,7 @@ static int sol20_cassette_calculate_size_in_samples(const UINT8 *bytes, int leng
{
sol20_image_size = length;
- return sol20_handle_cassette(NULL, bytes);
+ return sol20_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller sol20_legacy_fill_wave =
@@ -371,7 +371,7 @@ static const struct CassetteFormat sol20_cassette_image_format =
"svt",
sol20_cassette_identify,
sol20_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sol20_cassette_formats)
diff --git a/src/lib/formats/sorc_cas.cpp b/src/lib/formats/sorc_cas.cpp
index 6983dd0ba74..a900f77d5e5 100644
--- a/src/lib/formats/sorc_cas.cpp
+++ b/src/lib/formats/sorc_cas.cpp
@@ -121,7 +121,7 @@ static int sorcerer_cassette_calculate_size_in_samples(const UINT8 *bytes, int l
{
sorcerer_image_size = length;
- return sorcerer_handle_cassette(NULL, bytes);
+ return sorcerer_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller sorcerer_legacy_fill_wave =
@@ -150,7 +150,7 @@ static const struct CassetteFormat sorcerer_cassette_image_format =
"tape",
sorcerer_cassette_identify,
sorcerer_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sorcerer_cassette_formats)
diff --git a/src/lib/formats/sorc_dsk.cpp b/src/lib/formats/sorc_dsk.cpp
index 5e59d30cdb1..27dc4270f05 100644
--- a/src/lib/formats/sorc_dsk.cpp
+++ b/src/lib/formats/sorc_dsk.cpp
@@ -107,7 +107,7 @@ static floperr_t sorc_write_indexed_sector(floppy_image_legacy *floppy, int head
static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -156,5 +156,5 @@ static FLOPPY_CONSTRUCT(sorc_dsk_construct)
/* ----------------------------------------------------------------------- */
LEGACY_FLOPPY_OPTIONS_START( sorcerer )
- LEGACY_FLOPPY_OPTION( sorc_dsk, "dsk", "Exidy Sorcerer floppy disk image", sorc_dsk_identify, sorc_dsk_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION( sorc_dsk, "dsk", "Exidy Sorcerer floppy disk image", sorc_dsk_identify, sorc_dsk_construct, nullptr, nullptr)
LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/sord_cas.cpp b/src/lib/formats/sord_cas.cpp
index eb8a27bdba4..39de0fbca84 100644
--- a/src/lib/formats/sord_cas.cpp
+++ b/src/lib/formats/sord_cas.cpp
@@ -133,7 +133,7 @@ static const struct CassetteFormat sordm5_cas_format =
"cas",
sordm5_tap_identify,
sordm5_tap_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(sordm5_cassette_formats)
diff --git a/src/lib/formats/spc1000_cas.cpp b/src/lib/formats/spc1000_cas.cpp
index b05844b6ee7..3c86305e8a8 100644
--- a/src/lib/formats/spc1000_cas.cpp
+++ b/src/lib/formats/spc1000_cas.cpp
@@ -108,14 +108,14 @@ static int spc1000_tap_calculate_size_in_samples(const UINT8 *bytes, int length)
{
spc1000_image_size = length;
- return spc1000_handle_tap(NULL, bytes);
+ return spc1000_handle_tap(nullptr, bytes);
}
static int spc1000_cas_calculate_size_in_samples(const UINT8 *bytes, int length)
{
spc1000_image_size = length;
- return spc1000_handle_cas(NULL, bytes);
+ return spc1000_handle_cas(nullptr, bytes);
}
@@ -151,7 +151,7 @@ static const struct CassetteFormat spc1000_tap_cassette_image_format =
"tap",
spc1000_tap_cassette_identify,
spc1000_tap_cassette_load,
- NULL
+ nullptr
};
@@ -182,7 +182,7 @@ static const struct CassetteFormat spc1000_cas_cassette_image_format =
"cas",
spc1000_cas_cassette_identify,
spc1000_cas_cassette_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/st_dsk.h b/src/lib/formats/st_dsk.h
index 0888c980c72..242d7e9cf5b 100644
--- a/src/lib/formats/st_dsk.h
+++ b/src/lib/formats/st_dsk.h
@@ -18,14 +18,14 @@ class st_format : public floppy_image_format_t
public:
st_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
void find_size(io_generic *io, UINT8 &track_count, UINT8 &head_count, UINT8 &sector_count);
@@ -36,14 +36,14 @@ class msa_format : public floppy_image_format_t
public:
msa_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
private:
bool uncompress(UINT8 *buffer, int csize, int usize);
diff --git a/src/lib/formats/svi_cas.cpp b/src/lib/formats/svi_cas.cpp
index dd2bde8d5a1..a95c3b97fb5 100644
--- a/src/lib/formats/svi_cas.cpp
+++ b/src/lib/formats/svi_cas.cpp
@@ -203,7 +203,7 @@ static const struct CassetteFormat svi_cas_format =
"cas",
svi_cas_identify,
svi_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/svi_dsk.h b/src/lib/formats/svi_dsk.h
index 6ffd74619a1..9ae933572df 100644
--- a/src/lib/formats/svi_dsk.h
+++ b/src/lib/formats/svi_dsk.h
@@ -20,14 +20,14 @@ class svi_format : public floppy_image_format_t
public:
svi_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
-
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_SVI_FORMAT;
diff --git a/src/lib/formats/tandy2k_dsk.h b/src/lib/formats/tandy2k_dsk.h
index c306018fa48..e69eead2e55 100644
--- a/src/lib/formats/tandy2k_dsk.h
+++ b/src/lib/formats/tandy2k_dsk.h
@@ -17,9 +17,9 @@ class tandy2k_format : public upd765_format {
public:
tandy2k_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp
index 185bb21cfed..69b3e5bfc14 100644
--- a/src/lib/formats/td0_dsk.cpp
+++ b/src/lib/formats/td0_dsk.cpp
@@ -298,7 +298,7 @@ static floperr_t td0_read_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -510,7 +510,7 @@ void td0dsk_t::reconst()
for (i = 0, j = N_CHAR; j < T; i += 2, j++) {
k = i + 1;
f = freq[j] = freq[i] + freq[k];
- for (k = j - 1; f < freq[k]; k--);
+ for (k = j - 1; f < freq[k]; k--) {};
k++;
l = (j - k) * 2;
@@ -550,7 +550,7 @@ void td0dsk_t::update(int c)
/* swap nodes to keep the tree freq-ordered */
if (k > freq[l = c + 1]) {
- while (k > freq[++l]);
+ while (k > freq[++l]) {};
l--;
freq[c] = freq[l];
freq[l] = k;
@@ -699,7 +699,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct )
return FLOPPY_ERROR_OUTOFMEMORY;
tag->data = (UINT8*)malloc(floppy_image_size(floppy));
- if (tag->data==NULL) {
+ if (tag->data==nullptr) {
return FLOPPY_ERROR_OUTOFMEMORY;
}
floppy_image_read(floppy, tag->data, 0, floppy_image_size(floppy));
@@ -720,7 +720,7 @@ FLOPPY_CONSTRUCT( td0_dsk_construct )
memcpy(obuf,tag->data,12);
free(tag->data);
tag->data = (UINT8*)malloc(size+12);
- if (tag->data==NULL) {
+ if (tag->data==nullptr) {
return FLOPPY_ERROR_OUTOFMEMORY;
}
memcpy(tag->data,obuf,12);
@@ -786,7 +786,7 @@ FLOPPY_DESTRUCT( td0_dsk_destruct )
{
struct td0dsk_tag *tag = get_tag(floppy);
free(tag->data);
- tag->data = NULL;
+ tag->data = nullptr;
return FLOPPY_ERROR_SUCCESS;
}
@@ -999,7 +999,7 @@ bool td0_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
sdatapos += size;
}
else
- sects[i].data = NULL;
+ sects[i].data = nullptr;
}
track_count = track;
diff --git a/src/lib/formats/td0_dsk.h b/src/lib/formats/td0_dsk.h
index a714d1d9e1c..eae873e30e0 100644
--- a/src/lib/formats/td0_dsk.h
+++ b/src/lib/formats/td0_dsk.h
@@ -11,14 +11,14 @@ class td0_format : public floppy_image_format_t
public:
td0_format();
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+ virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_TD0_FORMAT;
diff --git a/src/lib/formats/thom_cas.cpp b/src/lib/formats/thom_cas.cpp
index 9fd6d6f0208..799e96c38ca 100644
--- a/src/lib/formats/thom_cas.cpp
+++ b/src/lib/formats/thom_cas.cpp
@@ -119,7 +119,7 @@ static casserr_t to7_k7_load( cassette_image *cass )
if ( to7_k7_bits )
{
free( to7_k7_bits );
- to7_k7_bits = NULL;
+ to7_k7_bits = nullptr;
}
to7_k7_bitsize = 0;
@@ -366,7 +366,7 @@ static casserr_t to7_k7_load( cassette_image *cass )
static const struct CassetteFormat to7_k7 =
-{ "k7", to7_k7_identify, to7_k7_load, NULL /* no save */ };
+{ "k7", to7_k7_identify, to7_k7_load, nullptr /* no save */ };
@@ -392,7 +392,7 @@ static casserr_t to7_wav_load ( cassette_image *cass )
if ( to7_k7_bits )
{
free( to7_k7_bits );
- to7_k7_bits = NULL;
+ to7_k7_bits = nullptr;
}
if ( e != CASSETTE_ERROR_SUCCESS )
@@ -730,7 +730,7 @@ static casserr_t mo5_k5_load( cassette_image *cass )
static const struct CassetteFormat mo5_k5 =
-{ "k5,k7", mo5_k5_identify, mo5_k5_load, NULL /* no save */ };
+{ "k5,k7", mo5_k5_identify, mo5_k5_load, nullptr /* no save */ };
/********************* MO5 WAV format ************************/
@@ -781,8 +781,8 @@ static const struct CassetteFormat mo5_wav =
const struct CassetteFormat *const to7_cassette_formats[] =
-{ &to7_wav, &to7_k7, NULL };
+{ &to7_wav, &to7_k7, nullptr };
const struct CassetteFormat *const mo5_cassette_formats[] =
-{ &mo5_wav, &mo5_k5, NULL };
+{ &mo5_wav, &mo5_k5, nullptr };
diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp
index ed9d977b723..da7187d65f8 100644
--- a/src/lib/formats/thom_dsk.cpp
+++ b/src/lib/formats/thom_dsk.cpp
@@ -175,7 +175,7 @@ static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
+ err = get_offset(floppy, head, track, sector, FALSE, nullptr);
if (err)
return err;
@@ -353,37 +353,37 @@ static FLOPPY_CONSTRUCT(qdd_dsk_construct)
LEGACY_FLOPPY_OPTIONS_START(thomson)
- LEGACY_FLOPPY_OPTION(fdmfm2, "fd", "Thomson FD (MFM) 80 tracks disk image (3\"1/2 DD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fdmfm2, "fd", "Thomson FD (MFM) 80 tracks disk image (3\"1/2 DD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([80])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fdmfm, "fd", "Thomson FD (MFM) 40 tracks disk image (5\"1/4 DD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fdmfm, "fd", "Thomson FD (MFM) 40 tracks disk image (5\"1/4 DD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([40])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fd2, "fd", "Thomson FD (FM) 80 tracks disk image (3\"1/2 SD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fd2, "fd", "Thomson FD (FM) 80 tracks disk image (3\"1/2 SD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([80])
SECTORS([16])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(fd, "fd", "Thomson FD (FM) 40 tracks disk image (5\"1/4 SD)", basicdsk_identify_default, basicdsk_construct_default, NULL,
+ LEGACY_FLOPPY_OPTION(fd, "fd", "Thomson FD (FM) 40 tracks disk image (5\"1/4 SD)", basicdsk_identify_default, basicdsk_construct_default, nullptr,
HEADS([1])
TRACKS([40])
SECTORS([16])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(sap,"sap", "Thomson SAP floppy disk image", sap_dsk_identify, sap_dsk_construct, NULL, NULL)
+ LEGACY_FLOPPY_OPTION(sap,"sap", "Thomson SAP floppy disk image", sap_dsk_identify, sap_dsk_construct, nullptr, nullptr)
- LEGACY_FLOPPY_OPTION(qdd,"qd", "Thomson QDD floppy disk image (2\"8 SD)", qdd_dsk_identify, qdd_dsk_construct, NULL,
+ LEGACY_FLOPPY_OPTION(qdd,"qd", "Thomson QDD floppy disk image (2\"8 SD)", qdd_dsk_identify, qdd_dsk_construct, nullptr,
HEADS([1])
TRACKS([1])
SECTORS([400])
diff --git a/src/lib/formats/ti99_dsk.h b/src/lib/formats/ti99_dsk.h
index a61d3da1a69..64285c1dcce 100644
--- a/src/lib/formats/ti99_dsk.h
+++ b/src/lib/formats/ti99_dsk.h
@@ -19,9 +19,9 @@
class ti99_floppy_format : public floppy_image_format_t
{
public:
- bool supports_save() const { return true; }
- bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- bool save(io_generic *io, floppy_image *image);
+ bool supports_save() const override { return true; }
+ bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ bool save(io_generic *io, floppy_image *image) override;
protected:
int decode_bitstream(const UINT8 *bitstream, UINT8 *trackdata, int *sector, int cell_count, int encoding, UINT8 gapbytes, int track_size);
@@ -35,7 +35,6 @@ protected:
virtual void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) =0;
int get_encoding(int cell_size);
- int get_track_size(int cell_size);
void generate_track_fm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image);
void generate_track_mfm(int track, int head, int cell_size, UINT8* trackdata, floppy_image *image);
@@ -52,19 +51,19 @@ protected:
class ti99_sdf_format : public ti99_floppy_format
{
public:
- int identify(io_generic *io, UINT32 form_factor);
- const char *name() const;
- const char *description() const;
- const char *extensions() const;
+ int identify(io_generic *io, UINT32 form_factor) override;
+ const char *name() const override;
+ const char *description() const override;
+ const char *extensions() const override;
private:
- void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads);
- int get_track_size(int cell_size, int sector_count);
- void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes);
- void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int sectorcount, int trackcount, int cellsize);
+ void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads) override;
+ int get_track_size(int cell_size, int sector_count) override;
+ void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override;
+ void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int sectorcount, int trackcount, int cellsize) override;
// This format supports single-sided images
- int min_heads() { return 1; }
+ int min_heads() override { return 1; }
struct ti99vib
{
@@ -91,19 +90,19 @@ extern const floppy_format_type FLOPPY_TI99_SDF_FORMAT;
class ti99_tdf_format : public ti99_floppy_format
{
public:
- int identify(io_generic *io, UINT32 form_factor);
- const char *name() const;
- const char *description() const;
- const char *extensions() const;
+ int identify(io_generic *io, UINT32 form_factor) override;
+ const char *name() const override;
+ const char *description() const override;
+ const char *extensions() const override;
private:
- void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads);
- void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int sectorcount, int trackcount, int cellsize);
- void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes);
- int get_track_size(int cell_size, int sector_count);
+ void determine_sizes(io_generic *io, int& cell_size, int& sector_count, int& heads) override;
+ void load_track(io_generic *io, UINT8 *trackdata, int head, int track, int sectorcount, int trackcount, int cellsize) override;
+ void write_track(io_generic *io, UINT8 *trackdata, int *sector, int track, int head, int maxsect, int maxtrack, int numbytes) override;
+ int get_track_size(int cell_size, int sector_count) override;
// This format only supports double-sided images
- int min_heads() { return 2; }
+ int min_heads() override { return 2; }
};
extern const floppy_format_type FLOPPY_TI99_TDF_FORMAT;
diff --git a/src/lib/formats/tiki100_dsk.h b/src/lib/formats/tiki100_dsk.h
index e3899f97ef9..4037ec5fe77 100644
--- a/src/lib/formats/tiki100_dsk.h
+++ b/src/lib/formats/tiki100_dsk.h
@@ -17,9 +17,9 @@ class tiki100_format : public wd177x_format {
public:
tiki100_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/trd_dsk.h b/src/lib/formats/trd_dsk.h
index 1d830c6d6c5..de4b7ff63d5 100644
--- a/src/lib/formats/trd_dsk.h
+++ b/src/lib/formats/trd_dsk.h
@@ -17,9 +17,9 @@ class trd_format : public wd177x_format {
public:
trd_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/trs80_dsk.h b/src/lib/formats/trs80_dsk.h
index 988d7ee2a7d..73583ca0f48 100644
--- a/src/lib/formats/trs80_dsk.h
+++ b/src/lib/formats/trs80_dsk.h
@@ -20,12 +20,12 @@ class trs80_format : public wd177x_format
public:
trs80_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
protected:
- virtual int get_track_dam_fm(const format &f, int head, int track);
+ virtual int get_track_dam_fm(const format &f, int head, int track) override;
private:
static const format formats[];
diff --git a/src/lib/formats/trs_cas.cpp b/src/lib/formats/trs_cas.cpp
index a4f748dea05..ec8bea116a7 100644
--- a/src/lib/formats/trs_cas.cpp
+++ b/src/lib/formats/trs_cas.cpp
@@ -21,7 +21,7 @@ static int cas_size;
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-INLINE int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, int high, int low)
+static inline int trs80l2_cas_cycle(INT16 *buffer, int sample_pos, int silence, int high, int low)
{
int i = 0;
@@ -96,7 +96,7 @@ static int trs80l2_cas_to_wav_size(const UINT8 *casdata, int caslen)
{
cas_size = caslen;
- return trs80l2_handle_cas( NULL, casdata );
+ return trs80l2_handle_cas( nullptr, casdata );
}
static const struct CassetteLegacyWaveFiller trs80l2_cas_legacy_fill_wave =
@@ -128,7 +128,7 @@ static const struct CassetteFormat trs80l2_cas_format =
"cas",
trs80l2_cas_identify,
trs80l2_cas_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/tvc_cas.cpp b/src/lib/formats/tvc_cas.cpp
index a33fba687b9..7dad5dac819 100644
--- a/src/lib/formats/tvc_cas.cpp
+++ b/src/lib/formats/tvc_cas.cpp
@@ -221,7 +221,7 @@ static const struct CassetteFormat tvc64_cassette_image_format =
"cas",
tvc64_cassette_identify,
tvc64_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(tvc64_cassette_formats)
diff --git a/src/lib/formats/tvc_dsk.h b/src/lib/formats/tvc_dsk.h
index f6796639d03..67df189b3da 100644
--- a/src/lib/formats/tvc_dsk.h
+++ b/src/lib/formats/tvc_dsk.h
@@ -17,9 +17,9 @@ class tvc_format : public wd177x_format {
public:
tvc_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/tzx_cas.cpp b/src/lib/formats/tzx_cas.cpp
index 225184b7bd0..d78fee1595f 100644
--- a/src/lib/formats/tzx_cas.cpp
+++ b/src/lib/formats/tzx_cas.cpp
@@ -66,7 +66,7 @@ static const UINT8 TZX_HEADER[8] = { 'Z','X','T','a','p','e','!',0x1a };
static INT16 wave_data = 0;
static int block_count = 0;
-static UINT8** blocks = NULL;
+static UINT8** blocks = nullptr;
static float t_scale = 1; /* for scaling T-states to the 4MHz CPC */
static void toggle_wave_data(void)
@@ -207,19 +207,19 @@ static void tzx_cas_get_blocks( const UINT8 *casdata, int caslen )
}
}
-INLINE int millisec_to_samplecount( int millisec )
+static inline int millisec_to_samplecount( int millisec )
{
return (int) (millisec * ((double)TZX_WAV_FREQUENCY / 1000.0));
}
-INLINE int tcycles_to_samplecount( int tcycles )
+static inline int tcycles_to_samplecount( int tcycles )
{
return (int) ((0.5 + (((double)TZX_WAV_FREQUENCY / 3500000) * (double)tcycles)) * (double) t_scale);
}
static void tzx_output_wave( INT16 **buffer, int length )
{
- if (buffer == NULL)
+ if (buffer == nullptr)
{
return;
}
@@ -335,14 +335,14 @@ static int tzx_handle_direct(INT16 **buffer, const UINT8 *bytes, int pause, int
}
-INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp)
+static inline int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp)
{
int size = 0;
const UINT8 *cursymb = symtable + (2 * maxp + 1)*symbol;
UINT8 starttype = cursymb[0];
-// printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp);
+// printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp);
switch (starttype)
{
@@ -371,13 +371,11 @@ INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol
for (int i = 0; i < maxp; i++)
{
UINT16 pulse_length = cursymb[1 + (i*2)] | (cursymb[2 + (i*2)] << 8);
- // printf("pulse_length %04x\n", pulse_length);
+ // printf("pulse_length %04x\n", pulse_length);
// shorter lists can be terminated with a pulse_length of 0
if (pulse_length != 0)
{
-
-
int samples = tcycles_to_samplecount(pulse_length);
tzx_output_wave(buffer, samples);
size += samples;
@@ -397,7 +395,7 @@ INLINE int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol
return size;
}
-INLINE int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 &stream_byte)
+static inline int stream_get_bit(const UINT8 *bytes, UINT8 &stream_bit, UINT32 &stream_byte)
{
// get bit here
UINT8 retbit = 0;
@@ -425,7 +423,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause,
if (totp > 0)
{
- // printf("pilot block table %04x\n", totp);
+ // printf("pilot block table %04x\n", totp);
const UINT8 *symtable = bytes;
const UINT8 *table2 = symtable + (2 * npp + 1)*asp;
@@ -440,7 +438,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause,
for (int j = 0; j < repetitions; j++)
{
size += tzx_handle_symbol(buffer, symtable, symbol, npp);
- // toggle_wave_data();
+ // toggle_wave_data();
}
@@ -470,7 +468,7 @@ static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause,
for (int i = 0; i < totd; i++)
{
UINT8 symbol = 0;
-
+
for (int j = 0; j < NB; j++)
{
symbol |= stream_get_bit(table2, stream_bit, stream_byte) << j;
@@ -750,12 +748,12 @@ static int tzx_cas_do_work( INT16 **buffer )
data_size = cur_block[1] + (cur_block[2] << 8) + (cur_block[3] << 16) + (cur_block[4] << 24);
pause_time= cur_block[5] + (cur_block[6] << 8);
-
+
UINT32 totp = cur_block[7] + (cur_block[8] << 8) + (cur_block[9] << 16) + (cur_block[10] << 24);
int npp = cur_block[11];
int asp = cur_block[12];
if (asp == 0) asp = 256;
-
+
UINT32 totd = cur_block[13] + (cur_block[14] << 8) + (cur_block[15] << 16) + (cur_block[16] << 24);
int npd = cur_block[17];
int asd = cur_block[18];
@@ -807,7 +805,7 @@ static int tzx_cas_to_wav_size( const UINT8 *casdata, int caslen )
goto cleanup;
}
- size = tzx_cas_do_work(NULL);
+ size = tzx_cas_do_work(nullptr);
return size;
@@ -845,7 +843,7 @@ static int tap_cas_to_wav_size( const UINT8 *casdata, int caslen )
// int pilot_length = (p[2] == 0x00) ? 8063 : 3223; /* worldofspectrum */
LOG_FORMATS("tap_cas_to_wav_size: Handling TAP block containing 0x%X bytes", data_size);
p += 2;
- size += tzx_cas_handle_block(NULL, p, 1000, data_size, 2168, pilot_length, 667, 735, 855, 1710, 8);
+ size += tzx_cas_handle_block(nullptr, p, 1000, data_size, 2168, pilot_length, 667, 735, 855, 1710, 8);
LOG_FORMATS(", total size is now: %d\n", size);
p += data_size;
}
@@ -938,7 +936,7 @@ static const struct CassetteFormat tzx_cassette_format =
"tzx",
tzx_cassette_identify,
tzx_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat tap_cassette_format =
@@ -946,7 +944,7 @@ static const struct CassetteFormat tap_cassette_format =
"tap,blk",
tap_cassette_identify,
tap_cassette_load,
- NULL
+ nullptr
};
static const struct CassetteFormat cdt_cassette_format =
@@ -954,7 +952,7 @@ static const struct CassetteFormat cdt_cassette_format =
"cdt",
cdt_cassette_identify,
cdt_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(tzx_cassette_formats)
diff --git a/src/lib/formats/uef_cas.cpp b/src/lib/formats/uef_cas.cpp
index f078ae776c4..6db1716348b 100644
--- a/src/lib/formats/uef_cas.cpp
+++ b/src/lib/formats/uef_cas.cpp
@@ -50,7 +50,7 @@ static const UINT8* skip_gz_header( const UINT8 *p ) {
method = *p; p++;
flags = *p; p++;
if ( method != Z_DEFLATED || ( flags & RESERVED ) != 0 ) {
- return NULL;
+ return nullptr;
}
/* Skip time, xflags and OS code */
p += 6;
@@ -75,7 +75,7 @@ static const UINT8* skip_gz_header( const UINT8 *p ) {
return p;
}
-static UINT8 *gz_ptr = NULL;
+static UINT8 *gz_ptr = nullptr;
static float get_uef_float( const UINT8 *Float)
{
@@ -114,14 +114,14 @@ static int uef_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
int inflate_size = ( casdata[ caslen - 1 ] << 24 ) | ( casdata[ caslen - 2 ] << 16 ) | ( casdata[ caslen - 3 ] << 8 ) | casdata[ caslen - 4 ];
const UINT8 *in_ptr = skip_gz_header( casdata );
- if ( in_ptr == NULL ) {
+ if ( in_ptr == nullptr ) {
goto cleanup;
}
gz_ptr = (UINT8 *)malloc( inflate_size );
- d_stream.zalloc = 0;
- d_stream.zfree = 0;
- d_stream.opaque = 0;
+ d_stream.zalloc = nullptr;
+ d_stream.zfree = nullptr;
+ d_stream.opaque = nullptr;
d_stream.next_in = (unsigned char *)in_ptr;
d_stream.avail_in = caslen - ( in_ptr - casdata );
d_stream.next_out = gz_ptr;
@@ -207,7 +207,7 @@ static int uef_cas_to_wav_size( const UINT8 *casdata, int caslen ) {
cleanup:
if ( gz_ptr ) {
free( gz_ptr );
- gz_ptr = NULL;
+ gz_ptr = nullptr;
}
return -1;
}
@@ -232,7 +232,7 @@ static int uef_cas_fill_wave( INT16 *buffer, int length, UINT8 *bytes ) {
INT16 *p = buffer;
if ( bytes[0] == 0x1f && bytes[1] == 0x8b ) {
- if ( gz_ptr == NULL ) {
+ if ( gz_ptr == nullptr ) {
return 1;
}
bytes = gz_ptr;
@@ -327,7 +327,7 @@ const struct CassetteFormat uef_cassette_format = {
"uef",
uef_cassette_identify,
uef_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(uef_cassette_formats)
diff --git a/src/lib/formats/upd765_dsk.cpp b/src/lib/formats/upd765_dsk.cpp
index eef28c23a4b..d9da1c5bd21 100644
--- a/src/lib/formats/upd765_dsk.cpp
+++ b/src/lib/formats/upd765_dsk.cpp
@@ -16,7 +16,7 @@ upd765_format::upd765_format(const format *_formats)
formats = _formats;
}
-int upd765_format::find_size(io_generic *io, UINT32 form_factor)
+int upd765_format::find_size(io_generic *io, UINT32 form_factor) const
{
UINT64 size = io_generic_size(io);
for(int i=0; formats[i].form_factor; i++) {
@@ -232,7 +232,7 @@ bool upd765_format::save(io_generic *io, floppy_image *image)
{
// Count the number of formats
int formats_count;
- for(formats_count=0; formats[formats_count].form_factor; formats_count++);
+ for(formats_count=0; formats[formats_count].form_factor; formats_count++) {};
// Allocate the storage for the list of testable formats for a
// given cell size
diff --git a/src/lib/formats/upd765_dsk.h b/src/lib/formats/upd765_dsk.h
index 6f36d1225a5..a108931d89b 100644
--- a/src/lib/formats/upd765_dsk.h
+++ b/src/lib/formats/upd765_dsk.h
@@ -38,15 +38,15 @@ public:
// End the array with {}
upd765_format(const format *formats);
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
protected:
floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size, int &end_gap_index);
floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index);
- int find_size(io_generic *io, UINT32 form_factor);
+ int find_size(io_generic *io, UINT32 form_factor) const;
int compute_track_size(const format &f) const;
virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const;
void check_compatibility(floppy_image *image, std::vector<int> &candidates);
diff --git a/src/lib/formats/vdk_dsk.h b/src/lib/formats/vdk_dsk.h
index 5570c14eab8..b685cb32f8b 100644
--- a/src/lib/formats/vdk_dsk.h
+++ b/src/lib/formats/vdk_dsk.h
@@ -22,14 +22,14 @@ class vdk_format : public floppy_image_format_t
public:
vdk_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
-
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
private:
static const int SECTOR_SIZE = 256;
diff --git a/src/lib/formats/vector06_dsk.h b/src/lib/formats/vector06_dsk.h
index cad2fa3ddf3..f884d79cf78 100644
--- a/src/lib/formats/vector06_dsk.h
+++ b/src/lib/formats/vector06_dsk.h
@@ -20,9 +20,9 @@ class vector06_format : public wd177x_format
public:
vector06_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/vg5k_cas.cpp b/src/lib/formats/vg5k_cas.cpp
index ef648707fd8..2933f77f8c0 100644
--- a/src/lib/formats/vg5k_cas.cpp
+++ b/src/lib/formats/vg5k_cas.cpp
@@ -20,7 +20,7 @@ static int k7_size;
/*******************************************************************
Generate one high-low cycle of sample data
********************************************************************/
-INLINE int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len)
+static inline int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len)
{
int i = 0;
@@ -45,7 +45,7 @@ INLINE int vg5k_cas_cycle(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate n samples of silence
********************************************************************/
-INLINE int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len)
+static inline int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len)
{
int i = 0;
@@ -60,7 +60,7 @@ INLINE int vg5k_cas_silence(INT16 *buffer, int sample_pos, int len)
/*******************************************************************
Generate the end-byte samples
********************************************************************/
-INLINE int vg5k_cas_eob(INT16 *buffer, int sample_pos)
+static inline int vg5k_cas_eob(INT16 *buffer, int sample_pos)
{
int i, samples = 0;
@@ -73,7 +73,7 @@ INLINE int vg5k_cas_eob(INT16 *buffer, int sample_pos)
}
-INLINE int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
+static inline int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
{
/* Writing an entire byte */
int i, samples;
@@ -100,7 +100,7 @@ INLINE int vg5k_cas_byte(INT16 *buffer, int sample_pos, UINT8 data)
/*******************************************************************
Generate n sample of synchro
********************************************************************/
-INLINE int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len)
+static inline int vg5k_k7_synchro(INT16 *buffer, int sample_pos, int len)
{
int i, samples = 0;
@@ -196,7 +196,7 @@ static int vg5k_k7_to_wav_size(const UINT8 *casdata, int caslen)
{
k7_size = caslen ;
- return vg5k_handle_tap( NULL, casdata );
+ return vg5k_handle_tap( nullptr, casdata );
}
@@ -228,7 +228,7 @@ static const struct CassetteFormat vg5k_k7_format =
"k7",
vg5k_k7_identify,
vg5k_k7_load,
- NULL
+ nullptr
};
diff --git a/src/lib/formats/victor9k_dsk.h b/src/lib/formats/victor9k_dsk.h
index 1564f1474f7..5664e66155b 100644
--- a/src/lib/formats/victor9k_dsk.h
+++ b/src/lib/formats/victor9k_dsk.h
@@ -27,14 +27,14 @@ public:
victor9k_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
-
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const { return true; }
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
+
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override { return true; }
static int get_rpm(int head, int track);
diff --git a/src/lib/formats/vt_cas.cpp b/src/lib/formats/vt_cas.cpp
index d0910efcc84..91e5f69ba64 100644
--- a/src/lib/formats/vt_cas.cpp
+++ b/src/lib/formats/vt_cas.cpp
@@ -102,7 +102,7 @@ static const struct CassetteLegacyWaveFiller vtech1_legacy_fill_wave =
vtech1_cassette_fill_wave, /* fill_wave */
1, /* chunk_size */
V1_BYTESAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
600*V1_BITSAMPLES, /* sample_frequency */
600*V1_BITSAMPLES, /* header_samples */
600*V1_BITSAMPLES /* trailer_samples */
@@ -123,7 +123,7 @@ static const struct CassetteFormat vtech1_cas_format =
"cas",
vtech1_cas_identify,
vtech1_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(vtech1_cassette_formats)
@@ -197,7 +197,7 @@ static const struct CassetteLegacyWaveFiller vtech2_legacy_fill_wave =
vtech2_cassette_fill_wave, /* fill_wave */
1, /* chunk_size */
VT2_BYTESAMPLES, /* chunk_samples */
- NULL, /* chunk_sample_calc */
+ nullptr, /* chunk_sample_calc */
600*VT2_BITSAMPLES, /* sample_frequency */
600*VT2_BITSAMPLES, /* header_samples */
600*VT2_BITSAMPLES /* trailer_samples */
@@ -218,7 +218,7 @@ static const struct CassetteFormat vtech2_cas_format =
"cas",
vtech2_cas_identify,
vtech2_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(vtech2_cassette_formats)
diff --git a/src/lib/formats/wd177x_dsk.cpp b/src/lib/formats/wd177x_dsk.cpp
index 69458af0335..527fb69a234 100644
--- a/src/lib/formats/wd177x_dsk.cpp
+++ b/src/lib/formats/wd177x_dsk.cpp
@@ -227,7 +227,7 @@ bool wd177x_format::save(io_generic *io, floppy_image *image)
{
// Count the number of formats
int formats_count;
- for(formats_count=0; formats[formats_count].form_factor; formats_count++);
+ for(formats_count=0; formats[formats_count].form_factor; formats_count++) {};
// Allocate the storage for the list of testable formats for a
// given cell size
diff --git a/src/lib/formats/wd177x_dsk.h b/src/lib/formats/wd177x_dsk.h
index a932beb1ced..6c93000b02c 100644
--- a/src/lib/formats/wd177x_dsk.h
+++ b/src/lib/formats/wd177x_dsk.h
@@ -37,10 +37,10 @@ public:
// End the array with {}
wd177x_format(const format *formats);
- virtual int identify(io_generic *io, UINT32 form_factor);
- virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
- virtual bool save(io_generic *io, floppy_image *image);
- virtual bool supports_save() const;
+ virtual int identify(io_generic *io, UINT32 form_factor) override;
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
+ virtual bool save(io_generic *io, floppy_image *image) override;
+ virtual bool supports_save() const override;
protected:
enum { FM_DAM = 0xf56f, FM_DDAM = 0xf56a, MFM_DAM = 0xfb, MFM_DDAM = 0xf8 };
diff --git a/src/lib/formats/x07_cas.cpp b/src/lib/formats/x07_cas.cpp
index 54f46acd488..0c36ad7c3e8 100644
--- a/src/lib/formats/x07_cas.cpp
+++ b/src/lib/formats/x07_cas.cpp
@@ -137,7 +137,7 @@ static int x07_cassette_calculate_size_in_samples(const UINT8 *bytes, int length
{
x07_image_size = length;
- return x07_handle_cassette(NULL, bytes);
+ return x07_handle_cassette(nullptr, bytes);
}
static const struct CassetteLegacyWaveFiller x07_legacy_fill_wave =
@@ -166,7 +166,7 @@ static const struct CassetteFormat x07_cassette_image_format =
"k7,lst,cas",
x07_cassette_identify,
x07_cassette_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(x07_cassette_formats)
diff --git a/src/lib/formats/x1_tap.cpp b/src/lib/formats/x1_tap.cpp
index 5cf6f9fef94..f66ca7d4431 100644
--- a/src/lib/formats/x1_tap.cpp
+++ b/src/lib/formats/x1_tap.cpp
@@ -131,7 +131,7 @@ static const struct CassetteFormat x1_cassette_format = {
"tap",
x1_cas_identify,
x1_cas_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(x1_cassette_formats)
diff --git a/src/lib/formats/xdf_dsk.h b/src/lib/formats/xdf_dsk.h
index 628d998be87..8ef01c846e4 100644
--- a/src/lib/formats/xdf_dsk.h
+++ b/src/lib/formats/xdf_dsk.h
@@ -17,9 +17,9 @@ class xdf_format : public upd765_format {
public:
xdf_format();
- virtual const char *name() const;
- virtual const char *description() const;
- virtual const char *extensions() const;
+ virtual const char *name() const override;
+ virtual const char *description() const override;
+ virtual const char *extensions() const override;
private:
static const format formats[];
diff --git a/src/lib/formats/zx81_p.cpp b/src/lib/formats/zx81_p.cpp
index 9a556f05ce5..5e6af375468 100644
--- a/src/lib/formats/zx81_p.cpp
+++ b/src/lib/formats/zx81_p.cpp
@@ -226,7 +226,7 @@ static const struct CassetteFormat zx81_p_image_format =
"p,81",
zx81_p_identify,
zx81_p_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(zx81_p_format)
@@ -289,7 +289,7 @@ static const struct CassetteFormat zx80_o_image_format =
"o,80",
zx80_o_identify,
zx80_o_load,
- NULL
+ nullptr
};
CASSETTE_FORMATLIST_START(zx80_o_format)