From 39906a9399324f6d9503ae17f52564811af4a355 Mon Sep 17 00:00:00 2001 From: Jaak Ristioja Date: Thu, 21 Mar 2024 20:48:43 +0200 Subject: [PATCH] Add override keyword, clean up virtual keyword Also removed virtual and override keywords from destructors which already override. --- configure.ac | 1 + include/bios_disk.h | 48 +-- include/cpu.h | 4 +- include/dos_system.h | 44 +-- include/dosbox.h | 4 +- include/iconvpp.hpp | 2 +- include/paging.h | 4 +- include/parport.h | 10 +- include/qcow2_disk.h | 6 +- include/serialport.h | 10 +- include/setup.h | 39 ++- include/shell.h | 2 +- src/cpu/core_dyn_x86/cache.h | 16 +- src/cpu/core_dynrec/cache.h | 16 +- src/cpu/cpu.cpp | 18 +- src/cpu/paging.cpp | 84 ++--- src/dos/cdrom.h | 142 ++++----- src/dos/dev_con.h | 16 +- src/dos/dos.cpp | 4 +- src/dos/dos_devices.cpp | 34 +- src/dos/dos_mscdex.cpp | 14 +- src/dos/dos_programs.cpp | 88 +++--- src/dos/drive_fat.cpp | 16 +- src/dos/drive_iso.cpp | 12 +- src/dos/drive_overlay.cpp | 2 +- src/dos/drive_physfs.cpp | 12 +- src/dos/drive_virtual.cpp | 10 +- src/dos/drives.h | 361 +++++++++++----------- src/dosbox.cpp | 4 +- src/gui/midi.cpp | 4 +- src/gui/midi_alsa.h | 12 +- src/gui/midi_mt32.h | 12 +- src/gui/midi_oss.h | 10 +- src/gui/midi_synth.h | 24 +- src/gui/render.cpp | 4 +- src/gui/sdl_gui.cpp | 114 +++---- src/gui/sdl_mapper.cpp | 114 +++---- src/hardware/adlib.cpp | 72 ++--- src/hardware/dbopl.h | 12 +- src/hardware/dma.cpp | 4 +- src/hardware/glide.cpp | 16 +- src/hardware/ide.cpp | 16 +- src/hardware/imfc.cpp | 2 +- src/hardware/keyboard.cpp | 16 +- src/hardware/mame/saa1099.h | 4 +- src/hardware/mame/sn76496.h | 4 +- src/hardware/memory.cpp | 34 +- src/hardware/mixer.cpp | 6 +- src/hardware/parport/directlpt.h | 16 +- src/hardware/parport/filelpt.h | 16 +- src/hardware/parport/parport.cpp | 2 +- src/hardware/parport/printer_redir.h | 16 +- src/hardware/pc98.cpp | 2 +- src/hardware/pci_bus.cpp | 4 +- src/hardware/pic.cpp | 4 +- src/hardware/sblaster.cpp | 6 +- src/hardware/serialport/directserial.h | 16 +- src/hardware/serialport/serialdummy.h | 16 +- src/hardware/serialport/serialfile.h | 16 +- src/hardware/serialport/seriallog.h | 16 +- src/hardware/serialport/serialmouse.h | 16 +- src/hardware/serialport/serialport.cpp | 2 +- src/hardware/vga.cpp | 8 +- src/hardware/vga_memory.cpp | 174 +++++------ src/hardware/voodoo_interface.h | 12 +- src/ints/ems.cpp | 14 +- src/ints/int10_modes.cpp | 2 +- src/ints/int_dosv.cpp | 12 +- src/ints/mouse.cpp | 4 +- src/libs/gui_tk/gui_tk.h | 202 ++++++------ src/libs/mt32/Analog.cpp | 28 +- src/libs/mt32/BReverbModel.cpp | 18 +- src/libs/mt32/File.h | 8 +- src/libs/mt32/FileStream.h | 6 +- src/libs/mt32/LA32FloatWaveGenerator.h | 8 +- src/libs/mt32/LA32WaveGenerator.h | 8 +- src/libs/mt32/MidiStreamParser.h | 8 +- src/libs/mt32/Part.h | 18 +- src/libs/mt32/Synth.cpp | 20 +- src/libs/mt32/c_interface/c_interface.cpp | 38 +-- src/misc/ethernet_nothing.h | 6 +- src/misc/ethernet_pcap.h | 6 +- src/misc/ethernet_slirp.h | 6 +- src/misc/programs.cpp | 2 +- src/shell/shell.cpp | 14 +- 85 files changed, 1137 insertions(+), 1136 deletions(-) diff --git a/configure.ac b/configure.ac index 9493b0142..709eb909a 100644 --- a/configure.ac +++ b/configure.ac @@ -386,6 +386,7 @@ AC_CHECK_CXXFLAGS([ -Wlogical-op ]) AC_CHECK_CXXFLAGS([ -Wsign-promo ]) AC_CHECK_CXXFLAGS([ -Wconversion-null ]) #AC_CHECK_CXXFLAGS([ -Woverloaded-virtual ]) NOT TOO USEFUL +AC_CHECK_CXXFLAGS([ -Wsuggest-override ]) AC_CHECK_CXXFLAGS([ -Wno-deprecated-declarations ]) dnl Let GCC 7.3.x know that the "fall through" switch cases in this codebase diff --git a/include/bios_disk.h b/include/bios_disk.h index 270cdb618..e8cefa761 100644 --- a/include/bios_disk.h +++ b/include/bios_disk.h @@ -134,10 +134,10 @@ class imageDisk { class imageDiskEmptyDrive : public imageDisk { public: - virtual uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0); - virtual uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0); - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); + uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0) override; + uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0) override; + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; imageDiskEmptyDrive(); virtual ~imageDiskEmptyDrive(); @@ -145,10 +145,10 @@ public: class imageDiskD88 : public imageDisk { public: - virtual uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0); - virtual uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0); - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); + uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0) override; + uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0) override; + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; imageDiskD88(FILE *imgFile, const char *imgName, uint32_t imgSizeK, bool isHardDisk); virtual ~imageDiskD88(); @@ -183,10 +183,10 @@ public: class imageDiskNFD : public imageDisk { public: - virtual uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0); - virtual uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0); - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); + uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0) override; + uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0) override; + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; imageDiskNFD(FILE *imgFile, const char *imgName, uint32_t imgSizeK, bool isHardDisk, unsigned int revision); virtual ~imageDiskNFD(); @@ -212,10 +212,10 @@ public: class imageDiskVFD : public imageDisk { public: - virtual uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0); - virtual uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0); - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); + uint8_t Read_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,void * data,unsigned int req_sector_size=0) override; + uint8_t Write_Sector(uint32_t head,uint32_t cylinder,uint32_t sector,const void * data,unsigned int req_sector_size=0) override; + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; imageDiskVFD(FILE *imgFile, const char *imgName, uint32_t imgSizeK, bool isHardDisk); virtual ~imageDiskVFD(); @@ -249,10 +249,10 @@ public: class imageDiskMemory : public imageDisk { public: - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); - virtual uint8_t GetBiosType(void); - virtual void Set_Geometry(uint32_t setHeads, uint32_t setCyl, uint32_t setSect, uint32_t setSectSize); + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; + uint8_t GetBiosType(void) override; + void Set_Geometry(uint32_t setHeads, uint32_t setCyl, uint32_t setSect, uint32_t setSectSize) override; // Partition and format the ramdrive virtual uint8_t Format(); @@ -345,8 +345,8 @@ public: std::string diskname; }; VHDTypes vhdType = VHD_TYPE_NONE; - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data); + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void * data) override; static ErrorCodes Open(const char* fileName, const bool readOnly, imageDisk** disk); static VHDTypes GetVHDType(const char* fileName); VHDTypes GetVHDType(void) const; @@ -423,7 +423,7 @@ class imageDiskElToritoFloppy : public imageDisk { public: /* Read_Sector and Write_Sector take care of geometry translation for us, * then call the absolute versions. So, we override the absolute versions only */ - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) { + uint8_t Read_AbsoluteSector(uint32_t sectnum, void * data) override { unsigned char buffer[2048]; bool GetMSCDEXDrive(unsigned char drive_letter,CDROM_Interface **_cdrom); @@ -437,7 +437,7 @@ public: memcpy(data,buffer+((sectnum&3)*512),512); return 0x00; } - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum,const void * data) { + uint8_t Write_AbsoluteSector(uint32_t sectnum,const void * data) override { (void)sectnum;//UNUSED (void)data;//UNUSED return 0x05; /* fail, read only */ diff --git a/include/cpu.h b/include/cpu.h index 17996084b..53b1e11c4 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -527,8 +527,8 @@ public: return true; } - virtual void SaveState( std::ostream& stream ); - virtual void LoadState( std::istream& stream ); + void SaveState( std::ostream& stream ) override; + void LoadState( std::istream& stream ) override; private: PhysPt ldt_base; diff --git a/include/dos_system.h b/include/dos_system.h index e0fb7c6f4..6120e7e7e 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -120,11 +120,11 @@ public: } DOS_Device():DOS_File() {}; virtual ~DOS_Device() {}; - virtual bool Read(uint8_t * data,uint16_t * size); - virtual bool Write(const uint8_t * data,uint16_t * size); - virtual bool Seek(uint32_t * pos,uint32_t type); - virtual bool Close(); - virtual uint16_t GetInformation(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; virtual void SetInformation(uint16_t info); virtual bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode); virtual bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode); @@ -158,14 +158,14 @@ public: return *this; } - virtual bool Read(uint8_t* data, uint16_t* size); - virtual bool Write(const uint8_t* data, uint16_t* size); - virtual bool Seek(uint32_t* pos, uint32_t type); - virtual bool Close(); - virtual uint16_t GetInformation(void); - virtual bool ReadFromControlChannel(PhysPt bufptr, uint16_t size, uint16_t* retcode); - virtual bool WriteToControlChannel(PhysPt bufptr, uint16_t size, uint16_t* retcode); - virtual uint8_t GetStatus(bool input_flag); + bool Read(uint8_t* data, uint16_t* size) override; + bool Write(const uint8_t* data, uint16_t* size) override; + bool Seek(uint32_t* pos, uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; + bool ReadFromControlChannel(PhysPt bufptr, uint16_t size, uint16_t* retcode) override; + bool WriteToControlChannel(PhysPt bufptr, uint16_t size, uint16_t* retcode) override; + uint8_t GetStatus(bool input_flag) override; bool CheckSameDevice(uint16_t seg, uint16_t s_off, uint16_t i_off); uint16_t CallDeviceFunction(uint8_t command, uint8_t length, uint16_t seg, uint16_t offset, uint16_t size); private: @@ -177,17 +177,17 @@ class LocalFile : public DOS_File { public: LocalFile(); LocalFile(const char* _name, FILE * handle); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); - bool Close(); - bool LockFile(uint8_t mode, uint32_t pos, uint16_t size); - uint16_t GetInformation(void); - bool UpdateDateTimeFromHost(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; + bool LockFile(uint8_t mode, uint32_t pos, uint16_t size) override; + uint16_t GetInformation(void) override; + bool UpdateDateTimeFromHost(void) override; bool UpdateLocalDateTime(void); void FlagReadOnlyMedium(void); - void Flush(void); - uint32_t GetSeekPos(void); + void Flush(void) override; + uint32_t GetSeekPos(void) override; FILE * fhandle; private: bool read_only_medium = false; diff --git a/include/dosbox.h b/include/dosbox.h index d9d53833c..b81a0e88d 100644 --- a/include/dosbox.h +++ b/include/dosbox.h @@ -395,12 +395,12 @@ public: } protected: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { std::for_each(podRef.begin(), podRef.end(), std::bind1st(WriteGlobalPOD(), &stream)); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { std::for_each(podRef.begin(), podRef.end(), std::bind1st(ReadGlobalPOD(), &stream)); } diff --git a/include/iconvpp.hpp b/include/iconvpp.hpp index 85fa1515d..905a0a047 100644 --- a/include/iconvpp.hpp +++ b/include/iconvpp.hpp @@ -243,7 +243,7 @@ public: close(); } public: - virtual int _do_convert(void) { + int _do_convert(void) override { if (context != NULL) { dstT *i_dst = pclass::dst_ptr; const srcT *i_src = pclass::src_ptr; diff --git a/include/paging.h b/include/paging.h index 3e6a8db85..2ac7a084d 100644 --- a/include/paging.h +++ b/include/paging.h @@ -499,7 +499,7 @@ extern bool dosbox_allow_nonrecursive_page_fault; /* when set, do nonrecursive m class GuestPageFaultException : public std::exception { public: - virtual const char *what() const throw() { + const char *what() const throw() override { return "Guest page fault exception"; } GuestPageFaultException(PhysPt n_lin_addr, Bitu n_page_addr, Bitu n_faultcode) : lin_addr(n_lin_addr), page_addr(n_page_addr), faultcode(n_faultcode) { @@ -512,7 +512,7 @@ public: class GuestGenFaultException : public std::exception { public: - virtual const char *what() const throw() { + virtual const char *what() const throw() override { return "Guest general protection fault exception"; } GuestGenFaultException() { diff --git a/include/parport.h b/include/parport.h index b99c1e275..9229c3080 100644 --- a/include/parport.h +++ b/include/parport.h @@ -31,11 +31,11 @@ public: // Creates a LPT device that communicates with the num-th parallel port, i.e. is LPTnum device_LPT(uint8_t num, class CParallel* pp); virtual ~device_LPT(); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); - bool Close(); - uint16_t GetInformation(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; private: CParallel* pportclass; uint8_t num; // This device is LPTnum diff --git a/include/qcow2_disk.h b/include/qcow2_disk.h index f0eaeb109..3e7c10144 100644 --- a/include/qcow2_disk.h +++ b/include/qcow2_disk.h @@ -122,11 +122,11 @@ public: QCow2Disk(QCow2Image::QCow2Header& qcow2Header, FILE *qcow2File, const char *imgName, uint32_t imgSizeK, uint32_t sectorSizeBytes, bool isHardDisk); - virtual ~QCow2Disk(); + ~QCow2Disk(); - virtual uint8_t Read_AbsoluteSector(uint32_t sectnum, void* data); + uint8_t Read_AbsoluteSector(uint32_t sectnum, void* data) override; - virtual uint8_t Write_AbsoluteSector(uint32_t sectnum, const void* data); + uint8_t Write_AbsoluteSector(uint32_t sectnum, const void* data) override; private: diff --git a/include/serialport.h b/include/serialport.h index b16f969ce..8bd5a1a60 100644 --- a/include/serialport.h +++ b/include/serialport.h @@ -448,11 +448,11 @@ public: // Creates a COM device that communicates with the num-th parallel port, i.e. is LPTnum device_COM(class CSerial* sc); virtual ~device_COM(); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); - bool Close(); - uint16_t GetInformation(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; private: CSerial* sclass; }; diff --git a/include/setup.h b/include/setup.h index 5ea526728..214a2dcfe 100644 --- a/include/setup.h +++ b/include/setup.h @@ -171,11 +171,11 @@ public: int getMin() { return min;} int getMax() { return max;} void SetMinMax(Value const& min,Value const& max) {this->min = min; this->max=max;} - bool SetValue(std::string const& input); + bool SetValue(std::string const& input) override; virtual ~Prop_int(){ } - virtual bool CheckValue(Value const& in, bool warn); + bool CheckValue(Value const& in, bool warn) override; // Override SetVal, so it takes min,max in account when there are no suggested values - virtual bool SetVal(Value const& in, bool forced,bool warn=true,bool init=false); + bool SetVal(Value const& in, bool forced,bool warn=true,bool init=false) override; private: Value min,max; @@ -195,9 +195,9 @@ public: double getMin() const { return min; } double getMax() const { return max; } void SetMinMax(Value const& min, Value const& max) { this->min = min; this->max = max; } - bool SetValue(std::string const& input); + bool SetValue(std::string const& input) override; virtual ~Prop_double(){ } - virtual bool CheckValue(Value const& in, bool warn); + bool CheckValue(Value const& in, bool warn) override; private: Value min, max; }; @@ -208,7 +208,7 @@ public: :Property(_propname,when) { default_value = value = _value; } - bool SetValue(std::string const& input); + bool SetValue(std::string const& input) override; virtual ~Prop_bool(){ } }; @@ -218,8 +218,8 @@ public: :Property(_propname,when) { default_value = value = _value; } - bool SetValue(std::string const& input); - virtual bool CheckValue(Value const& in, bool warn); + bool SetValue(std::string const& input) override; + bool CheckValue(Value const& in, bool warn) override; virtual ~Prop_string(){ } }; class Prop_path:public Prop_string{ @@ -229,7 +229,7 @@ public: :Prop_string(_propname,when,_value), realpath(_value) { default_value = value = _value; } - bool SetValue(std::string const& input); + bool SetValue(std::string const& input) override; virtual ~Prop_path(){ } }; @@ -239,7 +239,7 @@ public: :Property(_propname,when) { default_value = value = _value; } - bool SetValue(std::string const& input); + bool SetValue(std::string const& input) override; virtual ~Prop_hex(){ } }; @@ -371,9 +371,9 @@ public: Prop_path* Get_path(std::string const& _propname) const; Prop_multival* Get_multival(std::string const& _propname) const; Prop_multival_remain* Get_multivalremain(std::string const& _propname) const; - virtual bool HandleInputline(std::string const& gegevens); - virtual void PrintData(FILE* outfile,int everything=-1,bool norem=false); - virtual std::string GetPropValue(std::string const& _property) const; + bool HandleInputline(std::string const& gegevens) override; + void PrintData(FILE* outfile,int everything=-1,bool norem=false) override; + std::string GetPropValue(std::string const& _property) const override; virtual ~Section_prop(); std::string data; }; @@ -390,8 +390,8 @@ public: Section_prop *GetSection() { return section; } const Section_prop *GetSection() const { return section; } virtual bool SetValue(std::string const& input,bool init); - virtual bool SetValue(std::string const& input) { return SetValue(input,/*init*/false); }; - virtual const std::vector& GetValues() const; + bool SetValue(std::string const& input) override { return SetValue(input,/*init*/false); }; + const std::vector& GetValues() const override; virtual ~Prop_multival() { delete section; } }; //value bevat totale string. setvalue zet elk van de sub properties en checked die. @@ -399,8 +399,7 @@ class Prop_multival_remain:public Prop_multival{ public: Prop_multival_remain(std::string const& _propname, Changeable::Value when,std::string const& sep):Prop_multival(_propname,when,sep){ } - virtual bool SetValue(std::string const& input,bool init); - virtual bool SetValue(std::string const& input) { return SetValue(input,/*init*/false); }; + bool SetValue(std::string const& input,bool init) override; }; @@ -408,9 +407,9 @@ class Section_line: public Section{ public: Section_line(std::string const& _sectionname):Section(_sectionname){} virtual ~Section_line() { }; - virtual bool HandleInputline(std::string const& line); - virtual void PrintData(FILE* outfile,int everything=-1,bool norem=false); - virtual std::string GetPropValue(std::string const& _property) const; + bool HandleInputline(std::string const& line) override; + void PrintData(FILE* outfile,int everything=-1,bool norem=false) override; + std::string GetPropValue(std::string const& _property) const override; std::string data; }; diff --git a/include/shell.h b/include/shell.h index 258f58345..94b33c84f 100644 --- a/include/shell.h +++ b/include/shell.h @@ -111,7 +111,7 @@ public: void Prepare(void); /*! \brief Program entry point, when the command is run */ - void Run(void); + void Run(void) override; /*! \brief Alternate execution if /C switch is given */ diff --git a/src/cpu/core_dyn_x86/cache.h b/src/cpu/core_dyn_x86/cache.h index bf7d55730..fda8bd725 100644 --- a/src/cpu/core_dyn_x86/cache.h +++ b/src/cpu/core_dyn_x86/cache.h @@ -108,7 +108,7 @@ public: } return is_current_block; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("wb:non-readable code page found that is no ROM page"); @@ -128,7 +128,7 @@ public: invalidation_map[addr]++; InvalidateRange(addr,addr); } - void writew(PhysPt addr,uint16_t val){ + void writew(PhysPt addr,uint16_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("ww:non-readable code page found that is no ROM page"); @@ -148,7 +148,7 @@ public: (*(uint16_t*)&invalidation_map[addr])+=0x101; InvalidateRange(addr,addr+1); } - void writed(PhysPt addr,uint32_t val){ + void writed(PhysPt addr,uint32_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("wd:non-readable code page found that is no ROM page"); @@ -168,7 +168,7 @@ public: (*(uint32_t*)&invalidation_map[addr])+=0x1010101; InvalidateRange(addr,addr+3); } - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return false; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("cb:non-readable code page found that is no ROM page"); @@ -194,7 +194,7 @@ public: host_writeb(hostmem+addr,val); return false; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return false; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("cw:non-readable code page found that is no ROM page"); @@ -220,7 +220,7 @@ public: host_writew(hostmem+addr,val); return false; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { if (GCC_UNLIKELY(old_pagehandler->flags&PFLAG_HASROM)) return false; if (GCC_UNLIKELY((old_pagehandler->flags&PFLAG_READABLE)!=PFLAG_READABLE)) { E_Exit("cd:non-readable code page found that is no ROM page"); @@ -319,11 +319,11 @@ public: } return 0; } - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { hostmem=old_pagehandler->GetHostReadPt(phys_page); return hostmem; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return GetHostReadPt( phys_page ); } public: diff --git a/src/cpu/core_dynrec/cache.h b/src/cpu/core_dynrec/cache.h index 32598b899..8cd7e1c47 100644 --- a/src/cpu/core_dynrec/cache.h +++ b/src/cpu/core_dynrec/cache.h @@ -143,7 +143,7 @@ public: } // the following functions will clean all cache blocks that are invalid now due to the write - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { addr&=4095; if (host_readb(hostmem+addr)==val) return; host_writeb(hostmem+addr,val); @@ -164,7 +164,7 @@ public: invalidation_map[addr]++; InvalidateRange(addr,addr); } - void writew(PhysPt addr,uint16_t val){ + void writew(PhysPt addr,uint16_t val) override { addr&=4095; if (host_readw(hostmem+addr)==val) return; host_writew(hostmem+addr,val); @@ -190,7 +190,7 @@ public: #endif InvalidateRange(addr,addr+(Bitu)1); } - void writed(PhysPt addr,uint32_t val){ + void writed(PhysPt addr,uint32_t val) override { addr&=4095; if (host_readd(hostmem+addr)==val) return; host_writed(hostmem+addr,val); @@ -216,7 +216,7 @@ public: #endif InvalidateRange(addr,addr+(Bitu)3); } - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { addr&=4095; if (host_readb(hostmem+addr)==val) return false; // see if there's code where we are writing to @@ -245,7 +245,7 @@ public: host_writeb(hostmem+addr,val); return false; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { addr&=4095; if (host_readw(hostmem+addr)==val) return false; // see if there's code where we are writing to @@ -278,7 +278,7 @@ public: host_writew(hostmem+addr,val); return false; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { addr&=4095; if (host_readd(hostmem+addr)==val) return false; // see if there's code where we are writing to @@ -401,11 +401,11 @@ public: return 0; // none found } - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { hostmem=old_pagehandler->GetHostReadPt(phys_page); return hostmem; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return GetHostReadPt( phys_page ); } public: diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 72adf4c61..9f9128071 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -3376,12 +3376,12 @@ public: ~Weitek_PageHandler() { } - uint8_t readb(PhysPt addr); - void writeb(PhysPt addr,uint8_t val); - uint16_t readw(PhysPt addr); - void writew(PhysPt addr,uint16_t val); - uint32_t readd(PhysPt addr); - void writed(PhysPt addr,uint32_t val); + uint8_t readb(PhysPt addr) override; + void writeb(PhysPt addr,uint8_t val) override; + uint16_t readw(PhysPt addr) override; + void writew(PhysPt addr,uint16_t val) override; + uint32_t readd(PhysPt addr) override; + void writed(PhysPt addr,uint32_t val) override; }; uint8_t Weitek_PageHandler::readb(PhysPt addr) { @@ -3581,7 +3581,7 @@ public: CPU_JMP(false,0,0,0); //Setup the first cpu core menu_update_dynamic(); } - bool Change_Config(Section* newconfig){ + bool Change_Config(Section* newconfig) override { const Section_prop * section=static_cast(newconfig); CPU_AutoDetermineMode=CPU_AUTODETERMINE_NONE; //CPU_CycleLeft=0;//needed ? @@ -4710,7 +4710,7 @@ SerializeCPU() : SerializeGlobalPOD("CPU") {} private: -virtual void getBytes(std::ostream& stream) +void getBytes(std::ostream& stream) override { uint16_t decoder_idx; @@ -4766,7 +4766,7 @@ virtual void getBytes(std::ostream& stream) POD_Save_CPU_Paging(stream); } -virtual void setBytes(std::istream& stream) +void setBytes(std::istream& stream) override { uint16_t decoder_idx; uint16_t decoder_old; diff --git a/src/cpu/paging.cpp b/src/cpu/paging.cpp index 20f945d71..55844d180 100644 --- a/src/cpu/paging.cpp +++ b/src/cpu/paging.cpp @@ -388,41 +388,41 @@ private: } public: PageFoilHandler() : PageHandler(PFLAG_INIT|PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) {(void)addr;read();return 0;} - uint16_t readw(PhysPt addr) {(void)addr;read();return 0;} - uint32_t readd(PhysPt addr) {(void)addr;read();return 0;} + uint8_t readb(PhysPt addr) override {(void)addr;read();return 0;} + uint16_t readw(PhysPt addr) override {(void)addr;read();return 0;} + uint32_t readd(PhysPt addr) override {(void)addr;read();return 0;} - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { work(addr); // execute the write: // no need to care about mpl because we won't be entered // if write isn't allowed mem_writeb(addr,val); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { work(addr); mem_writew(addr,val); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { work(addr); mem_writed(addr,val); } - bool readb_checked(PhysPt addr, uint8_t * val) {(void)addr;(void)val;read();return true;} - bool readw_checked(PhysPt addr, uint16_t * val) {(void)addr;(void)val;read();return true;} - bool readd_checked(PhysPt addr, uint32_t * val) {(void)addr;(void)val;read();return true;} + bool readb_checked(PhysPt addr, uint8_t * val) override {(void)addr;(void)val;read();return true;} + bool readw_checked(PhysPt addr, uint16_t * val) override {(void)addr;(void)val;read();return true;} + bool readd_checked(PhysPt addr, uint32_t * val) override {(void)addr;(void)val;read();return true;} - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { work(addr); mem_writeb(addr,val); return false; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { work(addr); mem_writew(addr,val); return false; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { work(addr); mem_writed(addr,val); return false; @@ -539,13 +539,13 @@ private: public: ExceptionPageHandler() : PageHandler(PFLAG_INIT|PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { if (!cpu.mpl) return readb_through(addr); Exception(addr, false, false); return mem_readb(addr); // read the updated page (unlikely to happen?) } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { // access type is supervisor mode (temporary) // we are always allowed to read in superuser mode // so get the handler and address and read it @@ -554,13 +554,13 @@ public: Exception(addr, false, false); return mem_readw(addr); } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { if (!cpu.mpl) return readd_through(addr); Exception(addr, false, false); return mem_readd(addr); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { if (!cpu.mpl) { writeb_through(addr, val); return; @@ -568,7 +568,7 @@ public: Exception(addr, true, false); mem_writeb(addr, val); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { if (!cpu.mpl) { // TODO Exception on a KR-page? writew_through(addr, val); @@ -584,7 +584,7 @@ public: Exception(addr, true, false); mem_writew(addr, val); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { if (!cpu.mpl) { writed_through(addr, val); return; @@ -593,27 +593,27 @@ public: mem_writed(addr, val); } // returning true means an exception was triggered for these _checked functions - bool readb_checked(PhysPt addr, uint8_t * val) { + bool readb_checked(PhysPt addr, uint8_t * val) override { (void)val;//UNUSED Exception(addr, false, true); return true; } - bool readw_checked(PhysPt addr, uint16_t * val) { + bool readw_checked(PhysPt addr, uint16_t * val) override { (void)val;//UNUSED Exception(addr, false, true); return true; } - bool readd_checked(PhysPt addr, uint32_t * val) { + bool readd_checked(PhysPt addr, uint32_t * val) override { (void)val;//UNUSED Exception(addr, false, true); return true; } - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { (void)val;//UNUSED Exception(addr, true, true); return true; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { if (hack_check(addr)) { LOG_MSG("Page attributes modified without clear"); PAGING_ClearTLB(); @@ -623,7 +623,7 @@ public: Exception(addr, true, true); return true; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { (void)val;//UNUSED Exception(addr, true, true); return true; @@ -698,57 +698,57 @@ static INLINE bool InitPage_CheckUseraccess(Bitu u1,Bitu u2) { class NewInitPageHandler : public PageHandler { public: NewInitPageHandler() : PageHandler(PFLAG_INIT|PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { InitPage(addr, false, false); return mem_readb(addr); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { InitPage(addr, false, false); return mem_readw(addr); } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { InitPage(addr, false, false); return mem_readd(addr); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { InitPage(addr, true, false); mem_writeb(addr,val); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { InitPage(addr, true, false); mem_writew(addr,val); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { InitPage(addr, true, false); mem_writed(addr,val); } - bool readb_checked(PhysPt addr, uint8_t * val) { + bool readb_checked(PhysPt addr, uint8_t * val) override { if (InitPage(addr, false, true)) return true; *val=mem_readb(addr); return false; } - bool readw_checked(PhysPt addr, uint16_t * val) { + bool readw_checked(PhysPt addr, uint16_t * val) override { if (InitPage(addr, false, true)) return true; *val=mem_readw(addr); return false; } - bool readd_checked(PhysPt addr, uint32_t * val) { + bool readd_checked(PhysPt addr, uint32_t * val) override { if (InitPage(addr, false, true)) return true; *val=mem_readd(addr); return false; } - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { if (InitPage(addr, true, true)) return true; mem_writeb(addr,val); return false; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { if (InitPage(addr, true, true)) return true; mem_writew(addr,val); return false; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { if (InitPage(addr, true, true)) return true; mem_writed(addr,val); return false; @@ -1284,19 +1284,19 @@ public: InitPageUserROHandler() { flags=PFLAG_INIT|PFLAG_NOCODE; } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { InitPage(addr,true,false); host_writeb(get_tlb_read(addr)+addr,(uint8_t)(val&0xff)); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { InitPage(addr,true,false); host_writew(get_tlb_read(addr)+addr,(uint16_t)(val&0xffff)); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { InitPage(addr,true,false); host_writed(get_tlb_read(addr)+addr,(uint32_t)val); } - bool writeb_checked(PhysPt addr,uint8_t val) { + bool writeb_checked(PhysPt addr,uint8_t val) override { Bitu writecode=InitPageCheckOnly(addr,(uint8_t)(val&0xff)); if (writecode) { HostPt tlb_addr; @@ -1307,7 +1307,7 @@ public: } return true; } - bool writew_checked(PhysPt addr,uint16_t val) { + bool writew_checked(PhysPt addr,uint16_t val) override { Bitu writecode=InitPageCheckOnly(addr,(uint16_t)(val&0xffff)); if (writecode) { HostPt tlb_addr; @@ -1318,7 +1318,7 @@ public: } return true; } - bool writed_checked(PhysPt addr,uint32_t val) { + bool writed_checked(PhysPt addr,uint32_t val) override { Bitu writecode=InitPageCheckOnly(addr,(uint32_t)val); if (writecode) { HostPt tlb_addr; diff --git a/src/dos/cdrom.h b/src/dos/cdrom.h index 8c615041d..3c14e8b71 100644 --- a/src/dos/cdrom.h +++ b/src/dos/cdrom.h @@ -163,21 +163,21 @@ public: virtual ~CDROM_Interface_SDL(void); /* base C++ class overrides, no documentation needed */ - virtual bool SetDevice (char* path, int forceCD); - virtual bool GetUPC (unsigned char& attr, char* upc) { attr = 0; strcpy(upc,"UPC"); return true; }; - virtual bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut); - virtual bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr); - virtual bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos); - virtual bool GetAudioStatus (bool& playing, bool& pause); - virtual bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen); - virtual bool PlayAudioSector (unsigned long start,unsigned long len); - virtual bool PauseAudio (bool resume); - virtual bool StopAudio (void); - virtual void ChannelControl (TCtrl ctrl) { (void)ctrl; return; }; - virtual bool ReadSectors (PhysPt /*buffer*/, bool /*raw*/, unsigned long /*sector*/, unsigned long /*num*/) { return false; }; + bool SetDevice (char* path, int forceCD) override; + bool GetUPC (unsigned char& attr, char* upc) override { attr = 0; strcpy(upc,"UPC"); return true; }; + bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut) override; + bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr) override; + bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos) override; + bool GetAudioStatus (bool& playing, bool& pause) override; + bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen) override; + bool PlayAudioSector (unsigned long start,unsigned long len) override; + bool PauseAudio (bool resume) override; + bool StopAudio (void) override; + void ChannelControl (TCtrl ctrl) override { (void)ctrl; return; }; + bool ReadSectors (PhysPt /*buffer*/, bool /*raw*/, unsigned long /*sector*/, unsigned long /*num*/) override { return false; }; /* This is needed for IDE hack, who's buffer does not exist in DOS physical memory */ - virtual bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num); - virtual bool LoadUnloadMedia (bool unload); + bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num) override; + bool LoadUnloadMedia (bool unload) override; private: //! \brief Open the device @@ -198,22 +198,22 @@ private: class CDROM_Interface_Fake : public CDROM_Interface { public: - bool SetDevice (char* /*path*/, int /*forceCD*/) { return true; }; - bool GetUPC (unsigned char& attr, char* upc) { attr = 0; strcpy(upc,"UPC"); return true; }; - bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut); - bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr); - bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos); - bool GetAudioStatus (bool& playing, bool& pause); - bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen); - bool PlayAudioSector (unsigned long /*start*/,unsigned long /*len*/) { return true; }; - bool PauseAudio (bool /*resume*/) { return true; }; - bool StopAudio (void) { return true; }; - void ChannelControl (TCtrl ctrl) { (void)ctrl; return; }; - bool ReadSectors (PhysPt /*buffer*/, bool /*raw*/, unsigned long /*sector*/, unsigned long /*num*/) { return true; }; + bool SetDevice (char* /*path*/, int /*forceCD*/) override { return true; }; + bool GetUPC (unsigned char& attr, char* upc) override { attr = 0; strcpy(upc,"UPC"); return true; }; + bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut) override; + bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr) override; + bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos) override; + bool GetAudioStatus (bool& playing, bool& pause) override; + bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen) override; + bool PlayAudioSector (unsigned long /*start*/,unsigned long /*len*/) override { return true; }; + bool PauseAudio (bool /*resume*/) override { return true; }; + bool StopAudio (void) override { return true; }; + void ChannelControl (TCtrl ctrl) override { (void)ctrl; return; }; + bool ReadSectors (PhysPt /*buffer*/, bool /*raw*/, unsigned long /*sector*/, unsigned long /*num*/) override { return true; }; /* This is needed for IDE hack, who's buffer does not exist in DOS physical memory */ - bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num); + bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num) override; - bool LoadUnloadMedia (bool /*unload*/) { return true; }; + bool LoadUnloadMedia (bool /*unload*/) override { return true; }; CDROM_Interface_Fake() { class_id = ID_FAKE; } @@ -254,14 +254,14 @@ private: BinaryFile (const BinaryFile&) = delete; // prevent copying BinaryFile& operator= (const BinaryFile&) = delete; // prevent assignment - bool read(uint8_t *buffer,int64_t seek, int count); - bool seek(int64_t offset); - uint16_t decode(uint8_t *buffer); - uint16_t getEndian(); - uint32_t getRate() { return 44100; } - uint8_t getChannels() { return 2; } - int64_t getLength(); - void setAudioPosition(uint32_t pos) { audio_pos = pos; } + bool read(uint8_t *buffer,int64_t seek, int count) override; + bool seek(int64_t offset) override; + uint16_t decode(uint8_t *buffer) override; + uint16_t getEndian() override; + uint32_t getRate() override { return 44100; } + uint8_t getChannels() override { return 2; } + int64_t getLength() override; + void setAudioPosition(uint32_t pos) override { audio_pos = pos; } private: std::ifstream *file; }; @@ -275,14 +275,14 @@ private: AudioFile (const AudioFile&) = delete; // prevent copying AudioFile& operator= (const AudioFile&) = delete; // prevent assignment - bool read(uint8_t *buffer,int64_t seek, int count) { (void)buffer; (void)seek; (void)count; return false; } - bool seek(int64_t offset); - uint16_t decode(uint8_t *buffer); - uint16_t getEndian(); - uint32_t getRate(); - uint8_t getChannels(); - int64_t getLength(); - void setAudioPosition(uint32_t pos) { (void)pos;/*unused*/ } + bool read(uint8_t *buffer,int64_t seek, int count) override { (void)buffer; (void)seek; (void)count; return false; } + bool seek(int64_t offset) override; + uint16_t decode(uint8_t *buffer) override; + uint16_t getEndian() override; + uint32_t getRate() override; + uint8_t getChannels() override; + int64_t getLength() override; + void setAudioPosition(uint32_t pos) override { (void)pos;/*unused*/ } private: Sound_Sample *sample = nullptr; }; @@ -296,14 +296,14 @@ private: CHDFile(const CHDFile&) = delete; CHDFile& operator= (const CHDFile&) = delete; - bool read(uint8_t* buffer, int64_t seek, int count); - bool seek(int64_t offset); - uint16_t decode(uint8_t* buffer); - uint16_t getEndian(); - uint32_t getRate() { return 44100; } - uint8_t getChannels() { return 2; } - int64_t getLength(); - void setAudioPosition(uint32_t pos) { audio_pos = pos; } + bool read(uint8_t* buffer, int64_t seek, int count) override; + bool seek(int64_t offset) override; + uint16_t decode(uint8_t* buffer) override; + uint16_t getEndian() override; + uint32_t getRate() override { return 44100; } + uint8_t getChannels() override { return 2; } + int64_t getLength() override; + void setAudioPosition(uint32_t pos) override { audio_pos = pos; } chd_file* getChd() { return this->chd; } private: chd_file* chd = nullptr; @@ -339,22 +339,22 @@ public: //! \brief Constructor, with parameter for subunit CDROM_Interface_Image (uint8_t subUnit); virtual ~CDROM_Interface_Image (void); - void InitNewMedia (void) {}; - bool SetDevice (char *path, int forceCD); - bool GetUPC (unsigned char& attr, char* upc); - bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut); - bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr); - bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos); - bool GetAudioStatus (bool& playing, bool& pause); - bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen); - bool PlayAudioSector (unsigned long start, unsigned long len); - bool PauseAudio (bool resume); - bool StopAudio (void); - void ChannelControl (TCtrl ctrl); - bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num); + void InitNewMedia (void) override {}; + bool SetDevice (char *path, int forceCD) override; + bool GetUPC (unsigned char& attr, char* upc) override; + bool GetAudioTracks (int& stTrack, int& end, TMSF& leadOut) override; + bool GetAudioTrackInfo (int track, TMSF& start, unsigned char& attr) override; + bool GetAudioSub (unsigned char& attr, unsigned char& track, unsigned char& index, TMSF& relPos, TMSF& absPos) override; + bool GetAudioStatus (bool& playing, bool& pause) override; + bool GetMediaTrayStatus (bool& mediaPresent, bool& mediaChanged, bool& trayOpen) override; + bool PlayAudioSector (unsigned long start, unsigned long len) override; + bool PauseAudio (bool resume) override; + bool StopAudio (void) override; + void ChannelControl (TCtrl ctrl) override; + bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num) override; /* This is needed for IDE hack, who's buffer does not exist in DOS physical memory */ - bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num); - bool LoadUnloadMedia (bool unload); + bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num) override; + bool LoadUnloadMedia (bool unload) override; //! \brief Indicate whether the image has a data track bool ReadSector (uint8_t *buffer, bool raw, unsigned long sector); //! \brief Indicate whether the image has a data track @@ -571,11 +571,11 @@ class CDROM_Interface_Ioctl : public CDROM_Interface_SDL public: CDROM_Interface_Ioctl (void); - bool SetDevice (char* path, int forceCD); - bool GetUPC (unsigned char& attr, char* upc); - bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num); + bool SetDevice (char* path, int forceCD) override; + bool GetUPC (unsigned char& attr, char* upc) override; + bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num) override; /* This is needed for IDE hack, who's buffer does not exist in DOS physical memory */ - bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num); + bool ReadSectorsHost (void* buffer, bool raw, unsigned long sector, unsigned long num) override; private: char device_name[512]; diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index fa91bf089..114a4b0d1 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -70,22 +70,22 @@ uint8_t DefaultANSIAttr() { class device_CON : public DOS_Device { public: device_CON(); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); - bool Close(); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; uint8_t GetAnsiAttr(void) { return ansi.attr; } void SetAnsiAttr(uint8_t attr) { ansi.attr = attr; } - uint16_t GetInformation(void); - void SetInformation(uint16_t info) { + uint16_t GetInformation(void) override; + void SetInformation(uint16_t info) override { binary = info & DeviceInfoFlags::Binary; } - bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } - bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } + bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } + bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } bool ANSI_SYS_installed(); void ClearKeyMap() { key_map.clear(); diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index bc8dab2bf..45ce65cb2 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -5621,7 +5621,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { SerializeGlobalPOD::getBytes(stream); @@ -5663,7 +5663,7 @@ private: POD_Save_DOS_Tables(stream); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { SerializeGlobalPOD::setBytes(stream); diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index 51a9d7744..92dbb3632 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -233,28 +233,28 @@ static void DOS_CheckOpenExtDevice(const char *name) { class device_NUL : public DOS_Device { public: device_NUL() { SetName("NUL"); }; - virtual bool Read(uint8_t * data,uint16_t * size) { + bool Read(uint8_t * data,uint16_t * size) override { (void)data; // UNUSED *size = 0; //Return success and no data read. // LOG(LOG_IOCTL,LOG_NORMAL)("%s:READ",GetName()); return true; } - virtual bool Write(const uint8_t * data,uint16_t * size) { + bool Write(const uint8_t * data,uint16_t * size) override { (void)data; // UNUSED (void)size; // UNUSED // LOG(LOG_IOCTL,LOG_NORMAL)("%s:WRITE",GetName()); return true; } - virtual bool Seek(uint32_t * pos,uint32_t type) { + bool Seek(uint32_t * pos,uint32_t type) override { (void)type; (void)pos; // LOG(LOG_IOCTL,LOG_NORMAL)("%s:SEEK",GetName()); return true; } - virtual bool Close() { return true; } - virtual uint16_t GetInformation(void) { return DeviceInfoFlags::Device | DeviceInfoFlags::Nul; } - virtual bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } - virtual bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } + bool Close() override { return true; } + uint16_t GetInformation(void) override { return DeviceInfoFlags::Device | DeviceInfoFlags::Nul; } + bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } + bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } }; class device_PRN : public DOS_Device { @@ -262,13 +262,13 @@ public: device_PRN() { SetName("PRN"); } - bool Read(uint8_t * data,uint16_t * size) { + bool Read(uint8_t * data,uint16_t * size) override { (void)data; // UNUSED (void)size; // UNUSED DOS_SetError(DOSERR_ACCESS_DENIED); return false; } - bool Write(const uint8_t * data,uint16_t * size) { + bool Write(const uint8_t * data,uint16_t * size) override { for(int i = 0; i < 9; i++) { // look up a parallel port if(parallelPortObjects[i] != NULL) { @@ -281,15 +281,15 @@ public: } return false; } - bool Seek(uint32_t * pos,uint32_t type) { + bool Seek(uint32_t * pos,uint32_t type) override { (void)type; // UNUSED *pos = 0; return true; } - uint16_t GetInformation(void) { + uint16_t GetInformation(void) override { return DeviceInfoFlags::Device | DeviceInfoFlags::Binary; } - bool Close() { + bool Close() override { return false; } }; @@ -509,7 +509,7 @@ public: strcpy(tmpAscii, "#clip$.asc"); strcpy(tmpUnicode, "#clip$.txt"); } - virtual bool Read(uint8_t * data,uint16_t * size) { + bool Read(uint8_t * data,uint16_t * size) override { if(control->SecureMode()||!(dos_clipboard_device_access==2||dos_clipboard_device_access==4)) { *size = 0; return true; @@ -530,7 +530,7 @@ public: } return true; } - virtual bool Write(const uint8_t * data,uint16_t * size) { + bool Write(const uint8_t * data,uint16_t * size) override { if(control->SecureMode()||!(dos_clipboard_device_access==3||dos_clipboard_device_access==4)) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; @@ -564,7 +564,7 @@ public: } return true; } - virtual bool Seek(uint32_t * pos,uint32_t type) { + bool Seek(uint32_t * pos,uint32_t type) override { if(control->SecureMode()||!(dos_clipboard_device_access==2||dos_clipboard_device_access==4)) { *pos = 0; return true; @@ -602,7 +602,7 @@ public: fPointer = newPos; return true; } - virtual bool Close() { + bool Close() override { if(control->SecureMode()||dos_clipboard_device_access<2) return false; clipSize = 0; // Reset clipboard read @@ -616,7 +616,7 @@ public: CommitData(); return true; } - uint16_t GetInformation(void) { + uint16_t GetInformation(void) override { return DeviceInfoFlags::Device | DeviceInfoFlags::EofOnInput | DeviceInfoFlags::Binary; } }; diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index 8bfb20af1..8e7af34e5 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -1402,19 +1402,19 @@ static bool MSCDEX_ValidDevName(const char *s) { class device_MSCDEX : public DOS_Device { public: device_MSCDEX(const char *devname) { SetName(MSCDEX_ValidDevName(devname) ? devname : "MSCD001"); } - bool Read (uint8_t * /*data*/,uint16_t * /*size*/) { return false;} - bool Write(const uint8_t * /*data*/,uint16_t * /*size*/) { + bool Read (uint8_t * /*data*/,uint16_t * /*size*/) override { return false;} + bool Write(const uint8_t * /*data*/,uint16_t * /*size*/) override { LOG(LOG_ALL,LOG_NORMAL)("Write to mscdex device"); return false; } - bool Seek(uint32_t * /*pos*/,uint32_t /*type*/){return false;} - bool Close(){return false;} - uint16_t GetInformation(void) + bool Seek(uint32_t * /*pos*/,uint32_t /*type*/) override {return false;} + bool Close() override {return false;} + uint16_t GetInformation(void) override { return DeviceInfoFlags::Device | DeviceInfoFlags::IoctlSupport | DeviceInfoFlags::OpenCloseSupport; } - bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode); - bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode); + bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override; + bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override; // private: // uint8_t cache; }; diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 9fb2612bb..4bf1bf2b6 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -144,7 +144,7 @@ Bitu DEBUG_EnableDebugger(void); class MOUSE : public Program { public: - void Run(void); + void Run(void) override; }; void MOUSE::Run(void) { @@ -1043,7 +1043,7 @@ public: dos.dta(save_dta); } - void Run(void) { + void Run(void) override { DOS_Drive *newdrive = NULL; std::string label; std::string umount; @@ -1623,7 +1623,7 @@ void GUI_Run(bool pressed); class CFGTOOL : public Program { public: - void Run(void) { + void Run(void) override { if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) { WriteOut("Starts DOSBox-X's graphical configuration tool.\n\nCFGTOOL\n\nNote: You can also use CONFIG command for command-line configurations.\n"); return; @@ -1659,19 +1659,19 @@ class PC98ITFPageHandler : public PageHandler { public: PC98ITFPageHandler() : PageHandler(PFLAG_READABLE|PFLAG_HASROM) {} PC98ITFPageHandler(Bitu flags) : PageHandler(flags) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { return PC98_ITF_ROM+(phys_page&0x7)*MEM_PAGESIZE; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return PC98_ITF_ROM+(phys_page&0x7)*MEM_PAGESIZE; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { LOG(LOG_CPU,LOG_ERROR)("Write %x to rom at %x",(int)val,(int)addr); } - void writew(PhysPt addr,uint16_t val){ + void writew(PhysPt addr,uint16_t val) override { LOG(LOG_CPU,LOG_ERROR)("Write %x to rom at %x",(int)val,(int)addr); } - void writed(PhysPt addr,uint32_t val){ + void writed(PhysPt addr,uint32_t val) override { LOG(LOG_CPU,LOG_ERROR)("Write %x to rom at %x",(int)val,(int)addr); } }; @@ -1902,7 +1902,7 @@ public: /*! \brief Program entry point, when the command is run */ - void Run(void) { + void Run(void) override { std::string tmp; std::string bios; std::string boothax_str; @@ -2879,7 +2879,7 @@ void runBoot(const char *str) { class LOADROM : public Program { public: - void Run(void) { + void Run(void) override { if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) { WriteOut(MSG_Get("PROGRAM_LOADROM_HELP")); return; @@ -3254,7 +3254,7 @@ restart_int: } #endif - void Run(void) { + void Run(void) override { std::string disktype; std::string src; std::string filename; @@ -4194,7 +4194,7 @@ void IMGSWAP_ProgramStart(Program** make) class LOADFIX : public Program { public: - void Run(void); + void Run(void) override; }; bool XMS_Active(void); @@ -4370,7 +4370,7 @@ static void LOADFIX_ProgramStart(Program * * make) { class RESCAN : public Program { public: - void Run(void); + void Run(void) override; }; void RESCAN::Run(void) @@ -4561,7 +4561,7 @@ public: return true; } - void Run(void) { + void Run(void) override { if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) { WriteOut("A full-screen introduction to DOSBox-X.\n\nINTRO [/RUN] [CDROM|MOUNT|USAGE|WELCOME]\n"); return; @@ -4962,7 +4962,7 @@ class IMGMOUNT : public Program { if (none) WriteOut(MSG_Get("PROGRAM_IMGMOUNT_STATUS_NONE")); dos.dta(save_dta); } - void Run(void) { + void Run(void) override { //Hack To allow long commandlines ChangeToLongCmd(); /* In secure mode don't allow people to change imgmount points. @@ -6665,7 +6665,7 @@ const char* DOS_GetLoadedLayout(void); class KEYB : public Program { public: - void Run(void); + void Run(void) override; }; void KEYB::Run(void) { @@ -6789,7 +6789,7 @@ static void KEYB_ProgramStart(Program * * make) { class MODE : public Program { public: - void Run(void); + void Run(void) override; private: void PrintStatus() { WriteOut("Status for device CON:\n----------------------\nColumns=%d\nLines=%d\n", COLS, LINES); @@ -7098,7 +7098,7 @@ void MAPPER_AutoType(std::vector &sequence, const uint32_t wait_ms, class AUTOTYPE : public Program { public: - void Run(); + void Run() override; private: void PrintUsage(); @@ -7288,7 +7288,7 @@ void AUTOTYPE_ProgramStart(Program **make) class ADDKEY : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7321,7 +7321,7 @@ static void ADDKEY_ProgramStart(Program * * make) { class LS : public Program { public: - void Run(void); + void Run(void) override; }; void LS::Run() @@ -7340,7 +7340,7 @@ static void LS_ProgramStart(Program * * make) { class CHOICE : public Program { public: - void Run(void); + void Run(void) override; }; void CHOICE::Run() @@ -7361,7 +7361,7 @@ void CHOICE_ProgramStart(Program **make) class COUNTRY : public Program { public: - void Run(void); + void Run(void) override; }; void COUNTRY::Run() @@ -7379,7 +7379,7 @@ static void COUNTRY_ProgramStart(Program * * make) { #ifdef C_ICONV class UTF8 : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7459,7 +7459,7 @@ static void UTF8_ProgramStart(Program * * make) { class UTF16 : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7566,7 +7566,7 @@ static void UTF16_ProgramStart(Program * * make) { class VTEXT : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7595,7 +7595,7 @@ static void VTEXT_ProgramStart(Program * * make) { class DCGA : public Program { public: - void Run(void); + void Run(void) override; }; void DCGA::Run() @@ -7612,7 +7612,7 @@ static void DCGA_ProgramStart(Program * * make) { class TEXT80X25 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT80X25::Run() @@ -7632,7 +7632,7 @@ static void TEXT80X25_ProgramStart(Program * * make) { class TEXT80X43 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT80X43::Run() @@ -7652,7 +7652,7 @@ static void TEXT80X43_ProgramStart(Program * * make) { class TEXT80X50 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT80X50::Run() @@ -7672,7 +7672,7 @@ static void TEXT80X50_ProgramStart(Program * * make) { class TEXT80X60 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT80X60::Run() @@ -7692,7 +7692,7 @@ static void TEXT80X60_ProgramStart(Program * * make) { class TEXT132X25 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT132X25::Run() @@ -7712,7 +7712,7 @@ static void TEXT132X25_ProgramStart(Program * * make) { class TEXT132X43 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT132X43::Run() @@ -7732,7 +7732,7 @@ static void TEXT132X43_ProgramStart(Program * * make) { class TEXT132X50 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT132X50::Run() @@ -7752,7 +7752,7 @@ static void TEXT132X50_ProgramStart(Program * * make) { class TEXT132X60 : public Program { public: - void Run(void); + void Run(void) override; }; void TEXT132X60::Run() @@ -7772,7 +7772,7 @@ static void TEXT132X60_ProgramStart(Program * * make) { class HELP : public Program { public: - void Run(void); + void Run(void) override; }; void HELP::Run() @@ -7791,7 +7791,7 @@ static void HELP_ProgramStart(Program * * make) { class DELTREE : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7829,7 +7829,7 @@ static void DELTREE_ProgramStart(Program * * make) { class TREE : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7863,7 +7863,7 @@ static void TREE_ProgramStart(Program * * make) { class TITLE : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -7903,7 +7903,7 @@ static void TITLE_ProgramStart(Program * * make) { class VHDMAKE : public Program { public: - void Run(void); + void Run(void) override; private: const char* vhdTypes[5] = { "", "", "Fixed", "Dynamic", "Differencing" }; uint64_t ssizetou64(const char* s_size); @@ -8133,7 +8133,7 @@ static void VHDMAKE_ProgramStart(Program * * make) { class COLOR : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -8272,7 +8272,7 @@ void resetFontSize(); bool get_pal = false; class SETCOLOR : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -8412,7 +8412,7 @@ static void SETCOLOR_ProgramStart(Program * * make) { extern Bitu int2fdbg_hook_callback; class INT2FDBG : public Program { public: - void Run(void); + void Run(void) override; private: void PrintUsage() { constexpr const char *msg = @@ -8473,7 +8473,7 @@ void EndStartProcess() { const char * TranslateHostPath(const char * arg, bool next = false); class START : public Program { public: - void Run() { + void Run() override { if(control->SecureMode()) { WriteOut(MSG_Get("PROGRAM_CONFIG_SECURE_DISALLOW")); return; @@ -8792,7 +8792,7 @@ class FLAGSAVE : public Program { public: - void Run(void) + void Run(void) override { std::string file_to_flag; int i, lf; diff --git a/src/dos/drive_fat.cpp b/src/dos/drive_fat.cpp index 635dfbcec..318401879 100644 --- a/src/dos/drive_fat.cpp +++ b/src/dos/drive_fat.cpp @@ -230,14 +230,14 @@ char* fatDrive::Generate_SFN(const char *path, const char *name) { class fatFile : public DOS_File { public: fatFile(const char* name, uint32_t startCluster, uint32_t fileLen, fatDrive *useDrive); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); - bool Close(); - uint16_t GetInformation(void); - void Flush(void); - bool UpdateDateTimeFromHost(void); - uint32_t GetSeekPos(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; + void Flush(void) override; + bool UpdateDateTimeFromHost(void) override; + uint32_t GetSeekPos(void) override; uint32_t firstCluster; uint32_t seekpos = 0; uint32_t filelength; diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index 5f8aea0cd..a0918542b 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -844,12 +844,12 @@ unsigned int isoDrive::UDFextent_read(struct UDFextents &ex,unsigned char *buf,s class isoFile : public DOS_File { public: isoFile(isoDrive* drive, const char* name, const FileStat_Block* stat, uint32_t offset); - bool Read(uint8_t *data, uint16_t *size); - bool Write(const uint8_t *data, uint16_t *size); - bool Seek(uint32_t *pos, uint32_t type); - bool Close(); - uint16_t GetInformation(void); - uint32_t GetSeekPos(void); + bool Read(uint8_t *data, uint16_t *size) override; + bool Write(const uint8_t *data, uint16_t *size) override; + bool Seek(uint32_t *pos, uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; + uint32_t GetSeekPos(void) override; public: UDFextents udffext; bool udf = false; diff --git a/src/dos/drive_overlay.cpp b/src/dos/drive_overlay.cpp index db54e9cc2..dbbad03ce 100644 --- a/src/dos/drive_overlay.cpp +++ b/src/dos/drive_overlay.cpp @@ -323,7 +323,7 @@ public: overlay_active = false; if (logoverlay) LOG_MSG("constructing OverlayFile: %s",name); } - bool Write(const uint8_t * data,uint16_t * size) { + bool Write(const uint8_t * data,uint16_t * size) override { uint32_t f = flags&0xf; if (!overlay_active && (f == OPEN_READWRITE || f == OPEN_WRITE)) { if (logoverlay) LOG_MSG("write detected, switching file for %s",GetName()); diff --git a/src/dos/drive_physfs.cpp b/src/dos/drive_physfs.cpp index fd0962e92..1d4ffa3eb 100644 --- a/src/dos/drive_physfs.cpp +++ b/src/dos/drive_physfs.cpp @@ -92,14 +92,14 @@ static char *normalize(char * name, const char *basedir) { class physfsFile : public DOS_File { public: physfsFile(const char* name, PHYSFS_file * handle,uint16_t devinfo, const char* physname, bool write); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * pos,uint32_t type); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * pos,uint32_t type) override; bool prepareRead(); bool prepareWrite(); - bool Close(); - uint16_t GetInformation(void); - bool UpdateDateTimeFromHost(void); + bool Close() override; + uint16_t GetInformation(void) override; + bool UpdateDateTimeFromHost(void) override; private: PHYSFS_file * fhandle; enum { READ,WRITE } last_action; diff --git a/src/dos/drive_virtual.cpp b/src/dos/drive_virtual.cpp index aec030fb6..34c201fdb 100644 --- a/src/dos/drive_virtual.cpp +++ b/src/dos/drive_virtual.cpp @@ -311,11 +311,11 @@ uint32_t VFILE_GetCPIData(const char *filename, std::vector &cpibuf) { class Virtual_File : public DOS_File { public: Virtual_File(uint8_t * in_data,uint32_t in_size); - bool Read(uint8_t * data,uint16_t * size); - bool Write(const uint8_t * data,uint16_t * size); - bool Seek(uint32_t * new_pos,uint32_t type); - bool Close(); - uint16_t GetInformation(void); + bool Read(uint8_t * data,uint16_t * size) override; + bool Write(const uint8_t * data,uint16_t * size) override; + bool Seek(uint32_t * new_pos,uint32_t type) override; + bool Close() override; + uint16_t GetInformation(void) override; private: uint32_t file_size; uint32_t file_pos = 0; diff --git a/src/dos/drives.h b/src/dos/drives.h index 53f84294d..8ad928f26 100644 --- a/src/dos/drives.h +++ b/src/dos/drives.h @@ -63,44 +63,44 @@ private: class localDrive : public DOS_Drive { public: localDrive(const char * startdir,uint16_t _bytes_sector,uint8_t _sectors_cluster,uint16_t _total_clusters,uint16_t _free_clusters,uint8_t _mediaid, std::vector &options); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; virtual FILE *GetSystemFilePtr(char const * const name, char const * const type); virtual bool GetSystemFilename(char* sysName, char const * const dosName); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - virtual bool FileUnlink(const char * name); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); - virtual bool TestDir(const char * dir); - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); - virtual bool FindNext(DOS_DTA & dta); - virtual bool SetFileAttr(const char * name,uint16_t attr); - virtual bool GetFileAttr(const char * name,uint16_t * attr); - virtual bool GetFileAttrEx(char* name, struct stat *status); + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool TestDir(const char * dir) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false) override; + bool FindNext(DOS_DTA & dta) override; + bool SetFileAttr(const char * name,uint16_t attr) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; std::string GetHostName(const char * name); - virtual unsigned long GetCompressedSize(char* name); + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - virtual HANDLE CreateOpenFile(char const* const name); + HANDLE CreateOpenFile(char const* const name) override; virtual unsigned long GetSerial(); #endif - virtual bool Rename(const char * oldname,const char * newname); - virtual bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters); - virtual bool FileExists(const char* name); - virtual bool FileStat(const char* name, FileStat_Block * const stat_block); - virtual uint8_t GetMediaByte(void); - virtual bool isRemote(void); - virtual bool isRemovable(void); - virtual Bits UnMount(void); - virtual char const * GetLabel(){return dirCache.GetLabel();}; - virtual void SetLabel(const char *label, bool iscdrom, bool updatable) { dirCache.SetLabel(label,iscdrom,updatable); }; - virtual void *opendir(const char *name); - virtual void closedir(void *handle); - virtual bool read_directory_first(void *handle, char* entry_name, char* entry_sname, bool& is_directory); - virtual bool read_directory_next(void *handle, char* entry_name, char* entry_sname, bool& is_directory); + bool Rename(const char * oldname,const char * newname) override; + bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters) override; + bool FileExists(const char* name) override; + bool FileStat(const char* name, FileStat_Block * const stat_block) override; + uint8_t GetMediaByte(void) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; + char const * GetLabel() override {return dirCache.GetLabel();}; + void SetLabel(const char *label, bool iscdrom, bool updatable) override { dirCache.SetLabel(label,iscdrom,updatable); }; + void *opendir(const char *name) override; + void closedir(void *handle) override; + bool read_directory_first(void *handle, char* entry_name, char* entry_sname, bool& is_directory) override; + bool read_directory_next(void *handle, char* entry_name, char* entry_sname, bool& is_directory) override; virtual void remove_special_file_from_disk(const char* dosname, const char* operation); virtual std::string create_filename_of_special_operation(const char* dosname, const char* operation, bool expand); virtual bool add_special_file_to_disk(const char* dosname, const char* operation, uint16_t value, bool isdir); - virtual void EmptyCache(void) { dirCache.EmptyCache(); }; - virtual void MediaChange() {}; + void EmptyCache(void) override { dirCache.EmptyCache(); }; + void MediaChange() override {}; const char* getBasedir() const {return basedir;}; struct { uint16_t bytes_sector; @@ -131,36 +131,36 @@ private: public: physfsDrive(const char driveLetter, const char * startdir,uint16_t _bytes_sector,uint8_t _sectors_cluster,uint16_t _total_clusters,uint16_t _free_clusters,uint8_t _mediaid, int& error, std::vector &options); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - virtual bool FileUnlink(const char * name); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); - virtual bool TestDir(const char * dir); - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); - virtual bool FindNext(DOS_DTA & dta); - virtual bool Rename(const char * oldname,const char * newname); - virtual bool SetFileAttr(const char * name,uint16_t attr); - virtual bool GetFileAttr(const char * name,uint16_t * attr); - virtual bool GetFileAttrEx(char* name, struct stat *status); - virtual unsigned long GetCompressedSize(char* name); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool TestDir(const char * dir) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false) override; + bool FindNext(DOS_DTA & dta) override; + bool Rename(const char * oldname,const char * newname) override; + bool SetFileAttr(const char * name,uint16_t attr) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - virtual HANDLE CreateOpenFile(char const* const name); - virtual unsigned long GetSerial(); + HANDLE CreateOpenFile(char const* const name) override; + unsigned long GetSerial() override; #endif - virtual bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters); - virtual bool FileExists(const char* name); - virtual bool FileStat(const char* name, FileStat_Block * const stat_block); - virtual bool isRemote(void); - virtual bool isRemovable(void); - virtual void *opendir(const char *dir); - virtual void closedir(void *handle); - virtual bool read_directory_first(void *handle, char* entry_name, char* entry_sname, bool& is_directory); - virtual bool read_directory_next(void *handle, char* entry_name, char* entry_sname, bool& is_directory); - virtual const char *GetInfo(void); + bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters) override; + bool FileExists(const char* name) override; + bool FileStat(const char* name, FileStat_Block * const stat_block) override; + bool isRemote(void) override; + bool isRemovable(void) override; + void *opendir(const char *dir) override; + void closedir(void *handle) override; + bool read_directory_first(void *handle, char* entry_name, char* entry_sname, bool& is_directory) override; + bool read_directory_next(void *handle, char* entry_name, char* entry_sname, bool& is_directory) override; + const char *GetInfo(void) override; virtual const char *getOverlaydir(void); virtual bool setOverlaydir(const char * name); - Bits UnMount(); + Bits UnMount() override; virtual ~physfsDrive(void); protected: @@ -368,32 +368,32 @@ public: fatDrive(const char * sysFilename, uint32_t bytesector, uint32_t cylsector, uint32_t headscyl, uint32_t cylinders, std::vector &options); fatDrive(imageDisk *sourceLoadedDisk, std::vector &options); void fatDriveInit(const char *sysFilename, uint32_t bytesector, uint32_t cylsector, uint32_t headscyl, uint32_t cylinders, uint64_t filesize, const std::vector &options); - virtual ~fatDrive(); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - virtual bool FileUnlink(const char * name); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); - virtual bool TestDir(const char * dir); - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); - virtual bool FindNext(DOS_DTA & dta); - virtual bool SetFileAttr(const char * name,uint16_t attr); - virtual bool GetFileAttr(const char * name,uint16_t * attr); - virtual bool GetFileAttrEx(char* name, struct stat *status); - virtual unsigned long GetCompressedSize(char* name); + ~fatDrive(); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool TestDir(const char * dir) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false) override; + bool FindNext(DOS_DTA & dta) override; + bool SetFileAttr(const char * name,uint16_t attr) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - virtual HANDLE CreateOpenFile(char const* const name); + HANDLE CreateOpenFile(char const* const name) override; #endif virtual unsigned long GetSerial(); - virtual bool Rename(const char * oldname,const char * newname); - virtual bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters); - virtual bool AllocationInfo32(uint32_t * _bytes_sector,uint32_t * _sectors_cluster,uint32_t * _total_clusters,uint32_t * _free_clusters); - virtual bool FileExists(const char* name); - virtual bool FileStat(const char* name, FileStat_Block * const stat_block); - virtual uint8_t GetMediaByte(void); - virtual bool isRemote(void); - virtual bool isRemovable(void); - virtual Bits UnMount(void); + bool Rename(const char * oldname,const char * newname) override; + bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters) override; + bool AllocationInfo32(uint32_t * _bytes_sector,uint32_t * _sectors_cluster,uint32_t * _total_clusters,uint32_t * _free_clusters) override; + bool FileExists(const char* name) override; + bool FileStat(const char* name, FileStat_Block * const stat_block) override; + uint8_t GetMediaByte(void) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; public: struct clusterChainMemory { uint32_t current_cluster_no = 0; @@ -507,14 +507,14 @@ public: uint32_t sector_size = 0; // INT 25h/INT 26h - virtual uint32_t GetSectorCount(void); - virtual uint32_t GetSectorSize(void); - virtual uint8_t Read_AbsoluteSector_INT25(uint32_t sectnum, void * data); - virtual uint8_t Write_AbsoluteSector_INT25(uint32_t sectnum, void * data); - virtual void UpdateDPB(unsigned char dos_drive); + uint32_t GetSectorCount(void) override; + uint32_t GetSectorSize(void) override; + uint8_t Read_AbsoluteSector_INT25(uint32_t sectnum, void * data) override; + uint8_t Write_AbsoluteSector_INT25(uint32_t sectnum, void * data) override; + void UpdateDPB(unsigned char dos_drive) override; - virtual char const * GetLabel(){return labelCache.GetLabel();}; - virtual void SetLabel(const char *label, bool iscdrom, bool updatable); + char const * GetLabel() override {return labelCache.GetLabel();}; + void SetLabel(const char *label, bool iscdrom, bool updatable) override; virtual void UpdateBootVolumeLabel(const char *label); virtual uint32_t GetPartitionOffset(void); virtual uint32_t GetFirstClusterOffset(void); @@ -529,23 +529,24 @@ class cdromDrive : public localDrive { public: cdromDrive(const char driveLetter, const char * startdir,uint16_t _bytes_sector,uint8_t _sectors_cluster,uint16_t _total_clusters,uint16_t _free_clusters,uint8_t _mediaid, int& error, std::vector &options); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - virtual bool FileUnlink(const char * name); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); - virtual bool Rename(const char * oldname,const char * newname); - virtual bool GetFileAttr(const char * name,uint16_t * attr); - virtual bool GetFileAttrEx(char* name, struct stat *status); - virtual unsigned long GetCompressedSize(char* name); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool Rename(const char * oldname,const char * newname) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - virtual HANDLE CreateOpenFile(char const* const name); - virtual unsigned long GetSerial(); + HANDLE CreateOpenFile(char const* const name) override; + unsigned long GetSerial() override; #endif - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); - virtual void SetDir(const char* path); - virtual bool isRemote(void); - virtual bool isRemovable(void);virtual Bits UnMount(void); + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false) override; + void SetDir(const char* path) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; private: uint8_t subUnit = 0; char driveLetter = '\0'; }; @@ -554,19 +555,19 @@ class physfscdromDrive : public physfsDrive { public: physfscdromDrive(const char driveLetter, const char * startdir,uint16_t _bytes_sector,uint8_t _sectors_cluster,uint16_t _total_clusters,uint16_t _free_clusters,uint8_t _mediaid, int& error, std::vector &options); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - virtual bool FileUnlink(const char * name); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); - virtual bool Rename(const char * oldname,const char * newname); - virtual bool GetFileAttr(const char * name,uint16_t * attr); - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false); - virtual void SetDir(const char* path); - virtual bool isRemote(void); - virtual bool isRemovable(void); - virtual Bits UnMount(void); - virtual const char *GetInfo(void); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool Rename(const char * oldname,const char * newname) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst=false) override; + void SetDir(const char* path) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; + const char *GetInfo(void) override; private: uint8_t subUnit; char driveLetter; @@ -1042,38 +1043,38 @@ class isoDrive : public DOS_Drive { public: isoDrive(char driveLetter, const char* fileName, uint8_t mediaid, int &error, std::vector& options); ~isoDrive(); - virtual bool FileOpen(DOS_File **file, const char *name, uint32_t flags); - virtual bool FileCreate(DOS_File **file, const char *name, uint16_t attributes); - virtual bool FileUnlink(const char *name); - virtual bool RemoveDir(const char *dir); - virtual bool MakeDir(const char *dir); - virtual bool TestDir(const char *dir); - virtual bool FindFirst(const char *dir, DOS_DTA &dta, bool fcb_findfirst); - virtual bool FindNext(DOS_DTA &dta); - virtual bool SetFileAttr(const char *name,uint16_t attr); - virtual bool GetFileAttr(const char *name, uint16_t *attr); - virtual bool GetFileAttrEx(char* name, struct stat *status); - virtual unsigned long GetCompressedSize(char* name); + bool FileOpen(DOS_File **file, const char *name, uint32_t flags) override; + bool FileCreate(DOS_File **file, const char *name, uint16_t attributes) override; + bool FileUnlink(const char *name) override; + bool RemoveDir(const char *dir) override; + bool MakeDir(const char *dir) override; + bool TestDir(const char *dir) override; + bool FindFirst(const char *dir, DOS_DTA &dta, bool fcb_findfirst) override; + bool FindNext(DOS_DTA &dta) override; + bool SetFileAttr(const char *name,uint16_t attr) override; + bool GetFileAttr(const char *name, uint16_t *attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - virtual HANDLE CreateOpenFile(char const* const name); + HANDLE CreateOpenFile(char const* const name) override; #endif - virtual bool Rename(const char * oldname,const char * newname); - virtual bool AllocationInfo(uint16_t *bytes_sector, uint8_t *sectors_cluster, uint16_t *total_clusters, uint16_t *free_clusters); - virtual bool FileExists(const char *name); - virtual bool FileStat(const char *name, FileStat_Block *const stat_block); - virtual uint8_t GetMediaByte(void); - virtual void EmptyCache(void); - virtual void MediaChange(void); - virtual bool isRemote(void); - virtual bool isRemovable(void); - virtual Bits UnMount(void); + bool Rename(const char * oldname,const char * newname) override; + bool AllocationInfo(uint16_t *bytes_sector, uint8_t *sectors_cluster, uint16_t *total_clusters, uint16_t *free_clusters) override; + bool FileExists(const char *name) override; + bool FileStat(const char *name, FileStat_Block *const stat_block) override; + uint8_t GetMediaByte(void) override; + void EmptyCache(void) override; + void MediaChange(void) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; bool loadImage(); bool loadImageUDF(); bool loadImageUDFAnchorVolumePointer(UDFAnchorVolumeDescriptorPointer &avdp,uint8_t *pvd/*COOKED_SECTOR_SIZE*/,uint32_t sector) const; bool readSector(uint8_t *buffer, uint32_t sector) const; void setFileName(const char* fileName); - virtual char const* GetLabel(void) {return discLabel;}; - virtual void Activate(void); + char const* GetLabel(void) override {return discLabel;}; + void Activate(void) override; private: int readDirEntry(isoDirEntry* de, const uint8_t* data, unsigned int direntindex) const; bool lookup(isoDirEntry *de, const char *path); @@ -1149,32 +1150,32 @@ struct VFILE_Block; class Virtual_Drive: public DOS_Drive { public: Virtual_Drive(); - bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes); - bool FileUnlink(const char * name); - bool RemoveDir(const char * dir); - bool MakeDir(const char * dir); - bool TestDir(const char * dir); - bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst); - bool FindNext(DOS_DTA & dta); - bool SetFileAttr(const char * name,uint16_t attr); - bool GetFileAttr(const char * name,uint16_t * attr); - bool GetFileAttrEx(char* name, struct stat *status); - unsigned long GetCompressedSize(char* name); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t attributes) override; + bool FileUnlink(const char * name) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; + bool TestDir(const char * dir) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst) override; + bool FindNext(DOS_DTA & dta) override; + bool SetFileAttr(const char * name,uint16_t attr) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; + bool GetFileAttrEx(char* name, struct stat *status) override; + unsigned long GetCompressedSize(char* name) override; #if defined (WIN32) - HANDLE CreateOpenFile(char const* const name); + HANDLE CreateOpenFile(char const* const name) override; #endif - bool Rename(const char * oldname,const char * newname); - bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters); - bool FileExists(const char* name); - bool FileStat(const char* name, FileStat_Block* const stat_block); - virtual void MediaChange() {} - uint8_t GetMediaByte(void); - virtual void EmptyCache(void); - bool isRemote(void); - virtual bool isRemovable(void); - virtual Bits UnMount(void); - virtual char const* GetLabel(void); + bool Rename(const char * oldname,const char * newname) override; + bool AllocationInfo(uint16_t * _bytes_sector,uint8_t * _sectors_cluster,uint16_t * _total_clusters,uint16_t * _free_clusters) override; + bool FileExists(const char* name) override; + bool FileStat(const char* name, FileStat_Block* const stat_block) override; + void MediaChange() override {} + uint8_t GetMediaByte(void) override; + void EmptyCache(void) override; + bool isRemote(void) override; + bool isRemovable(void) override; + Bits UnMount(void) override; + char const* GetLabel(void) override; private: VFILE_Block* search_file = 0; }; @@ -1183,24 +1184,24 @@ class Overlay_Drive: public localDrive { public: Overlay_Drive(const char * startdir,const char* overlay, uint16_t _bytes_sector,uint8_t _sectors_cluster,uint16_t _total_clusters,uint16_t _free_clusters,uint8_t _mediaid,uint8_t &error, std::vector &options); - virtual bool FileOpen(DOS_File * * file,const char * name,uint32_t flags); - virtual bool FileCreate(DOS_File * * file,const char * name,uint16_t /*attributes*/); - virtual bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst); - virtual bool FindNext(DOS_DTA & dta); - virtual bool FileUnlink(const char * name); - virtual bool SetFileAttr(const char * name,uint16_t attr); - virtual bool GetFileAttr(const char * name,uint16_t * attr); + bool FileOpen(DOS_File * * file,const char * name,uint32_t flags) override; + bool FileCreate(DOS_File * * file,const char * name,uint16_t /*attributes*/) override; + bool FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst) override; + bool FindNext(DOS_DTA & dta) override; + bool FileUnlink(const char * name) override; + bool SetFileAttr(const char * name,uint16_t attr) override; + bool GetFileAttr(const char * name,uint16_t * attr) override; std::string GetHostName(const char * name); - virtual bool FileExists(const char* name); - virtual bool Rename(const char * oldname,const char * newname); - virtual bool FileStat(const char* name, FileStat_Block * const stat_block); - virtual void EmptyCache(void); + bool FileExists(const char* name) override; + bool Rename(const char * oldname,const char * newname) override; + bool FileStat(const char* name, FileStat_Block * const stat_block) override; + void EmptyCache(void) override; FILE* create_file_in_overlay(const char* dos_filename, char const* mode); - virtual Bits UnMount(void); - virtual bool TestDir(const char * dir); - virtual bool RemoveDir(const char * dir); - virtual bool MakeDir(const char * dir); + Bits UnMount(void) override; + bool TestDir(const char * dir) override; + bool RemoveDir(const char * dir) override; + bool MakeDir(const char * dir) override; const char* getOverlaydir() const {return overlaydir;}; bool ovlnocachedir = false; bool ovlreadonly = false; @@ -1228,9 +1229,9 @@ private: bool is_dir_only_in_overlay(const char* name); //cached - void remove_special_file_from_disk(const char* dosname, const char* operation); - bool add_special_file_to_disk(const char* dosname, const char* operation, uint16_t value = 0, bool isdir = false); - std::string create_filename_of_special_operation(const char* dosname, const char* operation, bool expand = false); + void remove_special_file_from_disk(const char* dosname, const char* operation) override; + bool add_special_file_to_disk(const char* dosname, const char* operation, uint16_t value = 0, bool isdir = false) override; + std::string create_filename_of_special_operation(const char* dosname, const char* operation, bool expand = false) override; void convert_overlay_to_DOSname_in_base(char* dirname ); //For caching the update_cache routine. std::vector DOSnames_cache; //Also set is probably better. diff --git a/src/dosbox.cpp b/src/dosbox.cpp index bbef3f0dc..ad84c94dc 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -4992,7 +4992,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { //****************************************** @@ -5008,7 +5008,7 @@ private: POD_Save_Sdlmain(stream); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { //****************************************** diff --git a/src/gui/midi.cpp b/src/gui/midi.cpp index ede018152..0a2cfa88c 100644 --- a/src/gui/midi.cpp +++ b/src/gui/midi.cpp @@ -712,7 +712,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { if( !test ) return; @@ -755,7 +755,7 @@ private: } } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { if( !test ) return; diff --git a/src/gui/midi_alsa.h b/src/gui/midi_alsa.h index 482b0d116..07c4e95bd 100644 --- a/src/gui/midi_alsa.h +++ b/src/gui/midi_alsa.h @@ -118,13 +118,13 @@ private: } public: MidiHandler_alsa() : MidiHandler() {}; - const char* GetName(void) { return "alsa"; } - void PlaySysex(uint8_t * sysex,Bitu len) { + const char* GetName(void) override { return "alsa"; } + void PlaySysex(uint8_t * sysex,Bitu len) override { snd_seq_ev_set_sysex(&ev, len, sysex); send_event(1); } - void PlayMsg(uint8_t * msg) { + void PlayMsg(uint8_t * msg) override { ev.type = SND_SEQ_EVENT_OSS; ev.data.raw32.d[0] = msg[0]; @@ -171,12 +171,12 @@ public: } } - void Close(void) { + void Close(void) override { if (seq_handle) snd_seq_close(seq_handle); } - bool Open(const char * conf) { + bool Open(const char * conf) override { char var[10]; unsigned int caps; bool defaultport = true; //try 17:0. Seems to be default nowadays @@ -240,7 +240,7 @@ public: return true; } - void ListAll(Program* base) { + void ListAll(Program* base) override { #if __cplusplus <= 201103L // C++11 compliant code not tested auto print_port = [base, this](snd_seq_client_info_t *client_info, snd_seq_port_info_t *port_info) { const auto* addr = snd_seq_port_info_get_addr(port_info); diff --git a/src/gui/midi_mt32.h b/src/gui/midi_mt32.h index 0684ea961..86262c11f 100644 --- a/src/gui/midi_mt32.h +++ b/src/gui/midi_mt32.h @@ -225,11 +225,11 @@ public: return midiHandler_mt32; } - const char *GetName(void) { + const char *GetName(void) override { return "mt32"; } - bool Open(const char *conf) { + bool Open(const char *conf) override { (void)conf;//UNUSED service = new MT32Emu::Service(); uint32_t version = service->getLibraryVersionInt(); @@ -346,7 +346,7 @@ public: return true; } - void Close(void) { + void Close(void) override { if (!open) return; chan->Enable(false); if (renderInThread) { @@ -371,7 +371,7 @@ public: open = false; } - void PlayMsg(uint8_t *msg) { + void PlayMsg(uint8_t *msg) override { if (renderInThread) { service->playMsgAt(SDL_SwapLE32(*(uint32_t *)msg), getMidiEventTimestamp()); } else { @@ -379,7 +379,7 @@ public: } } - void PlaySysex(uint8_t *sysex, Bitu len) { + void PlaySysex(uint8_t *sysex, Bitu len) override { if (renderInThread) { service->playSysexAt(sysex, (MT32Emu::uint32_t)len, getMidiEventTimestamp()); } else { @@ -387,7 +387,7 @@ public: } } - void ListAll(Program* base) { + void ListAll(Program* base) override { base->WriteOut(" %s\n",mt32info.c_str()); } }; diff --git a/src/gui/midi_oss.h b/src/gui/midi_oss.h index 5b69e6833..e82d2de05 100644 --- a/src/gui/midi_oss.h +++ b/src/gui/midi_oss.h @@ -26,8 +26,8 @@ private: bool isOpen; public: MidiHandler_oss() : MidiHandler(),isOpen(false) {}; - const char * GetName(void) { return "oss";}; - bool Open(const char * conf) { + const char * GetName(void) override { return "oss";}; + bool Open(const char * conf) override { char devname[512]; if (conf && conf[0]) safe_strncpy(devname,conf,512); else strcpy(devname,"/dev/sequencer"); @@ -41,11 +41,11 @@ public: if (device<0) return false; return true; }; - void Close(void) { + void Close(void) override { if (!isOpen) return; if (device>0) close(device); }; - void PlayMsg(uint8_t * msg) { + void PlayMsg(uint8_t * msg) override { uint8_t buf[128];Bitu pos=0; Bitu len=MIDI_evt_len[*msg]; for (;len>0;len--) { @@ -60,7 +60,7 @@ public: LOG(LOG_IO, LOG_ERROR) ("Writing error in PlayMsg\n"); } }; - void PlaySysex(uint8_t * sysex,Bitu len) { + void PlaySysex(uint8_t * sysex,Bitu len) override { uint8_t buf[SYSEX_SIZE*4];Bitu pos=0; for (;len>0;len--) { buf[pos++] = SEQ_MIDIPUTC; diff --git a/src/gui/midi_synth.h b/src/gui/midi_synth.h index 42f061f3a..dd5f945a6 100644 --- a/src/gui/midi_synth.h +++ b/src/gui/midi_synth.h @@ -134,11 +134,11 @@ private: public: MidiHandler_synth() : MidiHandler(),isOpen(false) {}; - const char * GetName(void) { + const char * GetName(void) override { return "synth"; }; - bool Open(const char *conf) { + bool Open(const char *conf) override { if (isOpen) return false; std::string sf = ""; @@ -230,7 +230,7 @@ public: return true; }; - void Close(void) { + void Close(void) override { if (!isOpen) return; synthchan->Enable(false); @@ -244,16 +244,16 @@ public: isOpen = false; }; - void PlayMsg(uint8_t *msg) { + void PlayMsg(uint8_t *msg) override { synthchan->Enable(true); PlayEvent(msg, MIDI_evt_len[*msg]); }; - void PlaySysex(uint8_t *sysex, Bitu len) { + void PlaySysex(uint8_t *sysex, Bitu len) override { PlayEvent(sysex, len); }; - void ListAll(Program* base) { + void ListAll(Program* base) override { base->WriteOut(" %s\n",fsinfo.c_str()); } @@ -271,12 +271,12 @@ private: fluid_audio_driver_t* adriver; public: MidiHandler_fluidsynth() : MidiHandler() {}; - const char* GetName(void) { return "fluidsynth"; } - void PlaySysex(uint8_t * sysex, Bitu len) { + const char* GetName(void) override { return "fluidsynth"; } + void PlaySysex(uint8_t * sysex, Bitu len) override { fluid_synth_sysex(synth, (char*)sysex, (int)len, NULL, NULL, NULL, 0); } - void PlayMsg(uint8_t * msg) { + void PlayMsg(uint8_t * msg) override { unsigned char chanID = msg[0] & 0x0F; switch (msg[0] & 0xF0) { case 0x80: @@ -305,7 +305,7 @@ public: } } - void Close(void) { + void Close(void) override { if (soundfont_id >= 0) { fluid_synth_sfunload(synth, soundfont_id, 0); } @@ -314,7 +314,7 @@ public: delete_fluid_settings(settings); } - bool Open(const char * conf) { + bool Open(const char * conf) override { (void)conf; Section_prop *section = static_cast(control->GetSection("midi")); @@ -447,7 +447,7 @@ public: return true; } - void ListAll(Program* base) { + void ListAll(Program* base) override { base->WriteOut(" %s\n",fsinfo.c_str()); } }; diff --git a/src/gui/render.cpp b/src/gui/render.cpp index 9e412d06d..30f804f2f 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -1455,7 +1455,7 @@ public: SerializeRender() : SerializeGlobalPOD("Render") {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { // - pure data SerializeGlobalPOD::getBytes(stream); @@ -1469,7 +1469,7 @@ private: WRITE_POD( &render.scale, render.scale ); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { // - pure data SerializeGlobalPOD::setBytes(stream); diff --git a/src/gui/sdl_gui.cpp b/src/gui/sdl_gui.cpp index 0900c43e1..c0addfc73 100644 --- a/src/gui/sdl_gui.cpp +++ b/src/gui/sdl_gui.cpp @@ -79,7 +79,7 @@ static DOSBoxMenu guiMenu, nullMenu; class VirtualBatch : public BatchFile { public: VirtualBatch(DOS_Shell *host, const std::string& cmds); - bool ReadLine(char *line); + bool ReadLine(char *line) override; protected: std::istringstream lines; }; @@ -692,7 +692,7 @@ public: virtual bool prepare(std::string &buffer) = 0; - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED // HACK: Attempting to cast a String to void causes "forming reference to void" errors when building with GCC 4.7 (void)arg.size();//UNUSED @@ -731,14 +731,14 @@ public: input->setChecked(static_cast(prop->GetValue())); } - bool prepare(std::string &buffer) { + bool prepare(std::string &buffer) override { if (input->isChecked() == static_cast(prop->GetValue())) return false; buffer.append(input->isChecked()?"true":"false"); return true; } /// Paint label - virtual void paint(GUI::Drawable &d) const { + void paint(GUI::Drawable &d) const override { paintVisGuideLineBetween(d,label,input,this); } }; @@ -791,7 +791,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { unsigned int j, k; for(k = 0; k < pv.size(); k++) if (pv[k].ToString().size()) { if (arg == pv[k].ToString() && opt[k]->isChecked()) @@ -861,14 +861,14 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == "...") new ShowOptions(getScreen(), 300, 300, MSG_Get("SELECT_VALUE"), ("Property: \033[31m" + prop->propname + "\033[0m\n\n"+(prop->Get_Default_Value().ToString().size()?"Default value: \033[32m"+prop->Get_Default_Value().ToString()+"\033[0m\n\n":"")+"Possible values to select:\n").c_str(), prop, input); else PropertyEditor::actionExecuted(b, arg); } - bool prepare(std::string &buffer) { + bool prepare(std::string &buffer) override { std::string temps = prop->GetValue().ToString(); if (input->getText() == GUI::String(temps)) return false; buffer.append(static_cast(input->getText())); @@ -876,7 +876,7 @@ public: } /// Paint label - virtual void paint(GUI::Drawable &d) const { + void paint(GUI::Drawable &d) const override { paintVisGuideLineBetween(d,label,input,this); } }; @@ -917,14 +917,14 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == "...") new ShowOptions(getScreen(), 300, 300, ("Values for " + prop->propname).c_str(), ("Property: \033[31m" + prop->propname + "\033[0m\n\n"+(prop->Get_Default_Value().ToString().size()?"Default value: \033[32m"+prop->Get_Default_Value().ToString()+"\033[0m\n\n":"")+"Possible values to select:\n").c_str(), prop, input); else PropertyEditor::actionExecuted(b, arg); } - bool prepare(std::string &buffer) { + bool prepare(std::string &buffer) override { double val; convert(input->getText(), val, false); if (val == (double)prop->GetValue()) return false; @@ -933,7 +933,7 @@ public: } /// Paint label - virtual void paint(GUI::Drawable &d) const { + void paint(GUI::Drawable &d) const override { paintVisGuideLineBetween(d,label,input,this); } }; @@ -975,14 +975,14 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == "...") new ShowOptions(getScreen(), 300, 300, ("Values for " + prop->propname).c_str(), ("Property: \033[31m" + prop->propname + "\033[0m\n\n"+(prop->Get_Default_Value().ToString().size()?"Default value: \033[32m"+prop->Get_Default_Value().ToString()+"\033[0m\n\n":"")+"Possible values to select:\n").c_str(), prop, input); else PropertyEditor::actionExecuted(b, arg); } - bool prepare(std::string &buffer) { + bool prepare(std::string &buffer) override { int val; convert(input->getText(), val, false, std::hex); if ((Hex)val == prop->GetValue()) return false; @@ -991,7 +991,7 @@ public: } /// Paint label - virtual void paint(GUI::Drawable &d) const { + virtual void paint(GUI::Drawable &d) const override { paintVisGuideLineBetween(d,label,input,this); } }; @@ -1033,14 +1033,14 @@ public: } }; - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == "...") new ShowOptions(getScreen(), 300, 300, ("Values for " + prop->propname).c_str(), ("Property: \033[31m" + prop->propname + "\033[0m\n\n"+(prop->Get_Default_Value().ToString().size()?"Default value: \033[32m"+prop->Get_Default_Value().ToString()+"\033[0m\n\n":"")+"Possible values to select:\n").c_str(), prop, input); else PropertyEditor::actionExecuted(b, arg); } - bool prepare(std::string &buffer) { + bool prepare(std::string &buffer) override { int val; convert(input->getText(), val, false); if (val == static_cast(prop->GetValue())) return false; @@ -1049,7 +1049,7 @@ public: }; /// Paint label - virtual void paint(GUI::Drawable &d) const { + void paint(GUI::Drawable &d) const override { paintVisGuideLineBetween(d,label,input,this); } }; @@ -1491,7 +1491,7 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { strcpy(tmp1, mainMenu.get_item("HelpMenu").get_text().c_str()); if (arg == MSG_Get("OK") && proplist.size()) { close(); running=false; if(!shortcut) resetcfg=true; } else if (arg == MSG_Get("OK") || arg == MSG_Get("CANCEL") || arg == MSG_Get("CLOSE")) { close(); if(shortcut) running=false; } @@ -1528,12 +1528,12 @@ public: ToplevelWindow::actionExecuted(b, arg); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { @@ -1717,7 +1717,7 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == MSG_Get("OK")) section->data = *(std::string*)content->getText(); std::string lines = *(std::string*)content->getText(); strcpy(tmp1, mainMenu.get_item("HelpMenu").get_text().c_str()); @@ -1771,12 +1771,12 @@ public: } else ToplevelWindow::actionExecuted(b, arg); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { @@ -1829,7 +1829,7 @@ public: } } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { if (arg == MSG_Get("OK")) section->data = *(std::string*)content->getText(); if (arg == MSG_Get("OK") || arg == MSG_Get("CANCEL") || arg == MSG_Get("CLOSE")) { close(); if(shortcut) running=false; } else if (arg == MSG_Get("PASTE_CLIPBOARD")) { @@ -1864,12 +1864,12 @@ public: } else ToplevelWindow::actionExecuted(b, arg); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { @@ -1912,7 +1912,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("USE_PORTABLECONFIG")) { name->setText("dosbox-x.conf"); @@ -1944,7 +1944,7 @@ public: if(shortcut) running=false; } - virtual bool keyUp(const GUI::Key &key) { + virtual bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Enter) { @@ -1982,14 +1982,14 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) MSG_Write(name->getText(), lang->getText()); close(); if(shortcut) running=false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Enter) { @@ -2018,7 +2018,7 @@ public: std::string trigger_enter = MSG_Get("OK"); std::string trigger_esc = MSG_Get("CANCEL"); public: - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (key.special == GUI::Key::Special::Enter) { if (trigger_who != NULL && !trigger_enter.empty()) trigger_who->actionExecuted(this, trigger_enter); @@ -2061,7 +2061,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { char *str = (char*)name->getText(); @@ -2103,7 +2103,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { Section* sec = control->GetSection("sdl"); @@ -2156,7 +2156,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { autosave_second = atoi(name[0]->getText()); @@ -2204,7 +2204,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { Section* sec = control->GetSection("cpu"); @@ -2240,7 +2240,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED Section_prop * sec = static_cast(control->GetSection("vsync")); if (arg == MSG_Get("OK")) { @@ -2279,7 +2279,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { extern unsigned int hdd_defsize; @@ -2318,7 +2318,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { if (set_ver(name->getText())) @@ -2348,7 +2348,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { SetVal("render", "aspect_ratio", name->getText()); @@ -2389,7 +2389,7 @@ public: title1->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { dosbox_title = trim(title1->getText()); @@ -2424,7 +2424,7 @@ public: name->posToEnd(); /* position the cursor at the end where the user is most likely going to edit */ } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("OK")) { SetVal("sdl", "transparency", name->getText()); @@ -2454,7 +2454,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2481,7 +2481,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2515,7 +2515,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2617,7 +2617,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get(MSG_Get("CLOSE"))) close(); @@ -2656,7 +2656,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2682,7 +2682,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2702,7 +2702,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("YES")) confres=true; @@ -2750,7 +2750,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == "360KB" && imgfd360->isChecked()) { imgfd400->setChecked(false); @@ -2972,7 +2972,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -2992,7 +2992,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); }; - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) if(shortcut) running=false; @@ -3018,7 +3018,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); }; - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) if(shortcut) running=false; @@ -3048,7 +3048,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -3082,7 +3082,7 @@ public: move(parent->getWidth()>this->getWidth()?(parent->getWidth()-this->getWidth())/2:0,parent->getHeight()>this->getHeight()?(parent->getHeight()-this->getHeight())/2:0); } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { (void)b;//UNUSED if (arg == MSG_Get("CLOSE")) close(); @@ -3164,12 +3164,12 @@ public: ~ConfigurationWindow() { running = false; cfg_windows_active.clear(); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { @@ -3180,7 +3180,7 @@ public: return false; } - void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) { + void actionExecuted(GUI::ActionEventSource *b, const GUI::String &arg) override { GUI::String sname = RestoreName(arg); sname.at(0) = (unsigned int)std::tolower((int)sname.at(0)); Section *sec; diff --git a/src/gui/sdl_mapper.cpp b/src/gui/sdl_mapper.cpp index 7d250dd12..837232479 100644 --- a/src/gui/sdl_mapper.cpp +++ b/src/gui/sdl_mapper.cpp @@ -460,13 +460,13 @@ public: // methods below this line have sufficient documentation inherited from the base class - virtual ~CTriggeredEvent() {} + ~CTriggeredEvent() {} - virtual bool IsTrigger(void) { + bool IsTrigger(void) override { return true; } - virtual void ActivateEvent(bool ev_trigger,bool skip_action) { + void ActivateEvent(bool ev_trigger,bool skip_action) override { if (current_value>25000) { /* value exceeds boundary, trigger event if not active */ if (!activity && !skip_action) Active(true); @@ -480,7 +480,7 @@ public: } } - virtual void DeActivateEvent(bool /*ev_trigger*/) { + void DeActivateEvent(bool /*ev_trigger*/) override { if (activity > 0) activity--; if (!activity) Active(false); } @@ -494,13 +494,13 @@ public: // methods below this line have sufficient documentation inherited from the base class - virtual ~CContinuousEvent() {} + ~CContinuousEvent() {} - virtual bool IsTrigger(void) { + bool IsTrigger(void) override { return false; } - virtual void ActivateEvent(bool ev_trigger,bool skip_action) { + void ActivateEvent(bool ev_trigger,bool skip_action) override { if (ev_trigger) { activity++; if (!skip_action) Active(true); @@ -511,7 +511,7 @@ public: } } - virtual void DeActivateEvent(bool ev_trigger) { + void DeActivateEvent(bool ev_trigger) override { if (ev_trigger) { if (activity>0) activity--; if (activity==0) { @@ -1537,7 +1537,7 @@ public: configname="key"; } virtual ~CKeyBindGroup() { delete[] lists; } - CBind * CreateConfigBind(char *& buf) { + CBind * CreateConfigBind(char *& buf) override { if (strncasecmp(buf,configname,strlen(configname))) return 0; StripWord(buf);char * num=StripWord(buf); Bitu code=(Bitu)ConvDecWord(num); @@ -1552,7 +1552,7 @@ public: #endif return bind; } - CBind * CreateEventBind(SDL_Event * event) { + CBind * CreateEventBind(SDL_Event * event) override { if (event->type!=SDL_KEYDOWN) return 0; #if defined(C_SDL2) SDL_Scancode key = event->key.keysym.scancode; @@ -1566,7 +1566,7 @@ public: return CreateKeyBind((SDLKey)GetKeyCode(event->key.keysym)); #endif }; - bool CheckEvent(SDL_Event * event) { + bool CheckEvent(SDL_Event * event) override { if (event->type!=SDL_KEYDOWN && event->type!=SDL_KEYUP) return false; #if defined(C_SDL2) Bitu key = event->key.keysym.scancode; @@ -1665,10 +1665,10 @@ public: return new CKeyBind(&lists[(Bitu)_key],_key); } private: - const char * ConfigStart(void) { + const char * ConfigStart(void) override { return configname; } - const char * BindStart(void) { + const char * BindStart(void) override { return "Key"; } protected: @@ -1870,7 +1870,7 @@ public: if (hat_lists != NULL) delete[] hat_lists; } - CBind * CreateConfigBind(char *& buf) { + CBind * CreateConfigBind(char *& buf) override { if (is_dummy) return 0; if (strncasecmp(configname,buf,strlen(configname))) return 0; StripWord(buf);char * type=StripWord(buf); @@ -1889,7 +1889,7 @@ public: } return bind; } - CBind * CreateEventBind(SDL_Event * event) { + CBind * CreateEventBind(SDL_Event * event) override { if (event->type==SDL_JOYAXISMOTION) { if ((unsigned int)event->jaxis.which!=(unsigned int)stick) return 0; #if defined (REDUCE_JOYSTICK_POLLING) @@ -1912,7 +1912,7 @@ public: } else return 0; } - virtual bool CheckEvent(SDL_Event * event) { + bool CheckEvent(SDL_Event * event) override { SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; @@ -2069,10 +2069,10 @@ private: else return NULL; return new CJHatBind(&hat_lists[(hat<<2)+hat_dir],this,hat,value); } - const char * ConfigStart(void) { + const char * ConfigStart(void) override { return configname; } - const char * BindStart(void) { + const char * BindStart(void) override { #if defined(C_SDL2) if (sdl_joystick!=NULL) return SDL_JoystickNameForIndex((int)stick); #else @@ -2179,7 +2179,7 @@ public: } virtual ~C4AxisBindGroup() {} - bool CheckEvent(SDL_Event * event) { + bool CheckEvent(SDL_Event * event) override { SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; Bitu but = 0; @@ -2208,7 +2208,7 @@ public: return false; } - virtual void UpdateJoystick() { + void UpdateJoystick() override { /* query SDL joystick and activate bindings */ ActivateJoystickBoundEvents(); @@ -2255,7 +2255,7 @@ public: } virtual ~CFCSBindGroup() {} - bool CheckEvent(SDL_Event * event) { + bool CheckEvent(SDL_Event * event) override { SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; SDL_JoyHatEvent * jhat = NULL; @@ -2291,7 +2291,7 @@ public: return false; } - virtual void UpdateJoystick() { + void UpdateJoystick() override { /* query SDL joystick and activate bindings */ ActivateJoystickBoundEvents(); @@ -2394,7 +2394,7 @@ public: } virtual ~CCHBindGroup() {} - bool CheckEvent(SDL_Event * event) { + bool CheckEvent(SDL_Event * event) override { SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; SDL_JoyHatEvent * jhat = NULL; @@ -2452,7 +2452,7 @@ public: return false; } - void UpdateJoystick() { + void UpdateJoystick() override { static unsigned const button_priority[6]={7,11,13,14,5,6}; static unsigned const hat_priority[2][4]={{0,1,2,3},{8,9,10,12}}; @@ -2686,8 +2686,8 @@ public: else {strncpy(text, _text, 99);text[99]=0;} invertw=0; } - virtual ~CTextButton() {} - void Draw(void) { + ~CTextButton() {} + void Draw(void) override { uint8_t fg,bg; if (!enabled) return; @@ -2755,11 +2755,11 @@ public: : CTextButton(_x,_y,_dx,_dy,_text) { event=_event; } - virtual ~CEventButton() {} - void BindColor(void) { + ~CEventButton() {} + void BindColor(void) override { this->SetColor(event->bindlist.begin() == event->bindlist.end() ? CLR_GREY : CLR_WHITE); } - void ClickImpl(void) { + void ClickImpl(void) override { if (last_clicked) last_clicked->BindColor(); this->SetColor(event->bindlist.begin() == event->bindlist.end() ? CLR_DARKGREEN : CLR_GREEN); SetActiveEvent(event); @@ -2768,7 +2768,7 @@ public: CEvent *GetEvent() { return event; } - void RebindRedraw(void) { + void RebindRedraw(void) override { Click();//HACK! } protected: @@ -2813,8 +2813,8 @@ public: : CTextButton(_x,_y,_dx,_dy,_text) { type=_type; } - virtual ~CBindButton() {} - void ClickImpl(void) { + ~CBindButton() {} + void ClickImpl(void) override { switch (type) { case BB_Add: mapper.addbind=true; @@ -2876,9 +2876,9 @@ public: type = wmod==4?event_t:mod_event_t; } - virtual ~CModEvent() {} + ~CModEvent() {} - virtual void Active(bool yesno) { + void Active(bool yesno) override { if (notify_button != NULL) notify_button->SetInvert(yesno); @@ -2891,7 +2891,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -2909,8 +2909,8 @@ public: : CTextButton(_x,_y,_dx,_dy,_text) { type=_type; } - virtual ~CCheckButton() {} - void Draw(void) { + ~CCheckButton() {} + void Draw(void) override { if (!enabled) return; bool checked=false; std::string str = ""; @@ -2954,7 +2954,7 @@ public: } } } - void ClickImpl(void) { + void ClickImpl(void) override { switch (type) { case BC_Mod1: mapper.abind->mods^=BMOD_Mod1; @@ -2986,9 +2986,9 @@ public: key=_key; } - virtual ~CKeyEvent() {} + ~CKeyEvent() {} - virtual void Active(bool yesno) { + void Active(bool yesno) override { if (MAPPER_DemoOnly()) { if (notify_button != NULL) notify_button->SetInvert(yesno); @@ -3005,7 +3005,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -3023,7 +3023,7 @@ public: button=_button; notify_button=NULL; } - void Active(bool yesno) { + void Active(bool yesno) override { if (yesno) Mouse_ButtonPressed(button); else @@ -3034,7 +3034,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -3060,20 +3060,20 @@ public: } } - virtual ~CJAxisEvent() {} + ~CJAxisEvent() {} - virtual void Active(bool /*moved*/) { + void Active(bool /*moved*/) override { if (notify_button != NULL) notify_button->SetPartialInvert(GetValue()/32768.0); virtual_joysticks[stick].axis_pos[axis]=(int16_t)(GetValue()*(positive?1:-1)); } - virtual Bitu GetActivityCount(void) { + Bitu GetActivityCount(void) override { return activity|opposite_axis->activity; } - virtual void RepostActivity(void) { + void RepostActivity(void) override { /* caring for joystick movement into the opposite direction */ opposite_axis->Active(true); } @@ -3083,7 +3083,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -3119,9 +3119,9 @@ public: notify_button=NULL; } - virtual ~CJButtonEvent() {} + ~CJButtonEvent() {} - virtual void Active(bool pressed) { + void Active(bool pressed) override { if (notify_button != NULL) notify_button->SetInvert(pressed); @@ -3134,7 +3134,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -3160,9 +3160,9 @@ public: notify_button = NULL; } - virtual ~CJHatEvent() {} + ~CJHatEvent() {} - virtual void Active(bool pressed) { + void Active(bool pressed) override { if (notify_button != NULL) notify_button->SetInvert(pressed); virtual_joysticks[stick].hat_pressed[(hat<<2)+dir]=pressed; @@ -3172,7 +3172,7 @@ public: notify_button = n; } - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } @@ -3217,14 +3217,14 @@ public: type = handler_event_t; } - virtual ~CHandlerEvent() {} + ~CHandlerEvent() {} - virtual void RebindRedraw(void) { + void RebindRedraw(void) override { if (notify_button != NULL) notify_button->RebindRedraw(); } - virtual void Active(bool yesno) { + void Active(bool yesno) override { if (MAPPER_DemoOnly()) { if (notify_button != NULL) notify_button->SetInvert(yesno); diff --git a/src/hardware/adlib.cpp b/src/hardware/adlib.cpp index 1e7685168..3c7295cd2 100644 --- a/src/hardware/adlib.cpp +++ b/src/hardware/adlib.cpp @@ -53,15 +53,15 @@ namespace OPL2 { #include "opl.cpp" struct Handler : public Adlib::Handler { - virtual void WriteReg( uint32_t reg, uint8_t val ) { + void WriteReg( uint32_t reg, uint8_t val ) override { adlib_write(reg,val); } - virtual uint32_t WriteAddr( uint32_t port, uint8_t val ) { + uint32_t WriteAddr( uint32_t port, uint8_t val ) override { (void)port;//UNUSED return val; } - virtual void Generate( MixerChannel* chan, Bitu samples ) { + void Generate( MixerChannel* chan, Bitu samples ) override { int16_t buf[1024]; while( samples > 0 ) { Bitu todo = samples > 1024 ? 1024 : samples; @@ -71,11 +71,11 @@ namespace OPL2 { } } - virtual void Init( Bitu rate ) { + void Init( Bitu rate ) override { adlib_init((uint32_t)rate); } - virtual void SaveState( std::ostream& stream ) { + void SaveState( std::ostream& stream ) override { const char pod_name[32] = "OPL2"; if( stream.fail() ) return; @@ -90,7 +90,7 @@ namespace OPL2 { adlib_savestate(stream); } - virtual void LoadState( std::istream& stream ) { + void LoadState( std::istream& stream ) override { char pod_name[32] = {0}; if( stream.fail() ) return; @@ -120,14 +120,14 @@ namespace OPL3 { #include "opl.cpp" struct Handler : public Adlib::Handler { - virtual void WriteReg( uint32_t reg, uint8_t val ) { + void WriteReg( uint32_t reg, uint8_t val ) override { adlib_write(reg,val); } - virtual uint32_t WriteAddr( uint32_t port, uint8_t val ) { + uint32_t WriteAddr( uint32_t port, uint8_t val ) override { adlib_write_index(port, val); return opl_index; } - virtual void Generate( MixerChannel* chan, Bitu samples ) { + void Generate( MixerChannel* chan, Bitu samples ) override { int16_t buf[1024*2]; while( samples > 0 ) { Bitu todo = samples > 1024 ? 1024 : samples; @@ -137,11 +137,11 @@ namespace OPL3 { } } - virtual void Init( Bitu rate ) { + void Init( Bitu rate ) override { adlib_init((uint32_t)rate); } - virtual void SaveState( std::ostream& stream ) { + void SaveState( std::ostream& stream ) override { const char pod_name[32] = "OPL3"; if( stream.fail() ) return; @@ -156,7 +156,7 @@ namespace OPL3 { adlib_savestate(stream); } - virtual void LoadState( std::istream& stream ) { + void LoadState( std::istream& stream ) override { char pod_name[32] = {0}; if( stream.fail() ) return; @@ -323,14 +323,14 @@ namespace MAMEOPL2 { struct Handler : public Adlib::Handler { void* chip = NULL; - virtual void WriteReg(uint32_t reg, uint8_t val) { + void WriteReg(uint32_t reg, uint8_t val) override { ym3812_write(chip, 0, (int)reg); ym3812_write(chip, 1, (int)val); } - virtual uint32_t WriteAddr(uint32_t /*port*/, uint8_t val) { + uint32_t WriteAddr(uint32_t /*port*/, uint8_t val) override { return val; } - virtual void Generate(MixerChannel* chan, Bitu samples) { + void Generate(MixerChannel* chan, Bitu samples) override { int16_t buf[1024 * 2]; while (samples > 0) { Bitu todo = samples > 1024 ? 1024 : samples; @@ -339,10 +339,10 @@ struct Handler : public Adlib::Handler { chan->AddSamples_m16(todo, buf); } } - virtual void Init(Bitu rate) { + void Init(Bitu rate) override { chip = ym3812_init(0, OPL2_INTERNAL_FREQ, (uint32_t)rate); } - virtual void SaveState( std::ostream& stream ) { + void SaveState( std::ostream& stream ) override { const char pod_name[32] = "MAMEOPL2"; if( stream.fail() ) return; @@ -357,7 +357,7 @@ struct Handler : public Adlib::Handler { FMOPL_SaveState(chip, stream); } - virtual void LoadState( std::istream& stream ) { + void LoadState( std::istream& stream ) override { char pod_name[32] = {0}; if( stream.fail() ) return; @@ -389,14 +389,14 @@ namespace MAMEOPL3 { struct Handler : public Adlib::Handler { void* chip = NULL; - virtual void WriteReg(uint32_t reg, uint8_t val) { + void WriteReg(uint32_t reg, uint8_t val) override { ymf262_write(chip, 0, (int)reg); ymf262_write(chip, 1, (int)val); } - virtual uint32_t WriteAddr(uint32_t /*port*/, uint8_t val) { + uint32_t WriteAddr(uint32_t /*port*/, uint8_t val) override { return val; } - virtual void Generate(MixerChannel* chan, Bitu samples) { + void Generate(MixerChannel* chan, Bitu samples) override { //We generate data for 4 channels, but only the first 2 are connected on a pc int16_t buf[4][1024]; int16_t result[1024][2]; @@ -414,10 +414,10 @@ struct Handler : public Adlib::Handler { chan->AddSamples_s16(todo, result[0]); } } - virtual void Init(Bitu rate) { + void Init(Bitu rate) override { chip = ymf262_init(0, OPL3_INTERNAL_FREQ, (int)rate); } - virtual void SaveState( std::ostream& stream ) { + void SaveState( std::ostream& stream ) override { const char pod_name[32] = "MAMEOPL3"; if( stream.fail() ) return; @@ -431,7 +431,7 @@ struct Handler : public Adlib::Handler { YMF_SaveState(chip, stream); } - virtual void LoadState( std::istream& stream ) { + void LoadState( std::istream& stream ) override { char pod_name[32] = {0}; if( stream.fail() ) return; @@ -464,20 +464,20 @@ namespace OPL2BOARD { Handler(const char* port) { opl2AudioBoard.connect(port); } - virtual void WriteReg(uint32_t reg, uint8_t val) { + void WriteReg(uint32_t reg, uint8_t val) override { opl2AudioBoard.write(reg, val); } - virtual uint32_t WriteAddr(uint32_t port, uint8_t val) { + uint32_t WriteAddr(uint32_t port, uint8_t val) override { (void)port; return val; } - virtual void Generate(MixerChannel* chan, Bitu samples) { + void Generate(MixerChannel* chan, Bitu samples) override { (void)samples; int16_t buf[1] = { 0 }; chan->AddSamples_m16(1, buf); } - virtual void Init(Bitu rate) { + void Init(Bitu rate) override { (void)rate; opl2AudioBoard.reset(); } @@ -495,10 +495,10 @@ namespace OPL3DUOBOARD { Handler(const char* port) { opl3DuoBoard.connect(port); } - virtual void WriteReg(uint32_t reg, uint8_t val) { + void WriteReg(uint32_t reg, uint8_t val) override { opl3DuoBoard.write(reg, val); } - virtual uint32_t WriteAddr(uint32_t port, uint8_t val) { + uint32_t WriteAddr(uint32_t port, uint8_t val) override { uint32_t reg = val; if ((port&3)!=0) { @@ -507,12 +507,12 @@ namespace OPL3DUOBOARD { return reg; } - virtual void Generate(MixerChannel* chan, Bitu samples) { + void Generate(MixerChannel* chan, Bitu samples) override { (void)samples;//UNUSED int16_t buf[1] = { 0 }; chan->AddSamples_m16(1, buf); } - virtual void Init(Bitu rate) { + void Init(Bitu rate) override { (void)rate;//UNUSED opl3DuoBoard.reset(); } @@ -525,7 +525,7 @@ namespace OPL3DUOBOARD { namespace Retrowave_OPL3 { struct Handler : public Adlib::Handler { - virtual void WriteReg(uint32_t reg, uint8_t val) { + void WriteReg(uint32_t reg, uint8_t val) override { // printf("writereg: 0x%08x 0x%02x\n", reg, val); uint16_t port = reg & 0x100; @@ -551,7 +551,7 @@ namespace Retrowave_OPL3 { } } - virtual uint32_t WriteAddr(uint32_t port, uint8_t val) { + uint32_t WriteAddr(uint32_t port, uint8_t val) override { // printf("writeaddr: 0x%08x 0x%02x\n", port, val); switch (port & 3) { @@ -564,7 +564,7 @@ namespace Retrowave_OPL3 { return 0; } - virtual void Generate(MixerChannel* chan, Bitu samples) { + void Generate(MixerChannel* chan, Bitu samples) override { (void)samples;//UNUSED #ifdef RETROWAVE_USE_BUFFER retrowave_flush(&retrowave_global_context); @@ -573,7 +573,7 @@ namespace Retrowave_OPL3 { chan->AddSamples_m16(1, &buf); } - virtual void Init(Bitu rate) { + void Init(Bitu rate) override { (void)rate;//UNUSED retrowave_opl3_reset(&retrowave_global_context); } diff --git a/src/hardware/dbopl.h b/src/hardware/dbopl.h index 9c25ad36a..74ceb5f3c 100644 --- a/src/hardware/dbopl.h +++ b/src/hardware/dbopl.h @@ -250,12 +250,12 @@ struct Chip { struct Handler : public Adlib::Handler { DBOPL::Chip chip; - virtual uint32_t WriteAddr( uint32_t port, uint8_t val ); - virtual void WriteReg( uint32_t addr, uint8_t val ); - virtual void Generate( MixerChannel* chan, Bitu samples ); - virtual void Init( Bitu rate ); - virtual void SaveState( std::ostream& stream ); - virtual void LoadState( std::istream& stream ); + uint32_t WriteAddr( uint32_t port, uint8_t val ) override; + void WriteReg( uint32_t addr, uint8_t val ) override; + void Generate( MixerChannel* chan, Bitu samples ) override; + void Init( Bitu rate ) override; + void SaveState( std::ostream& stream ) override; + void LoadState( std::istream& stream ) override; Handler(bool opl3Mode) : chip(opl3Mode) { } diff --git a/src/hardware/dma.cpp b/src/hardware/dma.cpp index 76d4f41c0..3cb97fdf2 100644 --- a/src/hardware/dma.cpp +++ b/src/hardware/dma.cpp @@ -854,7 +854,7 @@ namespace {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { SerializeGlobalPOD::getBytes(stream); @@ -875,7 +875,7 @@ namespace WRITE_POD( &ems_board_mapping, ems_board_mapping ); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { SerializeGlobalPOD::setBytes(stream); diff --git a/src/hardware/glide.cpp b/src/hardware/glide.cpp index 8ad138037..df4f0a624 100644 --- a/src/hardware/glide.cpp +++ b/src/hardware/glide.cpp @@ -261,37 +261,37 @@ public: return lin_addr[buffer]; } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { // LOG_MSG("Glide:Read from 0x%p", LFB_getAddr(addr)); return *(uint8_t *)(LFB_getAddr(addr)); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { // LOG_MSG("Glide:Read from 0x%p", LFB_getAddr(addr)); return *(uint16_t *)(LFB_getAddr(addr)); } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { // LOG_MSG("Glide:Read from 0x%p", LFB_getAddr(addr)); return *(uint32_t *)(LFB_getAddr(addr)); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { // LOG_MSG("Glide:Write to 0x%p", LFB_getAddr(addr)); *(uint8_t *)(LFB_getAddr(addr))=(uint8_t)val; } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { // LOG_MSG("Glide:Write to 0x%p", LFB_getAddr(addr)); *(uint16_t *)(LFB_getAddr(addr))=(uint16_t)val; } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { // LOG_MSG("Glide:Write to 0x%p", LFB_getAddr(addr)); *(uint32_t *)(LFB_getAddr(addr))=(uint32_t)val; } - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { Bitu buffer = (((phys_page<<12) - base_addr[0])>>12)>>GLIDE_PAGE_BITS; #if LOG_GLIDE // This only makes sense if full lfb access is used... @@ -301,7 +301,7 @@ public: return lfb_addr[buffer]+(phys_page<<12); } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { Bitu buffer = (((phys_page<<12) - base_addr[0])>>12)>>GLIDE_PAGE_BITS; #if LOG_GLIDE // This only makes sense if full lfb access is used... diff --git a/src/hardware/ide.cpp b/src/hardware/ide.cpp index 26ef67106..c347cc7ee 100644 --- a/src/hardware/ide.cpp +++ b/src/hardware/ide.cpp @@ -222,8 +222,8 @@ public: class IDEATADevice:public IDEDevice { public: IDEATADevice(IDEController *c,unsigned char disk_index,bool _slave); - virtual ~IDEATADevice(); - virtual void writecommand(uint8_t cmd); + ~IDEATADevice(); + void writecommand(uint8_t cmd) override; public: std::string id_serial; std::string id_firmware_rev; @@ -231,8 +231,8 @@ public: unsigned char bios_disk_index; imageDisk *getBIOSdisk(); void update_from_biosdisk(); - virtual Bitu data_read(Bitu iolen); /* read from 1F0h data port from IDE device */ - virtual void data_write(Bitu v,Bitu iolen);/* write to 1F0h data port to IDE device */ + virtual Bitu data_read(Bitu iolen) override; /* read from 1F0h data port from IDE device */ + virtual void data_write(Bitu v,Bitu iolen) override;/* write to 1F0h data port to IDE device */ virtual void generate_identify_device(); virtual void prepare_read(Bitu offset,Bitu size); virtual void prepare_write(Bitu offset,Bitu size); @@ -259,8 +259,8 @@ enum { class IDEATAPICDROMDevice:public IDEDevice { public: IDEATAPICDROMDevice(IDEController *c,unsigned char drive_index,bool _slave); - virtual ~IDEATAPICDROMDevice(); - virtual void writecommand(uint8_t cmd); + ~IDEATAPICDROMDevice(); + void writecommand(uint8_t cmd) override; public: std::string id_serial; std::string id_firmware_rev; @@ -269,8 +269,8 @@ public: Bitu sector_transfer_limit = 16; CDROM_Interface *getMSCDEXDrive(); void update_from_cdrom(); - virtual Bitu data_read(Bitu iolen); /* read from 1F0h data port from IDE device */ - virtual void data_write(Bitu v,Bitu iolen);/* write to 1F0h data port to IDE device */ + Bitu data_read(Bitu iolen) override; /* read from 1F0h data port from IDE device */ + void data_write(Bitu v,Bitu iolen) override; /* write to 1F0h data port to IDE device */ virtual void generate_identify_device(); virtual void generate_mmc_inquiry(); virtual void prepare_read(Bitu offset,Bitu size); diff --git a/src/hardware/imfc.cpp b/src/hardware/imfc.cpp index 7ab571fa4..050d9d6f5 100644 --- a/src/hardware/imfc.cpp +++ b/src/hardware/imfc.cpp @@ -12836,7 +12836,7 @@ public: m_timer.timerEvent(val); } - ~MusicFeatureCard() override + ~MusicFeatureCard() { keep_running = false; SDL_WaitThread(m_mainThread, nullptr); diff --git a/src/hardware/keyboard.cpp b/src/hardware/keyboard.cpp index bc9d7f131..a31611ba1 100644 --- a/src/hardware/keyboard.cpp +++ b/src/hardware/keyboard.cpp @@ -1823,7 +1823,7 @@ public: /* TODO: Writes to Port A should go to printer emulation */ /* TODO: Writes to bit 7, Port C should go to printer emulation (strobe pin) */ /* port B is input */ - virtual uint8_t inPortB(void) const { + uint8_t inPortB(void) const override { return 0x80 + /* bits [7:6] 10 = other model */ ((PIT_TICK_RATE == PIT_TICK_RATE_PC98_8MHZ) ? 0x20 : 0x00) + /* bit [5:5] 1 = 8MHz 0 = 5/10MHz */ 0x10 + /* bit [4:4] 1 = LCD plasma display usage cond. not used */ @@ -1913,7 +1913,7 @@ public: } public: /* port A is input */ - virtual uint8_t inPortA(void) const { + uint8_t inPortA(void) const override { /* TODO: Improve this! What do the various 2-1 to 2-8 switches do? * It might help to look at the BIOS setup menus of 1990s PC-98 systems * that offer toggling virtual versions of these DIP switches to see @@ -1924,12 +1924,12 @@ public: return 0x63 | (gdc_5mhz_mode_initial ? 0x00 : 0x80); // taken from a PC-9821 Lt2 } /* port B is input */ - virtual uint8_t inPortB(void) const { + uint8_t inPortB(void) const override { /* TODO: Improve this! */ return 0xF9; // taken from a PC-9821 Lt2 } /* port C is output (both halves) */ - virtual void outPortC(const uint8_t mask) { + void outPortC(const uint8_t mask) override { if (mask & 0x80) /* Shutdown flag 0 */ PC98_SHUT0 = !!(latchOutPortC & 0x80); @@ -2373,7 +2373,7 @@ public: } public: /* port A is input */ - virtual uint8_t inPortA(void) const { + uint8_t inPortA(void) const override { uint8_t bs; Bitu r; @@ -2408,17 +2408,17 @@ public: return r; } /* port B is input */ - virtual uint8_t inPortB(void) const { + uint8_t inPortB(void) const override { /* TODO */ return 0x00; } /* port C is input[3:0] and output[7:4] */ - virtual uint8_t inPortC(void) const { + uint8_t inPortC(void) const override { /* TODO */ return 0x00; } /* port C is input[3:0] and output[7:4] */ - virtual void outPortC(const uint8_t mask) { + void outPortC(const uint8_t mask) override { if (!enable_pc98_bus_mouse) return; diff --git a/src/hardware/mame/saa1099.h b/src/hardware/mame/saa1099.h index e95fc6afa..a44ff2147 100644 --- a/src/hardware/mame/saa1099.h +++ b/src/hardware/mame/saa1099.h @@ -57,10 +57,10 @@ public: //protected: // device-level overrides - virtual void device_start(); + void device_start() override; // sound stream update overrides - virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); + void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; void SaveState( std::ostream& stream ); void LoadState( std::istream& stream ); diff --git a/src/hardware/mame/sn76496.h b/src/hardware/mame/sn76496.h index 45c6c294d..3696b66d9 100644 --- a/src/hardware/mame/sn76496.h +++ b/src/hardware/mame/sn76496.h @@ -57,9 +57,9 @@ protected: device_t *owner, uint32_t clock); - virtual void device_start(); + void device_start() override; virtual void device_clock_changed(); - virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); + void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; private: inline bool in_noise_mode(); diff --git a/src/hardware/memory.cpp b/src/hardware/memory.cpp index 6ae6f0843..82c77e720 100644 --- a/src/hardware/memory.cpp +++ b/src/hardware/memory.cpp @@ -72,7 +72,7 @@ class ACPIPageHandler : public PageHandler { public: ACPIPageHandler() : PageHandler(PFLAG_NOCODE|PFLAG_READABLE|PFLAG_WRITEABLE) {} ACPIPageHandler(Bitu flags) : PageHandler(flags) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { assert(ACPI_buffer != NULL); assert(ACPI_buffer_size >= 4096); phys_page -= (ACPI_BASE >> 12); @@ -80,7 +80,7 @@ class ACPIPageHandler : public PageHandler { if (phys_page >= (ACPI_buffer_size >> 12)) phys_page = (ACPI_buffer_size >> 12) - 1; return ACPI_buffer + (phys_page << 12); } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { assert(ACPI_buffer != NULL); assert(ACPI_buffer_size >= 4096); phys_page -= (ACPI_BASE >> 12); @@ -211,11 +211,11 @@ HostPt MemBase = NULL; class UnmappedPageHandler : public PageHandler { public: UnmappedPageHandler() : PageHandler(PFLAG_INIT|PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { (void)addr;//UNUSED return 0xFF; /* Real hardware returns 0xFF not 0x00 */ } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { (void)addr;//UNUSED (void)val;//UNUSED } @@ -224,7 +224,7 @@ public: class IllegalPageHandler : public PageHandler { public: IllegalPageHandler() : PageHandler(PFLAG_INIT|PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { (void)addr; #if C_DEBUG LOG_MSG("Warning: Illegal read from %x, CS:IP %8x:%8x",addr,SegValue(cs),reg_eip); @@ -237,7 +237,7 @@ public: #endif return 0xFF; /* Real hardware returns 0xFF not 0x00 */ } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { (void)addr;//UNUSED (void)val;//UNUSED #if C_DEBUG @@ -256,13 +256,13 @@ class RAMPageHandler : public PageHandler { public: RAMPageHandler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE) {} RAMPageHandler(Bitu flags) : PageHandler(flags) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { if (!a20_fast_changeable || (phys_page & (~0xFul/*64KB*/)) == 0x100ul/*@1MB*/) return MemBase+(phys_page&memory.mem_alias_pagemask_active)*MEM_PAGESIZE; return MemBase+phys_page*MEM_PAGESIZE; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { if (!a20_fast_changeable || (phys_page & (~0xFul/*64KB*/)) == 0x100ul/*@1MB*/) return MemBase+(phys_page&memory.mem_alias_pagemask_active)*MEM_PAGESIZE; @@ -275,10 +275,10 @@ public: ROMAliasPageHandler() { flags=PFLAG_READABLE|PFLAG_HASROM; } - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { return MemBase+((phys_page&0xF)+0xF0)*MEM_PAGESIZE; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return MemBase+((phys_page&0xF)+0xF0)*MEM_PAGESIZE; } }; @@ -288,19 +288,19 @@ public: ROMPageHandler() { flags=PFLAG_READABLE|PFLAG_HASROM; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { if (IS_PC98_ARCH && (addr & ~0x7FFF) == 0xE0000u) { /* Many PC-98 games and programs will zero 0xE0000-0xE7FFF whether or not the 4th bitplane is mapped */ } else LOG(LOG_CPU,LOG_ERROR)("Write %x to rom at %x",(int)val,(int)addr); } - void writew(PhysPt addr,uint16_t val){ + void writew(PhysPt addr,uint16_t val) override { if (IS_PC98_ARCH && (addr & ~0x7FFF) == 0xE0000u) { /* Many PC-98 games and programs will zero 0xE0000-0xE7FFF whether or not the 4th bitplane is mapped */ } else LOG(LOG_CPU,LOG_ERROR)("Write %x to rom at %x",(int)val,(int)addr); } - void writed(PhysPt addr,uint32_t val){ + void writed(PhysPt addr,uint32_t val) override { if (IS_PC98_ARCH && (addr & ~0x7FFF) == 0xE0000u) { /* Many PC-98 games and programs will zero 0xE0000-0xE7FFF whether or not the 4th bitplane is mapped */ } else @@ -1719,7 +1719,7 @@ HostPt GetMemBase(void) { return MemBase; } class REDOS : public Program { public: /*! \brief Program entry point, when the command is run */ - void Run(void) { + void Run(void) override { if (cmd->FindExist("/?", false) || cmd->FindExist("-?", false)) { WriteOut("Reboots the kernel of DOSBox-X's emulated DOS.\n\nRE-DOS\n"); return; @@ -1739,7 +1739,7 @@ void REDOS_ProgramStart(Program * * make) { class A20GATE : public Program { public: /*! \brief Program entry point, when the command is run */ - void Run(void) { + void Run(void) override { if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) { WriteOut("Turns on/off or changes the A20 gate mode.\n\n"); WriteOut("A20GATE [ON | OFF | SET [off | off_fake | on | on_fake | mask | fast]]\n\n" @@ -2275,7 +2275,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { uint8_t pagehandler_idx[0x40000]; unsigned int size_table; @@ -2321,7 +2321,7 @@ private: WRITE_POD( &pagehandler_idx, pagehandler_idx ); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { uint8_t pagehandler_idx[0x40000]; void *old_ptrs[4]; diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index 4dfb6cfa6..33b57d735 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -1011,7 +1011,7 @@ public: if (!w) vol1=vol0; } - void Run(void) { + void Run(void) override { if (cmd->FindExist("-?", false) || cmd->FindExist("/?", false)) { WriteOut("Displays or changes the current sound mixer volumes.\n\n" "MIXER [/GUI|/NOSHOW] [/LISTMIDI [handler]] [channel volume]\n\n" @@ -1332,7 +1332,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { //************************************************* @@ -1351,7 +1351,7 @@ private: POD_Save_Tandy_Sound(stream); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { //************************************************* diff --git a/src/hardware/parport/directlpt.h b/src/hardware/parport/directlpt.h index 474028ba2..3bb03dc89 100644 --- a/src/hardware/parport/directlpt.h +++ b/src/hardware/parport/directlpt.h @@ -31,17 +31,17 @@ public: bool InstallationSuccessful; // check after constructing. If private: // something was wrong, delete it right away. - virtual bool Putchar(uint8_t); + bool Putchar(uint8_t) override; - virtual Bitu Read_PR(); - virtual Bitu Read_COM(); - virtual Bitu Read_SR(); + Bitu Read_PR() override; + Bitu Read_COM() override; + Bitu Read_SR() override; - virtual void Write_PR(Bitu); - virtual void Write_CON(Bitu); - virtual void Write_IOSEL(Bitu); + void Write_PR(Bitu) override; + void Write_CON(Bitu) override; + void Write_IOSEL(Bitu) override; - virtual void handleUpperEvent(uint16_t type); + void handleUpperEvent(uint16_t type) override; uint16_t realbaseaddress; uint16_t ecraddress; diff --git a/src/hardware/parport/filelpt.h b/src/hardware/parport/filelpt.h index 92c601931..3c0396423 100644 --- a/src/hardware/parport/filelpt.h +++ b/src/hardware/parport/filelpt.h @@ -51,24 +51,24 @@ public: bool ack_polarity = false; - Bitu Read_PR(); - Bitu Read_COM(); - Bitu Read_SR(); + Bitu Read_PR() override; + Bitu Read_COM() override; + Bitu Read_SR() override; uint8_t datareg = 0; uint8_t controlreg; - void Write_PR(Bitu); - void Write_CON(Bitu); - void Write_IOSEL(Bitu); - bool Putchar(uint8_t); + void Write_PR(Bitu) override; + void Write_CON(Bitu) override; + void Write_IOSEL(Bitu) override; + bool Putchar(uint8_t) override; bool autofeed = false; bool ack; unsigned int timeout = 0; Bitu lastUsedTick = 0; void doAction(); - virtual void handleUpperEvent(uint16_t type); + virtual void handleUpperEvent(uint16_t type) override; }; #endif // include guard diff --git a/src/hardware/parport/parport.cpp b/src/hardware/parport/parport.cpp index 5eff1a18f..c970b6889 100644 --- a/src/hardware/parport/parport.cpp +++ b/src/hardware/parport/parport.cpp @@ -489,7 +489,7 @@ static const char *parallelTypes[PARALLEL_TYPE_COUNT] = { class PARALLEL : public Program { public: - void Run(); + void Run() override; private: void showPort(int port); }; diff --git a/src/hardware/parport/printer_redir.h b/src/hardware/parport/printer_redir.h index 594a3f529..2986243e8 100644 --- a/src/hardware/parport/printer_redir.h +++ b/src/hardware/parport/printer_redir.h @@ -16,16 +16,16 @@ public: bool InstallationSuccessful; // check after constructing. If // something was wrong, delete it right away. - Bitu Read_PR(); - Bitu Read_COM(); - Bitu Read_SR(); + Bitu Read_PR() override; + Bitu Read_COM() override; + Bitu Read_SR() override; - void Write_PR(Bitu); - void Write_CON(Bitu); - void Write_IOSEL(Bitu); - bool Putchar(uint8_t); + void Write_PR(Bitu) override; + void Write_CON(Bitu) override; + void Write_IOSEL(Bitu) override; + bool Putchar(uint8_t) override; - void handleUpperEvent(uint16_t type); + void handleUpperEvent(uint16_t type) override; }; #endif // include guard diff --git a/src/hardware/pc98.cpp b/src/hardware/pc98.cpp index 00e7e49f8..f76281f6e 100644 --- a/src/hardware/pc98.cpp +++ b/src/hardware/pc98.cpp @@ -39,7 +39,7 @@ void PC98_ChangeMouseFunction(bool nec); /* ====================== PC98UTIL.COM ====================== */ class PC98UTIL : public Program { public: - void Run(void) { + void Run(void) override { string arg; bool got_opt=false; diff --git a/src/hardware/pci_bus.cpp b/src/hardware/pci_bus.cpp index d6ef7ebb8..e27451281 100644 --- a/src/hardware/pci_bus.cpp +++ b/src/hardware/pci_bus.cpp @@ -246,7 +246,7 @@ public: } } - virtual void config_write(uint8_t regnum,Bitu iolen,uint32_t value) { + void config_write(uint8_t regnum,Bitu iolen,uint32_t value) override { if (iolen == 1) { const unsigned char mask = config_writemask[regnum]; const unsigned char nmask = ~mask; @@ -280,7 +280,7 @@ public: PCI_Device::config_write(regnum,iolen,value); /* which will break down I/O into 8-bit */ } } - virtual uint32_t config_read(uint8_t regnum,Bitu iolen) { + uint32_t config_read(uint8_t regnum,Bitu iolen) override { if (iolen == 1) { switch (regnum) { case 0x4c: /* FIXME: I hope I ported this right --J.C. */ diff --git a/src/hardware/pic.cpp b/src/hardware/pic.cpp index 6e205665d..37633167e 100644 --- a/src/hardware/pic.cpp +++ b/src/hardware/pic.cpp @@ -1228,7 +1228,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { uint16_t pic_free_idx, pic_next_idx; uint16_t pic_next_ptr[PIC_QUEUESIZE]; @@ -1331,7 +1331,7 @@ private: //test->saveState(stream); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { uint16_t free_idx, next_idx; uint16_t ticker_size; diff --git a/src/hardware/sblaster.cpp b/src/hardware/sblaster.cpp index f91fd4f72..9272ade6a 100644 --- a/src/hardware/sblaster.cpp +++ b/src/hardware/sblaster.cpp @@ -3516,10 +3516,10 @@ class ViBRA_PnP : public ISAPnPDevice { end_write_res(); // END } - void select_logical_device(Bitu val) { + void select_logical_device(Bitu val) override { logical_device = val; } - uint8_t read(Bitu addr) { + uint8_t read(Bitu addr) override { uint8_t ret = 0xFF; if (logical_device == 0) { switch (addr) { @@ -3555,7 +3555,7 @@ class ViBRA_PnP : public ISAPnPDevice { return ret; } - void write(Bitu addr,Bitu val) { + void write(Bitu addr,Bitu val) override { if (logical_device == 0) { switch (addr) { case 0x30: /* activate range */ diff --git a/src/hardware/serialport/directserial.h b/src/hardware/serialport/directserial.h index 34048128c..ab71970cf 100644 --- a/src/hardware/serialport/directserial.h +++ b/src/hardware/serialport/directserial.h @@ -35,15 +35,15 @@ public: CDirectSerial(Bitu id, CommandLine* cmd); ~CDirectSerial(); - void updatePortConfig(uint16_t divider, uint8_t lcr); - void updateMSR(); - void transmitByte(uint8_t val, bool first); - void setBreak(bool value); + void updatePortConfig(uint16_t divider, uint8_t lcr) override; + void updateMSR() override; + void transmitByte(uint8_t val, bool first) override; + void setBreak(bool value) override; - void setRTSDTR(bool rts, bool dtr); - void setRTS(bool val); - void setDTR(bool val); - void handleUpperEvent(uint16_t type); + void setRTSDTR(bool rts, bool dtr) override; + void setRTS(bool val) override; + void setDTR(bool val) override; + void handleUpperEvent(uint16_t type) override; private: COMPORT comport; diff --git a/src/hardware/serialport/serialdummy.h b/src/hardware/serialport/serialdummy.h index 4ce04f3ba..a6e45e31c 100644 --- a/src/hardware/serialport/serialdummy.h +++ b/src/hardware/serialport/serialdummy.h @@ -29,15 +29,15 @@ public: CSerialDummy(Bitu id, CommandLine* cmd); virtual ~CSerialDummy(); - void setRTSDTR(bool rts, bool dtr); - void setRTS(bool val); - void setDTR(bool val); + void setRTSDTR(bool rts, bool dtr) override; + void setRTS(bool val) override; + void setDTR(bool val) override; - void updatePortConfig(uint16_t, uint8_t lcr); - void updateMSR(); - void transmitByte(uint8_t val, bool first); - void setBreak(bool value); - void handleUpperEvent(uint16_t type); + void updatePortConfig(uint16_t, uint8_t lcr) override; + void updateMSR() override; + void transmitByte(uint8_t val, bool first) override; + void setBreak(bool value) override; + void handleUpperEvent(uint16_t type) override; #ifdef CHECKIT_TESTPLUG uint8_t loopbackdata; diff --git a/src/hardware/serialport/serialfile.h b/src/hardware/serialport/serialfile.h index 0335aebef..9dcbe6d18 100644 --- a/src/hardware/serialport/serialfile.h +++ b/src/hardware/serialport/serialfile.h @@ -31,16 +31,16 @@ public: CSerialFile(Bitu id, CommandLine* cmd, bool sq = false); virtual ~CSerialFile(); - void setRTSDTR(bool rts, bool dtr); - void setRTS(bool val); - void setDTR(bool val); + void setRTSDTR(bool rts, bool dtr) override; + void setRTS(bool val) override; + void setDTR(bool val) override; - void updatePortConfig(uint16_t, uint8_t lcr); - void updateMSR(); - void transmitByte(uint8_t val, bool first); - void setBreak(bool value); + void updatePortConfig(uint16_t, uint8_t lcr) override; + void updateMSR() override; + void transmitByte(uint8_t val, bool first) override; + void setBreak(bool value) override; void doAction(); - void handleUpperEvent(uint16_t type); + void handleUpperEvent(uint16_t type) override; FILE* fp = NULL; bool squote; diff --git a/src/hardware/serialport/seriallog.h b/src/hardware/serialport/seriallog.h index 87d5e609e..869f4373c 100644 --- a/src/hardware/serialport/seriallog.h +++ b/src/hardware/serialport/seriallog.h @@ -31,15 +31,15 @@ public: CSerialLog(Bitu id, CommandLine* cmd); virtual ~CSerialLog(); - void setRTSDTR(bool rts, bool dtr); - void setRTS(bool val); - void setDTR(bool val); + void setRTSDTR(bool rts, bool dtr) override; + void setRTS(bool val) override; + void setDTR(bool val) override; - void updatePortConfig(uint16_t, uint8_t lcr); - void updateMSR(); - void transmitByte(uint8_t val, bool first); - void setBreak(bool value); - void handleUpperEvent(uint16_t type); + void updatePortConfig(uint16_t, uint8_t lcr) override; + void updateMSR() override; + void transmitByte(uint8_t val, bool first) override; + void setBreak(bool value) override; + void handleUpperEvent(uint16_t type) override; void log_emit(); diff --git a/src/hardware/serialport/serialmouse.h b/src/hardware/serialport/serialmouse.h index 332c62076..d283c0086 100644 --- a/src/hardware/serialport/serialmouse.h +++ b/src/hardware/serialport/serialmouse.h @@ -30,15 +30,15 @@ public: CSerialMouse(Bitu id, CommandLine* cmd); virtual ~CSerialMouse(); - void setRTSDTR(bool rts, bool dtr); - void setRTS(bool val); - void setDTR(bool val); + void setRTSDTR(bool rts, bool dtr) override; + void setRTS(bool val) override; + void setDTR(bool val) override; - void updatePortConfig(uint16_t, uint8_t lcr); - void updateMSR(); - void transmitByte(uint8_t val, bool first); - void setBreak(bool value); - void handleUpperEvent(uint16_t type); + void updatePortConfig(uint16_t, uint8_t lcr) override; + void updateMSR() override; + void transmitByte(uint8_t val, bool first) override; + void setBreak(bool value) override; + void handleUpperEvent(uint16_t type) override; void onMouseReset(); void on_mouse_event(int delta_x,int delta_y,uint8_t buttonstate); void start_packet(); diff --git a/src/hardware/serialport/serialport.cpp b/src/hardware/serialport/serialport.cpp index 6d8f4fb14..85c62acd6 100644 --- a/src/hardware/serialport/serialport.cpp +++ b/src/hardware/serialport/serialport.cpp @@ -1476,7 +1476,7 @@ static const char *serialTypes[SERIAL_TYPE_COUNT] = { class SERIAL : public Program { public: - void Run(); + void Run() override; private: void showPort(int port); }; diff --git a/src/hardware/vga.cpp b/src/hardware/vga.cpp index fad90e4a4..c52ea773b 100644 --- a/src/hardware/vga.cpp +++ b/src/hardware/vga.cpp @@ -601,7 +601,7 @@ static void resetSize(Bitu /*val*/) { class VFRCRATE : public Program { public: - void Run(void) { + void Run(void) override { if (cmd->FindExist("/?", false)) { WriteOut("Locks or unlocks the video refresh rate.\n\n"); WriteOut("VFRCRATE [SET [OFF|PAL|NTSC|rate]\n"); @@ -643,7 +643,7 @@ class CGASNOW : public Program { public: /*! \brief Program entry point, when the command is run */ - void Run(void) { + void Run(void) override { if (cmd->FindExist("/?", false)) { WriteOut("Turns CGA snow emulation on or off.\n\n"); WriteOut("CGASNOW [ON|OFF]\n"); @@ -2116,7 +2116,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { uint32_t tandy_drawbase_idx, tandy_membase_idx; @@ -2234,7 +2234,7 @@ private: POD_Save_VGA_XGA(stream); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { uint32_t tandy_drawbase_idx, tandy_membase_idx; diff --git a/src/hardware/vga_memory.cpp b/src/hardware/vga_memory.cpp index e33d3b03e..0dac0ac26 100644 --- a/src/hardware/vga_memory.cpp +++ b/src/hardware/vga_memory.cpp @@ -375,36 +375,36 @@ public: // planer index = addr & 3u (use low 2 bits as plane index) return chain4remap((PAGING_GetPhysicalAddress(addr)&vgapages.mask)+(PhysPt)vga.svga.bank_read_full)&vga.mem.memmask; } - uint8_t readb(PhysPt addr ) { + uint8_t readb(PhysPt addr ) override { VGAMEM_USEC_read_delay(); return vga.mem.linear[lin2mem(addr)]; } - uint16_t readw(PhysPt addr ) { + uint16_t readw(PhysPt addr ) override { VGAMEM_USEC_read_delay(); if ((addr & 1) == 0) return *((uint16_t*)(&vga.mem.linear[lin2mem(addr)])); else return PageHandler::readw(addr); } - uint32_t readd(PhysPt addr ) { + uint32_t readd(PhysPt addr ) override { VGAMEM_USEC_read_delay(); if ((addr & 3) == 0) return *((uint32_t*)(&vga.mem.linear[lin2mem(addr)])); else return PageHandler::readd(addr); } - void writeb(PhysPt addr, uint8_t val ) { + void writeb(PhysPt addr, uint8_t val ) override { VGAMEM_USEC_write_delay(); vga.mem.linear[lin2mem(addr)] = val; } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); if ((addr & 1) == 0) *((uint16_t*)(&vga.mem.linear[lin2mem(addr)])) = val; else PageHandler::writew(addr,val); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); if ((addr & 3) == 0) *((uint32_t*)(&vga.mem.linear[lin2mem(addr)])) = val; @@ -438,14 +438,14 @@ public: // planer index = addr & 3u (use low 2 bits as plane index) return VGA_Generic_Write_Handler(addr&~3u, addr, (uint8_t)val); } - uint8_t readb(PhysPt addr ) { + uint8_t readb(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; // addr = CHECKED(addr); return (uint8_t)readHandler8( addr ); } - uint16_t readw(PhysPt addr ) { + uint16_t readw(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -454,7 +454,7 @@ public: ret |= (readHandler8( addr+1 ) << 8 ); return ret; } - uint32_t readd(PhysPt addr ) { + uint32_t readd(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -465,14 +465,14 @@ public: ret |= (readHandler8( addr+3 ) << 24 ); return ret; } - void writeb(PhysPt addr, uint8_t val ) { + void writeb(PhysPt addr, uint8_t val ) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; // addr = CHECKED(addr); writeHandler8( addr, val ); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -480,7 +480,7 @@ public: writeHandler8( addr+0, (uint8_t)(val >> 0u) ); writeHandler8( addr+1, (uint8_t)(val >> 8u) ); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -505,14 +505,14 @@ public: // planer index = addr & 3u (use low 2 bits as plane index) return VGA_Generic_Write_Handler(addr>>2u, addr, (uint8_t)val); } - uint8_t readb(PhysPt addr ) { + uint8_t readb(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; // addr = CHECKED(addr); return (uint8_t)readHandler8( addr ); } - uint16_t readw(PhysPt addr ) { + uint16_t readw(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -521,7 +521,7 @@ public: ret |= (readHandler8( addr+1 ) << 8 ); return ret; } - uint32_t readd(PhysPt addr ) { + uint32_t readd(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -532,14 +532,14 @@ public: ret |= (readHandler8( addr+3 ) << 24 ); return ret; } - void writeb(PhysPt addr, uint8_t val ) { + void writeb(PhysPt addr, uint8_t val ) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; // addr = CHECKED(addr); writeHandler8( addr, val ); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -547,7 +547,7 @@ public: writeHandler8( addr+0, (uint8_t)(val >> 0u) ); writeHandler8( addr+1, (uint8_t)(val >> 8u) ); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -565,14 +565,14 @@ public: return VGA_Generic_Read_Handler(start, start, vga.config.read_map_select); } public: - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; // addr = CHECKED2(addr); return (uint8_t)readHandler(addr); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -581,7 +581,7 @@ public: ret |= (readHandler(addr+1) << 8); return ret; } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_read_full; @@ -598,14 +598,14 @@ public: } public: VGA_UnchainedVGA_Handler() : PageHandler(PFLAG_NOCODE) {} - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; // addr = CHECKED2(addr); writeHandler(addr+0,(uint8_t)(val >> 0)); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -613,7 +613,7 @@ public: writeHandler(addr+0,(uint8_t)(val >> 0)); writeHandler(addr+1,(uint8_t)(val >> 8)); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -641,7 +641,7 @@ public: } public: VGA_UnchainedVGA_Fast_Handler() : VGA_UnchainedVGA_Handler() {} - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -649,7 +649,7 @@ public: // For single byte emulation it's faster to just do the full mask and OR than check for "full" case. writeHandler(addr+0,(uint8_t)(val >> 0)); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -663,7 +663,7 @@ public: writeHandler(addr+1,(uint8_t)(val >> 8)); } } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; addr += (PhysPt)vga.svga.bank_write_full; @@ -690,12 +690,12 @@ public: VGA_CGATEXT_PageHandler() { flags=PFLAG_NOCODE; } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { addr = PAGING_GetPhysicalAddress(addr) & 0x3FFF; VGAMEM_USEC_read_delay(); return vga.tandy.mem_base[addr]; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); if (enableCGASnow) { @@ -720,12 +720,12 @@ public: VGA_MCGATEXT_PageHandler() { flags=PFLAG_NOCODE; } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { addr = PAGING_GetPhysicalAddress(addr) & 0xFFFF; VGAMEM_USEC_read_delay(); return vga.tandy.mem_base[addr]; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & 0xFFFF; @@ -1594,7 +1594,7 @@ void pc98_mem_msw_write(unsigned char which,unsigned char val) { class VGA_PC98_TEXT_PageHandler : public PageHandler { public: VGA_PC98_TEXT_PageHandler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { addr &= 0x3FFFu; if (addr >= 0x3FE0u) @@ -1604,7 +1604,7 @@ public: return VRAM98_TEXT[addr]; } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { addr &= 0x3FFFu; if (addr >= 0x3FE0u) @@ -1638,10 +1638,10 @@ extern uint16_t a1_font_load_addr; class VGA_PC98_CG_PageHandler : public PageHandler { public: VGA_PC98_CG_PageHandler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { return pc98_font_char_read(a1_font_load_addr,(addr >> 1) & 0xF,addr & 1); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { if ((a1_font_load_addr & 0x007E) == 0x0056 && (a1_font_load_addr & 0xFF00) != 0x0000) pc98_font_char_write(a1_font_load_addr,(addr >> 1) & 0xF,addr & 1,val); else @@ -1653,10 +1653,10 @@ public: class VGA_PC98_256MMIO_PageHandler : public PageHandler { public: VGA_PC98_256MMIO_PageHandler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { return pc98_pegc_mmio_read(addr & 0x7FFFu); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { pc98_pegc_mmio_write(addr & 0x7FFFu,val); } }; @@ -1669,25 +1669,25 @@ public: class VGA_PC98_256Planar_PageHandler : public PageHandler { public: VGA_PC98_256Planar_PageHandler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { (void)addr; // LOG_MSG("PEGC 256-color planar warning: Readb from %lxh",(unsigned long)addr); return (uint8_t)(~0); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { (void)addr; (void)val; // LOG_MSG("PEGC 256-color planar warning: Writeb to %lxh val %02xh",(unsigned long)addr,(unsigned int)val); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { (void)addr; // LOG_MSG("PEGC 256-color planar warning: Readw from %lxh",(unsigned long)addr); return (uint16_t)(~0); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { (void)addr; (void)val; @@ -1700,10 +1700,10 @@ public: template class VGA_PC98_256BANK_PageHandler : public PageHandler { public: VGA_PC98_256BANK_PageHandler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { return pc98_vram_256bank_from_window(bank)[addr & 0x7FFFu]; } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { pc98_vram_256bank_from_window(bank)[addr & 0x7FFFu] = val; } }; @@ -2008,18 +2008,18 @@ public: } /* byte-wise */ - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { VGAMEM_USEC_read_delay(); return readc( PAGING_GetPhysicalAddress(addr) ); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); writec( PAGING_GetPhysicalAddress(addr), val ); } /* word-wise. * in the style of the 8086, non-word-aligned I/O is split into byte I/O */ - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr); if (!(addr & 1)) /* if WORD aligned */ @@ -2029,7 +2029,7 @@ public: ((unsigned int)readc(addr+1U) << 8u); } } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr); if (!(addr & 1)) /* if WORD aligned */ @@ -2044,10 +2044,10 @@ public: class VGA_PC98_LFB_Handler : public PageHandler { public: VGA_PC98_LFB_Handler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE|PFLAG_NOCODE) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { return &vga.mem.linear[(phys_page&0x7F)*4096 + PC98_VRAM_GRAPHICS_OFFSET]; /* 512KB mapping */ } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return &vga.mem.linear[(phys_page&0x7F)*4096 + PC98_VRAM_GRAPHICS_OFFSET]; /* 512KB mapping */ } }; @@ -2055,11 +2055,11 @@ public: class VGA_Map_Handler : public PageHandler { public: VGA_Map_Handler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE|PFLAG_NOCODE) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { phys_page-=vgapages.base; return &vga.mem.linear[CHECKED3(vga.svga.bank_read_full+phys_page*4096)]; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { phys_page-=vgapages.base; return &vga.mem.linear[CHECKED3(vga.svga.bank_write_full+phys_page*4096)]; } @@ -2075,11 +2075,11 @@ public: CPU_IODelayRemoved += delaycyc; } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { delay(); return vga.tandy.mem_base[(addr - 0xb8000) & 0x3FFF]; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { delay(); vga.tandy.mem_base[(addr - 0xb8000) & 0x3FFF] = val; } @@ -2089,12 +2089,12 @@ public: class VGA_LFB_Handler : public PageHandler { public: VGA_LFB_Handler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE|PFLAG_NOCODE) {} - HostPt GetHostReadPt( Bitu phys_page ) { + HostPt GetHostReadPt( Bitu phys_page ) override { phys_page -= vga.lfb.page; phys_page &= (vga.mem.memsize >> 12) - 1; return &vga.mem.linear[CHECKED3(phys_page * 4096)]; } - HostPt GetHostWritePt( Bitu phys_page ) { + HostPt GetHostWritePt( Bitu phys_page ) override { return GetHostReadPt( phys_page ); } }; @@ -2105,33 +2105,33 @@ extern Bitu XGA_Read(Bitu port, Bitu len); class VGA_MMIO_Handler : public PageHandler { public: VGA_MMIO_Handler() : PageHandler(PFLAG_NOCODE) {} - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; XGA_Write(port, val, 1); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; XGA_Write(port, val, 2); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; XGA_Write(port, val, 4); } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { VGAMEM_USEC_read_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; return (uint8_t)XGA_Read(port, 1); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { VGAMEM_USEC_read_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; return (uint16_t)XGA_Read(port, 2); } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { VGAMEM_USEC_read_delay(); Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; return (uint32_t)XGA_Read(port, 4); @@ -2141,7 +2141,7 @@ public: class VGA_TANDY_PageHandler : public PageHandler { public: VGA_TANDY_PageHandler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { // Odd banks are limited to 16kB and repeated if (vga.tandy.mem_bank & 1) phys_page&=0x03; @@ -2149,7 +2149,7 @@ public: phys_page&=0x07; return vga.tandy.mem_base + (phys_page * 4096); } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return GetHostReadPt( phys_page ); } }; @@ -2158,14 +2158,14 @@ public: class VGA_PCJR_Handler : public PageHandler { public: VGA_PCJR_Handler() : PageHandler(PFLAG_READABLE|PFLAG_WRITEABLE) {} - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { phys_page-=0xb8; // The 16kB map area is repeated in the 32kB range // On CGA CPU A14 is not decoded so it repeats there too phys_page&=0x03; return vga.tandy.mem_base + (phys_page * 4096); } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return GetHostReadPt( phys_page ); } }; @@ -2200,7 +2200,7 @@ public: return ( (PAGING_GetPhysicalAddress(addr) & 0xffff) - 0x8000 ) & ( 16*1024-1 ); } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = wrAddr( addr ); Bitu plane = vga.mode==M_AMSTRAD ? vga.amstrad.write_plane : 0x01; // 0x0F? @@ -2209,7 +2209,7 @@ public: if( plane & 0x02 ) writeHandler(addr+16384,(uint8_t)(val >> 0)); if( plane & 0x01 ) writeHandler(addr+0,(uint8_t)(val >> 0)); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = wrAddr( addr ); Bitu plane = vga.mode==M_AMSTRAD ? vga.amstrad.write_plane : 0x01; // 0x0F? @@ -2238,7 +2238,7 @@ public: } } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = wrAddr( addr ); Bitu plane = vga.mode==M_AMSTRAD ? vga.amstrad.write_plane : 0x01; // 0x0F? @@ -2275,13 +2275,13 @@ public: } } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = wrAddr( addr ) + ( vga.amstrad.read_plane * 16384u ); addr &= (64u*1024u-1u); return readHandler(addr); } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = wrAddr( addr ) + ( vga.amstrad.read_plane * 16384u ); addr &= (64u*1024u-1u); @@ -2289,7 +2289,7 @@ public: (readHandler(addr+0) << 0u) | (readHandler(addr+1) << 8u); } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { VGAMEM_USEC_read_delay(); addr = wrAddr( addr ) + ( vga.amstrad.read_plane * 16384u ); addr &= (64u*1024u-1u); @@ -2327,12 +2327,12 @@ public: VGA_HERC_Handler() { flags=PFLAG_READABLE|PFLAG_WRITEABLE; } - HostPt GetHostReadPt(Bitu phys_page) { + HostPt GetHostReadPt(Bitu phys_page) override { (void)phys_page;//UNUSED // The 4kB map area is repeated in the 32kB range return &vga.mem.linear[0]; } - HostPt GetHostWritePt(Bitu phys_page) { + HostPt GetHostWritePt(Bitu phys_page) override { return GetHostReadPt( phys_page ); } }; @@ -2340,11 +2340,11 @@ public: class VGA_Empty_Handler : public PageHandler { public: VGA_Empty_Handler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt /*addr*/) { + uint8_t readb(PhysPt /*addr*/) override { // LOG(LOG_VGA, LOG_NORMAL ) ( "Read from empty memory space at %x", addr ); return 0xff; } - void writeb(PhysPt /*addr*/,uint8_t /*val*/) { + void writeb(PhysPt /*addr*/,uint8_t /*val*/) override { // LOG(LOG_VGA, LOG_NORMAL ) ( "Write %x to empty memory space at %x", val, addr ); } }; @@ -2373,13 +2373,13 @@ public: } public: HERC_InColor_Mono_Handler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr ) { + uint8_t readb(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); return (uint8_t)readHandler( addr ); } - uint16_t readw(PhysPt addr ) { + uint16_t readw(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); @@ -2387,7 +2387,7 @@ public: ret |= (readHandler( addr+1 ) << 8 ); return ret; } - uint32_t readd(PhysPt addr ) { + uint32_t readd(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); @@ -2397,20 +2397,20 @@ public: ret |= (readHandler( addr+3 ) << 24 ); return ret; } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); writeHandler(addr+0,val); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); writeHandler(addr+0,(uint8_t)(val >> 0)); writeHandler(addr+1,(uint8_t)(val >> 8)); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); @@ -2483,13 +2483,13 @@ public: } public: HERC_InColor_Graphics_Handler() : PageHandler(PFLAG_NOCODE) {} - uint8_t readb(PhysPt addr ) { + uint8_t readb(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); return (uint8_t)readHandler( addr ); } - uint16_t readw(PhysPt addr ) { + uint16_t readw(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); @@ -2497,7 +2497,7 @@ public: ret |= (readHandler( addr+1 ) << 8 ); return ret; } - uint32_t readd(PhysPt addr ) { + uint32_t readd(PhysPt addr ) override { VGAMEM_USEC_read_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED(addr); @@ -2507,20 +2507,20 @@ public: ret |= (readHandler( addr+3 ) << 24 ); return ret; } - void writeb(PhysPt addr,uint8_t val) { + void writeb(PhysPt addr,uint8_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); writeHandler(addr+0,val); } - void writew(PhysPt addr,uint16_t val) { + void writew(PhysPt addr,uint16_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); writeHandler(addr+0,(uint8_t)(val >> 0)); writeHandler(addr+1,(uint8_t)(val >> 8)); } - void writed(PhysPt addr,uint32_t val) { + void writed(PhysPt addr,uint32_t val) override { VGAMEM_USEC_write_delay(); addr = PAGING_GetPhysicalAddress(addr) & vgapages.mask; // addr = CHECKED2(addr); diff --git a/src/hardware/voodoo_interface.h b/src/hardware/voodoo_interface.h index 21029c4f2..9d5f9a3ea 100644 --- a/src/hardware/voodoo_interface.h +++ b/src/hardware/voodoo_interface.h @@ -45,12 +45,12 @@ public: ~Voodoo_PageHandler() { } - uint8_t readb(PhysPt addr); - void writeb(PhysPt addr,uint8_t val); - uint16_t readw(PhysPt addr); - void writew(PhysPt addr,uint16_t val); - uint32_t readd(PhysPt addr); - void writed(PhysPt addr,uint32_t val); + uint8_t readb(PhysPt addr) override; + void writeb(PhysPt addr,uint8_t val) override; + uint16_t readw(PhysPt addr) override; + void writew(PhysPt addr,uint16_t val) override; + uint32_t readd(PhysPt addr) override; + void writed(PhysPt addr,uint32_t val) override; }; diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index 16268407b..897b8aa50 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -195,19 +195,19 @@ public: SetName("EMMXXXX0"); GEMMIS_seg=0; } - bool Read(uint8_t * /*data*/,uint16_t * /*size*/) { return false;} - bool Write(const uint8_t * /*data*/,uint16_t * /*size*/){ + bool Read(uint8_t * /*data*/,uint16_t * /*size*/) override { return false;} + bool Write(const uint8_t * /*data*/,uint16_t * /*size*/) override { LOG(LOG_IOCTL,LOG_NORMAL)("EMS:Write to device"); return false; } - bool Seek(uint32_t * /*pos*/,uint32_t /*type*/){return false;} - bool Close(){return false;} - uint16_t GetInformation(void) + bool Seek(uint32_t * /*pos*/,uint32_t /*type*/) override {return false;} + bool Close() override {return false;} + uint16_t GetInformation(void) override { return DeviceInfoFlags::Device | DeviceInfoFlags::IoctlSupport; } - bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode); - bool WriteToControlChannel(PhysPt /*bufptr*/,uint16_t /*size*/,uint16_t * /*retcode*/){return true;} + bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override; + bool WriteToControlChannel(PhysPt /*bufptr*/,uint16_t /*size*/,uint16_t * /*retcode*/) override {return true;} private: // uint8_t cache; bool is_emm386; diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index d84b04b06..2a1cdd769 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -2454,7 +2454,7 @@ Bitu INT10_WriteVESAModeList(Bitu max_modes); /* ====================== VESAMOED.COM ====================== */ class VESAMOED : public Program { public: - void Run(void) { + void Run(void) override { size_t array_i = 0; std::string arg,tmp; bool got_opt=false; diff --git a/src/ints/int_dosv.cpp b/src/ints/int_dosv.cpp index 889c3485f..3d0ce03c4 100644 --- a/src/ints/int_dosv.cpp +++ b/src/ints/int_dosv.cpp @@ -2416,7 +2416,7 @@ public: flags = PFLAG_HASROM; bank = 0; } - uint8_t readb(PhysPt addr) { + uint8_t readb(PhysPt addr) override { uint16_t code; Bitu offset; if(bank == 0) { @@ -2446,7 +2446,7 @@ public: } return 0; } - uint16_t readw(PhysPt addr) { + uint16_t readw(PhysPt addr) override { uint16_t code; Bitu offset; if(bank == 0) { @@ -2476,21 +2476,21 @@ public: } return 0; } - uint32_t readd(PhysPt addr) { + uint32_t readd(PhysPt addr) override { (void)addr; return 0; } - void writeb(PhysPt addr,uint8_t val){ + void writeb(PhysPt addr,uint8_t val) override { (void)addr; if((val & 0x80) && val != 0xff) { bank = val & 0x7f; } } - void writew(PhysPt addr,uint16_t val){ + void writew(PhysPt addr,uint16_t val) override { (void)addr; (void)val; } - void writed(PhysPt addr,uint32_t val){ + void writed(PhysPt addr,uint32_t val) override { (void)addr; (void)val; } diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index a14fa90bb..ee6a316a5 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -2644,7 +2644,7 @@ public: {} private: - virtual void getBytes(std::ostream& stream) + void getBytes(std::ostream& stream) override { uint8_t screenMask_idx, cursorMask_idx; @@ -2689,7 +2689,7 @@ private: WRITE_POD( &cursorMask_idx, cursorMask_idx ); } - virtual void setBytes(std::istream& stream) + void setBytes(std::istream& stream) override { uint8_t screenMask_idx, cursorMask_idx; diff --git a/src/libs/gui_tk/gui_tk.h b/src/libs/gui_tk/gui_tk.h index f6fc97f7c..a3ebe3b6b 100644 --- a/src/libs/gui_tk/gui_tk.h +++ b/src/libs/gui_tk/gui_tk.h @@ -866,22 +866,22 @@ public: Window(parent,x,y,w,h) {} /// Mouse was moved while a button was pressed. Returns true if event was handled. - virtual bool mouseDragged(int x, int y, MouseButton button); + bool mouseDragged(int x, int y, MouseButton button) override; /// Mouse was pressed. Returns true if event was handled. - virtual bool mouseDown(int x, int y, MouseButton button); + bool mouseDown(int x, int y, MouseButton button) override; /// Mouse was released. Returns true if event was handled. - virtual bool mouseUp(int x, int y, MouseButton button); + bool mouseUp(int x, int y, MouseButton button) override; /// Mouse was moved. Returns true if event was handled. - virtual bool mouseMoved(int x, int y); + bool mouseMoved(int x, int y) override; /// Mouse was clicked. Returns true if event was handled. /** Clicking means pressing and releasing the mouse button while not moving it. */ - virtual bool mouseClicked(int x, int y, MouseButton button); + bool mouseClicked(int x, int y, MouseButton button) override; /// Mouse was double-clicked. Returns true if event was handled. - virtual bool mouseDoubleClicked(int x, int y, MouseButton button); + bool mouseDoubleClicked(int x, int y, MouseButton button) override; /// Key was pressed. Returns true if event was handled. - virtual bool keyDown(const Key &key); + bool keyDown(const Key &key) override; virtual void getVScrollInfo(vscrollbarlayout &vsl) const; virtual void paintScrollBarArrowInBox(Drawable &dscroll,const int x,const int y,const int w,const int h,bool downArrow,bool disabled) const; @@ -890,11 +890,11 @@ public: virtual void paintScrollBarThumb(Drawable &dscroll, vscrollbarlayout &vsl) const; virtual void paintScrollBar3DOutset(Drawable &dscroll, int x, int y, int w, int h) const; virtual void paintScrollBar3DInset(Drawable &dscroll, int x, int y, int w, int h) const; - virtual void paintAll(Drawable &d) const; + void paintAll(Drawable &d) const override; - virtual void onTabbing(const int msg); + void onTabbing(const int msg) override; - virtual void resize(int w, int h); + void resize(int w, int h) override; virtual void enableScrollBars(bool hs,bool vs); virtual void enableBorder(bool en); @@ -915,8 +915,8 @@ public: * than 500 days. If you want callbacks to be called again, return the * delay in ticks relative to the scheduled time of this * callback (which may be earlier than now() ). Otherwise return 0. */ - virtual Ticks timerExpired(Ticks time); - virtual ~DragTimer_Callback() {} + Ticks timerExpired(Ticks time) override; + ~DragTimer_Callback() {} public: WindowInWindow *wnd = NULL; }; @@ -987,19 +987,19 @@ public: template void setClipboard(const STR s) { this->setClipboard(String(s)); } /// Set clipboard content. - virtual void setClipboard(const String &s) { clipboard = s; } + void setClipboard(const String &s) override { clipboard = s; } /// Get clipboard content. - virtual const String& getClipboard() { return clipboard; } + const String& getClipboard() override { return clipboard; } /// Do nothing. - virtual void resize(int w, int h); + void resize(int w, int h) override; /// Do nothing. - virtual void move(int x, int y); + void move(int x, int y) override; /// Screen has always focus. - virtual bool hasFocus() const { return true; } + bool hasFocus() const override { return true; } /// Update the given surface with this screen's content, fully honouring the alpha channel. /** \p ticks can be set to a different value depending on how much time has passed. Timing @@ -1009,7 +1009,7 @@ public: Ticks update(void *surface, Ticks ticks = 1); /// Default: clear screen. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; }; @@ -1021,14 +1021,14 @@ public: class ScreenRGB32le : public Screen { protected: /// Map a single RGB triple (8 bit each) to a native pixel value. - virtual void rgbToSurface(RGB color, void **pixel) { RGB **p = (RGB **)pixel; **p = color; (*p)++; }; + void rgbToSurface(RGB color, void **pixel) override { RGB **p = (RGB **)pixel; **p = color; (*p)++; }; /// Map a single surface pixel to an RGB value. - virtual RGB surfaceToRGB(void *pixel) { return *(RGB*)pixel; }; + RGB surfaceToRGB(void *pixel) override { return *(RGB*)pixel; }; public: ScreenRGB32le(Size width, Size height) : Screen(width,height) {}; - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; }; @@ -1050,10 +1050,10 @@ public: class ScreenSDL : public Screen { protected: /// not used. - virtual void rgbToSurface(RGB color, void **pixel) { (void)color; (void)pixel; }; + void rgbToSurface(RGB color, void **pixel) override { (void)color; (void)pixel; }; /// not used. - virtual RGB surfaceToRGB(void *pixel) { (void)pixel; return 0; }; + RGB surfaceToRGB(void *pixel) override { (void)pixel; return 0; }; /// The SDL surface being drawn to. SDL_Surface *surface; @@ -1090,7 +1090,7 @@ public: SDL_Surface *getSurface() { return surface; } /// Overridden: makes background transparent by default. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Use this to update the SDL surface. The screen must not be locked. Ticks update(Ticks ticks); @@ -1491,7 +1491,7 @@ protected: /// Draw character to a drawable at the current position. /** \p d's current position is advanced to the position of the next character. * The y coordinate is located at the baseline before and after the call. */ - virtual void drawChar(Drawable *d, const Char c) const; + void drawChar(Drawable *d, const Char c) const override; public: /// Constructor. @@ -1505,22 +1505,22 @@ public: const unsigned char *const* char_position = NULL, const SpecialChar *special = NULL); - virtual ~BitmapFont(); + ~BitmapFont(); /// Retrieve total height of font in pixels. - virtual int getHeight() const { return height; }; + int getHeight() const override { return height; }; /// Retrieve the ascent, i.e. the number of pixels above the base line. - virtual int getAscent() const { return ascent; }; + int getAscent() const override { return ascent; }; /// Retrieve width of a character. - virtual int getWidth(Char c = 'M') const { return (widths != NULL?widths[c]:width); }; + int getWidth(Char c = 'M') const override { return (widths != NULL?widths[c]:width); }; /// Convert a character to an equivalent SpecialChar. See Font::toSpecial(Char c) - virtual SpecialChar toSpecial(Char c) const { return (special != NULL?special[c]:Font::toSpecial(c)); } + SpecialChar toSpecial(Char c) const override { return (special != NULL?special[c]:Font::toSpecial(c)); } /// Convert a character to an equivalent character. See Font::fromSpecial(SpecialChar c). - virtual Char fromSpecial(SpecialChar c) const { if (special == NULL) return Font::fromSpecial(c); Char i = 0; while(special[i] != c) i++; return i; } + Char fromSpecial(SpecialChar c) const override { if (special == NULL) return Font::fromSpecial(c); Char i = 0; while(special[i] != c) i++; return i; } }; @@ -1596,13 +1596,13 @@ protected: Window(parent,x,y,w,h), border_left(bl), border_top(bt), border_right(br), border_bottom(bb) {} public: - virtual void paintAll(Drawable &d) const; - virtual bool mouseMoved(int x, int y); - virtual bool mouseDown(int x, int y, MouseButton button); - virtual bool mouseDragged(int x, int y, MouseButton button); - virtual bool mouseUp(int x, int y, MouseButton button); - virtual int getScreenX() const { return Window::getScreenX()+border_left; } - virtual int getScreenY() const { return Window::getScreenY()+border_top; } + void paintAll(Drawable &d) const override; + bool mouseMoved(int x, int y) override; + bool mouseDown(int x, int y, MouseButton button) override; + bool mouseDragged(int x, int y, MouseButton button) override; + bool mouseUp(int x, int y, MouseButton button) override; + int getScreenX() const override { return Window::getScreenX()+border_left; } + int getScreenY() const override { return Window::getScreenY()+border_top; } }; /// A text label @@ -1649,7 +1649,7 @@ public: RGB getColor() { return color; } /// Calculate label size. Parameters are ignored. - virtual void resize(int w = -1, int h = -1) { + void resize(int w = -1, int h = -1) override { (void)h;//UNUSED if (w == -1) w = (interpret?getWidth():0); else interpret = (w != 0); @@ -1661,12 +1661,12 @@ public: } /// Returns \c true if this window has currently the keyboard focus. - virtual bool hasFocus() const { return allow_focus && Window::hasFocus(); } + bool hasFocus() const override { return allow_focus && Window::hasFocus(); } /// Paint label - virtual void paint(Drawable &d) const { d.setColor(color); d.drawText(0, font->getAscent(), text, interpret, 0); if (hasFocus()) d.drawDotRect(0,0,width-1,height-1); } + void paint(Drawable &d) const override { d.setColor(color); d.drawText(0, font->getAscent(), text, interpret, 0); if (hasFocus()) d.drawDotRect(0,0,width-1,height-1); } - virtual bool raise() { return false; } + bool raise() override { return false; } }; @@ -1740,7 +1740,7 @@ public: } /// Paint input. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Clear selected area. void clearSelection() { @@ -1776,16 +1776,16 @@ public: const String& getText() { return text; }; /// Handle text input. - virtual bool keyDown(const Key &key); + bool keyDown(const Key &key) override; /// Handle mouse input. - virtual bool mouseDown(int x, int y, MouseButton button); + bool mouseDown(int x, int y, MouseButton button) override; /// Handle mouse input. - virtual bool mouseDragged(int x, int y, MouseButton button); + bool mouseDragged(int x, int y, MouseButton button) override; /// Timer callback function - virtual Ticks timerExpired(Ticks time) + Ticks timerExpired(Ticks time) override { (void)time; blink = !blink; setDirty(); return 30; } /// Move the cursor to the end of the text field @@ -1843,7 +1843,7 @@ public: } /// Menu callback function - virtual void actionExecuted(ActionEventSource *src, const String &item) { + void actionExecuted(ActionEventSource *src, const String &item) override { (void)src; if (item == String(MSG_Get("CLOSE"))) close(); } @@ -1854,10 +1854,10 @@ public: /// Remove a window event handler. void removeCloseHandler(ToplevelWindow_Callback *handler) { closehandlers.remove(handler); } - virtual void paint(Drawable &d) const; - virtual bool mouseDown(int x, int y, MouseButton button); - virtual bool mouseDoubleClicked(int x, int y, MouseButton button); - virtual bool mouseUp(int x, int y, MouseButton button) { + void paint(Drawable &d) const override; + bool mouseDown(int x, int y, MouseButton button) override; + bool mouseDoubleClicked(int x, int y, MouseButton button) override; + bool mouseUp(int x, int y, MouseButton button) override { if (button == Left && dragx >= 0 && dragy >= 0) { dragx = dragy = -1; return true; @@ -1865,7 +1865,7 @@ public: BorderedWindow::mouseUp(x,y,button); return true; } - virtual bool mouseDragged(int x, int y, MouseButton button) { + bool mouseDragged(int x, int y, MouseButton button) override { if (button == Left && dragx >= 0 && dragy >= 0) { move(x-dragx+this->x,y-dragy+this->y); return true; @@ -1873,13 +1873,13 @@ public: BorderedWindow::mouseDragged(x,y,button); return true; } - virtual bool mouseMoved(int x, int y) { + bool mouseMoved(int x, int y) override { BorderedWindow::mouseMoved(x,y); return true; } /// Put window on top of all other windows without changing their relative order - virtual bool raise() { + bool raise() override { Window *last = parent->children.back(); parent->children.remove(this); parent->children.push_back(this); @@ -1935,7 +1935,7 @@ protected: public: /// Handle automatic hiding - virtual void focusChanged(bool gained) { + void focusChanged(bool gained) override { Window::focusChanged(gained); if (isVisible() && !gained) { if (realparent->hasFocus()) raise(); @@ -1944,13 +1944,13 @@ public: } /// Handle automatic delete - void windowClosed(ToplevelWindow *win) { + void windowClosed(ToplevelWindow *win) override { (void)win; delete this; } /// No-op - bool windowClosing(ToplevelWindow *win) { (void)win; return true; } + bool windowClosing(ToplevelWindow *win) override { (void)win; return true; } /// Create a transient window with given position and size /** \a parent is the logical parent. The true parent object is @@ -1980,13 +1980,13 @@ public: dynamic_cast(last2)->removeCloseHandler(this); } - virtual void move(int x, int y) { relx = x; rely = y; + void move(int x, int y) override { relx = x; rely = y; Window::move(x+realparent->getScreenX(),y+realparent->getScreenY()); } - virtual int getX() const { return x-realparent->getScreenX(); } - virtual int getY() const { return y-realparent->getScreenY(); } - virtual void setVisible(bool v) { if (v) raise(); Window::setVisible(v); } - virtual void windowMoved(Window *src, int x, int y) { (void)src; (void)x; (void)y; move(relx,rely); } - virtual bool mouseDownOutside(MouseButton button) { + int getX() const override { return x-realparent->getScreenX(); } + int getY() const override { return y-realparent->getScreenY(); } + void setVisible(bool v) override { if (v) raise(); Window::setVisible(v); } + void windowMoved(Window *src, int x, int y) override { (void)src; (void)x; (void)y; move(relx,rely); } + bool mouseDownOutside(MouseButton button) override { (void)button; if (visible) { @@ -1998,7 +1998,7 @@ public: } /// Put window on top of all other windows without changing their relative order - virtual bool raise() { + bool raise() override { Window *last = parent->children.back(); parent->children.remove(this); parent->children.push_back(this); @@ -2155,10 +2155,10 @@ public: } /// Paint button. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Highlight current item. - virtual bool mouseMoved(int x, int y) { + bool mouseMoved(int x, int y) override { if (visible) { firstMouseUp = false; selectItem(x,y); @@ -2168,7 +2168,7 @@ public: return false; } - void mouseMovedOutside(void) { + void mouseMovedOutside(void) override { if (visible && selected >= 0) { firstMouseUp = false; selected = -1; @@ -2177,7 +2177,7 @@ public: } /// Highlight current item. - virtual bool mouseDragged(int x, int y, MouseButton button) { + bool mouseDragged(int x, int y, MouseButton button) override { (void)button;//UNUSED if (visible) { @@ -2191,7 +2191,7 @@ public: return false; } - virtual bool mouseDown(int x, int y, MouseButton button) { + bool mouseDown(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2202,7 +2202,7 @@ public: return false; } - virtual bool mouseDownOutside(MouseButton button) { + bool mouseDownOutside(MouseButton button) override { (void)button;//UNUSED if (visible) { @@ -2215,7 +2215,7 @@ public: } /// Possibly select item. - virtual bool mouseUp(int x, int y, MouseButton button) { + bool mouseUp(int x, int y, MouseButton button) override { (void)button;//UNUSED if (visible) { @@ -2230,7 +2230,7 @@ public: } /// Handle keyboard input. - virtual bool keyDown(const Key &key) { + bool keyDown(const Key &key) override { if (visible) { if (key.special == Key::Up) { if (selected == 0) @@ -2270,7 +2270,7 @@ public: resize(getPreferredWidth(),getPreferredHeight()); } - virtual void setVisible(bool v) { + void setVisible(bool v) override { if (!visible && v) firstMouseUp = true; @@ -2327,10 +2327,10 @@ public: template Button(Window *parent, int x, int y, const T text, int w = -1, int h = -1); /// Paint button. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Press button. - virtual bool mouseDown(int x, int y, MouseButton button) { + bool mouseDown(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2343,7 +2343,7 @@ public: } /// Release button. - virtual bool mouseUp(int x, int y, MouseButton button) { + bool mouseUp(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2356,7 +2356,7 @@ public: } /// Handle mouse activation. - virtual bool mouseClicked(int x, int y, MouseButton button) { + bool mouseClicked(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2369,10 +2369,10 @@ public: } /// Handle keyboard input. - virtual bool keyDown(const Key &key); + bool keyDown(const Key &key) override; /// Handle keyboard input. - virtual bool keyUp(const Key &key); + bool keyUp(const Key &key) override; }; @@ -2414,10 +2414,10 @@ public: template void removeItem(int index, const STR name) { menus[(unsigned int)index]->removeItem(name); } /// Paint menubar. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Open menu. - virtual bool mouseDown(int x, int y, MouseButton button) { + bool mouseDown(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)y;//UNUSED int oldselected = selected; @@ -2431,7 +2431,7 @@ public: } /// Handle keyboard input. - virtual bool keyDown(const Key &key) { + bool keyDown(const Key &key) override { if (key.special == Key::Tab) return false; @@ -2439,14 +2439,14 @@ public: } /// Handle keyboard input. - virtual bool keyUp(const Key &key) { + bool keyUp(const Key &key) override { if (key.special == Key::Tab) return false; return true; } - virtual void actionExecuted(ActionEventSource *src, const String &arg) { + void actionExecuted(ActionEventSource *src, const String &arg) override { std::list::iterator i = actionHandlers.begin(); bool end = (i == actionHandlers.end()); while (!end) { @@ -2476,7 +2476,7 @@ public: template Checkbox(Window *parent, int x, int y, const T text, int w = -1, int h = -1); /// Paint checkbox. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Change checkbox state. virtual void setChecked(bool checked) { this->checked = checked; } @@ -2485,7 +2485,7 @@ public: virtual bool isChecked() { return checked; } /// Press checkbox. - virtual bool mouseDown(int x, int y, MouseButton button) { + bool mouseDown(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2494,7 +2494,7 @@ public: } /// Release checkbox. - virtual bool mouseUp(int x, int y, MouseButton button) { + bool mouseUp(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2503,10 +2503,10 @@ public: } /// Handle keyboard input. - virtual bool keyDown(const Key &key); + bool keyDown(const Key &key) override; /// Handle keyboard input. - virtual bool keyUp(const Key &key); + bool keyUp(const Key &key) override; /// Execute handlers. virtual void execute() { @@ -2536,7 +2536,7 @@ public: template Radiobox(Frame *parent, int x, int y, const T text, int w = -1, int h = -1); /// Paint radio box. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; /// Change radio box state. virtual void setChecked(bool checked) { this->checked = checked; } @@ -2545,7 +2545,7 @@ public: virtual bool isChecked() { return checked; } /// Press radio box. - virtual bool mouseDown(int x, int y, MouseButton button) { + bool mouseDown(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2554,7 +2554,7 @@ public: } /// Release checkbox. - virtual bool mouseUp(int x, int y, MouseButton button) { + bool mouseUp(int x, int y, MouseButton button) override { (void)button;//UNUSED (void)x;//UNUSED (void)y;//UNUSED @@ -2563,10 +2563,10 @@ public: } /// Handle keyboard input. - virtual bool keyDown(const Key &key); + bool keyDown(const Key &key) override; /// Handle keyboard input. - virtual bool keyUp(const Key &key); + bool keyUp(const Key &key) override; }; /// A rectangular 3D sunken frame @@ -2583,7 +2583,7 @@ protected: String label; /// Execute handlers. - virtual void actionExecuted(ActionEventSource *src, const String &arg) { + void actionExecuted(ActionEventSource *src, const String &arg) override { // HACK: Attempting to cast a String to void causes "forming reference to void" errors when building with GCC 4.7 (void)arg.size();//UNUSED for (std::list::iterator i = children.begin(); i != children.end(); ++i) { @@ -2603,7 +2603,7 @@ public: ActionEventSource(text), selected(0), label(text) { } /// Paint frame. - virtual void paint(Drawable &d) const; + void paint(Drawable &d) const override; }; @@ -2659,12 +2659,12 @@ public: resize(width, sfh+close->getHeight()+border_bottom+border_top+5); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { @@ -2730,12 +2730,12 @@ public: resize(width, sfh+close->getHeight()+border_bottom+border_top+5); } - virtual bool keyDown(const GUI::Key &key) { + bool keyDown(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyDown(key)) return true; return false; } - virtual bool keyUp(const GUI::Key &key) { + bool keyUp(const GUI::Key &key) override { if (GUI::ToplevelWindow::keyUp(key)) return true; if (key.special == GUI::Key::Escape) { diff --git a/src/libs/mt32/Analog.cpp b/src/libs/mt32/Analog.cpp index 41fb19b44..0c9a8f82a 100644 --- a/src/libs/mt32/Analog.cpp +++ b/src/libs/mt32/Analog.cpp @@ -127,7 +127,7 @@ public: template class NullLowPassFilter : public AbstractLowPassFilter { public: - SampleEx process(const SampleEx sample) { + SampleEx process(const SampleEx sample) override { return sample; } }; @@ -150,7 +150,7 @@ public: Synth::muteSampleBuffer(ringBuffer, COARSE_LPF_DELAY_LINE_LENGTH); } - SampleEx process(const SampleEx inSample) { + SampleEx process(const SampleEx inSample) override { static const unsigned int DELAY_LINE_MASK = COARSE_LPF_DELAY_LINE_LENGTH - 1; SampleEx sample = lpfTaps[COARSE_LPF_DELAY_LINE_LENGTH] * ringBuffer[ringBufferPosition]; @@ -179,12 +179,12 @@ private: public: AccurateLowPassFilter(const bool oldMT32AnalogLPF, const bool oversample); - FloatSample process(const FloatSample sample); - IntSampleEx process(const IntSampleEx sample); - bool hasNextSample() const; - unsigned int getOutputSampleRate() const; - unsigned int estimateInSampleCount(const unsigned int outSamples) const; - void addPositionIncrement(const unsigned int positionIncrement); + FloatSample process(const FloatSample sample) override; + IntSampleEx process(const IntSampleEx sample) override; + bool hasNextSample() const override; + unsigned int getOutputSampleRate() const override; + unsigned int estimateInSampleCount(const unsigned int outSamples) const override; + void addPositionIncrement(const unsigned int positionIncrement) override; }; static inline IntSampleEx normaliseSample(const IntSampleEx sample) { @@ -223,19 +223,19 @@ public: delete &rightChannelLPF; } - unsigned int getOutputSampleRate() const { + unsigned int getOutputSampleRate() const override { return leftChannelLPF.getOutputSampleRate(); } - Bit32u getDACStreamsLength(const Bit32u outputLength) const { + Bit32u getDACStreamsLength(const Bit32u outputLength) const override { return leftChannelLPF.estimateInSampleCount(outputLength); } - void setSynthOutputGain(const float synthGain); - void setReverbOutputGain(const float reverbGain, const bool mt32ReverbCompatibilityMode); + void setSynthOutputGain(const float synthGain) override; + void setReverbOutputGain(const float reverbGain, const bool mt32ReverbCompatibilityMode) override; - bool process(IntSample *outStream, const IntSample *nonReverbLeft, const IntSample *nonReverbRight, const IntSample *reverbDryLeft, const IntSample *reverbDryRight, const IntSample *reverbWetLeft, const IntSample *reverbWetRight, Bit32u outLength); - bool process(FloatSample *outStream, const FloatSample *nonReverbLeft, const FloatSample *nonReverbRight, const FloatSample *reverbDryLeft, const FloatSample *reverbDryRight, const FloatSample *reverbWetLeft, const FloatSample *reverbWetRight, Bit32u outLength); + bool process(IntSample *outStream, const IntSample *nonReverbLeft, const IntSample *nonReverbRight, const IntSample *reverbDryLeft, const IntSample *reverbDryRight, const IntSample *reverbWetLeft, const IntSample *reverbWetRight, Bit32u outLength) override; + bool process(FloatSample *outStream, const FloatSample *nonReverbLeft, const FloatSample *nonReverbRight, const FloatSample *reverbDryLeft, const FloatSample *reverbDryRight, const FloatSample *reverbWetLeft, const FloatSample *reverbWetRight, Bit32u outLength) override; template void produceOutput(Sample *outStream, const Sample *nonReverbLeft, const Sample *nonReverbRight, const Sample *reverbDryLeft, const Sample *reverbDryRight, const Sample *reverbWetLeft, const Sample *reverbWetRight, Bit32u outLength) { diff --git a/src/libs/mt32/BReverbModel.cpp b/src/libs/mt32/BReverbModel.cpp index 05a2e4240..3080db3fe 100644 --- a/src/libs/mt32/BReverbModel.cpp +++ b/src/libs/mt32/BReverbModel.cpp @@ -455,11 +455,11 @@ public: close(); } - bool isOpen() const { + bool isOpen() const override { return combs != NULL; } - void open() { + void open() override { if (isOpen()) return; if (currentSettings.numberOfAllpasses > 0) { allpasses = new AllpassFilter*[currentSettings.numberOfAllpasses]; @@ -479,7 +479,7 @@ public: mute(); } - void close() { + void close() override { if (allpasses != NULL) { for (Bit32u i = 0; i < currentSettings.numberOfAllpasses; i++) { if (allpasses[i] != NULL) { @@ -502,7 +502,7 @@ public: } } - void mute() { + void mute() override { if (allpasses != NULL) { for (Bit32u i = 0; i < currentSettings.numberOfAllpasses; i++) { allpasses[i]->mute(); @@ -515,7 +515,7 @@ public: } } - void setParameters(Bit8u time, Bit8u level) { + void setParameters(Bit8u time, Bit8u level) override { if (!isOpen()) return; level &= 7; time &= 7; @@ -542,7 +542,7 @@ public: } } - bool isActive() const { + bool isActive() const override { if (!isOpen()) return false; for (Bit32u i = 0; i < currentSettings.numberOfAllpasses; i++) { if (!allpasses[i]->isEmpty()) return true; @@ -553,7 +553,7 @@ public: return false; } - bool isMT32Compatible(const ReverbMode mode) const { + bool isMT32Compatible(const ReverbMode mode) const override { return ¤tSettings == &getMT32Settings(mode); } @@ -622,8 +622,8 @@ public: } // while ((numSamples--) > 0) } // produceOutput - bool process(const IntSample *inLeft, const IntSample *inRight, IntSample *outLeft, IntSample *outRight, Bit32u numSamples); - bool process(const FloatSample *inLeft, const FloatSample *inRight, FloatSample *outLeft, FloatSample *outRight, Bit32u numSamples); + bool process(const IntSample *inLeft, const IntSample *inRight, IntSample *outLeft, IntSample *outRight, Bit32u numSamples) override; + bool process(const FloatSample *inLeft, const FloatSample *inRight, FloatSample *outLeft, FloatSample *outRight, Bit32u numSamples) override; }; BReverbModel *BReverbModel::createBReverbModel(const ReverbMode mode, const bool mt32CompatibleModel, const RendererType rendererType) { diff --git a/src/libs/mt32/File.h b/src/libs/mt32/File.h index 2aa34b4c7..6d00d9962 100644 --- a/src/libs/mt32/File.h +++ b/src/libs/mt32/File.h @@ -40,7 +40,7 @@ public: class MT32EMU_EXPORT AbstractFile : public File { public: - const SHA1Digest &getSHA1(); + const SHA1Digest &getSHA1() override; protected: AbstractFile(); @@ -59,9 +59,9 @@ public: ArrayFile(const Bit8u *data, size_t size); ArrayFile(const Bit8u *data, size_t size, const SHA1Digest &sha1Digest); - size_t getSize(); - const Bit8u *getData(); - void close() {} + size_t getSize() override; + const Bit8u *getData() override; + void close() override {} private: const Bit8u *data; diff --git a/src/libs/mt32/FileStream.h b/src/libs/mt32/FileStream.h index 3b3976869..1d3b509e6 100644 --- a/src/libs/mt32/FileStream.h +++ b/src/libs/mt32/FileStream.h @@ -30,10 +30,10 @@ class FileStream : public AbstractFile { public: MT32EMU_EXPORT FileStream(); MT32EMU_EXPORT ~FileStream(); - MT32EMU_EXPORT size_t getSize(); - MT32EMU_EXPORT const Bit8u *getData(); + MT32EMU_EXPORT size_t getSize() override; + MT32EMU_EXPORT const Bit8u *getData() override; MT32EMU_EXPORT bool open(const char *filename); - MT32EMU_EXPORT void close(); + MT32EMU_EXPORT void close() override; private: std::ifstream &ifsp; diff --git a/src/libs/mt32/LA32FloatWaveGenerator.h b/src/libs/mt32/LA32FloatWaveGenerator.h index b34c1fa86..8b0673f97 100644 --- a/src/libs/mt32/LA32FloatWaveGenerator.h +++ b/src/libs/mt32/LA32FloatWaveGenerator.h @@ -106,13 +106,13 @@ public: // ringModulated should be set to false for the structures with mixing or stereo output // ringModulated should be set to true for the structures with ring modulation // mixed is used for the structures with ring modulation and indicates whether the master partial output is mixed to the ring modulator output - void init(const bool ringModulated, const bool mixed); + void init(const bool ringModulated, const bool mixed) override; // Initialise the WG engine for generation of synth partial samples and set up the invariant parameters - void initSynth(const PairType master, const bool sawtoothWaveform, const Bit8u pulseWidth, const Bit8u resonance); + void initSynth(const PairType master, const bool sawtoothWaveform, const Bit8u pulseWidth, const Bit8u resonance) override; // Initialise the WG engine for generation of PCM partial samples and set up the invariant parameters - void initPCM(const PairType master, const Bit16s * const pcmWaveAddress, const Bit32u pcmWaveLength, const bool pcmWaveLooped); + void initPCM(const PairType master, const Bit16s * const pcmWaveAddress, const Bit32u pcmWaveLength, const bool pcmWaveLooped) override; // Update parameters with respect to TVP, TVA and TVF, and generate next sample void generateNextSample(const PairType master, const Bit32u amp, const Bit16u pitch, const Bit32u cutoff); @@ -121,7 +121,7 @@ public: float nextOutSample(); // Deactivate the WG engine - void deactivate(const PairType master); + void deactivate(const PairType master) override; // Return active state of the WG engine bool isActive(const PairType master) const; diff --git a/src/libs/mt32/LA32WaveGenerator.h b/src/libs/mt32/LA32WaveGenerator.h index 71d909df8..d2e128e1e 100644 --- a/src/libs/mt32/LA32WaveGenerator.h +++ b/src/libs/mt32/LA32WaveGenerator.h @@ -239,13 +239,13 @@ public: // ringModulated should be set to false for the structures with mixing or stereo output // ringModulated should be set to true for the structures with ring modulation // mixed is used for the structures with ring modulation and indicates whether the master partial output is mixed to the ring modulator output - void init(const bool ringModulated, const bool mixed); + void init(const bool ringModulated, const bool mixed) override; // Initialise the WG engine for generation of synth partial samples and set up the invariant parameters - void initSynth(const PairType master, const bool sawtoothWaveform, const Bit8u pulseWidth, const Bit8u resonance); + void initSynth(const PairType master, const bool sawtoothWaveform, const Bit8u pulseWidth, const Bit8u resonance) override; // Initialise the WG engine for generation of PCM partial samples and set up the invariant parameters - void initPCM(const PairType master, const Bit16s * const pcmWaveAddress, const Bit32u pcmWaveLength, const bool pcmWaveLooped); + void initPCM(const PairType master, const Bit16s * const pcmWaveAddress, const Bit32u pcmWaveLength, const bool pcmWaveLooped) override; // Update parameters with respect to TVP, TVA and TVF, and generate next sample void generateNextSample(const PairType master, const Bit32u amp, const Bit16u pitch, const Bit32u cutoff); @@ -255,7 +255,7 @@ public: Bit16s nextOutSample(); // Deactivate the WG engine - void deactivate(const PairType master); + void deactivate(const PairType master) override; // Return active state of the WG engine bool isActive(const PairType master) const; diff --git a/src/libs/mt32/MidiStreamParser.h b/src/libs/mt32/MidiStreamParser.h index d3a76c8a0..5437ddc39 100644 --- a/src/libs/mt32/MidiStreamParser.h +++ b/src/libs/mt32/MidiStreamParser.h @@ -108,10 +108,10 @@ public: void resetTimestamp(); protected: - void handleShortMessage(const Bit32u message); - void handleSysex(const Bit8u *stream, const Bit32u length); - void handleSystemRealtimeMessage(const Bit8u realtime); - void printDebug(const char *debugMessage); + void handleShortMessage(const Bit32u message) override; + void handleSysex(const Bit8u *stream, const Bit32u length) override; + void handleSystemRealtimeMessage(const Bit8u realtime) override; + void printDebug(const char *debugMessage) override; private: Synth &synth; diff --git a/src/libs/mt32/Part.h b/src/libs/mt32/Part.h index d266efb7e..42bd23ddc 100644 --- a/src/libs/mt32/Part.h +++ b/src/libs/mt32/Part.h @@ -144,15 +144,15 @@ class RhythmPart: public Part { PatchCache drumCache[85][4]; public: RhythmPart(Synth *synth, unsigned int usePartNum); - void refresh(); - void refreshTimbre(unsigned int timbreNum); - void setTimbre(TimbreParam *timbre); - void noteOn(unsigned int key, unsigned int velocity); - void noteOff(unsigned int midiKey); - unsigned int getAbsTimbreNum() const; - void setPan(unsigned int midiPan); - void setProgram(unsigned int patchNum); - void polyStateChanged(PolyState oldState, PolyState newState); + void refresh() override; + void refreshTimbre(unsigned int timbreNum) override; + void setTimbre(TimbreParam *timbre) override; + void noteOn(unsigned int key, unsigned int velocity) override; + void noteOff(unsigned int midiKey) override; + unsigned int getAbsTimbreNum() const override; + void setPan(unsigned int midiPan) override; + void setProgram(unsigned int patchNum) override; + void polyStateChanged(PolyState oldState, PolyState newState) override; }; } // namespace MT32Emu diff --git a/src/libs/mt32/Synth.cpp b/src/libs/mt32/Synth.cpp index 0b81edb93..14e8e07b3 100644 --- a/src/libs/mt32/Synth.cpp +++ b/src/libs/mt32/Synth.cpp @@ -213,10 +213,10 @@ public: tmpBuffers(createTmpBuffers()) {} - void render(IntSample *stereoStream, Bit32u len); - void render(FloatSample *stereoStream, Bit32u len); - void renderStreams(const DACOutputStreams &streams, Bit32u len); - void renderStreams(const DACOutputStreams &streams, Bit32u len); + void render(IntSample *stereoStream, Bit32u len) override; + void render(FloatSample *stereoStream, Bit32u len) override; + void renderStreams(const DACOutputStreams &streams, Bit32u len) override; + void renderStreams(const DACOutputStreams &streams, Bit32u len) override; template void doRenderAndConvert(O *stereoStream, Bit32u len); @@ -1978,13 +1978,13 @@ public: /** Storage space for SysEx data is allocated dynamically on demand and is disposed lazily. */ class DynamicSysexDataStorage : public MidiEventQueue::SysexDataStorage { public: - Bit8u *allocate(Bit32u sysexLength) { + Bit8u *allocate(Bit32u sysexLength) override { return new Bit8u[sysexLength]; } - void reclaimUnused(const Bit8u *, Bit32u) {} + void reclaimUnused(const Bit8u *, Bit32u) override {} - void dispose(const Bit8u *sysexData, Bit32u) { + void dispose(const Bit8u *sysexData, Bit32u) override { delete[] sysexData; } }; @@ -2007,7 +2007,7 @@ public: delete[] storageBuffer; } - Bit8u *allocate(Bit32u sysexLength) { + Bit8u *allocate(Bit32u sysexLength) override { Bit32u myStartPosition = startPosition; Bit32u myEndPosition = endPosition; @@ -2033,7 +2033,7 @@ public: return storageBuffer + myEndPosition; } - void reclaimUnused(const Bit8u *sysexData, Bit32u sysexLength) { + void reclaimUnused(const Bit8u *sysexData, Bit32u sysexLength) override { if (sysexData == NULL) return; Bit32u allocatedPosition = startPosition; if (storageBuffer + allocatedPosition == sysexData) { @@ -2044,7 +2044,7 @@ public: } } - void dispose(const Bit8u *, Bit32u) {} + void dispose(const Bit8u *, Bit32u) override {} private: Bit8u * const storageBuffer; diff --git a/src/libs/mt32/c_interface/c_interface.cpp b/src/libs/mt32/c_interface/c_interface.cpp index 4c7706be8..d7612a28d 100644 --- a/src/libs/mt32/c_interface/c_interface.cpp +++ b/src/libs/mt32/c_interface/c_interface.cpp @@ -169,7 +169,7 @@ private: return delegate.v0->getVersionID(delegate) < versionID; } - void printDebug(const char *fmt, va_list list) { + void printDebug(const char *fmt, va_list list) override { if (delegate.v0->printDebug == NULL) { ReportHandler::printDebug(fmt, list); } else { @@ -177,7 +177,7 @@ private: } } - void onErrorControlROM() { + void onErrorControlROM() override { if (delegate.v0->onErrorControlROM == NULL) { ReportHandler::onErrorControlROM(); } else { @@ -185,7 +185,7 @@ private: } } - void onErrorPCMROM() { + void onErrorPCMROM() override { if (delegate.v0->onErrorPCMROM == NULL) { ReportHandler::onErrorPCMROM(); } else { @@ -193,7 +193,7 @@ private: } } - void showLCDMessage(const char *message) { + void showLCDMessage(const char *message) override { if (delegate.v0->showLCDMessage == NULL) { ReportHandler::showLCDMessage(message); } else { @@ -201,7 +201,7 @@ private: } } - void onMIDIMessagePlayed() { + void onMIDIMessagePlayed() override { if (delegate.v0->onMIDIMessagePlayed == NULL) { ReportHandler::onMIDIMessagePlayed(); } else { @@ -209,14 +209,14 @@ private: } } - bool onMIDIQueueOverflow() { + bool onMIDIQueueOverflow() override { if (delegate.v0->onMIDIQueueOverflow == NULL) { return ReportHandler::onMIDIQueueOverflow(); } return delegate.v0->onMIDIQueueOverflow(instanceData) != MT32EMU_BOOL_FALSE; } - void onMIDISystemRealtime(Bit8u systemRealtime) { + void onMIDISystemRealtime(Bit8u systemRealtime) override { if (delegate.v0->onMIDISystemRealtime == NULL) { ReportHandler::onMIDISystemRealtime(systemRealtime); } else { @@ -224,7 +224,7 @@ private: } } - void onDeviceReset() { + void onDeviceReset() override { if (delegate.v0->onDeviceReset == NULL) { ReportHandler::onDeviceReset(); } else { @@ -232,7 +232,7 @@ private: } } - void onDeviceReconfig() { + void onDeviceReconfig() override { if (delegate.v0->onDeviceReconfig == NULL) { ReportHandler::onDeviceReconfig(); } else { @@ -240,7 +240,7 @@ private: } } - void onNewReverbMode(Bit8u mode) { + void onNewReverbMode(Bit8u mode) override { if (delegate.v0->onNewReverbMode == NULL) { ReportHandler::onNewReverbMode(mode); } else { @@ -248,7 +248,7 @@ private: } } - void onNewReverbTime(Bit8u time) { + void onNewReverbTime(Bit8u time) override { if (delegate.v0->onNewReverbTime == NULL) { ReportHandler::onNewReverbTime(time); } else { @@ -256,7 +256,7 @@ private: } } - void onNewReverbLevel(Bit8u level) { + void onNewReverbLevel(Bit8u level) override { if (delegate.v0->onNewReverbLevel == NULL) { ReportHandler::onNewReverbLevel(level); } else { @@ -264,7 +264,7 @@ private: } } - void onPolyStateChanged(Bit8u partNum) { + void onPolyStateChanged(Bit8u partNum) override { if (delegate.v0->onPolyStateChanged == NULL) { ReportHandler::onPolyStateChanged(partNum); } else { @@ -272,7 +272,7 @@ private: } } - void onProgramChanged(Bit8u partNum, const char *soundGroupName, const char *patchName) { + void onProgramChanged(Bit8u partNum, const char *soundGroupName, const char *patchName) override { if (delegate.v0->onProgramChanged == NULL) { ReportHandler::onProgramChanged(partNum, soundGroupName, patchName); } else { @@ -280,7 +280,7 @@ private: } } - void onLCDStateUpdated() { + void onLCDStateUpdated() override { if (isVersionLess(MT32EMU_REPORT_HANDLER_VERSION_1) || delegate.v1->onLCDStateUpdated == NULL) { ReportHandler2::onLCDStateUpdated(); } else { @@ -288,7 +288,7 @@ private: } } - void onMidiMessageLEDStateUpdated(bool ledState) { + void onMidiMessageLEDStateUpdated(bool ledState) override { if (isVersionLess(MT32EMU_REPORT_HANDLER_VERSION_1) || delegate.v1->onMidiMessageLEDStateUpdated == NULL) { ReportHandler2::onMidiMessageLEDStateUpdated(ledState); } else { @@ -307,7 +307,7 @@ protected: void *instanceData; private: - void handleShortMessage(const Bit32u message) { + void handleShortMessage(const Bit32u message) override { if (delegate.v0->handleShortMessage == NULL) { DefaultMidiStreamParser::handleShortMessage(message); } else { @@ -315,7 +315,7 @@ private: } } - void handleSysex(const Bit8u *stream, const Bit32u length) { + void handleSysex(const Bit8u *stream, const Bit32u length) override { if (delegate.v0->handleSysex == NULL) { DefaultMidiStreamParser::handleSysex(stream, length); } else { @@ -323,7 +323,7 @@ private: } } - void handleSystemRealtimeMessage(const Bit8u realtime) { + void handleSystemRealtimeMessage(const Bit8u realtime) override { if (delegate.v0->handleSystemRealtimeMessage == NULL) { DefaultMidiStreamParser::handleSystemRealtimeMessage(realtime); } else { diff --git a/src/misc/ethernet_nothing.h b/src/misc/ethernet_nothing.h index 0e3e19eaf..a6ace8fda 100644 --- a/src/misc/ethernet_nothing.h +++ b/src/misc/ethernet_nothing.h @@ -35,9 +35,9 @@ class NothingEthernetConnection : public EthernetConnection { public: NothingEthernetConnection(); ~NothingEthernetConnection(); - bool Initialize(Section* config); - void SendPacket(const uint8_t* packet, int len); - void GetPackets(std::function callback); + bool Initialize(Section* config) override; + void SendPacket(const uint8_t* packet, int len) override; + void GetPackets(std::function callback) override; }; #endif diff --git a/src/misc/ethernet_pcap.h b/src/misc/ethernet_pcap.h index 6cf9910ce..47cc9c49e 100644 --- a/src/misc/ethernet_pcap.h +++ b/src/misc/ethernet_pcap.h @@ -42,9 +42,9 @@ class PcapEthernetConnection : public EthernetConnection { public: PcapEthernetConnection(); ~PcapEthernetConnection(); - bool Initialize(Section* config); - void SendPacket(const uint8_t* packet, int len); - void GetPackets(std::function callback); + bool Initialize(Section* config) override; + void SendPacket(const uint8_t* packet, int len) override; + void GetPackets(std::function callback) override; private: pcap_t* adhandle = 0; /*!< The pcap handle used for this device */ diff --git a/src/misc/ethernet_slirp.h b/src/misc/ethernet_slirp.h index d1b20c2e4..e5c73909c 100644 --- a/src/misc/ethernet_slirp.h +++ b/src/misc/ethernet_slirp.h @@ -62,9 +62,9 @@ class SlirpEthernetConnection : public EthernetConnection { /* Boilerplate EthernetConnection interface */ SlirpEthernetConnection(); ~SlirpEthernetConnection(); - bool Initialize(Section* config); - void SendPacket(const uint8_t* packet, int len); - void GetPackets(std::function callback); + bool Initialize(Section* config) override; + void SendPacket(const uint8_t* packet, int len) override; + void GetPackets(std::function callback) override; /* Called by libslirp when it has a packet for us */ void ReceivePacket(const uint8_t* packet, int len); diff --git a/src/misc/programs.cpp b/src/misc/programs.cpp index b78506a8b..2114597fa 100644 --- a/src/misc/programs.cpp +++ b/src/misc/programs.cpp @@ -593,7 +593,7 @@ class CONFIG : public Program { public: /*! \brief Program entry point, when the command is run */ - void Run(void); + void Run(void) override; private: void restart(const char* useconfig); diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 9847e6f38..f6ddfd06d 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -382,7 +382,7 @@ public: std::string str = ""; unsigned long long curpos = 0; device_TMP(char *name) { SetName(name); }; - virtual bool Read(uint8_t * data,uint16_t * size) { + bool Read(uint8_t * data,uint16_t * size) override { int i; for (i=0; i<*size; i++) { if (curpos+i>=str.size()) break; @@ -391,11 +391,11 @@ public: *size = i; return true; } - virtual bool Write(const uint8_t * data,uint16_t * size) { + bool Write(const uint8_t * data,uint16_t * size) override { for (int i=0; i<*size; i++) str += std::string(1, data[i]); return true; } - virtual bool Seek(uint32_t * pos,uint32_t type) { + bool Seek(uint32_t * pos,uint32_t type) override { switch (type) { case 0: curpos = *pos; @@ -414,10 +414,10 @@ public: else if (curpos < 0) curpos = 0; return true; } - virtual bool Close() { return true; } - virtual uint16_t GetInformation(void) { return (strcmp(RunningProgram, "WCLIP") ? DeviceInfoFlags::Device : 0) | DeviceInfoFlags::EofOnInput; } - virtual bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } - virtual bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) { (void)bufptr; (void)size; (void)retcode; return false; } + bool Close() override { return true; } + uint16_t GetInformation(void) override { return (strcmp(RunningProgram, "WCLIP") ? DeviceInfoFlags::Device : 0) | DeviceInfoFlags::EofOnInput; } + bool ReadFromControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } + bool WriteToControlChannel(PhysPt bufptr,uint16_t size,uint16_t * retcode) override { (void)bufptr; (void)size; (void)retcode; return false; } }; void DOS_Shell::ParseLine(char * line) {