diff --git a/source/6522.cpp b/source/6522.cpp index 09324a62d..f4df0f551 100644 --- a/source/6522.cpp +++ b/source/6522.cpp @@ -62,14 +62,14 @@ void SY6522::Reset(const bool powerCycle) //--------------------------------------------------------------------------- -void SY6522::StartTimer1(void) +void SY6522::StartTimer1() { m_timer1Active = true; } // The assumption was that timer1 was only active if IER.TIMER1=1 // . Not true, since IFR can be polled (with IER.TIMER1=0) -void SY6522::StartTimer1_LoadStateV1(void) +void SY6522::StartTimer1_LoadStateV1() { if ((m_regs.IER & IxR_TIMER1) == 0x00) return; @@ -77,19 +77,19 @@ void SY6522::StartTimer1_LoadStateV1(void) m_timer1Active = true; } -void SY6522::StopTimer1(void) +void SY6522::StopTimer1() { m_timer1Active = false; } //----------------------------------------------------------------------------- -void SY6522::StartTimer2(void) +void SY6522::StartTimer2() { m_timer2Active = true; } -void SY6522::StopTimer2(void) +void SY6522::StopTimer2() { m_timer2Active = false; } diff --git a/source/6522.h b/source/6522.h index b00911822..b4b1ef48b 100644 --- a/source/6522.h +++ b/source/6522.h @@ -10,7 +10,7 @@ class SY6522 Reset(true); } - ~SY6522(void) + ~SY6522() { } @@ -27,11 +27,11 @@ class SY6522 void Reset(const bool powerCycle); - void StartTimer1(void); - void StopTimer1(void); - bool IsTimer1Active(void) { return m_timer1Active; } - void StopTimer2(void); - bool IsTimer2Active(void) { return m_timer2Active; } + void StartTimer1(); + void StopTimer1(); + bool IsTimer1Active() { return m_timer1Active; } + void StopTimer2(); + bool IsTimer2Active() { return m_timer2Active; } void UpdateIFR(BYTE clr_ifr, BYTE set_ifr = 0); @@ -53,14 +53,14 @@ class SY6522 _ASSERT(0); return 0; } - BYTE GetBusViewOfORB(void) { return m_regs.ORB & m_regs.DDRB; } // Return how the AY8913 sees ORB on the bus (ie. not CPU's view which will be OR'd with !DDRB) - USHORT GetRegT1C(void) { return m_regs.TIMER1_COUNTER.w; } - USHORT GetRegT2C(void) { return m_regs.TIMER2_COUNTER.w; } + BYTE GetBusViewOfORB() { return m_regs.ORB & m_regs.DDRB; } // Return how the AY8913 sees ORB on the bus (ie. not CPU's view which will be OR'd with !DDRB) + USHORT GetRegT1C() { return m_regs.TIMER1_COUNTER.w; } + USHORT GetRegT2C() { return m_regs.TIMER2_COUNTER.w; } void GetRegs(BYTE regs[SIZE_6522_REGS]) { memcpy(®s[0], (BYTE*)&m_regs, SIZE_6522_REGS); } // For debugger void SetRegIRA(BYTE reg) { m_regs.ORA = reg; } - bool IsTimer1IrqDelay(void) { return m_timer1IrqDelay ? true : false; } + bool IsTimer1IrqDelay() { return m_timer1IrqDelay ? true : false; } void SetBusBeingDriven(bool state) { m_isBusDriven = state; } - bool IsBad(void) { return m_bad6522; } + bool IsBad() { return m_bad6522; } BYTE Read(BYTE nReg); void Write(BYTE nReg, BYTE nValue); @@ -99,8 +99,8 @@ class SY6522 UINT GetOpcodeCyclesForWrite(BYTE reg); UINT GetOpcodeCycles(BYTE reg, UINT zpOpcodeCycles, UINT opcodeCycles, BYTE zpOpcode, BYTE opcode, bool abs16x, bool abs16y, bool indx, bool indy); - void StartTimer2(void); - void StartTimer1_LoadStateV1(void); + void StartTimer2(); + void StartTimer1_LoadStateV1(); #pragma pack(push) #pragma pack(1) // Ensure 'struct Regs' is packed so that GetRegs() can just do a memcpy() diff --git a/source/6821.h b/source/6821.h index c3aff37e3..a0fc404a1 100644 --- a/source/6821.h +++ b/source/6821.h @@ -61,7 +61,7 @@ class C6821 m_stOutB.func = NULL; }; - ~C6821() {}; + ~C6821() {} // AppleWin:TC void SetPA(BYTE byData) { m_byIA = byData; } diff --git a/source/AY8910.cpp b/source/AY8910.cpp index 22cc7a41d..54a4729e7 100644 --- a/source/AY8910.cpp +++ b/source/AY8910.cpp @@ -111,7 +111,7 @@ static int rstereopos, rchan1pos, rchan2pos, rchan3pos; double AY8913::m_fCurrentCLK_AY8910 = 0.0; -void AY8913::init(void) +void AY8913::init() { // Init the statics that were in sound_ay_overlay() rng = 1; @@ -119,7 +119,7 @@ void AY8913::init(void) env_first = 1; env_rev = 0; env_counter = 15; } -AY8913::AY8913(void) +AY8913::AY8913() { memset(sound_ay_registers, 0, sizeof(sound_ay_registers)); init(); @@ -127,7 +127,7 @@ AY8913::AY8913(void) }; -void AY8913::sound_ay_init( void ) +void AY8913::sound_ay_init() { /* AY output doesn't match the claimed levels; these levels are based * on the measurements posted to comp.sys.sinclair in Dec 2001 by @@ -320,7 +320,7 @@ void AY8913::sound_init( const char *device ) #if 0 void -sound_pause( void ) +sound_pause() { if( sound_enabled ) sound_end(); @@ -328,7 +328,7 @@ sound_pause( void ) void -sound_unpause( void ) +sound_unpause() { /* No sound if fastloading in progress */ if( settings_current.fastload && tape_is_playing() ) @@ -339,7 +339,7 @@ sound_unpause( void ) #endif -void AY8913::sound_end( void ) +void AY8913::sound_end() { #if 0 if( sound_enabled ) { @@ -471,7 +471,7 @@ sound_write_buf_pstereo( libspectrum_signed_word * out, int c ) #define HZ_COMMON_DENOMINATOR 50 #include "Log.h" -void AY8913::sound_ay_overlay( void ) +void AY8913::sound_ay_overlay() { int tone_level[3]; int mixer, envshape; @@ -792,7 +792,7 @@ void AY8913::sound_ay_write( int reg, int val, libspectrum_dword now ) /* no need to call this initially, but should be called * on reset otherwise. */ -void AY8913::sound_ay_reset( void ) +void AY8913::sound_ay_reset() { int f; @@ -836,7 +836,7 @@ void AY8913::sound_ay_reset( void ) #ifdef HAVE_SAMPLERATE static void -sound_resample( void ) +sound_resample() { int error; SRC_DATA data; @@ -873,7 +873,7 @@ sound_resample( void ) } #endif /* #ifdef HAVE_SAMPLERATE */ -void AY8913::sound_frame( void ) +void AY8913::sound_frame() { #if 0 libspectrum_signed_word *ptr, *tptr; diff --git a/source/AY8910.h b/source/AY8910.h index 4c613be37..cf3b2f8d8 100644 --- a/source/AY8910.h +++ b/source/AY8910.h @@ -16,16 +16,16 @@ typedef SHORT libspectrum_signed_word; class AY8913 { public: - AY8913(void); - ~AY8913(void) {}; + AY8913(); + ~AY8913() {}; - void sound_ay_init( void ); + void sound_ay_init(); void sound_init( const char *device ); BYTE sound_ay_read( int reg ); // TC void sound_ay_write( int reg, int val, libspectrum_dword now ); - void sound_ay_reset( void ); - void sound_frame( void ); - BYTE* GetAYRegsPtr( void ) { return &sound_ay_registers[0]; } + void sound_ay_reset(); + void sound_frame(); + BYTE* GetAYRegsPtr() { return &sound_ay_registers[0]; } void SetFramesize(int frameSize) { sound_generator_framesiz = frameSize; } void SetSoundBuffers(INT16** buffers) { ppSoundBuffers = buffers; } static void SetCLK( double CLK ) { m_fCurrentCLK_AY8910 = CLK; } @@ -33,9 +33,9 @@ class AY8913 bool LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, const std::string& suffix); private: - void init( void ); - void sound_end( void ); - void sound_ay_overlay( void ); + void init(); + void sound_end(); + void sound_ay_overlay(); private: /* foo_subcycles are fixed-point with low 16 bits as fractional part. diff --git a/source/CPU.cpp b/source/CPU.cpp index 4686a1872..6a16f9102 100644 --- a/source/CPU.cpp +++ b/source/CPU.cpp @@ -145,7 +145,7 @@ static bool g_irqOnLastOpcodeCycle = false; static eCpuType g_MainCPU = CPU_65C02; static eCpuType g_ActiveCPU = CPU_65C02; -eCpuType GetMainCpu(void) +eCpuType GetMainCpu() { return g_MainCPU; } @@ -175,7 +175,7 @@ void SetMainCpuDefault(eApple2Type apple2Type) SetMainCpu( ProbeMainCpuDefault(apple2Type) ); } -eCpuType GetActiveCpu(void) +eCpuType GetActiveCpu() { return g_ActiveCPU; } @@ -185,27 +185,27 @@ void SetActiveCpu(eCpuType cpu) g_ActiveCPU = cpu; } -bool IsIrqAsserted(void) +bool IsIrqAsserted() { return g_bmIRQ ? true : false; } -bool Is6502InterruptEnabled(void) +bool Is6502InterruptEnabled() { return !(regs.ps & AF_INTERRUPT); } -void ResetCyclesExecutedForDebugger(void) +void ResetCyclesExecutedForDebugger() { g_nCyclesExecuted = 0; } -bool IsInterruptInLastExecution(void) +bool IsInterruptInLastExecution() { return g_interruptInLastExecutionBatch; } -void SetIrqOnLastOpcodeCycle(void) +void SetIrqOnLastOpcodeCycle() { if (!(regs.ps & AF_INTERRUPT)) g_irqOnLastOpcodeCycle = true; @@ -280,7 +280,7 @@ char g_OutputBuffer[OUTPUT_BUFFER_SIZE+1+1]; // +1 for EOL, +1 for NULL UINT OutputBufferIdx = 0; bool bEscMode = false; -void CaptureCOUT(void) +void CaptureCOUT() { const char ch = regs.a & 0x7f; @@ -753,7 +753,7 @@ uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate) // Called by: // . CpuInitialize() // . SY6522.Reset() -void CpuCreateCriticalSection(void) +void CpuCreateCriticalSection() { if (!g_bCritSectionValid) { @@ -766,7 +766,7 @@ void CpuCreateCriticalSection(void) // Called from RepeatInitialization(): // . MemInitialize() -> MemReset() -void CpuInitialize(void) +void CpuInitialize() { regs.a = regs.x = regs.y = 0xFF; regs.sp = 0x01FF; @@ -923,7 +923,7 @@ void CpuNmiDeassert(eIRQSRC Device) #define SS_YAML_VALUE_6502 "6502" #define SS_YAML_VALUE_65C02 "65C02" -static const std::string& CpuGetSnapshotStructName(void) +static const std::string& CpuGetSnapshotStructName() { static const std::string name("CPU"); return name; diff --git a/source/CPU.h b/source/CPU.h index 02059da7f..490ed3607 100644 --- a/source/CPU.h +++ b/source/CPU.h @@ -28,20 +28,20 @@ enum { extern regsrec regs; extern unsigned __int64 g_nCumulativeCycles; -void CpuDestroy (); +void CpuDestroy(); void CpuCalcCycles(ULONG nExecutedCycles); uint32_t CpuExecute(const uint32_t uCycles, const bool bVideoUpdate); ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles); -void CpuCreateCriticalSection(void); -void CpuInitialize(void); -void CpuSetupBenchmark (); +void CpuCreateCriticalSection(); +void CpuInitialize(); +void CpuSetupBenchmark(); void CpuIrqReset(); void CpuIrqAssert(eIRQSRC Device); void CpuIrqDeassert(eIRQSRC Device); void CpuNmiReset(); void CpuNmiAssert(eIRQSRC Device); void CpuNmiDeassert(eIRQSRC Device); -void CpuReset (); +void CpuReset(); void CpuSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void CpuLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version); @@ -50,15 +50,15 @@ void CpuWrite(USHORT addr, BYTE value, ULONG uExecutedCycles); enum eCpuType {CPU_UNKNOWN=0, CPU_6502=1, CPU_65C02, CPU_Z80}; // Don't change! Persisted to Registry -eCpuType GetMainCpu(void); +eCpuType GetMainCpu(); void SetMainCpu(eCpuType cpu); eCpuType ProbeMainCpuDefault(eApple2Type apple2Type); void SetMainCpuDefault(eApple2Type apple2Type); -eCpuType GetActiveCpu(void); +eCpuType GetActiveCpu(); void SetActiveCpu(eCpuType cpu); -bool IsIrqAsserted(void); -bool Is6502InterruptEnabled(void); -void ResetCyclesExecutedForDebugger(void); -bool IsInterruptInLastExecution(void); -void SetIrqOnLastOpcodeCycle(void); +bool IsIrqAsserted(); +bool Is6502InterruptEnabled(); +void ResetCyclesExecutedForDebugger(); +bool IsInterruptInLastExecution(); +void SetIrqOnLastOpcodeCycle(); diff --git a/source/Card.cpp b/source/Card.cpp index 42ab3d17b..0fdf6b723 100644 --- a/source/Card.cpp +++ b/source/Card.cpp @@ -119,7 +119,7 @@ const std::string& Card::GetCardNameEmpty() return name; } -std::string Card::GetCardName(void) +std::string Card::GetCardName() { return GetCardName(m_type); } diff --git a/source/Card.h b/source/Card.h index a66f0677c..641dca05a 100644 --- a/source/Card.h +++ b/source/Card.h @@ -43,7 +43,7 @@ class Card { public: Card(SS_CARDTYPE type, UINT slot) : m_type(type), m_slot(slot) {} - virtual ~Card(void) {} + virtual ~Card() {} virtual void InitializeIO(LPBYTE pCxRomPeripheral) = 0; virtual void Destroy() = 0; // Called by CardManager::Destroy() on WM_DESTROY @@ -52,10 +52,10 @@ class Card virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) = 0; virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) = 0; - SS_CARDTYPE QueryType(void) { return m_type; } + SS_CARDTYPE QueryType() { return m_type; } static const std::string& GetCardNameEmpty(); - std::string GetCardName(void); + std::string GetCardName(); static std::string GetCardName(const SS_CARDTYPE cardType); static SS_CARDTYPE GetCardType(const std::string & card); @@ -79,7 +79,7 @@ class EmptyCard : public Card { public: EmptyCard(UINT slot) : Card(CT_Empty, slot) {} - virtual ~EmptyCard(void) {} + virtual ~EmptyCard() {} virtual void InitializeIO(LPBYTE pCxRomPeripheral) {} virtual void Destroy() {} @@ -95,7 +95,7 @@ class DummyCard : public Card // For cards that currently can't be instantiated { public: DummyCard(SS_CARDTYPE type, UINT slot) : Card(type, slot) {} - virtual ~DummyCard(void) {} + virtual ~DummyCard() {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Destroy() {} diff --git a/source/CardManager.cpp b/source/CardManager.cpp index faf2f7e59..7ddc9681b 100644 --- a/source/CardManager.cpp +++ b/source/CardManager.cpp @@ -251,7 +251,7 @@ void CardManager::RemoveAuxInternal() m_aux = NULL; } -void CardManager::RemoveAux(void) +void CardManager::RemoveAux() { InsertAux(CT_Empty); } diff --git a/source/CardManager.h b/source/CardManager.h index b3f4831aa..7f89c868a 100644 --- a/source/CardManager.h +++ b/source/CardManager.h @@ -9,7 +9,7 @@ class CardManager { public: - CardManager(void) : + CardManager() : m_pMouseCard(NULL), m_pSSC(NULL), m_pParallelPrinterCard(NULL), @@ -27,7 +27,7 @@ class CardManager InsertInternal(SLOT7, CT_Empty); InsertAuxInternal(CT_Extended80Col); // For Apple //e and above } - ~CardManager(void) + ~CardManager() { for (UINT i=0; iQueryType(); } - Card* GetObjAux(void) { _ASSERT(0); return m_aux; } // ASSERT because this is a DummyCard + void RemoveAux(); + SS_CARDTYPE QueryAux() { return m_aux->QueryType(); } + Card* GetObjAux() { _ASSERT(0); return m_aux; } // ASSERT because this is a DummyCard // - Disk2CardManager& GetDisk2CardMgr(void) { return m_disk2CardMgr; } - LanguageCardManager& GetLanguageCardMgr(void) { return m_languageCardMgr; } - MockingboardCardManager& GetMockingboardCardMgr(void) { return m_mockingboardCardMgr; } - class CMouseInterface* GetMouseCard(void) { return m_pMouseCard; } - bool IsMouseCardInstalled(void) { return m_pMouseCard != NULL; } - class CSuperSerialCard* GetSSC(void) { return m_pSSC; } - bool IsSSCInstalled(void) { return m_pSSC != NULL; } - class ParallelPrinterCard* GetParallelPrinterCard(void) { return m_pParallelPrinterCard; } - bool IsParallelPrinterCardInstalled(void) { return m_pParallelPrinterCard != NULL; } - class VidHDCard* GetVidHDCard(void) { return m_pVidHDCard; } + Disk2CardManager& GetDisk2CardMgr() { return m_disk2CardMgr; } + LanguageCardManager& GetLanguageCardMgr() { return m_languageCardMgr; } + MockingboardCardManager& GetMockingboardCardMgr() { return m_mockingboardCardMgr; } + class CMouseInterface* GetMouseCard() { return m_pMouseCard; } + bool IsMouseCardInstalled() { return m_pMouseCard != NULL; } + class CSuperSerialCard* GetSSC() { return m_pSSC; } + bool IsSSCInstalled() { return m_pSSC != NULL; } + class ParallelPrinterCard* GetParallelPrinterCard() { return m_pParallelPrinterCard; } + bool IsParallelPrinterCardInstalled() { return m_pParallelPrinterCard != NULL; } + class VidHDCard* GetVidHDCard() { return m_pVidHDCard; } SS_CARDTYPE QueryDefaultCardForSlot(UINT slot, eApple2Type model); void GetCardChoicesForSlot(const UINT slot, const SS_CARDTYPE currConfig[NUM_SLOTS], std::vector& choicesList); void GetCardChoicesForAuxSlot(std::vector& choicesList); void InitializeIO(LPBYTE pCxRomPeripheral); - void Destroy(void); + void Destroy(); void Reset(const bool powerCycle); void Update(const ULONG nExecutedCycles); void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); @@ -79,7 +79,7 @@ class CardManager void InsertInternal(UINT slot, SS_CARDTYPE type); void InsertAuxInternal(SS_CARDTYPE type); void RemoveInternal(UINT slot); - void RemoveAuxInternal(void); + void RemoveAuxInternal(); bool IsSingleInstanceCard(SS_CARDTYPE card); Card* m_slot[NUM_SLOTS]; diff --git a/source/Common.h b/source/Common.h index 0defdb057..488277d29 100644 --- a/source/Common.h +++ b/source/Common.h @@ -247,12 +247,12 @@ inline bool IsAppleIIc(eApple2Type type) // Apple //c } extern eApple2Type g_Apple2Type; -inline bool IsEnhancedIIE(void) +inline bool IsEnhancedIIE() { return ( (g_Apple2Type == A2TYPE_APPLE2EENHANCED) || (g_Apple2Type == A2TYPE_TK30002E) ); } -inline bool IsEnhancedIIEorIIC(void) +inline bool IsEnhancedIIEorIIC() { return ( (g_Apple2Type == A2TYPE_APPLE2EENHANCED) || (g_Apple2Type == A2TYPE_TK30002E) || IS_APPLE2C() ); } diff --git a/source/CommonVICE/interrupt.h b/source/CommonVICE/interrupt.h index 49097e816..476804010 100644 --- a/source/CommonVICE/interrupt.h +++ b/source/CommonVICE/interrupt.h @@ -103,9 +103,9 @@ struct interrupt_cpu_status_s { unsigned int global_pending_int; - void (*nmi_trap_func)(void); + void (*nmi_trap_func)(); - void (*reset_trap_func)(void); + void (*reset_trap_func)(); /* flag for interrupt_restore to handle CPU snapshots before 1.1 */ int needs_global_restore; @@ -114,8 +114,8 @@ typedef struct interrupt_cpu_status_s interrupt_cpu_status_t; /* ------------------------------------------------------------------------- */ -extern void interrupt_log_wrong_nirq(void); -extern void interrupt_log_wrong_nnmi(void); +extern void interrupt_log_wrong_nirq(); +extern void interrupt_log_wrong_nnmi(); extern void interrupt_trigger_dma(interrupt_cpu_status_t *cs, CLOCK cpu_clk); extern void interrupt_ack_dma(interrupt_cpu_status_t *cs); @@ -246,7 +246,7 @@ inline static void interrupt_ack_irq(interrupt_cpu_status_t *cs) struct snapshot_module_s; -extern interrupt_cpu_status_t *interrupt_cpu_status_new(void); +extern interrupt_cpu_status_t *interrupt_cpu_status_new(); extern void interrupt_cpu_status_destroy(interrupt_cpu_status_t *cs); extern void interrupt_cpu_status_init(interrupt_cpu_status_t *cs, unsigned int *last_opcode_info_ptr); @@ -257,7 +257,7 @@ extern unsigned int interrupt_cpu_status_int_new(interrupt_cpu_status_t *cs, const char *name); extern void interrupt_ack_reset(interrupt_cpu_status_t *cs); extern void interrupt_set_reset_trap_func(interrupt_cpu_status_t *cs, - void (*reset_trap_func)(void)); + void (*reset_trap_func)()); extern void interrupt_maincpu_trigger_trap(void (*trap_func)(WORD, void *data), void *data); extern void interrupt_do_trap(interrupt_cpu_status_t *cs, WORD address); @@ -285,7 +285,7 @@ extern void interrupt_restore_nmi(interrupt_cpu_status_t *cs, int int_num, extern int interrupt_get_irq(interrupt_cpu_status_t *cs, int int_num); extern int interrupt_get_nmi(interrupt_cpu_status_t *cs, int int_num); extern void interrupt_set_nmi_trap_func(interrupt_cpu_status_t *cs, - void (*nmi_trap_func)(void)); + void (*nmi_trap_func)()); /* ------------------------------------------------------------------------- */ diff --git a/source/CommonVICE/mem.h b/source/CommonVICE/mem.h index d6391fb0c..63d9d6b9c 100644 --- a/source/CommonVICE/mem.h +++ b/source/CommonVICE/mem.h @@ -50,9 +50,9 @@ extern BYTE *mem_color_ram_vicii; extern unsigned int mem_old_reg_pc; extern BYTE *mem_chargen_rom_ptr; -extern void mem_initialize_memory(void); -extern void mem_powerup(void); -extern int mem_load(void); +extern void mem_initialize_memory(); +extern void mem_powerup(); +extern int mem_load(); extern void mem_get_basic_text(WORD *start, WORD *end); extern void mem_set_basic_text(WORD start, WORD end); extern void mem_toggle_watchpoints(int flag, void *context); @@ -70,7 +70,7 @@ extern store_func_t mem_store; /* ------------------------------------------------------------------------- */ /* Memory access functions for the monitor. */ -extern const char **mem_bank_list(void); +extern const char **mem_bank_list(); extern int mem_bank_from_name(const char *name); extern BYTE mem_bank_read(int bank, WORD addr, void *context); extern BYTE mem_bank_peek(int bank, WORD addr, void *context); diff --git a/source/Configuration/About.cpp b/source/Configuration/About.cpp index 711317c9d..d49b62b81 100644 --- a/source/Configuration/About.cpp +++ b/source/Configuration/About.cpp @@ -78,7 +78,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPA return FALSE; } -bool AboutDlg(void) +bool AboutDlg() { return DialogBox(GetFrame().g_hInstance, (LPCTSTR)IDD_ABOUT, GetFrame().g_hFrameWindow, DlgProcAbout) ? true : false; } diff --git a/source/Configuration/About.h b/source/Configuration/About.h index fa854fe11..b476d7429 100644 --- a/source/Configuration/About.h +++ b/source/Configuration/About.h @@ -1,3 +1,3 @@ #pragma once -bool AboutDlg(void); +bool AboutDlg(); diff --git a/source/Configuration/IPropertySheet.h b/source/Configuration/IPropertySheet.h index c3026b738..d97ff6261 100644 --- a/source/Configuration/IPropertySheet.h +++ b/source/Configuration/IPropertySheet.h @@ -7,29 +7,29 @@ class CConfigNeedingRestart; class IPropertySheet { public: - virtual void Init(void) = 0; - virtual uint32_t GetVolumeMax(void) = 0; // TODO:TC: Move out of here + virtual void Init() = 0; + virtual uint32_t GetVolumeMax() = 0; // TODO:TC: Move out of here virtual bool SaveStateSelectImage(HWND hWindow, bool bSave) = 0; // TODO:TC: Move out of here virtual void ResetAllToDefault() = 0; virtual void ApplyConfigAfterClose(UINT bmPages) = 0; virtual void ApplyNewConfigFromSnapshot() = 0; virtual void ConfigSaveApple2Type(eApple2Type apple2Type) = 0; - virtual UINT GetScrollLockToggle(void) = 0; + virtual UINT GetScrollLockToggle() = 0; virtual void SetScrollLockToggle(UINT uValue) = 0; - virtual UINT GetJoystickCursorControl(void) = 0; + virtual UINT GetJoystickCursorControl() = 0; virtual void SetJoystickCursorControl(UINT uValue) = 0; - virtual UINT GetJoystickCenteringControl(void) = 0; + virtual UINT GetJoystickCenteringControl() = 0; virtual void SetJoystickCenteringControl(UINT uValue) = 0; virtual UINT GetAutofire(UINT uButton) = 0; - virtual UINT GetAutofire(void) = 0; + virtual UINT GetAutofire() = 0; virtual void SetAutofire(UINT uValue) = 0; - virtual bool GetButtonsSwapState(void) = 0; + virtual bool GetButtonsSwapState() = 0; virtual void SetButtonsSwapState(bool value) = 0; - virtual UINT GetMouseShowCrosshair(void) = 0; + virtual UINT GetMouseShowCrosshair() = 0; virtual void SetMouseShowCrosshair(UINT uValue) = 0; - virtual UINT GetMouseRestrictToWindow(void) = 0; + virtual UINT GetMouseRestrictToWindow() = 0; virtual void SetMouseRestrictToWindow(UINT uValue) = 0; - virtual UINT GetTheFreezesF8Rom(void) = 0; + virtual UINT GetTheFreezesF8Rom() = 0; virtual void SetTheFreezesF8Rom(UINT uValue) = 0; }; diff --git a/source/Configuration/PageAdvanced.cpp b/source/Configuration/PageAdvanced.cpp index cb0fa24a6..d0eef1249 100644 --- a/source/Configuration/PageAdvanced.cpp +++ b/source/Configuration/PageAdvanced.cpp @@ -243,7 +243,7 @@ eApple2Type CPageAdvanced::GetCloneType(uint32_t NewMenuItem) } } -int CPageAdvanced::GetCloneMenuItem(void) +int CPageAdvanced::GetCloneMenuItem() { const eApple2Type type = m_PropertySheetHelper.GetConfigNew().m_Apple2Type; const bool bIsClone = IsClone(type); diff --git a/source/Configuration/PageAdvanced.h b/source/Configuration/PageAdvanced.h index 3bc838f13..aa7bd2063 100644 --- a/source/Configuration/PageAdvanced.h +++ b/source/Configuration/PageAdvanced.h @@ -20,8 +20,8 @@ class CPageAdvanced : private IPropertySheetPage static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); - UINT GetTheFreezesF8Rom(void){ return m_uTheFreezesF8Rom; } - void SetTheFreezesF8Rom(UINT uValue){ m_uTheFreezesF8Rom = uValue; } + UINT GetTheFreezesF8Rom() { return m_uTheFreezesF8Rom; } + void SetTheFreezesF8Rom(UINT uValue) { m_uTheFreezesF8Rom = uValue; } virtual void ApplyConfigAfterClose(); // IPropertySheetPage virtual void ResetToDefault(); // IPropertySheetPage @@ -35,7 +35,7 @@ class CPageAdvanced : private IPropertySheetPage private: void InitOptions(HWND hWnd); eApple2Type GetCloneType(uint32_t NewMenuItem); - int GetCloneMenuItem(void); + int GetCloneMenuItem(); void InitFreezeDlgButton(HWND hWnd); void InitCloneDropdownMenu(HWND hWnd); void InitGameIOConnectorDropdownMenu(HWND hWnd); diff --git a/source/Configuration/PageConfig.h b/source/Configuration/PageConfig.h index b7e625f3e..3d974ed49 100644 --- a/source/Configuration/PageConfig.h +++ b/source/Configuration/PageConfig.h @@ -21,10 +21,10 @@ class CPageConfig : private IPropertySheetPage static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); - UINT GetScrollLockToggle(void) { return m_uScrollLockToggle; } + UINT GetScrollLockToggle() { return m_uScrollLockToggle; } void SetScrollLockToggle(UINT uValue) { m_uScrollLockToggle = uValue; } - uint32_t GetVolumeMax(void) { return VOLUME_MAX; } + uint32_t GetVolumeMax() { return VOLUME_MAX; } virtual void ApplyConfigAfterClose(); // IPropertySheetPage virtual void ResetToDefault(); // IPropertySheetPage diff --git a/source/Configuration/PageInput.h b/source/Configuration/PageInput.h index 83ff072d3..bbf0a36b8 100644 --- a/source/Configuration/PageInput.h +++ b/source/Configuration/PageInput.h @@ -23,15 +23,15 @@ class CPageInput : private IPropertySheetPage static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); - UINT GetJoystickCursorControl(void){ return m_uCursorControl; } - void SetJoystickCursorControl(UINT uValue){ m_uCursorControl = uValue; } - UINT GetJoystickCenteringControl(void){ return m_uCenteringControl; } - void SetJoystickCenteringControl(UINT uValue){ m_uCenteringControl = uValue; } + UINT GetJoystickCursorControl() { return m_uCursorControl; } + void SetJoystickCursorControl(UINT uValue) { m_uCursorControl = uValue; } + UINT GetJoystickCenteringControl() { return m_uCenteringControl; } + void SetJoystickCenteringControl(UINT uValue) { m_uCenteringControl = uValue; } UINT GetAutofire(UINT uButton) { return (m_bmAutofire >> uButton) & 1; } // Get a specific button - UINT GetAutofire(void) { return m_bmAutofire; } // Get all buttons + UINT GetAutofire() { return m_bmAutofire; } // Get all buttons void SetAutofire(UINT uValue) { m_bmAutofire = uValue; } // Set all buttons - bool GetButtonsSwapState(void){ return m_bSwapButtons0and1; } - void SetButtonsSwapState(bool value){ m_bSwapButtons0and1 = value; } + bool GetButtonsSwapState() { return m_bSwapButtons0and1; } + void SetButtonsSwapState(bool value) { m_bSwapButtons0and1 = value; } static const UINT kAutofire_Default = 0; static const UINT kCenteringControl_Default = JOYSTICK_MODE_CENTERING; diff --git a/source/Configuration/PageSlots.h b/source/Configuration/PageSlots.h index 5985950c1..7f127d357 100644 --- a/source/Configuration/PageSlots.h +++ b/source/Configuration/PageSlots.h @@ -23,9 +23,9 @@ class CPageSlots : private IPropertySheetPage static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam); - UINT GetMouseShowCrosshair(void) { return m_mouseShowCrosshair; } + UINT GetMouseShowCrosshair() { return m_mouseShowCrosshair; } void SetMouseShowCrosshair(UINT uValue) { m_mouseShowCrosshair = uValue; } - UINT GetMouseRestrictToWindow(void) { return m_mouseRestrictToWindow; } + UINT GetMouseRestrictToWindow() { return m_mouseRestrictToWindow; } void SetMouseRestrictToWindow(UINT uValue) { m_mouseRestrictToWindow = uValue; } virtual void ApplyConfigAfterClose(); // IPropertySheetPage diff --git a/source/Configuration/PropertySheet.cpp b/source/Configuration/PropertySheet.cpp index 8ee8d4fa2..f46199a66 100644 --- a/source/Configuration/PropertySheet.cpp +++ b/source/Configuration/PropertySheet.cpp @@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "../Windows/AppleWin.h" #include "../resource/resource.h" -void CPropertySheet::Init(void) +void CPropertySheet::Init() { PROPSHEETPAGE PropSheetPages[PG_NUM_SHEETS]; diff --git a/source/Configuration/PropertySheet.h b/source/Configuration/PropertySheet.h index cf35150c3..93556b56d 100644 --- a/source/Configuration/PropertySheet.h +++ b/source/Configuration/PropertySheet.h @@ -19,8 +19,8 @@ class CPropertySheet : public IPropertySheet } virtual ~CPropertySheet(){} - virtual void Init(void); - virtual uint32_t GetVolumeMax(void); // TODO:TC: Move out of here + virtual void Init(); + virtual uint32_t GetVolumeMax(); // TODO:TC: Move out of here virtual bool SaveStateSelectImage(HWND hWindow, bool bSave); // TODO:TC: Move out of here virtual void ResetAllToDefault(); virtual void ApplyConfigAfterClose(UINT bmPages); @@ -34,23 +34,23 @@ class CPropertySheet : public IPropertySheet m_PropertySheetHelper.ConfigSaveApple2Type(apple2Type); } - virtual UINT GetScrollLockToggle(void){ return m_PageConfig.GetScrollLockToggle(); } - virtual void SetScrollLockToggle(UINT uValue){ m_PageConfig.SetScrollLockToggle(uValue); } - virtual UINT GetJoystickCursorControl(void){ return m_PageInput.GetJoystickCursorControl(); } - virtual void SetJoystickCursorControl(UINT uValue){ m_PageInput.SetJoystickCursorControl(uValue); } - virtual UINT GetJoystickCenteringControl(void){ return m_PageInput.GetJoystickCenteringControl(); } - virtual void SetJoystickCenteringControl(UINT uValue){ m_PageInput.SetJoystickCenteringControl(uValue); } + virtual UINT GetScrollLockToggle() { return m_PageConfig.GetScrollLockToggle(); } + virtual void SetScrollLockToggle(UINT uValue) { m_PageConfig.SetScrollLockToggle(uValue); } + virtual UINT GetJoystickCursorControl() { return m_PageInput.GetJoystickCursorControl(); } + virtual void SetJoystickCursorControl(UINT uValue) { m_PageInput.SetJoystickCursorControl(uValue); } + virtual UINT GetJoystickCenteringControl() { return m_PageInput.GetJoystickCenteringControl(); } + virtual void SetJoystickCenteringControl(UINT uValue) { m_PageInput.SetJoystickCenteringControl(uValue); } virtual UINT GetAutofire(UINT uButton) { return m_PageInput.GetAutofire(uButton); } - virtual UINT GetAutofire(void) { return m_PageInput.GetAutofire(); } + virtual UINT GetAutofire() { return m_PageInput.GetAutofire(); } virtual void SetAutofire(UINT uValue) { m_PageInput.SetAutofire(uValue); } - virtual bool GetButtonsSwapState(void) { return m_PageInput.GetButtonsSwapState(); } + virtual bool GetButtonsSwapState() { return m_PageInput.GetButtonsSwapState(); } virtual void SetButtonsSwapState(bool value) { m_PageInput.SetButtonsSwapState(value); } - virtual UINT GetMouseShowCrosshair(void){ return m_PageSlots.GetMouseShowCrosshair(); } + virtual UINT GetMouseShowCrosshair() { return m_PageSlots.GetMouseShowCrosshair(); } virtual void SetMouseShowCrosshair(UINT uValue) { m_PageSlots.SetMouseShowCrosshair(uValue); } - virtual UINT GetMouseRestrictToWindow(void){ return m_PageSlots.GetMouseRestrictToWindow(); } - virtual void SetMouseRestrictToWindow(UINT uValue){ m_PageSlots.SetMouseRestrictToWindow(uValue); } - virtual UINT GetTheFreezesF8Rom(void){ return m_PageAdvanced.GetTheFreezesF8Rom(); } - virtual void SetTheFreezesF8Rom(UINT uValue){ m_PageAdvanced.SetTheFreezesF8Rom(uValue); } + virtual UINT GetMouseRestrictToWindow() { return m_PageSlots.GetMouseRestrictToWindow(); } + virtual void SetMouseRestrictToWindow(UINT uValue) { m_PageSlots.SetMouseRestrictToWindow(uValue); } + virtual UINT GetTheFreezesF8Rom() { return m_PageAdvanced.GetTheFreezesF8Rom(); } + virtual void SetTheFreezesF8Rom(UINT uValue) { m_PageAdvanced.SetTheFreezesF8Rom(uValue); } private: CPropertySheetHelper m_PropertySheetHelper; diff --git a/source/Configuration/PropertySheetHelper.cpp b/source/Configuration/PropertySheetHelper.cpp index d12993ba0..a043aec9a 100644 --- a/source/Configuration/PropertySheetHelper.cpp +++ b/source/Configuration/PropertySheetHelper.cpp @@ -439,7 +439,7 @@ void CPropertySheetHelper::ApplyNewConfigFromSnapshot() } // Called when PSPs are created -void CPropertySheetHelper::SaveCurrentConfig(void) +void CPropertySheetHelper::SaveCurrentConfig() { m_ConfigOld.Reload(); m_ConfigNew = m_ConfigOld; // Setup ConfigNew diff --git a/source/Configuration/PropertySheetHelper.h b/source/Configuration/PropertySheetHelper.h index 0e35c07d4..cf2be3453 100644 --- a/source/Configuration/PropertySheetHelper.h +++ b/source/Configuration/PropertySheetHelper.h @@ -20,8 +20,8 @@ class CPropertySheetHelper int SaveStateSelectImage(HWND hWindow, const char* pszTitle, bool bSave); void PostMsgAfterClose(HWND hWnd, PAGETYPE page); - void ResetPageMask(void) { m_bmPages = 0; } // Req'd because cancelling doesn't clear the page-mask - PAGETYPE GetLastPage(void) { return m_LastPage; } + void ResetPageMask() { m_bmPages = 0; } // Req'd because cancelling doesn't clear the page-mask + PAGETYPE GetLastPage() { return m_LastPage; } void SetLastPage(PAGETYPE page) { m_LastPage = page; @@ -29,11 +29,11 @@ class CPropertySheetHelper m_bmAfterClosePages = m_bmPages; } - void SaveCurrentConfig(void); - const std::string & GetSSNewFilename(void) { return m_szSSNewFilename; } - CConfigNeedingRestart& GetConfigNew(void) { return m_ConfigNew; } - bool IsConfigChangedForRestart(void) { return m_ConfigNew != m_ConfigOld; } - void SetDoBenchmark(void) { m_bDoBenchmark = true; } + void SaveCurrentConfig(); + const std::string & GetSSNewFilename() { return m_szSSNewFilename; } + CConfigNeedingRestart& GetConfigNew() { return m_ConfigNew; } + bool IsConfigChangedForRestart() { return m_ConfigNew != m_ConfigOld; } + void SetDoBenchmark() { m_bDoBenchmark = true; } void ApplyNewConfigFromSnapshot(); void ConfigSaveApple2Type(eApple2Type apple2Type); void SetSlot(UINT slot, SS_CARDTYPE newCardType); diff --git a/source/CopyProtectionDongles.cpp b/source/CopyProtectionDongles.cpp index 049b1c256..fca7e167e 100644 --- a/source/CopyProtectionDongles.cpp +++ b/source/CopyProtectionDongles.cpp @@ -59,7 +59,7 @@ void SetCopyProtectionDongleType(DONGLETYPE type) copyProtectionDongleType = type; } -DONGLETYPE GetCopyProtectionDongleType(void) +DONGLETYPE GetCopyProtectionDongleType() { return copyProtectionDongleType; } @@ -83,19 +83,19 @@ void DongleControl(WORD address) // This protection dongle consists of a NAND gate connected with AN1 and AN2 on the inputs // PB2 on the output, and AN0 connected to power it. -static bool SdsSpeedStar(void) +static bool SdsSpeedStar() { return !MemGetAnnunciator(0) || !(MemGetAnnunciator(1) && MemGetAnnunciator(2)); } // Returns the copy protection dongle state of PB0. A return value of -1 means not used by copy protection dongle -int CopyProtectionDonglePB0(void) +int CopyProtectionDonglePB0() { return -1; } // Returns the copy protection dongle state of PB1. A return value of -1 means not used by copy protection dongle -int CopyProtectionDonglePB1(void) +int CopyProtectionDonglePB1() { if (copyProtectionDongleType == DT_HAYDENCOMPILER) return 0; // connected to GND @@ -104,7 +104,7 @@ int CopyProtectionDonglePB1(void) } // Returns the copy protection dongle state of PB2. A return value of -1 means not used by copy protection dongle -int CopyProtectionDonglePB2(void) +int CopyProtectionDonglePB2() { switch (copyProtectionDongleType) { @@ -177,37 +177,37 @@ int CopyProtectionDonglePDL(UINT pdl) // Add Robocom Ltd - Robo 500/1000/1500 Interface Modules // 3: Add Hayden Compiler protection key -static const std::string& GetSnapshotStructName_SDSSpeedStar(void) +static const std::string& GetSnapshotStructName_SDSSpeedStar() { static const std::string name("SDS SpeedStar dongle"); return name; } -static const std::string& GetSnapshotStructName_CodeWriter(void) +static const std::string& GetSnapshotStructName_CodeWriter() { static const std::string name("Cortechs Corp - CodeWriter protection key"); return name; } -static const std::string& GetSnapshotStructName_Robocom500(void) +static const std::string& GetSnapshotStructName_Robocom500() { static const std::string name("Robocom Ltd - Robo 500 Interface Module"); return name; } -static const std::string& GetSnapshotStructName_Robocom1000(void) +static const std::string& GetSnapshotStructName_Robocom1000() { static const std::string name("Robocom Ltd - Robo 1000 Interface Module"); return name; } -static const std::string& GetSnapshotStructName_Robocom1500(void) +static const std::string& GetSnapshotStructName_Robocom1500() { static const std::string name("Robocom Ltd - Robo 1500 Interface Module"); return name; } -static const std::string& GetSnapshotStructName_HaydenCompiler(void) +static const std::string& GetSnapshotStructName_HaydenCompiler() { static const std::string name("Hayden - Applesoft Compiler protection key"); return name; diff --git a/source/CopyProtectionDongles.h b/source/CopyProtectionDongles.h index 5ed1ee7b5..4616ba000 100644 --- a/source/CopyProtectionDongles.h +++ b/source/CopyProtectionDongles.h @@ -6,11 +6,11 @@ enum DONGLETYPE { DT_EMPTY, DT_SDSSPEEDSTAR, DT_CODEWRITER, DT_ROBOCOM500, DT_ROBOCOM1000, DT_ROBOCOM1500, DT_HAYDENCOMPILER, DT_NUM, DT_DEFAULT = DT_EMPTY }; void SetCopyProtectionDongleType(DONGLETYPE type); -DONGLETYPE GetCopyProtectionDongleType(void); +DONGLETYPE GetCopyProtectionDongleType(); void DongleControl(WORD address); -int CopyProtectionDonglePB0(void); -int CopyProtectionDonglePB1(void); -int CopyProtectionDonglePB2(void); +int CopyProtectionDonglePB0(); +int CopyProtectionDonglePB1(); +int CopyProtectionDonglePB2(); int CopyProtectionDonglePDL(UINT pdl); void CopyProtectionDongleSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); diff --git a/source/Core.cpp b/source/Core.cpp index addf12e9f..3503b1564 100644 --- a/source/Core.cpp +++ b/source/Core.cpp @@ -101,7 +101,7 @@ UINT64 g_timeMB_NoTimer = 0; UINT64 g_timeSpeaker = 0; static UINT64 g_timeVideoRefresh = 0; -void LogPerfTimings(void) +void LogPerfTimings() { if (g_timeTotal) { @@ -131,7 +131,7 @@ void LogPerfTimings(void) static uint32_t dwLogKeyReadTickStart; static bool bLogKeyReadDone = false; -void LogFileTimeUntilFirstKeyReadReset(void) +void LogFileTimeUntilFirstKeyReadReset() { #ifdef LOG_PERF_TIMINGS LogPerfTimings(); @@ -149,7 +149,7 @@ void LogFileTimeUntilFirstKeyReadReset(void) // . AZTEC.DSK (DOS 3.3) does prior LDY $C000 reads, but the BIT $C000 is at the "Press any key" message // . Phasor1.dsk / ProDOS 1.1.1: PC=E797: B1 50: LDA ($50),Y / "Select an Option:" message // . Rescue Raiders v1.3,v1.5: PC=895: LDA $C000 / boot to intro -void LogFileTimeUntilFirstKeyRead(void) +void LogFileTimeUntilFirstKeyRead() { if (!g_fh || bLogKeyReadDone) return; @@ -169,7 +169,7 @@ void LogFileTimeUntilFirstKeyRead(void) //--------------------------------------------------------------------------- -eApple2Type GetApple2Type(void) +eApple2Type GetApple2Type() { return g_Apple2Type; } @@ -180,12 +180,12 @@ void SetApple2Type(eApple2Type type) SetMainCpuDefault(type); } -const UINT16* GetOldAppleWinVersion(void) +const UINT16* GetOldAppleWinVersion() { return g_OldAppleWinVersion; } -CardManager& GetCardMgr(void) +CardManager& GetCardMgr() { static CardManager g_CardMgr; // singleton return g_CardMgr; @@ -193,12 +193,12 @@ CardManager& GetCardMgr(void) //=========================================================================== -double Get6502BaseClock(void) +double Get6502BaseClock() { return (GetVideo().GetVideoRefreshRate() == VR_50HZ) ? CLK_6502_PAL : CLK_6502_NTSC; } -void SetCurrentCLK6502(void) +void SetCurrentCLK6502() { static uint32_t dwPrevSpeed = (uint32_t) -1; static VideoRefreshRate_e prevVideoRefreshRate = VR_NONE; @@ -260,7 +260,7 @@ void SetAppleWinVersion(UINT16 major, UINT16 minor, UINT16 fix, UINT16 fix_minor g_VERSIONSTRING = StrFormat("%d.%d.%d.%d", major, minor, fix, fix_minor); } -bool CheckOldAppleWinVersion(void) +bool CheckOldAppleWinVersion() { const int VERSIONSTRING_SIZE = 16; char szOldAppleWinVersion[VERSIONSTRING_SIZE + 1]; @@ -285,12 +285,12 @@ bool CheckOldAppleWinVersion(void) return bShowAboutDlg; } -UINT GetCompilationTarget(void) +UINT GetCompilationTarget() { return sizeof(void*) * 8; // Portable (Windows, Linux); returns 32 or 64 } -std::string GetAppleWinVersionAndBuild(void) +std::string GetAppleWinVersionAndBuild() { std::string debugStr = #ifdef _DEBUG @@ -314,7 +314,7 @@ bool SetCurrentImageDir(const std::string& pszImageDir) return false; } -Pravets& GetPravets(void) +Pravets& GetPravets() { static Pravets pravets; return pravets; diff --git a/source/Core.h b/source/Core.h index 16e3605ad..072d8096e 100644 --- a/source/Core.h +++ b/source/Core.h @@ -5,26 +5,26 @@ #include "StrFormat.h" #include "Log.h" -void LogFileTimeUntilFirstKeyReadReset(void); -void LogFileTimeUntilFirstKeyRead(void); +void LogFileTimeUntilFirstKeyReadReset(); +void LogFileTimeUntilFirstKeyRead(); -extern const UINT16* GetOldAppleWinVersion(void); +extern const UINT16* GetOldAppleWinVersion(); extern UINT16 g_AppleWinVersion[4]; extern std::string g_VERSIONSTRING; // Constructed in WinMain() void SetAppleWinVersion(UINT16 major, UINT16 minor, UINT16 fix, UINT16 fix_minor); -bool CheckOldAppleWinVersion(void); -std::string GetAppleWinVersionAndBuild(void); -UINT GetCompilationTarget(void); +bool CheckOldAppleWinVersion(); +std::string GetAppleWinVersionAndBuild(); +UINT GetCompilationTarget(); extern std::string g_pAppTitle; extern eApple2Type g_Apple2Type; -eApple2Type GetApple2Type(void); +eApple2Type GetApple2Type(); void SetApple2Type(eApple2Type type); -double Get6502BaseClock(void); -void SetCurrentCLK6502(void); +double Get6502BaseClock(); +void SetCurrentCLK6502(); // set g_dwSpeed = // | clockMultiplier == 0 => unchanged @@ -55,7 +55,7 @@ extern uint32_t g_dwCyclesThisFrame; extern int g_nMemoryClearType; // Cmd line switch: use specific MIP (Memory Initialization Pattern) -extern class CardManager& GetCardMgr(void); +extern class CardManager& GetCardMgr(); extern class SynchronousEventManager g_SynchronousEventMgr; extern HANDLE g_hCustomRomF8; // INVALID_HANDLE_VALUE if no custom F8 rom @@ -73,7 +73,7 @@ extern bool g_bDisableDirectInput; // Cmd line switch: don't init DI (s extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB/Speaker support) extern bool g_bDisableDirectSoundMockingboard; // Cmd line switch: don't init MB support -class Pravets& GetPravets(void); +class Pravets& GetPravets(); //#define LOG_PERF_TIMINGS #ifdef LOG_PERF_TIMINGS diff --git a/source/Debugger/BreakpointCard.cpp b/source/Debugger/BreakpointCard.cpp index dfc76e485..d2a0ed7fe 100644 --- a/source/Debugger/BreakpointCard.cpp +++ b/source/Debugger/BreakpointCard.cpp @@ -241,7 +241,7 @@ void BreakpointCard::Deferred(uint8_t type, uint16_t addrStart, uint16_t addrEnd static const UINT kUNIT_VERSION = 1; -const std::string& BreakpointCard::GetSnapshotCardName(void) +const std::string& BreakpointCard::GetSnapshotCardName() { static const std::string name("Breakpoint"); return name; diff --git a/source/Debugger/BreakpointCard.h b/source/Debugger/BreakpointCard.h index eee386525..82ca57333 100644 --- a/source/Debugger/BreakpointCard.h +++ b/source/Debugger/BreakpointCard.h @@ -43,7 +43,7 @@ class BreakpointCard : public Card { public: BreakpointCard(UINT slot); - virtual ~BreakpointCard(void); + virtual ~BreakpointCard(); void ResetState() { @@ -53,7 +53,7 @@ class BreakpointCard : public Card m_BP_FIFO.pop(); } - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles) {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); @@ -63,7 +63,7 @@ class BreakpointCard : public Card static void CbFunction(uint8_t slot, INTERCEPTBREAKPOINT interceptBreakpoint); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 8b050c263..907e3afeb 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -440,13 +440,13 @@ class DebugVideoMode // NB. Implemented as a singleton return m_Instance; } - void Reset(void) + void Reset() { m_bIsVideoModeValid = false; m_uVideoMode = 0; } - bool IsSet(void) + bool IsSet() { return m_bIsVideoModeValid; } @@ -1556,7 +1556,7 @@ int CheckBreakpointsVideo () } //=========================================================================== -static int CheckBreakpointsDmaToOrFromIOMemory (void) +static int CheckBreakpointsDmaToOrFromIOMemory () { int res = g_DebugBreakOnDMAIO.isToOrFromMemory; g_DebugBreakOnDMAIO.isToOrFromMemory = 0; @@ -8872,7 +8872,7 @@ bool ProfileSave () } -static void InitDisasm (void) +static void InitDisasm () { g_nDisasmCurAddress = regs.pc; DisasmCalcTopBotAddress(); @@ -9010,7 +9010,7 @@ static void CheckBreakOpcode ( int iOpcode ) g_bDebugBreakpointHit |= BP_HIT_OPCODE; } -static void UpdateLBR (void) +static void UpdateLBR () { const BYTE nOpcode = ReadByteFromMemory(regs.pc); @@ -9247,7 +9247,7 @@ void DebugContinueStepping (const bool bCallerWillUpdateDisplay/*=false*/) } //=========================================================================== -void DebugStopStepping (void) +void DebugStopStepping () { _ASSERT(g_nAppMode == MODE_STEPPING); @@ -9479,7 +9479,7 @@ void DebugInitialize () } //=========================================================================== -void DebugReset (void) +void DebugReset () { g_videoScannerDisplayInfo.Reset(); g_LBR = LBR_UNDEFINED; @@ -10173,7 +10173,7 @@ void DebuggerCursorNext () //=========================================================================== -bool IsDebugSteppingAtFullSpeed (void) +bool IsDebugSteppingAtFullSpeed () { return (g_nAppMode == MODE_STEPPING) && g_bDebugFullSpeed; } diff --git a/source/Debugger/Debug.h b/source/Debugger/Debug.h index 1e46c2ebd..9932a8c14 100644 --- a/source/Debugger/Debug.h +++ b/source/Debugger/Debug.h @@ -169,15 +169,15 @@ bool DebugGetVideoMode(UINT* pVideoMode); - void DebugBegin (); - void DebugExitDebugger (); + void DebugBegin(); + void DebugExitDebugger(); void DebugContinueStepping(const bool bCallerWillUpdateDisplay = false); - void DebugStopStepping(void); - void DebugDestroy (); - void DebugDisplay ( BOOL bInitDisasm = FALSE ); - void DebugInitialize (); - void DebugReset(void); - bool DebugQueryAnyBreakpointsSet (); + void DebugStopStepping(); + void DebugDestroy(); + void DebugDisplay( BOOL bInitDisasm = FALSE ); + void DebugInitialize(); + void DebugReset(); + bool DebugQueryAnyBreakpointsSet(); void DebuggerInputConsoleChar( char ch ); void DebuggerProcessKey( int keycode ); @@ -187,7 +187,7 @@ void DebuggerMouseClick( int x, int y ); - bool IsDebugSteppingAtFullSpeed(void); + bool IsDebugSteppingAtFullSpeed(); void DebuggerBreakOnDmaToOrFromIoMemory(WORD nAddress, bool isDmaToMemory); bool DebuggerCheckMemBreakpoints(WORD nAddress, WORD nSize, bool isDmaToMemory); diff --git a/source/Debugger/Debugger_Color.cpp b/source/Debugger/Debugger_Color.cpp index a81ccfec6..466de7cfc 100644 --- a/source/Debugger/Debugger_Color.cpp +++ b/source/Debugger/Debugger_Color.cpp @@ -227,7 +227,7 @@ static void _SetupColorRamp(const int iPrimary, int & iColor_) //=========================================================================== -void ConfigColorsReset (void) +void ConfigColorsReset () { // int iColor = 1; // black only has one level, skip it, since black levels same as white levels // for (int iPrimary = 1; iPrimary < 8; iPrimary++ ) diff --git a/source/Debugger/Debugger_Color.h b/source/Debugger/Debugger_Color.h index 13492fe22..77fe8913c 100644 --- a/source/Debugger/Debugger_Color.h +++ b/source/Debugger/Debugger_Color.h @@ -157,5 +157,5 @@ // Color COLORREF DebuggerGetColor( int iColor ); - bool DebuggerSetColor ( const int iScheme, const int iColor, const COLORREF nColor ); - void ConfigColorsReset(void); + bool DebuggerSetColor( const int iScheme, const int iColor, const COLORREF nColor ); + void ConfigColorsReset(); diff --git a/source/Debugger/Debugger_Display.cpp b/source/Debugger/Debugger_Display.cpp index cd7ef1d5c..bb4fea888 100644 --- a/source/Debugger/Debugger_Display.cpp +++ b/source/Debugger/Debugger_Display.cpp @@ -504,7 +504,7 @@ const uint32_t aROP4[ 256 ] = //=========================================================================== -HDC GetDebuggerMemDC(void) +HDC GetDebuggerMemDC() { if (!g_hDebuggerMemDC) { @@ -540,7 +540,7 @@ HDC GetDebuggerMemDC(void) return g_hDebuggerMemDC; } -void ReleaseDebuggerMemDC(void) +void ReleaseDebuggerMemDC() { if (g_hDebuggerMemDC) { @@ -559,7 +559,7 @@ void ReleaseDebuggerMemDC(void) } -HDC GetConsoleFontDC(void) +HDC GetConsoleFontDC() { if (!g_hConsoleFontDC) { @@ -606,7 +606,7 @@ HDC GetConsoleFontDC(void) return g_hConsoleFontDC; } -void ReleaseConsoleFontDC(void) +void ReleaseConsoleFontDC() { if (g_hConsoleFontDC) { @@ -627,7 +627,7 @@ void ReleaseConsoleFontDC(void) } -void StretchBltMemToFrameDC(void) +void StretchBltMemToFrameDC() { Win32Frame& win32Frame = Win32Frame::GetWin32Frame(); diff --git a/source/Debugger/Debugger_Display.h b/source/Debugger/Debugger_Display.h index f3f3c2f28..79afdf742 100644 --- a/source/Debugger/Debugger_Display.h +++ b/source/Debugger/Debugger_Display.h @@ -52,11 +52,11 @@ // - extern HDC GetDebuggerMemDC(void); - extern void ReleaseDebuggerMemDC(void); - extern void StretchBltMemToFrameDC(void); - extern HDC GetConsoleFontDC(void); - extern void ReleaseConsoleFontDC(void); + extern HDC GetDebuggerMemDC(); + extern void ReleaseDebuggerMemDC(); + extern void StretchBltMemToFrameDC(); + extern HDC GetConsoleFontDC(); + extern void ReleaseConsoleFontDC(); enum DebugVirtualTextScreen_e { @@ -71,9 +71,9 @@ class VideoScannerDisplayInfo { public: - VideoScannerDisplayInfo(void) : isDecimal(false), isHorzReal(false), cycleMode(rel), - lastCumulativeCycles(0), savedCumulativeCycles(0), cycleDelta(0) {} - void Reset(void) { lastCumulativeCycles = savedCumulativeCycles = g_nCumulativeCycles; cycleDelta = 0; } + VideoScannerDisplayInfo() : isDecimal(false), isHorzReal(false), cycleMode(rel), + lastCumulativeCycles(0), savedCumulativeCycles(0), cycleDelta(0) {} + void Reset() { lastCumulativeCycles = savedCumulativeCycles = g_nCumulativeCycles; cycleDelta = 0; } bool isDecimal; bool isHorzReal; diff --git a/source/Debugger/Debugger_Parser.cpp b/source/Debugger/Debugger_Parser.cpp index 5bcc40c3c..c2c3ac42a 100644 --- a/source/Debugger/Debugger_Parser.cpp +++ b/source/Debugger/Debugger_Parser.cpp @@ -401,7 +401,7 @@ bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ ) //=========================================================================== -void ArgsRawParse ( void ) +void ArgsRawParse () { const int BASE = 16; // hex char *pSrc = NULL; diff --git a/source/Debugger/Debugger_Parser.h b/source/Debugger/Debugger_Parser.h index 4bff765cd..3de9071d5 100644 --- a/source/Debugger/Debugger_Parser.h +++ b/source/Debugger/Debugger_Parser.h @@ -54,7 +54,7 @@ inline const char* SkipUntilToken( const char *pSrc, const TokenTable_t *aTokens bool ArgsGetImmediateValue ( Arg_t *pArg, WORD * pAddressValue_ ); int ArgsGet ( char * pInput ); bool ArgsGetRegisterValue ( Arg_t *pArg, WORD * pAddressValue_ ); - void ArgsRawParse ( void ); + void ArgsRawParse (); int ArgsCook ( const int nArgs ); // const int bProcessMask ); #endif diff --git a/source/Disk.cpp b/source/Disk.cpp index 574306a8b..9c6268c80 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -94,7 +94,7 @@ Disk2InterfaceCard::Disk2InterfaceCard(UINT slot) : #endif } -Disk2InterfaceCard::~Disk2InterfaceCard(void) +Disk2InterfaceCard::~Disk2InterfaceCard() { EjectDiskInternal(DRIVE_1); EjectDiskInternal(DRIVE_2); @@ -103,15 +103,15 @@ Disk2InterfaceCard::~Disk2InterfaceCard(void) g_SynchronousEventMgr.Remove(m_syncEvent.m_id); } -bool Disk2InterfaceCard::GetEnhanceDisk(void) { return m_enhanceDisk; } +bool Disk2InterfaceCard::GetEnhanceDisk() { return m_enhanceDisk; } void Disk2InterfaceCard::SetEnhanceDisk(bool bEnhanceDisk) { m_enhanceDisk = bEnhanceDisk; } -UINT Disk2InterfaceCard::GetCurrentBitOffset (void) { return m_floppyDrive[m_currDrive].m_disk.m_bitOffset; } -double Disk2InterfaceCard::GetCurrentExtraCycles(void) { return m_floppyDrive[m_currDrive].m_disk.m_extraCycles; } -float Disk2InterfaceCard::GetCurrentPhase (void) { return m_floppyDrive[m_currDrive].m_phasePrecise; } -int Disk2InterfaceCard::GetCurrentDrive (void) { return m_currDrive; } -BYTE Disk2InterfaceCard::GetCurrentShiftReg (void) { return m_shiftReg; } -int Disk2InterfaceCard::GetCurrentTrack (void) { return ImagePhaseToTrack(m_floppyDrive[m_currDrive].m_disk.m_imagehandle, m_floppyDrive[m_currDrive].m_phasePrecise, false); } +UINT Disk2InterfaceCard::GetCurrentBitOffset () { return m_floppyDrive[m_currDrive].m_disk.m_bitOffset; } +double Disk2InterfaceCard::GetCurrentExtraCycles() { return m_floppyDrive[m_currDrive].m_disk.m_extraCycles; } +float Disk2InterfaceCard::GetCurrentPhase () { return m_floppyDrive[m_currDrive].m_phasePrecise; } +int Disk2InterfaceCard::GetCurrentDrive () { return m_currDrive; } +BYTE Disk2InterfaceCard::GetCurrentShiftReg () { return m_shiftReg; } +int Disk2InterfaceCard::GetCurrentTrack () { return ImagePhaseToTrack(m_floppyDrive[m_currDrive].m_disk.m_imagehandle, m_floppyDrive[m_currDrive].m_phasePrecise, false); } float Disk2InterfaceCard::GetPhase(const int drive) { return m_floppyDrive[drive].m_phasePrecise; } int Disk2InterfaceCard::GetTrack(const int drive) { return ImagePhaseToTrack(m_floppyDrive[drive].m_disk.m_imagehandle, m_floppyDrive[drive].m_phasePrecise, false); } @@ -128,12 +128,12 @@ std::string Disk2InterfaceCard::FormatIntFracString(float phase, bool hex) } -std::string Disk2InterfaceCard::GetCurrentTrackString(void) +std::string Disk2InterfaceCard::GetCurrentTrackString() { return FormatIntFracString(m_floppyDrive[m_currDrive].m_phasePrecise / 2, true); } -std::string Disk2InterfaceCard::GetCurrentPhaseString(void) +std::string Disk2InterfaceCard::GetCurrentPhaseString() { return FormatIntFracString(m_floppyDrive[m_currDrive].m_phasePrecise, true); } @@ -489,7 +489,7 @@ void Disk2InterfaceCard::FlushCurrentTrack(const int drive) //=========================================================================== -void Disk2InterfaceCard::Boot(void) +void Disk2InterfaceCard::Boot() { // THIS FUNCTION RELOADS A PROGRAM IMAGE IF ONE IS LOADED IN DRIVE ONE. // IF A DISK IMAGE OR NO IMAGE IS LOADED IN DRIVE ONE, IT DOES NOTHING. @@ -609,7 +609,7 @@ void __stdcall Disk2InterfaceCard::ControlStepper(WORD, WORD address, BYTE, BYTE m_deferredStepperEvent = true; } -void Disk2InterfaceCard::InsertSyncEvent(void) +void Disk2InterfaceCard::InsertSyncEvent() { m_syncEvent.m_cyclesRemaining = 10; // NB. same cycle delay for magnet off and on - but perhaps they take different times? g_SynchronousEventMgr.Insert(&m_syncEvent); @@ -622,7 +622,7 @@ int Disk2InterfaceCard::SyncEventCallback(int id, int cycles, ULONG uExecutedCyc return 0; // Don't repeat event } -void Disk2InterfaceCard::ControlStepperDeferred(void) +void Disk2InterfaceCard::ControlStepperDeferred() { m_deferredStepperEvent = false; const WORD address = m_deferredStepperAddress; @@ -700,7 +700,7 @@ void Disk2InterfaceCard::ControlStepperLogging(WORD address, unsigned __int64 cu //=========================================================================== -void Disk2InterfaceCard::Destroy(void) +void Disk2InterfaceCard::Destroy() { m_saveDiskImage = false; EjectDisk(DRIVE_1); @@ -902,7 +902,7 @@ ImageError_e Disk2InterfaceCard::InsertDisk(const int drive, const std::string& //=========================================================================== -bool Disk2InterfaceCard::IsConditionForFullSpeed(void) +bool Disk2InterfaceCard::IsConditionForFullSpeed() { return m_floppyMotorOn && m_enhanceDisk; } @@ -1185,7 +1185,7 @@ void __stdcall Disk2InterfaceCard::ReadWrite(WORD pc, WORD addr, BYTE bWrite, BY //=========================================================================== -void Disk2InterfaceCard::ResetLogicStateSequencer(void) +void Disk2InterfaceCard::ResetLogicStateSequencer() { m_shiftReg = 0; m_latchDelay = 0; @@ -1821,7 +1821,7 @@ void Disk2InterfaceCard::Reset(const bool bIsPowerCycle) GetFrame().FrameRefreshStatus(DRAW_TITLE); } -void Disk2InterfaceCard::ResetSwitches(void) +void Disk2InterfaceCard::ResetSwitches() { m_currDrive = 0; m_floppyMotorOn = 0; @@ -2004,7 +2004,7 @@ void Disk2InterfaceCard::Update(const ULONG cycles) //=========================================================================== -bool Disk2InterfaceCard::DriveSwap(void) +bool Disk2InterfaceCard::DriveSwap() { // Refuse to swap if either Disk][ is active // TODO: if Shift-Click then FORCE drive swap to bypass message @@ -2301,13 +2301,13 @@ static const UINT kUNIT_VERSION = 9; #define SS_YAML_KEY_TRACK_IMAGE_DIRTY "Track Image Dirty" #define SS_YAML_KEY_TRACK_IMAGE "Track Image" -const std::string& Disk2InterfaceCard::GetSnapshotCardNameOld(void) +const std::string& Disk2InterfaceCard::GetSnapshotCardNameOld() { static const std::string name("Disk]["); return name; } -const std::string& Disk2InterfaceCard::GetSnapshotCardName(void) +const std::string& Disk2InterfaceCard::GetSnapshotCardName() { static const std::string name("Disk II"); return name; diff --git a/source/Disk.h b/source/Disk.h index 69b08ace0..125705b95 100644 --- a/source/Disk.h +++ b/source/Disk.h @@ -137,16 +137,16 @@ class Disk2InterfaceCard : public Card { public: Disk2InterfaceCard(UINT slot); - virtual ~Disk2InterfaceCard(void); + virtual ~Disk2InterfaceCard(); virtual void Reset(const bool powerCycle); virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Update(const ULONG nExecutedCycles); - virtual void Destroy(void); // No, doesn't "destroy" the disk image. Called by CardManager::Destroy() + virtual void Destroy(); // No, doesn't "destroy" the disk image. Called by CardManager::Destroy() - void Boot(void); + void Boot(); void FlushCurrentTrack(const int drive); const std::string & GetFullDiskFilename(const int drive); @@ -160,32 +160,32 @@ class Disk2InterfaceCard : public Card void EjectDisk(const int drive); void UnplugDrive(const int drive); - bool IsConditionForFullSpeed(void); + bool IsConditionForFullSpeed(); void NotifyInvalidImage(const int drive, const std::string & szImageFilename, const ImageError_e Error); - UINT GetCurrentBitOffset(void); - UINT GetCurrentFirmware(void) { return m_is13SectorFirmware ? 13 : 16; } - double GetCurrentExtraCycles(void); - float GetCurrentPhase(void); - int GetCurrentDrive(void); - BYTE GetCurrentShiftReg(void); - int GetCurrentTrack(void); + UINT GetCurrentBitOffset(); + UINT GetCurrentFirmware() { return m_is13SectorFirmware ? 13 : 16; } + double GetCurrentExtraCycles(); + float GetCurrentPhase(); + int GetCurrentDrive(); + BYTE GetCurrentShiftReg(); + int GetCurrentTrack(); float GetPhase(const int drive); int GetTrack(const int drive); static std::string FormatIntFracString(float phase, bool hex); - std::string GetCurrentTrackString(void); - std::string GetCurrentPhaseString(void); + std::string GetCurrentTrackString(); + std::string GetCurrentPhaseString(); LPCTSTR GetCurrentState(Disk_Status_e& eDiskState_); bool UserSelectNewDiskImageOnly(const int drive, LPCSTR pszFilename, std::string& openFilename, DWORD flags); bool UserSelectNewDiskImage(const int drive, LPCSTR pszFilename=""); - bool DriveSwap(void); + bool DriveSwap(); bool IsDriveConnected(int drive) { return m_floppyDrive[drive].m_isConnected; } bool Get13SectorFirmware(); void Set13SectorFirmware(const bool is13Sector); - static const std::string& GetSnapshotCardNameOld(void); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardNameOld(); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); @@ -197,7 +197,7 @@ class Disk2InterfaceCard : public Card bool IsDriveEmpty(const int drive); bool IsWozImageInDrive(const int drive); - bool GetEnhanceDisk(void); + bool GetEnhanceDisk(); void SetEnhanceDisk(bool bEnhanceDisk); void ForbidSaveDiskImageToRegistry() { m_saveDiskImageToRegistry = false; } @@ -206,7 +206,7 @@ class Disk2InterfaceCard : public Card static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles); private: - void ResetSwitches(void); + void ResetSwitches(); void CheckSpinning(const bool stateChanged, const ULONG uExecutedCycles); Disk_Status_e GetDriveLightStatus(const int drive); bool IsDriveValid(const int drive); @@ -214,7 +214,7 @@ class Disk2InterfaceCard : public Card void AllocTrack(const int drive, const UINT minSize=NIBBLES_PER_TRACK); void ReadTrack(const int drive, ULONG uExecutedCycles); void WriteTrack(const int drive); - void ResetLogicStateSequencer(void); + void ResetLogicStateSequencer(); UINT GetBitCellDelta(const ULONG uExecutedCycles); void UpdateBitStreamPosition(FloppyDisk& floppy, const ULONG bitCellDelta); void UpdateBitStreamOffsets(FloppyDisk& floppy); @@ -228,9 +228,9 @@ class Disk2InterfaceCard : public Card bool GetFirmware(WORD lpNameId, BYTE* pDst); void InitFirmware(LPBYTE pCxRomPeripheral); void UpdateLatchForEmptyDrive(FloppyDrive* pDrive); - void InsertSyncEvent(void); + void InsertSyncEvent(); static int SyncEventCallback(int id, int cycles, ULONG uExecutedCycles); - void ControlStepperDeferred(void); + void ControlStepperDeferred(); void ControlStepperLogging(WORD address, unsigned __int64 cumulativeCycles); void PreJitterCheck(int phase, BYTE latch); diff --git a/source/Disk2CardManager.cpp b/source/Disk2CardManager.cpp index f96397cb3..43b9722d6 100644 --- a/source/Disk2CardManager.cpp +++ b/source/Disk2CardManager.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "CardManager.h" #include "Disk.h" -bool Disk2CardManager::IsConditionForFullSpeed(void) +bool Disk2CardManager::IsConditionForFullSpeed() { for (UINT i = 0; i < NUM_SLOTS; i++) { @@ -59,7 +59,7 @@ void Disk2CardManager::Update(const ULONG nExecutedCycles) } } -bool Disk2CardManager::GetEnhanceDisk(void) +bool Disk2CardManager::GetEnhanceDisk() { for (UINT i = 0; i < NUM_SLOTS; i++) { @@ -83,7 +83,7 @@ void Disk2CardManager::SetEnhanceDisk(bool enhanceDisk) } } -void Disk2CardManager::LoadLastDiskImage(void) +void Disk2CardManager::LoadLastDiskImage() { for (UINT i = 0; i < NUM_SLOTS; i++) { @@ -95,7 +95,7 @@ void Disk2CardManager::LoadLastDiskImage(void) } } -bool Disk2CardManager::IsAnyFirmware13Sector(void) +bool Disk2CardManager::IsAnyFirmware13Sector() { for (UINT i = 0; i < NUM_SLOTS; i++) { diff --git a/source/Disk2CardManager.h b/source/Disk2CardManager.h index aa0aebcac..67b9394e8 100644 --- a/source/Disk2CardManager.h +++ b/source/Disk2CardManager.h @@ -3,18 +3,18 @@ class Disk2CardManager { public: - Disk2CardManager(void) : m_stepperDeferred(true) {} - ~Disk2CardManager(void) {} + Disk2CardManager() : m_stepperDeferred(true) {} + ~Disk2CardManager() {} - bool IsConditionForFullSpeed(void); + bool IsConditionForFullSpeed(); void Update(const ULONG nExecutedCycles); - bool GetEnhanceDisk(void); + bool GetEnhanceDisk(); void SetEnhanceDisk(bool enhanceDisk); - void LoadLastDiskImage(void); - bool IsAnyFirmware13Sector(void); + void LoadLastDiskImage(); + bool IsAnyFirmware13Sector(); void GetFilenameAndPathForSaveState(std::string& filename, std::string& path); void SetStepperDefer(bool defer); - bool IsStepperDeferred(void) { return m_stepperDeferred; } + bool IsStepperDeferred() { return m_stepperDeferred; } private: bool m_stepperDeferred; // debug: can disable via cmd-line diff --git a/source/DiskFormatTrack.cpp b/source/DiskFormatTrack.cpp index 97da564de..7207a7903 100644 --- a/source/DiskFormatTrack.cpp +++ b/source/DiskFormatTrack.cpp @@ -51,7 +51,7 @@ Writes the following: (in 1 continuous write operation) // Occurs on these conditions: // . ctor // . disk][ reset -void FormatTrack::Reset(void) +void FormatTrack::Reset() { memset(m_VolTrkSecChk, 0, sizeof(m_VolTrkSecChk)); memset(m_VolTrkSecChk4and4, 0, sizeof(m_VolTrkSecChk4and4)); @@ -67,7 +67,7 @@ void FormatTrack::Reset(void) // . drive stepper track change // . drive motor state change // . switch to read mode after having written a complete track -void FormatTrack::DriveNotWritingTrack(void) +void FormatTrack::DriveNotWritingTrack() { m_bmWrittenSectorAddrFields = 0x0000; m_WriteTrackStartIndex = 0; diff --git a/source/DiskFormatTrack.h b/source/DiskFormatTrack.h index a2dd27347..3b473bd7e 100644 --- a/source/DiskFormatTrack.h +++ b/source/DiskFormatTrack.h @@ -34,15 +34,15 @@ class FormatTrack // Monitor for formatting of track Reset(); }; - ~FormatTrack(void) {}; + ~FormatTrack() {} - void Reset(void); - void DriveNotWritingTrack(void); + void Reset(); + void DriveNotWritingTrack(); void DriveSwitchedToReadMode(class FloppyDisk* const pFloppy); void DriveSwitchedToWriteMode(UINT uTrackIndex); void DecodeLatchNibbleRead(BYTE floppylatch); void DecodeLatchNibbleWrite(BYTE floppylatch, UINT uSpinNibbleCount, const class FloppyDisk* const pFloppy, bool bIsSyncFF); - std::string GetReadD5AAxxDetectedString(void) { std::string tmp = m_strReadD5AAxxDetected; m_strReadD5AAxxDetected = ""; return tmp; } + std::string GetReadD5AAxxDetectedString() { std::string tmp = m_strReadD5AAxxDetected; m_strReadD5AAxxDetected = ""; return tmp; } void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void LoadSnapshot(class YamlLoadHelper& yamlLoadHelper); diff --git a/source/DiskImageHelper.cpp b/source/DiskImageHelper.cpp index 289deabd2..b88317048 100644 --- a/source/DiskImageHelper.cpp +++ b/source/DiskImageHelper.cpp @@ -650,8 +650,8 @@ bool CImageBase::IsValidImageSize(const uint32_t uImageSize) class CDoImage : public CImageBase { public: - CDoImage(void) {} - virtual ~CDoImage(void) {} + CDoImage() {} + virtual ~CDoImage() {} virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -704,12 +704,12 @@ class CDoImage : public CImageBase WriteTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE); } - virtual bool AllowCreate(void) { return true; } - virtual UINT GetImageSizeForCreate(void) { m_uNumTracksInImage = TRACKS_STANDARD; return TRACK_DENIBBLIZED_SIZE * TRACKS_STANDARD; } + virtual bool AllowCreate() { return true; } + virtual UINT GetImageSizeForCreate() { m_uNumTracksInImage = TRACKS_STANDARD; return TRACK_DENIBBLIZED_SIZE * TRACKS_STANDARD; } - virtual eImageType GetType(void) { return eImageDO; } - virtual const char* GetCreateExtensions(void) { return ".do;.dsk"; } - virtual const char* GetRejectExtensions(void) { return ".nib;.iie;.po;.prg"; } + virtual eImageType GetType() { return eImageDO; } + virtual const char* GetCreateExtensions() { return ".do;.dsk"; } + virtual const char* GetRejectExtensions() { return ".nib;.iie;.po;.prg"; } }; //------------------------------------- @@ -718,8 +718,8 @@ class CDoImage : public CImageBase class CPoImage : public CImageBase { public: - CPoImage(void) {} - virtual ~CPoImage(void) {} + CPoImage() {} + virtual ~CPoImage() {} virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -772,9 +772,9 @@ class CPoImage : public CImageBase WriteTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE); } - virtual eImageType GetType(void) { return eImagePO; } - virtual const char* GetCreateExtensions(void) { return ".po"; } - virtual const char* GetRejectExtensions(void) { return ".do;.iie;.nib;.prg;.woz"; } + virtual eImageType GetType() { return eImagePO; } + virtual const char* GetCreateExtensions() { return ".po"; } + virtual const char* GetRejectExtensions() { return ".do;.iie;.nib;.prg;.woz"; } }; //------------------------------------- @@ -783,8 +783,8 @@ class CPoImage : public CImageBase class CNib1Image : public CImageBase { public: - CNib1Image(void) {} - virtual ~CNib1Image(void) {} + CNib1Image() {} + virtual ~CNib1Image() {} static const UINT NIB1_TRACK_SIZE = NIBBLES_PER_TRACK_NIB; @@ -836,12 +836,12 @@ class CNib1Image : public CImageBase WriteTrack(pImageInfo, track, pTrackImageBuffer, nNibbles); } - virtual bool AllowCreate(void) { return true; } - virtual UINT GetImageSizeForCreate(void) { m_uNumTracksInImage = TRACKS_STANDARD; return NIB1_TRACK_SIZE * TRACKS_STANDARD; } + virtual bool AllowCreate() { return true; } + virtual UINT GetImageSizeForCreate() { m_uNumTracksInImage = TRACKS_STANDARD; return NIB1_TRACK_SIZE * TRACKS_STANDARD; } - virtual eImageType GetType(void) { return eImageNIB1; } - virtual const char* GetCreateExtensions(void) { return ".nib"; } - virtual const char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg;.woz"; } + virtual eImageType GetType() { return eImageNIB1; } + virtual const char* GetCreateExtensions() { return ".nib"; } + virtual const char* GetRejectExtensions() { return ".do;.iie;.po;.prg;.woz"; } }; //------------------------------------- @@ -850,8 +850,8 @@ class CNib1Image : public CImageBase class CNib2Image : public CImageBase { public: - CNib2Image(void) {} - virtual ~CNib2Image(void) {} + CNib2Image() {} + virtual ~CNib2Image() {} static const UINT NIB2_TRACK_SIZE = 6384; @@ -878,9 +878,9 @@ class CNib2Image : public CImageBase WriteTrack(pImageInfo, track, pTrackImageBuffer, nNibbles); } - virtual eImageType GetType(void) { return eImageNIB2; } - virtual const char* GetCreateExtensions(void) { return ".nb2"; } - virtual const char* GetRejectExtensions(void) { return ".do;.iie;.po;.prg;.woz;.2mg;.2img"; } + virtual eImageType GetType() { return eImageNIB2; } + virtual const char* GetCreateExtensions() { return ".nb2"; } + virtual const char* GetRejectExtensions() { return ".do;.iie;.po;.prg;.woz;.2mg;.2img"; } }; //------------------------------------- @@ -889,8 +889,8 @@ class CNib2Image : public CImageBase class CHDVImage : public CImageBase { public: - CHDVImage(void) {} - virtual ~CHDVImage(void) {} + CHDVImage() {} + virtual ~CHDVImage() {} virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -919,9 +919,9 @@ class CHDVImage : public CImageBase return WriteBlock(pImageInfo, nBlock, pBlockBuffer); } - virtual eImageType GetType(void) { return eImageHDV; } - virtual const char* GetCreateExtensions(void) { return ".hdv"; } - virtual const char* GetRejectExtensions(void) { return ".do;.iie;.prg"; } + virtual eImageType GetType() { return eImageHDV; } + virtual const char* GetCreateExtensions() { return ".hdv"; } + virtual const char* GetRejectExtensions() { return ".do;.iie;.prg"; } }; //------------------------------------- @@ -930,8 +930,8 @@ class CHDVImage : public CImageBase class CIIeImage : public CImageBase { public: - CIIeImage(void) : m_pHeader(NULL) {} - virtual ~CIIeImage(void) { delete [] m_pHeader; } + CIIeImage() : m_pHeader(NULL) {} + virtual ~CIIeImage() { delete [] m_pHeader; } virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -985,9 +985,9 @@ class CIIeImage : public CImageBase // note: unimplemented } - virtual eImageType GetType(void) { return eImageIIE; } - virtual const char* GetCreateExtensions(void) { return ".iie"; } - virtual const char* GetRejectExtensions(void) { return ".do.;.nib;.po;.prg;.woz;.2mg;.2img"; } + virtual eImageType GetType() { return eImageIIE; } + virtual const char* GetCreateExtensions() { return ".iie"; } + virtual const char* GetRejectExtensions() { return ".do.;.nib;.po;.prg;.woz;.2mg;.2img"; } private: void ConvertSectorOrder(LPBYTE sourceorder) @@ -1020,8 +1020,8 @@ class CIIeImage : public CImageBase class CAplImage : public CImageBase { public: - CAplImage(void) {} - virtual ~CAplImage(void) {} + CAplImage() {} + virtual ~CAplImage() {} virtual bool Boot(ImageInfo* ptr) { @@ -1056,12 +1056,12 @@ class CAplImage : public CImageBase return !bRes ? eMismatch : ePossibleMatch; } - virtual bool AllowBoot(void) { return true; } - virtual bool AllowRW(void) { return false; } + virtual bool AllowBoot() { return true; } + virtual bool AllowRW() { return false; } - virtual eImageType GetType(void) { return eImageAPL; } - virtual const char* GetCreateExtensions(void) { return ".apl"; } - virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.woz;.2mg;.2img"; } + virtual eImageType GetType() { return eImageAPL; } + virtual const char* GetCreateExtensions() { return ".apl"; } + virtual const char* GetRejectExtensions() { return ".do;.dsk;.iie;.nib;.po;.woz;.2mg;.2img"; } }; //------------------------------------- @@ -1069,8 +1069,8 @@ class CAplImage : public CImageBase class CPrgImage : public CImageBase { public: - CPrgImage(void) {} - virtual ~CPrgImage(void) {} + CPrgImage() {} + virtual ~CPrgImage() {} virtual bool Boot(ImageInfo* pImageInfo) { @@ -1107,12 +1107,12 @@ class CPrgImage : public CImageBase return (*(LPDWORD)pImage == 0x214C470A) ? eMatch : eMismatch; // "!LG\x0A" } - virtual bool AllowBoot(void) { return true; } - virtual bool AllowRW(void) { return false; } + virtual bool AllowBoot() { return true; } + virtual bool AllowRW() { return false; } - virtual eImageType GetType(void) { return eImagePRG; } - virtual const char* GetCreateExtensions(void) { return ".prg"; } - virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.iie;.nib;.po;.woz;.2mg;.2img"; } + virtual eImageType GetType() { return eImagePRG; } + virtual const char* GetCreateExtensions() { return ".prg"; } + virtual const char* GetRejectExtensions() { return ".do;.dsk;.iie;.nib;.po;.woz;.2mg;.2img"; } }; //------------------------------------- @@ -1120,7 +1120,7 @@ class CPrgImage : public CImageBase class CWOZImageHelper { public: - CWOZImageHelper(void) + CWOZImageHelper() { m_pWOZEmptyTrack = new BYTE[CWOZHelper::EMPTY_TRACK_SIZE]; @@ -1136,7 +1136,7 @@ class CWOZImageHelper m_pWOZEmptyTrack[i] = n; } } - virtual ~CWOZImageHelper(void) { delete [] m_pWOZEmptyTrack; } + virtual ~CWOZImageHelper() { delete [] m_pWOZEmptyTrack; } void ReadEmptyTrack(LPBYTE pTrackImageBuffer, int* pNibbles, UINT* pBitCount) { @@ -1163,8 +1163,8 @@ class CWOZImageHelper class CWOZ1Image : public CImageBase, private CWOZImageHelper { public: - CWOZ1Image(void) {} - virtual ~CWOZ1Image(void) {} + CWOZ1Image() {} + virtual ~CWOZ1Image() {} virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -1274,9 +1274,9 @@ class CWOZ1Image : public CImageBase, private CWOZImageHelper } } - virtual eImageType GetType(void) { return eImageWOZ1; } - virtual const char* GetCreateExtensions(void) { return ".woz"; } - virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.nib;.iie;.po;.prg"; } + virtual eImageType GetType() { return eImageWOZ1; } + virtual const char* GetCreateExtensions() { return ".woz"; } + virtual const char* GetRejectExtensions() { return ".do;.dsk;.nib;.iie;.po;.prg"; } }; //------------------------------------- @@ -1284,8 +1284,8 @@ class CWOZ1Image : public CImageBase, private CWOZImageHelper class CWOZ2Image : public CImageBase, private CWOZImageHelper { public: - CWOZ2Image(void) {} - virtual ~CWOZ2Image(void) {} + CWOZ2Image() {} + virtual ~CWOZ2Image() {} virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) { @@ -1406,12 +1406,12 @@ class CWOZ2Image : public CImageBase, private CWOZImageHelper } } - virtual bool AllowCreate(void) { return true; } - virtual UINT GetImageSizeForCreate(void) { m_uNumTracksInImage = CWOZHelper::MAX_TRACKS_5_25; return sizeof(CWOZHelper::WOZHeader); } + virtual bool AllowCreate() { return true; } + virtual UINT GetImageSizeForCreate() { m_uNumTracksInImage = CWOZHelper::MAX_TRACKS_5_25; return sizeof(CWOZHelper::WOZHeader); } - virtual eImageType GetType(void) { return eImageWOZ2; } - virtual const char* GetCreateExtensions(void) { return ".woz"; } - virtual const char* GetRejectExtensions(void) { return ".do;.dsk;.nib;.iie;.po;.prg"; } + virtual eImageType GetType() { return eImageWOZ2; } + virtual const char* GetCreateExtensions() { return ".woz"; } + virtual const char* GetRejectExtensions() { return ".do;.dsk;.nib;.iie;.po;.prg"; } }; //----------------------------------------------------------------------------- @@ -1500,7 +1500,7 @@ eDetectResult C2IMGHelper::DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint return eMatch; } -BYTE C2IMGHelper::GetVolumeNumber(void) +BYTE C2IMGHelper::GetVolumeNumber() { if (m_Hdr.ImageFormat != e2IMGFormatDOS33 || !m_Hdr.Flags.bDOS33VolumeNumberValid) return DEFAULT_VOLUME_NUMBER; @@ -1508,7 +1508,7 @@ BYTE C2IMGHelper::GetVolumeNumber(void) return m_Hdr.Flags.VolumeNumber; } -bool C2IMGHelper::IsLocked(void) +bool C2IMGHelper::IsLocked() { return m_Hdr.Flags.bDiskImageLocked; } @@ -2054,7 +2054,7 @@ bool CImageHelperBase::WOZUpdateInfo(ImageInfo* pImageInfo, uint32_t& dwOffset) //----------------------------------------------------------------------------- -CDiskImageHelper::CDiskImageHelper(void) : +CDiskImageHelper::CDiskImageHelper() : CImageHelperBase(true) { m_vecImageTypes.push_back( new CWOZ1Image ); // Try to match WOZ1/WOZ2 first, as these can be precisely matched @@ -2181,7 +2181,7 @@ CImageBase* CDiskImageHelper::GetImageForCreation(const char* pszExt, uint32_t* return NULL; } -UINT CDiskImageHelper::GetMaxImageSize(void) +UINT CDiskImageHelper::GetMaxImageSize() { // Pathologic largest 5.25 image is a WOZ with FLUX tracks for each 0.25 track (GH#1240) const UINT largestFluxTrackInBlocks = 100; // typically this is 70-80 blocks @@ -2198,7 +2198,7 @@ UINT CDiskImageHelper::GetMinDetectSize(const UINT uImageSize, bool* pTempDetect //----------------------------------------------------------------------------- -CHardDiskImageHelper::CHardDiskImageHelper(void) : +CHardDiskImageHelper::CHardDiskImageHelper() : CImageHelperBase(false) { m_vecImageTypes.push_back( new CHDVImage ); @@ -2266,7 +2266,7 @@ CImageBase* CHardDiskImageHelper::GetImageForCreation(const char* pszExt, uint32 return NULL; } -UINT CHardDiskImageHelper::GetMaxImageSize(void) +UINT CHardDiskImageHelper::GetMaxImageSize() { // TODO: This doesn't account for .2mg files with comments after the disk-image return HARDDISK_32M_SIZE + m_2IMGHelper.GetMaxHdrSize(); diff --git a/source/DiskImageHelper.h b/source/DiskImageHelper.h index 156f5c16f..fb57fda8a 100644 --- a/source/DiskImageHelper.h +++ b/source/DiskImageHelper.h @@ -56,8 +56,8 @@ struct ImageInfo class CImageBase { public: - CImageBase(void); - virtual ~CImageBase(void); + CImageBase(); + virtual ~CImageBase(); virtual bool Boot(ImageInfo* pImageInfo) { return false; } virtual eDetectResult Detect(const LPBYTE pImage, const uint32_t dwImageSize, const char* pszExt) = 0; @@ -66,14 +66,14 @@ class CImageBase virtual void Write(ImageInfo* pImageInfo, const float phase, LPBYTE pTrackImageBuffer, int nNibbles) { } virtual bool Write(ImageInfo* pImageInfo, UINT nBlock, LPBYTE pBlockBuffer) { return false; } - virtual bool AllowBoot(void) { return false; } // Only: APL and PRG - virtual bool AllowRW(void) { return true; } // All but: APL and PRG - virtual bool AllowCreate(void) { return false; } // WE CREATE ONLY DOS ORDER (DO) OR 6656-NIBBLE (NIB) FORMAT FILES - virtual UINT GetImageSizeForCreate(void) { _ASSERT(0); return (UINT)-1; } + virtual bool AllowBoot() { return false; } // Only: APL and PRG + virtual bool AllowRW() { return true; } // All but: APL and PRG + virtual bool AllowCreate() { return false; } // WE CREATE ONLY DOS ORDER (DO) OR 6656-NIBBLE (NIB) FORMAT FILES + virtual UINT GetImageSizeForCreate() { _ASSERT(0); return (UINT)-1; } - virtual eImageType GetType(void) = 0; - virtual const char* GetCreateExtensions(void) = 0; - virtual const char* GetRejectExtensions(void) = 0; + virtual eImageType GetType() = 0; + virtual const char* GetCreateExtensions() = 0; + virtual const char* GetRejectExtensions() = 0; bool WriteImageHeader(ImageInfo* pImageInfo, LPBYTE pHdr, const UINT hdrSize); void SetVolumeNumber(const BYTE uVolumeNumber) { m_uVolumeNumber = uVolumeNumber; } @@ -115,19 +115,19 @@ class CHdrHelper { public: virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) = 0; - virtual UINT GetMaxHdrSize(void) = 0; + virtual UINT GetMaxHdrSize() = 0; protected: - CHdrHelper(void) {} - virtual ~CHdrHelper(void) {} + CHdrHelper() {} + virtual ~CHdrHelper() {} }; class CMacBinaryHelper : public CHdrHelper { public: - CMacBinaryHelper(void) {} - virtual ~CMacBinaryHelper(void) {} + CMacBinaryHelper() {} + virtual ~CMacBinaryHelper() {} virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset); - virtual UINT GetMaxHdrSize(void) { return uMacBinHdrSize; } + virtual UINT GetMaxHdrSize() { return uMacBinHdrSize; } private: static const UINT uMacBinHdrSize = 128; @@ -146,13 +146,13 @@ class C2IMGHelper : public CHdrHelper { public: C2IMGHelper(const bool bIsFloppy) : m_bIsFloppy(bIsFloppy) {} - virtual ~C2IMGHelper(void) {} + virtual ~C2IMGHelper() {} virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset); - virtual UINT GetMaxHdrSize(void) { return sizeof(Header2IMG); } - BYTE GetVolumeNumber(void); - bool IsLocked(void); - bool IsImageFormatDOS33(void) { return m_Hdr.ImageFormat == e2IMGFormatDOS33; } - bool IsImageFormatProDOS(void) { return m_Hdr.ImageFormat == e2IMGFormatProDOS; } + virtual UINT GetMaxHdrSize() { return sizeof(Header2IMG); } + BYTE GetVolumeNumber(); + bool IsLocked(); + bool IsImageFormatDOS33() { return m_Hdr.ImageFormat == e2IMGFormatDOS33; } + bool IsImageFormatProDOS() { return m_Hdr.ImageFormat == e2IMGFormatProDOS; } private: static const UINT32 FormatID_2IMG = 'GMI2'; // '2IMG' @@ -205,15 +205,15 @@ class CWOZHelper : public CHdrHelper CWOZHelper() : m_pInfo(NULL) {} - virtual ~CWOZHelper(void) {} + virtual ~CWOZHelper() {} virtual eDetectResult DetectHdr(LPBYTE& pImage, uint32_t& dwImageSize, uint32_t& dwOffset) { _ASSERT(0); return eMismatch; } - virtual UINT GetMaxHdrSize(void) { return sizeof(WOZHeader); } + virtual UINT GetMaxHdrSize() { return sizeof(WOZHeader); } eDetectResult ProcessChunks(ImageInfo* pImageInfo, uint32_t& dwOffset); - bool IsWriteProtected(void) { return m_pInfo->v1.writeProtected == 1; } - BYTE GetOptimalBitTiming(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->optimalBitTiming : InfoChunkv2::optimalBitTiming5_25; } - UINT GetMaxNibblesPerTrack(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->largestTrack*CWOZHelper::BLOCK_SIZE : WOZ1_TRACK_SIZE; } - BYTE GetBootSectorFormat(void) { return (m_pInfo->v1.version >= 2) ? m_pInfo->bootSectorFormat : bootUnknown; } - void InvalidateInfo(void) { m_pInfo = NULL; } + bool IsWriteProtected() { return m_pInfo->v1.writeProtected == 1; } + BYTE GetOptimalBitTiming() { return (m_pInfo->v1.version >= 2) ? m_pInfo->optimalBitTiming : InfoChunkv2::optimalBitTiming5_25; } + UINT GetMaxNibblesPerTrack() { return (m_pInfo->v1.version >= 2) ? m_pInfo->largestTrack*CWOZHelper::BLOCK_SIZE : WOZ1_TRACK_SIZE; } + BYTE GetBootSectorFormat() { return (m_pInfo->v1.version >= 2) ? m_pInfo->bootSectorFormat : bootUnknown; } + void InvalidateInfo() { m_pInfo = NULL; } BYTE* CreateEmptyDisk(uint32_t& size); #if _DEBUG BYTE* CreateEmptyDiskv1(uint32_t& size); @@ -370,7 +370,7 @@ class CImageHelperBase m_WOZHelper() { } - virtual ~CImageHelperBase(void) + virtual ~CImageHelperBase() { for (UINT i=0; im_uNumTracksInImage; } @@ -445,11 +445,11 @@ class CDiskImageHelper : public CImageHelperBase class CHardDiskImageHelper : public CImageHelperBase { public: - CHardDiskImageHelper(void); - virtual ~CHardDiskImageHelper(void) {} + CHardDiskImageHelper(); + virtual ~CHardDiskImageHelper() {} virtual CImageBase* Detect(LPBYTE pImage, uint32_t dwSize, const char* pszExt, uint32_t& dwOffset, ImageInfo* pImageInfo); virtual CImageBase* GetImageForCreation(const char* pszExt, uint32_t* pCreateImageSize); - virtual UINT GetMaxImageSize(void); + virtual UINT GetMaxImageSize(); virtual UINT GetMinDetectSize(const UINT uImageSize, bool* pTempDetectBuffer); }; diff --git a/source/FourPlay.cpp b/source/FourPlay.cpp index e537cd335..e1bf1c25b 100644 --- a/source/FourPlay.cpp +++ b/source/FourPlay.cpp @@ -130,7 +130,7 @@ void FourPlayCard::InitializeIO(LPBYTE pCxRomPeripheral) static const UINT kUNIT_VERSION = 1; -const std::string& FourPlayCard::GetSnapshotCardName(void) +const std::string& FourPlayCard::GetSnapshotCardName() { static const std::string name("4Play"); return name; diff --git a/source/FourPlay.h b/source/FourPlay.h index 71e063c62..0d02ebfa7 100644 --- a/source/FourPlay.h +++ b/source/FourPlay.h @@ -9,9 +9,9 @@ class FourPlayCard : public Card Card(CT_FourPlay, slot) { } - virtual ~FourPlayCard(void) {} + virtual ~FourPlayCard() {} - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle) {} virtual void Update(const ULONG nExecutedCycles) {} @@ -19,7 +19,7 @@ class FourPlayCard : public Card static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/FrameBase.cpp b/source/FrameBase.cpp index 33b1e26c2..5606aef43 100644 --- a/source/FrameBase.cpp +++ b/source/FrameBase.cpp @@ -30,7 +30,7 @@ void FrameBase::VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bR VideoPresentScreen(); } -void FrameBase::VideoRedrawScreen(void) +void FrameBase::VideoRedrawScreen() { // NB. Can't rely on g_uVideoMode being non-zero (ie. so it can double up as a flag) since 'GR,PAGE1,non-mixed' mode == 0x00. VideoRefreshScreen(GetVideo().GetVideoMode(), true); diff --git a/source/FrameBase.h b/source/FrameBase.h index 9a7276ca6..ab627804f 100644 --- a/source/FrameBase.h +++ b/source/FrameBase.h @@ -21,7 +21,7 @@ class FrameBase bool g_bFreshReset; virtual void Initialize(bool resetVideoState) = 0; - virtual void Destroy(void) = 0; + virtual void Destroy() = 0; virtual void FrameDrawDiskLEDS() = 0; virtual void FrameDrawDiskStatus() = 0; @@ -39,8 +39,8 @@ class FrameBase virtual void SetLoadedSaveStateFlag(const bool bFlag) = 0; - virtual void VideoPresentScreen(void) = 0; - virtual void ResizeWindow(void) = 0; + virtual void VideoPresentScreen() = 0; + virtual void ResizeWindow() = 0; // this function has the same interface as MessageBox in windows.h virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType) = 0; @@ -65,7 +65,7 @@ class FrameBase virtual void Restart() = 0; void VideoRefreshScreen(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen); - void VideoRedrawScreen(void); + void VideoRedrawScreen(); void VideoRedrawScreenDuringFullSpeed(uint32_t dwCyclesThisFrame, bool bInit = false); void VideoRedrawScreenAfterFullSpeed(uint32_t dwCyclesThisFrame); void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename); @@ -76,7 +76,7 @@ class FrameBase void SetDisplayPrintScreenFileName(bool state) { g_bDisplayPrintScreenFileName = state; } void Video_ResetScreenshotCounter(const std::string& pDiskImageFileName); - bool GetShowPrintScreenWarningDialog(void) { return g_bShowPrintScreenWarningDialog; } + bool GetShowPrintScreenWarningDialog() { return g_bShowPrintScreenWarningDialog; } void SetShowPrintScreenWarningDialog(bool state) { g_bShowPrintScreenWarningDialog = state; } private: diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index 76bcc95ec..2f463d0bb 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -189,7 +189,7 @@ HarddiskInterfaceCard::HarddiskInterfaceCard(UINT slot) : m_useHdcFirmwareMode = (HdcMode)tmp; } -HarddiskInterfaceCard::~HarddiskInterfaceCard(void) +HarddiskInterfaceCard::~HarddiskInterfaceCard() { for (UINT i = HARDDISK_1; i < NUM_HARDDISKS; i++) CleanupDriveInternal(i); @@ -406,7 +406,7 @@ void HarddiskInterfaceCard::GetFilenameAndPathForSaveState(std::string& filename //=========================================================================== -void HarddiskInterfaceCard::Destroy(void) +void HarddiskInterfaceCard::Destroy() { for (UINT i = HARDDISK_1; i < NUM_HARDDISKS; i++) { @@ -1009,7 +1009,7 @@ BYTE __stdcall HarddiskInterfaceCard::IOWrite(WORD pc, WORD addr, BYTE bWrite, B //=========================================================================== -void HarddiskInterfaceCard::FixupUnitNum(void) +void HarddiskInterfaceCard::FixupUnitNum() { if (!m_isFirmwareV1or2) return; @@ -1019,7 +1019,7 @@ void HarddiskInterfaceCard::FixupUnitNum(void) m_unitNum = (m_unitNum & 0x8F) | (m_slot << 4); } -BYTE HarddiskInterfaceCard::GetNumConnectedDevices(void) +BYTE HarddiskInterfaceCard::GetNumConnectedDevices() { // Scan backwards to find the index of the last attached HDD int numDevices = NUM_HARDDISKS - 1; @@ -1033,14 +1033,14 @@ BYTE HarddiskInterfaceCard::GetNumConnectedDevices(void) return numDevices + 1; } -BYTE HarddiskInterfaceCard::GetProDOSBlockDeviceUnit(void) +BYTE HarddiskInterfaceCard::GetProDOSBlockDeviceUnit() { const BYTE slotFromUnitNum = (m_unitNum >> 4) & 7; const BYTE offset = (slotFromUnitNum == m_slot) ? 0 : 2; return offset + (m_unitNum >> 7); // bit7 = drive select } -HardDiskDrive* HarddiskInterfaceCard::GetUnit(void) +HardDiskDrive* HarddiskInterfaceCard::GetUnit() { const bool isSmartPortCmd = !!(m_command & SP_Cmd_base); @@ -1236,7 +1236,7 @@ void HarddiskInterfaceCard::GetLightStatus(Disk_Status_e *pDisk1Status) //=========================================================================== -bool HarddiskInterfaceCard::ImageSwap(void) +bool HarddiskInterfaceCard::ImageSwap() { std::swap(m_hardDiskDrive[HARDDISK_1], m_hardDiskDrive[HARDDISK_2]); @@ -1279,13 +1279,13 @@ static const UINT kUNIT_VERSION = 6; #define SS_YAML_KEY_FIFO_INDEX "FIFO Index" #define SS_YAML_KEY_FIRMWARE "Firmware" -const std::string& HarddiskInterfaceCard::GetSnapshotCardNameOld(void) +const std::string& HarddiskInterfaceCard::GetSnapshotCardNameOld() { static const std::string name("Generic HDD"); return name; } -const std::string& HarddiskInterfaceCard::GetSnapshotCardName(void) +const std::string& HarddiskInterfaceCard::GetSnapshotCardName() { static const std::string name("Hard Disk Controller"); return name; diff --git a/source/Harddisk.h b/source/Harddisk.h index 6f37c4fb1..249153c69 100644 --- a/source/Harddisk.h +++ b/source/Harddisk.h @@ -49,11 +49,11 @@ const UINT kMaxSmartPortUnits = NUM_HARDDISKS; class HardDiskDrive { public: - HardDiskDrive(void) + HardDiskDrive() { clear(); } - ~HardDiskDrive(void) {} + ~HardDiskDrive() {} void clear() { @@ -95,13 +95,13 @@ class HarddiskInterfaceCard : public Card { public: HarddiskInterfaceCard(UINT slot); - virtual ~HarddiskInterfaceCard(void); + virtual ~HarddiskInterfaceCard(); virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles) {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); - virtual void Destroy(void); + virtual void Destroy(); const std::string& GetFullName(const int iDrive); const std::string& HarddiskGetFullPathName(const int iDrive); void GetFilenameAndPathForSaveState(std::string& filename, std::string& path); @@ -111,18 +111,18 @@ class HarddiskInterfaceCard : public Card void NotifyInvalidImage(const std::string& szImageFilename); void LoadLastDiskImage(const int drive); void SetUserNumBlocks(UINT numBlocks) { m_userNumBlocks = numBlocks; } - void UseHdcFirmwareV1(void) { m_useHdcFirmwareV1 = true; } - void UseHdcFirmwareV2(void) { m_useHdcFirmwareV2 = true; } + void UseHdcFirmwareV1() { m_useHdcFirmwareV1 = true; } + void UseHdcFirmwareV2() { m_useHdcFirmwareV2 = true; } HdcMode GetHdcFirmwareMode(); void SetHdcFirmwareMode(HdcMode hdcMode); void GetLightStatus(Disk_Status_e* pDisk1Status); - bool ImageSwap(void); + bool ImageSwap(); void ForbidSaveDiskImageToRegistry() { m_saveDiskImageToRegistry = false; } - static const std::string& GetSnapshotCardNameOld(void); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardNameOld(); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); @@ -136,10 +136,10 @@ class HarddiskInterfaceCard : public Card const std::string& DiskGetBaseName(const int iDrive); bool SelectImage(const int drive, LPCSTR pszFilename); void UpdateLightStatus(HardDiskDrive* pHDD); - void FixupUnitNum(void); - BYTE GetNumConnectedDevices(void); - BYTE GetProDOSBlockDeviceUnit(void); - HardDiskDrive* GetUnit(void); + void FixupUnitNum(); + BYTE GetNumConnectedDevices(); + BYTE GetProDOSBlockDeviceUnit(); + HardDiskDrive* GetUnit(); BYTE CmdExecute(HardDiskDrive* pHDD, const ULONG nExecutedCycles); BYTE CmdStatus(HardDiskDrive* pHDD); void SetIdString(std::vector& status, const std::string& idStr); diff --git a/source/Interface.h b/source/Interface.h index bc13d7f0f..8a262d437 100644 --- a/source/Interface.h +++ b/source/Interface.h @@ -9,10 +9,10 @@ // nor the actual rendering of the video buffer to screen #include "Video.h" -Video& GetVideo(void); +Video& GetVideo(); #include "Configuration/IPropertySheet.h" -IPropertySheet& GetPropertySheet(void); +IPropertySheet& GetPropertySheet(); #include "FrameBase.h" -FrameBase& GetFrame(void); +FrameBase& GetFrame(); diff --git a/source/Joystick.cpp b/source/Joystick.cpp index 604572b1c..e69959852 100644 --- a/source/Joystick.cpp +++ b/source/Joystick.cpp @@ -120,12 +120,12 @@ void JoySetHookAltKeys(bool hook) g_bHookAltKeys = hook; } -int GetJoystick1(void) +int GetJoystick1() { return JOYSTICK_1; } -int GetJoystick2(void) +int GetJoystick2() { return JOYSTICK_2; } @@ -572,7 +572,7 @@ BYTE __stdcall JoyportReadButton(WORD address, ULONG nExecutedCycles) return MemReadFloatingBus(pressed, nExecutedCycles); } -static BOOL CheckButton0Pressed(void) +static BOOL CheckButton0Pressed() { BOOL pressed = joybutton[0] || setbutton[0] || @@ -584,7 +584,7 @@ static BOOL CheckButton0Pressed(void) return pressed; } -static BOOL CheckButton1Pressed(void) +static BOOL CheckButton1Pressed() { BOOL pressed = joybutton[1] || setbutton[1] || @@ -1037,7 +1037,7 @@ void JoyportControl(const UINT uControl) #define SS_YAML_KEY_JOY1TRIMY "Joystick1 TrimY" #define SS_YAML_KEY_PDL_INACTIVE_CYCLE "Paddle%1d Inactive Cycle" -static const std::string& JoyGetSnapshotStructName(void) +static const std::string& JoyGetSnapshotStructName() { static const std::string name("Joystick"); return name; diff --git a/source/Joystick.h b/source/Joystick.h index c93ada726..249dd1e1e 100644 --- a/source/Joystick.h +++ b/source/Joystick.h @@ -30,8 +30,8 @@ short JoyGetTrim(bool bAxisX); void JoyportControl(const UINT uControl); void JoySetHookAltKeys(bool hook); void JoySetButtonVirtualKey(UINT button, UINT virtKey); -int GetJoystick1(void); -int GetJoystick2(void); +int GetJoystick1(); +int GetJoystick2(); void JoySaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void JoyLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/Keyboard.cpp b/source/Keyboard.cpp index f0b20c85b..60f6a92b7 100644 --- a/source/Keyboard.cpp +++ b/source/Keyboard.cpp @@ -401,7 +401,7 @@ void KeybAnyKeyDown(UINT message, WPARAM wparam, bool bIsExtended) } } -static bool IsAKD(void) +static bool IsAKD() { uint64_t* p = &g_AKDFlags[0][0]; @@ -414,7 +414,7 @@ static bool IsAKD(void) //=========================================================================== -BYTE KeybReadData (void) +BYTE KeybReadData() { LogFileTimeUntilFirstKeyRead(); @@ -427,14 +427,14 @@ BYTE KeybReadData (void) //=========================================================================== -BYTE KeybClearStrobe(void) +BYTE KeybClearStrobe() { keywaiting = 0; return ClipboardReadOrPeek(true); } -BYTE KeybReadFlag (void) +BYTE KeybReadFlag() { _ASSERT(!IS_APPLE2); // And also not Pravets machines? @@ -448,7 +448,7 @@ BYTE KeybReadFlag (void) } //=========================================================================== -void KeybToggleCapsLock () +void KeybToggleCapsLock() { if (!IS_APPLE2) { @@ -462,7 +462,7 @@ void KeybToggleCapsLock () #define SS_YAML_KEY_LASTKEY "Last Key" #define SS_YAML_KEY_KEYWAITING "Key Waiting" -static const std::string& KeybGetSnapshotStructName(void) +static const std::string& KeybGetSnapshotStructName() { static const std::string name("Keyboard"); return name; diff --git a/source/Keyboard.h b/source/Keyboard.h index a1526f004..c3c27b0b3 100644 --- a/source/Keyboard.h +++ b/source/Keyboard.h @@ -12,13 +12,13 @@ bool KeybGetAltStatus(); bool KeybGetCtrlStatus(); bool KeybGetShiftStatus(); void KeybUpdateCtrlShiftStatus(); -BYTE KeybGetKeycode (); +BYTE KeybGetKeycode(); void KeybQueueKeypress(WPARAM key, Keystroke_e bASCII); -void KeybToggleCapsLock (); -void KeybToggleP8ACapsLock (); +void KeybToggleCapsLock(); +void KeybToggleP8ACapsLock(); void KeybAnyKeyDown(UINT message, WPARAM wparam, bool bIsExtended); -BYTE KeybClearStrobe(void); -BYTE KeybReadData (void); -BYTE KeybReadFlag (void); +BYTE KeybClearStrobe(); +BYTE KeybReadData(); +BYTE KeybReadFlag(); void KeybSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void KeybLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/LanguageCard.cpp b/source/LanguageCard.cpp index 9bdd83d57..8e7475344 100644 --- a/source/LanguageCard.cpp +++ b/source/LanguageCard.cpp @@ -79,7 +79,7 @@ LanguageCardUnit::LanguageCardUnit(SS_CARDTYPE type, UINT slot) : SetMemMainLanguageCard(NULL, SLOT0, true); } -LanguageCardUnit::~LanguageCardUnit(void) +LanguageCardUnit::~LanguageCardUnit() { // Nothing to do for SetMemMainLanguageCard(): // . if //e, then no ptr to clean up (since just using memmain) @@ -227,7 +227,7 @@ LanguageCardSlot0::LanguageCardSlot0(SS_CARDTYPE type, UINT slot) SetMemMainLanguageCard(m_pMemory, SLOT0); } -LanguageCardSlot0::~LanguageCardSlot0(void) +LanguageCardSlot0::~LanguageCardSlot0() { delete [] m_pMemory; m_pMemory = NULL; @@ -242,13 +242,13 @@ static const UINT kUNIT_LANGUAGECARD_VER = 1; #define SS_YAML_KEY_MEMORYMODE "Memory Mode" #define SS_YAML_KEY_LASTRAMWRITE "Last RAM Write" -const std::string& LanguageCardSlot0::GetSnapshotMemStructName(void) +const std::string& LanguageCardSlot0::GetSnapshotMemStructName() { static const std::string name("Memory Bank"); return name; } -const std::string& LanguageCardSlot0::GetSnapshotCardName(void) +const std::string& LanguageCardSlot0::GetSnapshotCardName() { static const std::string name("Language Card"); return name; @@ -344,7 +344,7 @@ Saturn128K::Saturn128K(UINT slot, UINT banks) ::SetMemMainLanguageCard(m_aSaturnBanks[m_uSaturnActiveBank], SLOT0); } -Saturn128K::~Saturn128K(void) +Saturn128K::~Saturn128K() { m_aSaturnBanks[0] = NULL; // just zero this - deallocated in base ctor @@ -361,7 +361,7 @@ Saturn128K::~Saturn128K(void) // In reality, dtor only called when whole VM is being destroyed, so won't have have use-after-frees. } -UINT Saturn128K::GetActiveBank(void) +UINT Saturn128K::GetActiveBank() { return m_uSaturnActiveBank; } @@ -473,13 +473,13 @@ static const UINT kUNIT_SATURN_VER = 1; #define SS_YAML_KEY_NUM_SATURN_BANKS "Num Saturn Banks" #define SS_YAML_KEY_ACTIVE_SATURN_BANK "Active Saturn Bank" -const std::string& Saturn128K::GetSnapshotMemStructName(void) +const std::string& Saturn128K::GetSnapshotMemStructName() { static const std::string name("Memory Bank"); return name; } -const std::string& Saturn128K::GetSnapshotCardName(void) +const std::string& Saturn128K::GetSnapshotCardName() { static const std::string name("Saturn 128"); return name; @@ -547,7 +547,7 @@ bool Saturn128K::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) return true; } -void Saturn128K::SetMemMainLanguageCard(void) +void Saturn128K::SetMemMainLanguageCard() { ::SetMemMainLanguageCard(m_aSaturnBanks[m_uSaturnActiveBank], m_slot); } @@ -674,7 +674,7 @@ void LanguageCardManager::SetMemMode(const uint8_t slot) MemUpdatePaging(PagingUpdateOnly); } -void LanguageCardManager::SetMemModeFromSnapshot(void) +void LanguageCardManager::SetMemModeFromSnapshot() { // If multiple "Language Cards" (eg. LC+Saturn or 2xSaturn) then setup via the last card that selected the 16KB LC bank. // NB. Skip if not Saturn card (ie. a LC), since LC's are only in slot0 and in the ctor it has called SetMainMemLanguageCard() diff --git a/source/LanguageCard.h b/source/LanguageCard.h index a6d4a43b0..f1e37601d 100644 --- a/source/LanguageCard.h +++ b/source/LanguageCard.h @@ -12,24 +12,24 @@ class LanguageCardUnit : public Card // in modern C++ this could be a 2nd constructor static LanguageCardUnit * create(UINT slot); - virtual ~LanguageCardUnit(void); + virtual ~LanguageCardUnit(); - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles) {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); - virtual UINT GetActiveBank(void) { return 0; } // Always 0 as only 1x 16K bank + virtual UINT GetActiveBank() { return 0; } // Always 0 as only 1x 16K bank virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) { } // A no-op for //e - called from CardManager::SaveSnapshot() virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) { _ASSERT(0); return false; } // Not used for //e virtual void SetMainMemLanguageCardMemory(); - BOOL GetLastRamWrite(void) { return m_uLastRamWrite; } + BOOL GetLastRamWrite() { return m_uLastRamWrite; } void SetLastRamWrite(BOOL count) { m_uLastRamWrite = count; } - UINT GetLCMemMode(void) { return m_memMode; } + UINT GetLCMemMode() { return m_memMode; } void SetLCMemMode(UINT memMode) { m_memMode = memMode; } - SS_CARDTYPE GetMemoryType(void) { return QueryType(); } + SS_CARDTYPE GetMemoryType() { return QueryType(); } bool IsOpcodeRMWabs(WORD addr); uint8_t ReadByte(uint16_t phyAddr); @@ -58,13 +58,13 @@ class LanguageCardSlot0 : public LanguageCardUnit // in modern C++ this could be a 2nd constructor static LanguageCardSlot0 * create(UINT slot); - virtual ~LanguageCardSlot0(void); + virtual ~LanguageCardSlot0(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); static const UINT kMemBankSize = 16*1024; - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); protected: LanguageCardSlot0(SS_CARDTYPE type, UINT slot); @@ -72,7 +72,7 @@ class LanguageCardSlot0 : public LanguageCardUnit void LoadLCState(class YamlLoadHelper& yamlLoadHelper); private: - const std::string& GetSnapshotMemStructName(void); + const std::string& GetSnapshotMemStructName(); }; // @@ -83,16 +83,16 @@ class Saturn128K : public LanguageCardSlot0 { public: Saturn128K(UINT slot, UINT banks); - virtual ~Saturn128K(void); + virtual ~Saturn128K(); virtual void InitializeIO(LPBYTE pCxRomPeripheral); - virtual UINT GetActiveBank(void); + virtual UINT GetActiveBank(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); virtual void SetMainMemLanguageCardMemory(); - void SetMemMainLanguageCard(void); + void SetMemMainLanguageCard(); uint8_t ReadByteFromBank(uint8_t bank, uint16_t phyAddr); uint8_t GetSaturnMemorySize(); void SetSaturnMemorySize(uint8_t banks); @@ -104,10 +104,10 @@ class Saturn128K : public LanguageCardSlot0 // "The boards consist of 16K banks of memory (4 banks for the 64K board, 8 banks for the 128K), accessed one at a time" - Ref: "64K/128K RAM BOARD", Saturn Systems, Ch.1 Introduction(pg-5) static const UINT kMaxSaturnBanks = 8; // 8 * 16K = 128K - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); private: - const std::string& GetSnapshotMemStructName(void); + const std::string& GetSnapshotMemStructName(); static UINT g_uSaturnBanksFromCmdLine; @@ -123,24 +123,24 @@ class Saturn128K : public LanguageCardSlot0 class LanguageCardManager { public: - LanguageCardManager(void) : + LanguageCardManager() : m_pLanguageCard(NULL), m_lastSlotToSetMainMemLC(SLOT0), m_lastSlotToSetMainMemLCFromSnapshot(SLOT0) {} - ~LanguageCardManager(void) {} + ~LanguageCardManager() {} void Reset(const bool powerCycle = false); - UINT GetLastSlotToSetMainMemLC(void) { return m_lastSlotToSetMainMemLC; } + UINT GetLastSlotToSetMainMemLC() { return m_lastSlotToSetMainMemLC; } void SetLastSlotToSetMainMemLC(UINT slot) { m_lastSlotToSetMainMemLC = slot; } void SetLastSlotToSetMainMemLCFromSnapshot(UINT slot) { m_lastSlotToSetMainMemLCFromSnapshot = slot; } - LanguageCardUnit* GetLanguageCard(void) { return m_pLanguageCard; } + LanguageCardUnit* GetLanguageCard() { return m_pLanguageCard; } bool SetLanguageCard(SS_CARDTYPE type); void SetMemMode(const uint8_t slot); - void SetMemModeFromSnapshot(void); + void SetMemModeFromSnapshot(); uint8_t ReadByte(uint8_t slot, uint8_t bank, uint16_t phyAddr); diff --git a/source/Log.cpp b/source/Log.cpp index 347305819..db9916240 100644 --- a/source/Log.cpp +++ b/source/Log.cpp @@ -59,7 +59,7 @@ inline std::string GetTimeStamp() return std::string(ct, 24); } -void LogInit(void) +void LogInit() { if (g_fh) return; @@ -76,7 +76,7 @@ void LogInit(void) fprintf(g_fh, "*** Logging started: %s\n", GetTimeStamp().c_str()); } -void LogDone(void) +void LogDone() { if (!g_fh) return; diff --git a/source/Log.h b/source/Log.h index e58285b4e..6b3bd598b 100644 --- a/source/Log.h +++ b/source/Log.h @@ -14,8 +14,8 @@ extern FILE* g_fh; // File handle for log file -void LogInit(void); -void LogDone(void); +void LogInit(); +void LogDone(); void LogOutput(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2); void LogFileOutput(const char* format, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2); diff --git a/source/Memory.cpp b/source/Memory.cpp index 7f96c5ddc..79fb72ead 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -273,7 +273,7 @@ static FILE * g_hMemTempFile = NULL; #endif BYTE __stdcall IO_Annunciator(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCycles); -static void FreeMemImage(void); +static void FreeMemImage(); static bool g_isMemCacheValid = true; // flag for is 'mem' valid - set in UpdatePaging() and valid for regular (not alternate) CPU emulation static bool g_forceAltCpuEmulation = false; // set by cmd line @@ -295,7 +295,7 @@ const UINT MaxRomPages = 4; // For Copam Base64A const UINT Base64ARomSize = MaxRomPages * Apple2RomSize; // Called from MemLoadSnapshot() -static void ResetDefaultMachineMemTypes(void) +static void ResetDefaultMachineMemTypes() { g_MemTypeAppleII = CT_Empty; g_MemTypeAppleIIPlus = CT_LanguageCard; @@ -303,7 +303,7 @@ static void ResetDefaultMachineMemTypes(void) } // Called from MemLoadSnapshot() -static void SetExpansionMemTypeDefault(void) +static void SetExpansionMemTypeDefault() { SS_CARDTYPE defaultType = IsApple2Original(GetApple2Type()) ? g_MemTypeAppleII : IsApple2PlusOrClone(GetApple2Type()) ? g_MemTypeAppleIIPlus @@ -371,7 +371,7 @@ void SetExpansionMemType(const SS_CARDTYPE type, bool updateRegistry/*=true*/) GetCardMgr().InsertAux(newSlotAuxCard, updateRegistry); } -void CreateLanguageCard(void) +void CreateLanguageCard() { SS_CARDTYPE slot0CardType = GetCardMgr().QuerySlot(SLOT0); if (IsApple2PlusOrClone(GetApple2Type())) @@ -396,7 +396,7 @@ void CreateLanguageCard(void) } } -SS_CARDTYPE GetCurrentExpansionMemType(void) +SS_CARDTYPE GetCurrentExpansionMemType() { if (IsApple2PlusOrClone(GetApple2Type())) return GetCardMgr().QuerySlot(SLOT0); @@ -423,20 +423,20 @@ void SetRamWorksMemorySize(UINT banks, bool updateRegistry/*=true*/) SetRegistryAuxNumberOfBanks(); } -void SetRegistryAuxNumberOfBanks(void) +void SetRegistryAuxNumberOfBanks() { std::string regSection = RegGetConfigSlotSection(SLOT_AUX); RegSaveValue(regSection.c_str(), REGVALUE_AUX_NUM_BANKS, true, g_uMaxExBanks); } -UINT GetRamWorksActiveBank(void) +UINT GetRamWorksActiveBank() { return g_uActiveBank; } // -static BOOL GetLastRamWrite(void) +static BOOL GetLastRamWrite() { if (GetCardMgr().GetLanguageCardMgr().GetLanguageCard()) return GetCardMgr().GetLanguageCardMgr().GetLanguageCard()->GetLastRamWrite(); @@ -461,12 +461,12 @@ void SetMemMainLanguageCard(LPBYTE ptr, UINT slot, bool bMemMain /*=false*/) GetCardMgr().GetLanguageCardMgr().SetLastSlotToSetMainMemLC(slot); } -LPBYTE GetCxRomPeripheral(void) +LPBYTE GetCxRomPeripheral() { return pCxRomPeripheral; // Can be NULL if at MODE_LOGO } -bool GetIsMemCacheValid(void) +bool GetIsMemCacheValid() { return g_isMemCacheValid; } @@ -528,7 +528,7 @@ void CopyBytesFromMemoryPage(uint8_t* pDst, uint16_t srcAddr, size_t size) } // //e aux slot is empty & ALTZP=1 -bool IsZeroPageFloatingBus(void) +bool IsZeroPageFloatingBus() { if (GetIsMemCacheValid()) return false; @@ -536,7 +536,7 @@ bool IsZeroPageFloatingBus(void) return memreadPageType[0x0000 >> 8] == MEM_FloatingBus; } -void ForceAltCpuEmulation(void) +void ForceAltCpuEmulation() { g_forceAltCpuEmulation = true; } @@ -1194,7 +1194,7 @@ LPVOID MemGetSlotParameters(UINT uSlot) } // From UTAIIe:5-28: Since INTCXROM==1 then state of SLOTC3ROM is not important -static void IoHandlerCardsOut(void) +static void IoHandlerCardsOut() { _ASSERT( SW_INTCXROM ); @@ -1209,7 +1209,7 @@ static void IoHandlerCardsOut(void) } // From UTAIIe:5-28: If INTCXROM==0 && SLOTC3ROM==0 Then $C300-C3FF is internal ROM -static void IoHandlerSlot3CardOut(void) +static void IoHandlerSlot3CardOut() { _ASSERT(!SW_INTCXROM && !SW_SLOTC3ROM); @@ -1220,7 +1220,7 @@ static void IoHandlerSlot3CardOut(void) } } -static void IoHandlerCardsIn(void) +static void IoHandlerCardsIn() { _ASSERT( !SW_INTCXROM ); @@ -1251,7 +1251,7 @@ static bool IsCardInSlot(UINT slot) //=========================================================================== -uint32_t GetMemMode(void) +uint32_t GetMemMode() { return g_memmode; } @@ -1482,7 +1482,7 @@ static void UpdatePaging(const UPDATEPAGING updateType) } // For Cpu6502_altRW() & Cpu65C02_altRW() -static void UpdatePagingForAltRW(void) +static void UpdatePagingForAltRW() { UINT page; @@ -1758,7 +1758,7 @@ LPBYTE MemGetMainPtr(const WORD offset) //=========================================================================== -static void BackMainImage(void) +static void BackMainImage() { if (!g_isMemCacheValid) return; @@ -1847,7 +1847,7 @@ bool MemIsAddrCodeMemory(const USHORT addr) //=========================================================================== -static void FreeMemImage(void) +static void FreeMemImage() { #ifdef _WIN32 if (g_hMemImage) @@ -1878,7 +1878,7 @@ static void FreeMemImage(void) #endif } -static LPBYTE AllocMemImage(void) +static LPBYTE AllocMemImage() { #ifdef _WIN32 LPBYTE baseAddr = NULL; @@ -2044,7 +2044,7 @@ void MemInitialize() MemReset(); } -void MemInitializeROM(void) +void MemInitializeROM() { // READ THE APPLE FIRMWARE ROMS INTO THE ROM IMAGE UINT ROM_SIZE = 0; @@ -2117,7 +2117,7 @@ void MemInitializeROM(void) memcpy(memrom, pData, ROM_SIZE); // ROM at $D000...$FFFF, one or several pages } -void MemInitializeCustomF8ROM(void) +void MemInitializeCustomF8ROM() { const UINT F8RomSize = 0x800; const UINT F8RomOffset = Apple2RomSize-F8RomSize; @@ -2170,7 +2170,7 @@ void MemInitializeCustomF8ROM(void) } } -void MemInitializeCustomROM(void) +void MemInitializeCustomROM() { if (g_hCustomRom == INVALID_HANDLE_VALUE) return; @@ -2218,7 +2218,7 @@ void MemInitializeCustomROM(void) // // Since called by LoadState(), then this must not init any cards // - it should only init the card I/O hooks -void MemInitializeIO(void) +void MemInitializeIO() { InitIoHandlers(); @@ -2227,7 +2227,7 @@ void MemInitializeIO(void) // Called by: // . Snapshot_LoadState_v2() -void MemInitializeFromSnapshot(void) +void MemInitializeFromSnapshot() { MemInitializeROM(); MemInitializeCustomROM(); @@ -2481,7 +2481,7 @@ BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles) return (r & ~0x80) | (highbit ? 0x80 : 0); } -BYTE MemReadFloatingBusFromNTSC(void) +BYTE MemReadFloatingBusFromNTSC() { // fullspeed=false: to avoid NTSC_VideoGetScannerAddress() calling NTSC_VideoClockResync() // NB. g_bFullSpeed only true when doing NTSC_VideoRedrawWholeScreen() @@ -2649,7 +2649,7 @@ bool MemIsWriteAux(uint32_t memMode) //=========================================================================== -bool IsIIeWithoutAuxMem(void) +bool IsIIeWithoutAuxMem() { return IsAppleIIe(GetApple2Type()) && (GetCardMgr().QueryAux() == CT_Empty || GetCardMgr().QueryAux() == CT_80Col); @@ -2697,7 +2697,7 @@ bool MemOptimizeForModeChanging(WORD programcounter, WORD address) //=========================================================================== -void MemAnnunciatorReset(void) +void MemAnnunciatorReset() { for (UINT i=0; iReset(); } -void MemRemoveNoSlotClock(void) +void MemRemoveNoSlotClock() { delete g_NoSlotClock; g_NoSlotClock = NULL; @@ -2789,25 +2789,25 @@ const std::string& MemGetSnapshotCardNameRamWorksIII() return name; } -static const std::string& MemGetSnapshotStructName(void) +static const std::string& MemGetSnapshotStructName() { static const std::string name("Memory"); return name; } -const std::string& MemGetSnapshotUnitAuxSlotName(void) +const std::string& MemGetSnapshotUnitAuxSlotName() { static const std::string name("Auxiliary Slot"); return name; } -static const std::string& MemGetSnapshotMainMemStructName(void) +static const std::string& MemGetSnapshotMainMemStructName() { static const std::string name("Main Memory"); return name; } -static const std::string& MemGetSnapshotAuxMemStructName(void) +static const std::string& MemGetSnapshotAuxMemStructName() { static const std::string name("Auxiliary Memory Bank"); return name; diff --git a/source/Memory.h b/source/Memory.h index 483746b2a..085d607c5 100644 --- a/source/Memory.h +++ b/source/Memory.h @@ -67,35 +67,35 @@ LPBYTE MemGetMainPtrWithLC(const WORD offset); LPBYTE MemGetMainPtr(const WORD offset); LPBYTE MemGetBankPtr(const UINT nBank, const bool isSaveSnapshotOrDebugging = true); LPBYTE MemGetCxRomPeripheral(); -uint32_t GetMemMode(void); +uint32_t GetMemMode(); void SetMemMode(uint32_t memmode); bool MemIsWriteAux(uint32_t memMode); -bool IsIIeWithoutAuxMem(void); +bool IsIIeWithoutAuxMem(); bool MemOptimizeForModeChanging(WORD programcounter, WORD address); bool MemIsAddrCodeMemory(const USHORT addr); void MemInitialize (); -void MemInitializeROM(void); -void MemInitializeCustomROM(void); -void MemInitializeCustomF8ROM(void); -void MemInitializeIO(void); -void MemInitializeFromSnapshot(void); +void MemInitializeROM(); +void MemInitializeCustomROM(); +void MemInitializeCustomF8ROM(); +void MemInitializeIO(); +void MemInitializeFromSnapshot(); BYTE MemReadFloatingBus(const ULONG uExecutedCycles); BYTE MemReadFloatingBus(const BYTE highbit, const ULONG uExecutedCycles); -BYTE MemReadFloatingBusFromNTSC(void); +BYTE MemReadFloatingBusFromNTSC(); void MemReset (); void MemResetPaging (); enum UPDATEPAGING { PagingUpdateOnly = 0, PagingFullInitialize }; void MemUpdatePaging(const UPDATEPAGING updateType); LPVOID MemGetSlotParameters (UINT uSlot); -void MemAnnunciatorReset(void); +void MemAnnunciatorReset(); bool MemGetAnnunciator(UINT annunciator); -bool MemHasNoSlotClock(void); -void MemInsertNoSlotClock(void); -void MemRemoveNoSlotClock(void); +bool MemHasNoSlotClock(); +void MemInsertNoSlotClock(); +void MemRemoveNoSlotClock(); const std::string& MemGetSnapshotCardName80Col(); const std::string& MemGetSnapshotCardNameExtended80Col(); const std::string& MemGetSnapshotCardNameRamWorksIII(); -const std::string& MemGetSnapshotUnitAuxSlotName(void); +const std::string& MemGetSnapshotUnitAuxSlotName(); void MemSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); bool MemLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT unitVersion); void MemSaveSnapshotAux(class YamlSaveHelper& yamlSaveHelper); @@ -110,20 +110,20 @@ BYTE __stdcall MemSetPaging(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExec BYTE __stdcall IO_F8xx(WORD programcounter, WORD address, BYTE write, BYTE value, ULONG nCycles); void SetExpansionMemType(const SS_CARDTYPE type, bool updateRegistry=true); -SS_CARDTYPE GetCurrentExpansionMemType(void); +SS_CARDTYPE GetCurrentExpansionMemType(); UINT GetRamWorksMemorySize(); void SetRamWorksMemorySize(UINT banks, bool updateRegistry=true); -UINT GetRamWorksActiveBank(void); +UINT GetRamWorksActiveBank(); void SetMemMainLanguageCard(LPBYTE ptr, UINT slot, bool bMemMain=false); -void SetRegistryAuxNumberOfBanks(void); +void SetRegistryAuxNumberOfBanks(); -LPBYTE GetCxRomPeripheral(void); -bool GetIsMemCacheValid(void); +LPBYTE GetCxRomPeripheral(); +bool GetIsMemCacheValid(); uint8_t ReadByteFromMemory(uint16_t addr); uint16_t ReadWordFromMemory(uint16_t addr); void WriteByteToMemory(uint16_t addr, uint8_t data); void CopyBytesFromMemoryPage(uint8_t* pDst, uint16_t srcAddr, size_t size); -bool IsZeroPageFloatingBus(void); -void ForceAltCpuEmulation(void); +bool IsZeroPageFloatingBus(); +void ForceAltCpuEmulation(); uint8_t ReadByteFromROM(uint16_t addr); diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index ecd96f4a1..b8f984c88 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -123,7 +123,7 @@ MockingboardCard::MockingboardCard(UINT slot, SS_CARDTYPE type) : Card(type, slo LogFileOutput("MockingboardCard::ctor: Reset()\n"); } -MockingboardCard::~MockingboardCard(void) +MockingboardCard::~MockingboardCard() { Destroy(); } @@ -151,7 +151,7 @@ void MockingboardCard::SetSocketSC01(SSI263Type type) //--------------------------------------------------------------------------- -bool MockingboardCard::IsAnyTimer1Active(void) +bool MockingboardCard::IsAnyTimer1Active() { bool active = false; for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++) @@ -432,7 +432,7 @@ void MockingboardCard::UpdateIFRandIRQ(MB_SUBUNIT* pMB, BYTE clr_mask, BYTE set_ //--------------------------------------------------------------------------- // Called from MockingboardCardMgr -bool MockingboardCard::Is6522IRQ(void) +bool MockingboardCard::Is6522IRQ() { // Now update the IRQ signal from all 6522s // . OR-sum of all active TIMER1, TIMER2 & SPEECH sources (from all 6522s) @@ -452,7 +452,7 @@ bool MockingboardCard::Is6522IRQ(void) //--------------------------------------------------------------------------- // Called from class SSI263 -UINT64 MockingboardCard::GetLastCumulativeCycles(void) +UINT64 MockingboardCard::GetLastCumulativeCycles() { return m_lastCumulativeCycle; } @@ -472,7 +472,7 @@ BYTE MockingboardCard::GetPCR(BYTE nDevice) // Called by: // . MB_SyncEventCallback() -> MockingboardCardManager::UpdateSoundBuffer() on a TIMER1 (not TIMER2) underflow - when IsAnyTimer1Active() == true (for any MB) // . MockingboardCardManager::Update() - when IsAnyTimer1Active() == false (for all MB's) -UINT MockingboardCard::MB_Update(void) +UINT MockingboardCard::MB_Update() { if (g_bFullSpeed) { @@ -570,7 +570,7 @@ UINT MockingboardCard::MB_Update(void) //----------------------------------------------------------------------------- // NB. Called when /g_fCurrentCLK6502/ changes -void MockingboardCard::ReinitializeClock(void) +void MockingboardCard::ReinitializeClock() { AY8910_InitClock((int)g_fCurrentCLK6502); // todo: account for g_PhasorClockScaleFactor? // NB. Other calls to AY8910_InitClock() use the constant CLK_6502 @@ -578,7 +578,7 @@ void MockingboardCard::ReinitializeClock(void) //----------------------------------------------------------------------------- -void MockingboardCard::Destroy(void) +void MockingboardCard::Destroy() { for (UINT i = 0; i < NUM_SSI263; i++) m_MBSubUnit[i].ssi263.DSUninit(); @@ -930,7 +930,7 @@ void MockingboardCard::MuteControl(bool mute) //----------------------------------------------------------------------------- #ifdef _DEBUG -void MockingboardCard::CheckCumulativeCycles(void) +void MockingboardCard::CheckCumulativeCycles() { _ASSERT(m_lastCumulativeCycle == g_nCumulativeCycles); m_lastCumulativeCycle = g_nCumulativeCycles; @@ -938,7 +938,7 @@ void MockingboardCard::CheckCumulativeCycles(void) #endif // Called by: ResetState() and Snapshot_LoadState_v2() -void MockingboardCard::SetCumulativeCycles(void) +void MockingboardCard::SetCumulativeCycles() { m_lastCumulativeCycle = g_nCumulativeCycles; } @@ -1027,7 +1027,7 @@ int MockingboardCard::MB_SyncEventCallbackInternal(int id, int /*cycles*/, ULONG //----------------------------------------------------------------------------- -bool MockingboardCard::IsActiveToPreventFullSpeed(void) +bool MockingboardCard::IsActiveToPreventFullSpeed() { // Full-speed check ignores SSI263::IsPhonemeActive(), because: (GH#1340) // . Once an SSI263 has started playing a phoneme (and the chip isn't powered-down) then it'll repeat it indefinitely. @@ -1215,25 +1215,25 @@ const UINT kUNIT_VERSION = 14; #define SS_YAML_KEY_VOTRAX_PHONEME "Votrax Phoneme" -std::string MockingboardCard::GetSnapshotCardName(void) +std::string MockingboardCard::GetSnapshotCardName() { static const std::string name("Mockingboard C"); return name; } -std::string MockingboardCard::GetSnapshotCardNamePhasor(void) +std::string MockingboardCard::GetSnapshotCardNamePhasor() { static const std::string name("Phasor"); return name; } -std::string MockingboardCard::GetSnapshotCardNameMegaAudio(void) +std::string MockingboardCard::GetSnapshotCardNameMegaAudio() { static const std::string name("MEGA Audio"); return name; } -std::string MockingboardCard::GetSnapshotCardNameSDMusic(void) +std::string MockingboardCard::GetSnapshotCardNameSDMusic() { static const std::string name("SD Music"); return name; diff --git a/source/Mockingboard.h b/source/Mockingboard.h index 449a8f1fb..b2a433358 100644 --- a/source/Mockingboard.h +++ b/source/Mockingboard.h @@ -11,7 +11,7 @@ class MockingboardCard : public Card { public: MockingboardCard(UINT slot, SS_CARDTYPE type); - virtual ~MockingboardCard(void); + virtual ~MockingboardCard(); virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Destroy(); @@ -28,28 +28,28 @@ class MockingboardCard : public Card BYTE IOWriteInternal(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles); BYTE PhasorIOInternal(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULONG nExecutedCycles); - void ReinitializeClock(void); + void ReinitializeClock(); void MuteControl(bool mute); void UpdateCycles(ULONG executedCycles); - bool IsActiveToPreventFullSpeed(void); + bool IsActiveToPreventFullSpeed(); void SetVolume(uint32_t dwVolume, uint32_t dwVolumeMax); - void SetCumulativeCycles(void); - UINT MB_Update(void); - short** GetVoiceBuffers(void) { return m_ppAYVoiceBuffer; } - int GetNumSamplesError(void) { return m_numSamplesError; } + void SetCumulativeCycles(); + UINT MB_Update(); + short** GetVoiceBuffers() { return m_ppAYVoiceBuffer; } + int GetNumSamplesError() { return m_numSamplesError; } void SetNumSamplesError(int numSamplesError) { m_numSamplesError = numSamplesError; } #ifdef _DEBUG - void CheckCumulativeCycles(void); + void CheckCumulativeCycles(); void Get6522IrqDescription(std::string& desc); #endif - bool Is6522IRQ(void); - UINT64 GetLastCumulativeCycles(void); + bool Is6522IRQ(); + UINT64 GetLastCumulativeCycles(); void UpdateIFR(BYTE nDevice, BYTE clr_mask, BYTE set_mask); BYTE GetPCR(BYTE nDevice); - bool IsAnyTimer1Active(void); - void UseBad6522A(void) { m_MBSubUnit[0].sy6522.InitBadState(true); } - void UseBad6522B(void) { m_MBSubUnit[1].sy6522.InitBadState(true); } + bool IsAnyTimer1Active(); + void UseBad6522A() { m_MBSubUnit[0].sy6522.InitBadState(true); } + void UseBad6522B() { m_MBSubUnit[1].sy6522.InitBadState(true); } SSI263Type GetSocketSSI263(BYTE socket) { return m_MBSubUnit[socket].ssi263.GetType(); } void SetSocketSSI263(BYTE socket, SSI263Type type); SSI263Type GetSocketSC01() { return m_MBSubUnit[0].ssi263.GetSC01(); } @@ -73,10 +73,10 @@ class MockingboardCard : public Card }; void GetSnapshotForDebugger(DEBUGGER_MB_CARD* const pMBForDebugger); - static std::string GetSnapshotCardName(void); - static std::string GetSnapshotCardNamePhasor(void); - static std::string GetSnapshotCardNameMegaAudio(void); - static std::string GetSnapshotCardNameSDMusic(void); + static std::string GetSnapshotCardName(); + static std::string GetSnapshotCardNamePhasor(); + static std::string GetSnapshotCardNameMegaAudio(); + static std::string GetSnapshotCardNameSDMusic(); static const unsigned short NUM_MB_CHANNELS = 2; static const uint32_t SAMPLE_RATE = 44100; // Use a base freq so that DirectX (or sound h/w) doesn't have to up/down-sample diff --git a/source/MockingboardCardManager.cpp b/source/MockingboardCardManager.cpp index ba2b7ce10..461a18768 100644 --- a/source/MockingboardCardManager.cpp +++ b/source/MockingboardCardManager.cpp @@ -50,7 +50,7 @@ bool MockingboardCardManager::IsMockingboardExtraCardType(UINT slot) return type == CT_MegaAudio || type == CT_SDMusic; } -void MockingboardCardManager::ReinitializeClock(void) +void MockingboardCardManager::ReinitializeClock() { for (UINT i = SLOT0; i < NUM_SLOTS; i++) { @@ -59,7 +59,7 @@ void MockingboardCardManager::ReinitializeClock(void) } } -void MockingboardCardManager::InitializeForLoadingSnapshot(void) +void MockingboardCardManager::InitializeForLoadingSnapshot() { if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard) return; @@ -96,7 +96,7 @@ void MockingboardCardManager::MuteControl(bool mute) } } -void MockingboardCardManager::SetCumulativeCycles(void) +void MockingboardCardManager::SetCumulativeCycles() { for (UINT i = SLOT0; i < NUM_SLOTS; i++) { @@ -115,7 +115,7 @@ void MockingboardCardManager::UpdateCycles(ULONG executedCycles) } // Called from class SY6522 -void MockingboardCardManager::UpdateIRQ(void) +void MockingboardCardManager::UpdateIRQ() { bool irq = false; for (UINT i = SLOT0; i < NUM_SLOTS; i++) @@ -130,7 +130,7 @@ void MockingboardCardManager::UpdateIRQ(void) CpuIrqDeassert(IS_6522); } -bool MockingboardCardManager::IsActiveToPreventFullSpeed(void) +bool MockingboardCardManager::IsActiveToPreventFullSpeed() { if (!m_mockingboardVoice.bActive) return false; @@ -145,7 +145,7 @@ bool MockingboardCardManager::IsActiveToPreventFullSpeed(void) return false; } -uint32_t MockingboardCardManager::GetVolume(void) +uint32_t MockingboardCardManager::GetVolume() { return m_userVolume; } @@ -167,7 +167,7 @@ void MockingboardCardManager::SetVolume(uint32_t volume, uint32_t volumeMax) } } -bool MockingboardCardManager::GetEnableExtraCardTypes(void) +bool MockingboardCardManager::GetEnableExtraCardTypes() { // Scan slots for any extra card types // . eg. maybe started a new AppleWin (with empty cmd line), but with Registry's slot 4 = CT_MegaAudio @@ -182,7 +182,7 @@ bool MockingboardCardManager::GetEnableExtraCardTypes(void) } #ifdef _DEBUG -void MockingboardCardManager::CheckCumulativeCycles(void) +void MockingboardCardManager::CheckCumulativeCycles() { for (UINT i = SLOT0; i < NUM_SLOTS; i++) { @@ -202,7 +202,7 @@ void MockingboardCardManager::Get6522IrqDescription(std::string& desc) #endif // Called by CardManager::Destroy() -void MockingboardCardManager::Destroy(void) +void MockingboardCardManager::Destroy() { // NB. All cards (including any Mockingboard cards) have just been destroyed by CardManager @@ -247,7 +247,7 @@ void MockingboardCardManager::Update(const ULONG executedCycles) // Called by: // . MB_SyncEventCallback() on a TIMER1 (not TIMER2) underflow - when IsAnyTimer1Active() == true // . Update() - when IsAnyTimer1Active() == false -void MockingboardCardManager::UpdateSoundBuffer(void) +void MockingboardCardManager::UpdateSoundBuffer() { #ifdef LOG_PERF_TIMINGS extern UINT64 g_timeMB_NoTimer; @@ -281,7 +281,7 @@ void MockingboardCardManager::UpdateSoundBuffer(void) MixAllAndCopyToRingBuffer(numSamples); } -bool MockingboardCardManager::Init(void) +bool MockingboardCardManager::Init() { if (!DSAvailable()) return false; @@ -305,7 +305,7 @@ bool MockingboardCardManager::Init(void) return true; } -UINT MockingboardCardManager::GenerateAllSoundData(void) +UINT MockingboardCardManager::GenerateAllSoundData() { UINT nNumSamples = 0; @@ -331,38 +331,20 @@ UINT MockingboardCardManager::GenerateAllSoundData(void) if (m_byteOffset == (uint32_t)-1) { // First time in this func - m_byteOffset = dwCurrentWriteCursor; } else { // Check that our offset isn't between Play & Write positions - - if (dwCurrentWriteCursor > dwCurrentPlayCursor) - { - // |-----PxxxxxW-----| - if ((m_byteOffset > dwCurrentPlayCursor) && (m_byteOffset < dwCurrentWriteCursor)) - { -#ifdef DBG_MB_UPDATE - double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, dwByteOffset, nNumSamples); -#endif - m_byteOffset = dwCurrentWriteCursor; - m_numSamplesError = 0; - } - } - else + if (SoundCore_ValidateAndAlignWriteOffset(m_byteOffset, dwCurrentPlayCursor, dwCurrentWriteCursor)) { - // |xxW----------Pxxx| - if ((m_byteOffset > dwCurrentPlayCursor) || (m_byteOffset < dwCurrentWriteCursor)) - { #ifdef DBG_MB_UPDATE - double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, dwByteOffset, nNumSamples); + double fTicksSecs = (double)GetTickCount() / 1000.0; + const char* tag = (dwCurrentWriteCursor > dwCurrentPlayCursor) ? "xxx" : "XXX"; + LogOutput("%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X %s\n", + fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset, nNumSamples, tag); #endif - m_byteOffset = dwCurrentWriteCursor; - m_numSamplesError = 0; - } + m_numSamplesError = 0; } } @@ -381,7 +363,8 @@ UINT MockingboardCardManager::GenerateAllSoundData(void) #ifdef DBG_MB_UPDATE double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X, NSE=%08X, Interval=%f\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, dwByteOffset, nNumSamples, nNumSamplesError, updateInterval); + // NB. removed outputting 'updateInterval' - would need to get it above from MB.MB_Update() + LogOutput("%010.3f: [MBUpdt] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X, NSE=%08X\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset, nNumSamples, m_numSamplesError); #endif return nNumSamples; diff --git a/source/MockingboardCardManager.h b/source/MockingboardCardManager.h index 5b1605556..2e5cfb18d 100644 --- a/source/MockingboardCardManager.h +++ b/source/MockingboardCardManager.h @@ -7,7 +7,7 @@ class MockingboardCardManager { public: - MockingboardCardManager(void) + MockingboardCardManager() { m_numSamplesError = 0; m_byteOffset = (uint32_t)-1; @@ -19,39 +19,39 @@ class MockingboardCardManager // NB. Cmd line has already been processed LogFileOutput("MBCardMgr::ctor() g_bDisableDirectSound=%d, g_bDisableDirectSoundMockingboard=%d\n", g_bDisableDirectSound, g_bDisableDirectSoundMockingboard); } - ~MockingboardCardManager(void) + ~MockingboardCardManager() {} bool IsMockingboard(UINT slot); - void ReinitializeClock(void); - void InitializeForLoadingSnapshot(void); + void ReinitializeClock(); + void InitializeForLoadingSnapshot(); void MuteControl(bool mute); - void SetCumulativeCycles(void); + void SetCumulativeCycles(); void UpdateCycles(ULONG executedCycles); - void UpdateIRQ(void); - bool IsActiveToPreventFullSpeed(void); - uint32_t GetVolume(void); + void UpdateIRQ(); + bool IsActiveToPreventFullSpeed(); + uint32_t GetVolume(); void SetVolume(uint32_t volume, uint32_t volumeMax); - void OutputToRiff(void) { m_outputToRiff = true; } + void OutputToRiff() { m_outputToRiff = true; } void SetEnableExtraCardTypes(bool enable) { m_enableExtraCardTypes = enable; } - bool GetEnableExtraCardTypes(void); + bool GetEnableExtraCardTypes(); - void Destroy(void); + void Destroy(); void Reset(const bool powerCycle) { m_cyclesThisAudioFrame = 0; } void Update(const ULONG executedCycles); - void UpdateSoundBuffer(void); + void UpdateSoundBuffer(); #ifdef _DEBUG - void CheckCumulativeCycles(void); + void CheckCumulativeCycles(); void Get6522IrqDescription(std::string& desc); #endif private: - bool Init(void); - UINT GenerateAllSoundData(void); + bool Init(); + UINT GenerateAllSoundData(); void MixAllAndCopyToRingBuffer(UINT nNumSamples); bool IsMockingboardExtraCardType(UINT slot); diff --git a/source/MouseInterface.cpp b/source/MouseInterface.cpp index 9504b334a..4f8a1cd42 100644 --- a/source/MouseInterface.cpp +++ b/source/MouseInterface.cpp @@ -160,7 +160,7 @@ CMouseInterface::~CMouseInterface() //=========================================================================== -void CMouseInterface::InitializeROM(void) +void CMouseInterface::InitializeROM() { _ASSERT(m_pSlotRom == NULL); if (m_pSlotRom) @@ -633,7 +633,7 @@ void CMouseInterface::SetButton(eBUTTON Button, eBUTTONSTATE State) #define SS_YAML_KEY_BUTTON1 "Button1" #define SS_YAML_KEY_ENABLED "Enabled" -const std::string& CMouseInterface::GetSnapshotCardName(void) +const std::string& CMouseInterface::GetSnapshotCardName() { static const std::string name("Mouse Card"); return name; diff --git a/source/MouseInterface.h b/source/MouseInterface.h index 9d0dae7dd..f62d5cd23 100644 --- a/source/MouseInterface.h +++ b/source/MouseInterface.h @@ -17,7 +17,7 @@ class CMouseInterface : public Card virtual void InitializeIO(LPBYTE pCxRomPeripheral); // void Uninitialize(); - UINT GetSlot(void) { return m_slot; } + UINT GetSlot() { return m_slot; } static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles); static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nExecutedCycles); @@ -42,12 +42,12 @@ class CMouseInterface : public Card m_iY = iY; } - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); protected: - void InitializeROM(void); + void InitializeROM(); void SetSlotRom(); void On6821_A(BYTE byData); void On6821_B(BYTE byData); diff --git a/source/NTSC.cpp b/source/NTSC.cpp index b10bbe807..3743e7b7c 100644 --- a/source/NTSC.cpp +++ b/source/NTSC.cpp @@ -325,7 +325,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA static real initFilterLuma0 (real z); static real initFilterLuma1 (real z); static real initFilterSignal(real z); - static void initPixelDoubleMasks(void); + static void initPixelDoubleMasks(); static void updateMonochromeTables( uint16_t r, uint16_t g, uint16_t b ); static void updatePixelBnWColorTVSingleScanline( uint16_t compositeSignal ); @@ -578,7 +578,7 @@ inline void updateFramebufferMonitorDoubleScanline( uint16_t signal, bgra_t *pTa #endif //=========================================================================== -inline bool GetColorBurst( void ) +inline bool GetColorBurst() { return g_nColorBurstPixels >= 2; } @@ -812,7 +812,7 @@ inline void updateVideoScannerAddress() #define CLEAR_COLOUR_SIDE 0x00FF0000 // red #endif -static void ClearOverscanVideoArea(void) +static void ClearOverscanVideoArea() { if (g_pFuncUpdateGraphicsScreen == updateScreenSHR) return; @@ -916,7 +916,7 @@ INLINE uint16_t getVideoScannerAddressSHR() // Build the 4 phase chroma lookup table // The YI'Q' colors are hard-coded //=========================================================================== -static void initChromaPhaseTables (void) +static void initChromaPhaseTables () { int phase,s,t,n; real z,y0,y1,c,i,q; @@ -1162,7 +1162,7 @@ static real initFilterSignal (real z) } //=========================================================================== -static void initPixelDoubleMasks (void) +static void initPixelDoubleMasks () { /* Convert 7-bit monochrome luminance to 14-bit double pixel luminance @@ -1966,7 +1966,7 @@ void NTSC_GetVideoVertHorzForDebugger(uint16_t& vert, uint16_t& horz) horz = g_nVideoClockHorz; } -uint16_t NTSC_GetVideoVertForDebugger(void) +uint16_t NTSC_GetVideoVertForDebugger() { uint16_t vert, horz; NTSC_GetVideoVertHorzForDebugger(vert, horz); @@ -2230,7 +2230,7 @@ void NTSC_SetVideoMode( uint32_t uVideoModeFlags, bool bDelay/*=false*/ ) //=========================================================================== -void NTSC_SetVideoStyle(void) +void NTSC_SetVideoStyle() { const bool half = GetVideo().IsVideoStyle(VS_HALF_SCANLINES); const VideoRefreshRate_e refresh = GetVideo().GetVideoRefreshRate(); @@ -2326,10 +2326,10 @@ void NTSC_SetVideoStyle(void) } //=========================================================================== -static void GenerateVideoTables( void ); +static void GenerateVideoTables(); static void GenerateBaseColors(baseColors_t pBaseNtscColors); -void NTSC_Destroy(void) +void NTSC_Destroy() { // After a VM restart, this will point to an old FrameBuffer // - if it's now unmapped then this can cause a crash in NTSC_SetVideoMode()! @@ -2536,7 +2536,7 @@ void NTSC_VideoUpdateCycles( UINT cycles6502 ) } //=========================================================================== -void NTSC_VideoRedrawWholeScreen( void ) +void NTSC_VideoRedrawWholeScreen() { #ifdef _DEBUG const uint16_t currVideoClockVert = g_nVideoClockVert; @@ -2594,7 +2594,7 @@ static bool CheckVideoTables2( eApple2Type type, uint32_t mode ) return true; } -static void CheckVideoTables( void ) +static void CheckVideoTables() { CheckVideoTables2(A2TYPE_APPLE2PLUS, VF_HIRES); CheckVideoTables2(A2TYPE_APPLE2PLUS, VF_TEXT); @@ -2602,12 +2602,12 @@ static void CheckVideoTables( void ) CheckVideoTables2(A2TYPE_APPLE2E, VF_TEXT); } -static bool IsNTSC(void) +static bool IsNTSC() { return g_videoScannerMaxVert == VIDEO_SCANNER_MAX_VERT; } -static void GenerateVideoTables( void ) +static void GenerateVideoTables() { eApple2Type currentApple2Type = GetApple2Type(); uint32_t currentVideoMode = GetVideo().GetVideoMode(); @@ -2740,17 +2740,17 @@ void NTSC_SetRefreshRate(VideoRefreshRate_e rate) GenerateVideoTables(); } -UINT NTSC_GetCyclesPerFrame(void) +UINT NTSC_GetCyclesPerFrame() { return g_videoScanner6502Cycles; } -UINT NTSC_GetCyclesPerLine(void) +UINT NTSC_GetCyclesPerLine() { return VIDEO_SCANNER_MAX_HORZ; } -UINT NTSC_GetVideoLines(void) +UINT NTSC_GetVideoLines() { return (GetVideo().GetVideoRefreshRate() == VR_50HZ) ? VIDEO_SCANNER_MAX_VERT_PAL : VIDEO_SCANNER_MAX_VERT; } @@ -2773,13 +2773,13 @@ UINT NTSC_GetCyclesUntilVBlank(int cycles) (cyclesPerFrames - cycleCurrentPos + cycleVBl); } -bool NTSC_GetVblBar(void) +bool NTSC_GetVblBar() { const UINT visibleScanLines = ((g_uNewVideoModeFlags & VF_SHR) == 0) ? VIDEO_SCANNER_Y_DISPLAY : VIDEO_SCANNER_Y_DISPLAY_IIGS; return g_nVideoClockVert < visibleScanLines; } -bool NTSC_IsVisible(void) +bool NTSC_IsVisible() { return NTSC_GetVblBar() && (g_nVideoClockHorz >= VIDEO_SCANNER_HORZ_START); } diff --git a/source/NTSC.h b/source/NTSC.h index 270d30912..10c95d1c2 100644 --- a/source/NTSC.h +++ b/source/NTSC.h @@ -7,26 +7,26 @@ extern uint32_t g_nChromaSize; // Prototypes (Public) ________________________________________________ void NTSC_SetVideoMode(uint32_t uVideoModeFlags, bool bDelay=false); -void NTSC_SetVideoStyle(void); +void NTSC_SetVideoStyle(); void NTSC_SetVideoTextMode(int cols); uint32_t* NTSC_VideoGetChromaTable(bool bHueTypeMonochrome, bool bMonitorTypeColorTV); void NTSC_VideoClockResync(const uint32_t dwCyclesThisFrame); uint16_t NTSC_VideoGetScannerAddress(const ULONG uExecutedCycles, const bool fullSpeed); void NTSC_GetVideoVertHorzForDebugger(uint16_t& vert, uint16_t& horz); -uint16_t NTSC_GetVideoVertForDebugger(void); -void NTSC_Destroy(void); +uint16_t NTSC_GetVideoVertForDebugger(); +void NTSC_Destroy(); void NTSC_VideoInit(uint8_t *pFramebuffer); void NTSC_VideoReinitialize(uint32_t cyclesThisFrame, bool bInitVideoScannerAddress); -void NTSC_VideoInitAppleType(void); -void NTSC_VideoInitChroma(void); +void NTSC_VideoInitAppleType(); +void NTSC_VideoInitChroma(); void NTSC_VideoUpdateCycles(UINT cycles6502); -void NTSC_VideoRedrawWholeScreen(void); +void NTSC_VideoRedrawWholeScreen(); void NTSC_SetRefreshRate(VideoRefreshRate_e rate); -UINT NTSC_GetCyclesPerFrame(void); -UINT NTSC_GetCyclesPerLine(void); -UINT NTSC_GetVideoLines(void); +UINT NTSC_GetCyclesPerFrame(); +UINT NTSC_GetCyclesPerLine(); +UINT NTSC_GetVideoLines(); UINT NTSC_GetCyclesUntilVBlank(int cycles); -bool NTSC_GetVblBar(void); -bool NTSC_IsVisible(void); +bool NTSC_GetVblBar(); +bool NTSC_IsVisible(); uint16_t NTSC_GetScannerAddressAndData(uint32_t& data, int& dataSize); diff --git a/source/NTSC_CharSet.cpp b/source/NTSC_CharSet.cpp index 928ce0a38..10a579163 100644 --- a/source/NTSC_CharSet.cpp +++ b/source/NTSC_CharSet.cpp @@ -155,7 +155,7 @@ static void userVideoRom4K(csbits_t csbits, const BYTE* pVideoRom) } } -static void userVideoRomForIIe(void) +static void userVideoRomForIIe() { const BYTE* pVideoRom; UINT size = GetVideo().GetVideoRom(pVideoRom); // 2K or 4K or 8K @@ -234,7 +234,7 @@ static void userVideoRom2K(csbits_t csbits, const BYTE* pVideoRom, const eApple2 } } -static void userVideoRomForIIPlus(void) +static void userVideoRomForIIPlus() { const BYTE* pVideoRom; UINT size = GetVideo().GetVideoRom(pVideoRom); // 2K or 4K or 8K @@ -246,7 +246,7 @@ static void userVideoRomForIIPlus(void) //------------------------------------- -static void VideoRomForIIandIIPlus(void) +static void VideoRomForIIandIIPlus() { BYTE* pVideoRom = GetFrame().GetResource(IDR_APPLE2_VIDEO_ROM, "ROM", Video::kVideoRomSize2K); if (pVideoRom == NULL) @@ -255,7 +255,7 @@ static void VideoRomForIIandIIPlus(void) userVideoRom2K(&csbits_a2[0], pVideoRom); } -static void VideoRomForIIJPlus(void) +static void VideoRomForIIJPlus() { BYTE* pVideoRom = GetFrame().GetResource(IDR_APPLE2_JPLUS_VIDEO_ROM, "ROM", Video::kVideoRomSize2K); if (pVideoRom == NULL) @@ -265,7 +265,7 @@ static void VideoRomForIIJPlus(void) userVideoRom2K(&csbits_a2j[1], pVideoRom, A2TYPE_APPLE2JPLUS, 1); } -static void VideoRomForBase64A(void) +static void VideoRomForBase64A() { BYTE* pVideoRom = GetFrame().GetResource(IDR_BASE64A_VIDEO_ROM, "ROM", Video::kVideoRomSize4K); if (pVideoRom == NULL) @@ -275,7 +275,7 @@ static void VideoRomForBase64A(void) userVideoRom2K(&csbits_base64a[1], pVideoRom + Video::kVideoRomSize2K, A2TYPE_BASE64A, 0); } -static void VideoRomForIIeEnhanced(void) +static void VideoRomForIIeEnhanced() { BYTE* pVideoRom = GetFrame().GetResource(IDR_APPLE2E_ENHANCED_VIDEO_ROM, "ROM", Video::kVideoRomSize4K); if (pVideoRom == NULL) @@ -286,7 +286,7 @@ static void VideoRomForIIeEnhanced(void) //------------------------------------- -void make_csbits(void) +void make_csbits() { get_csbits(&csbits_pravets82[0], IDB_CHARSET82, 0); // Pravets 82 get_csbits(&csbits_pravets8M[0], IDB_CHARSET8M, 0); // Pravets 8M @@ -310,7 +310,7 @@ void make_csbits(void) userVideoRomForIIPlus(); } -csbits_t Get2e_csbits(void) +csbits_t Get2e_csbits() { const csbits_t videoRom4K = (GetApple2Type() == A2TYPE_APPLE2E) ? csbits_2e : csbits_enhanced2e; diff --git a/source/NTSC_CharSet.h b/source/NTSC_CharSet.h index f8ce9370b..09b7a7856 100644 --- a/source/NTSC_CharSet.h +++ b/source/NTSC_CharSet.h @@ -11,5 +11,5 @@ extern unsigned char csbits_pravets8C[2][256][8]; // Pravets 8A & 8C extern unsigned char csbits_base64a[2][256][8]; // Base64A -void make_csbits(void); -csbits_t Get2e_csbits(void); +void make_csbits(); +csbits_t Get2e_csbits(); diff --git a/source/NoSlotClock.cpp b/source/NoSlotClock.cpp index 6acb275e6..cfceae422 100644 --- a/source/NoSlotClock.cpp +++ b/source/NoSlotClock.cpp @@ -187,7 +187,7 @@ void CNoSlotClock::PopulateClockRegister() #define SS_YAML_KEY_COMPARISON_REGISTER_MASK "Comparison Register Mask" #define SS_YAML_KEY_COMPARISON_REGISTER "Comparison Register" -const std::string& CNoSlotClock::GetSnapshotStructName(void) +const std::string& CNoSlotClock::GetSnapshotStructName() { static const std::string name("No Slot Clock"); return name; diff --git a/source/NoSlotClock.h b/source/NoSlotClock.h index 9b10380e8..daa6cfb53 100644 --- a/source/NoSlotClock.h +++ b/source/NoSlotClock.h @@ -68,7 +68,7 @@ class CNoSlotClock bool Read(int address, BYTE& data); void Write(int address); void PopulateClockRegister(); - const std::string& GetSnapshotStructName(void); + const std::string& GetSnapshotStructName(); static const UINT64 kClockInitSequence = 0x5CA33AC55CA33AC5; }; diff --git a/source/ParallelPrinter.cpp b/source/ParallelPrinter.cpp index 9e7c802e2..9e7a782bb 100644 --- a/source/ParallelPrinter.cpp +++ b/source/ParallelPrinter.cpp @@ -53,7 +53,7 @@ void ParallelPrinterCard::InitializeIO(LPBYTE pCxRomPeripheral) } //=========================================================================== -bool ParallelPrinterCard::CheckPrint(void) +bool ParallelPrinterCard::CheckPrint() { m_inactivity = 0; if (m_file == NULL) @@ -71,7 +71,7 @@ bool ParallelPrinterCard::CheckPrint(void) } //=========================================================================== -void ParallelPrinterCard::ClosePrint(void) +void ParallelPrinterCard::ClosePrint() { if (m_file != NULL) { @@ -90,7 +90,7 @@ void ParallelPrinterCard::ClosePrint(void) } //=========================================================================== -void ParallelPrinterCard::Destroy(void) +void ParallelPrinterCard::Destroy() { ClosePrint(); } @@ -154,7 +154,7 @@ BYTE __stdcall ParallelPrinterCard::IOWrite(WORD, WORD address, BYTE, BYTE value //=========================================================================== -const std::string& ParallelPrinterCard::GetFilename(void) +const std::string& ParallelPrinterCard::GetFilename() { return m_szPrintFilename; } @@ -176,7 +176,7 @@ void ParallelPrinterCard::SetFilename(const std::string& prtFilename) //=========================================================================== -void ParallelPrinterCard::GetRegistryConfig(void) +void ParallelPrinterCard::GetRegistryConfig() { std::string regSection = RegGetConfigSlotSection(m_slot); @@ -202,7 +202,7 @@ void ParallelPrinterCard::GetRegistryConfig(void) SetIdleLimit(dwTmp); } -void ParallelPrinterCard::SetRegistryConfig(void) +void ParallelPrinterCard::SetRegistryConfig() { std::string regSection = RegGetConfigSlotSection(m_slot); RegSaveValue(regSection.c_str(), REGVALUE_DUMP_TO_PRINTER, true, GetDumpToPrinter()); @@ -225,7 +225,7 @@ void ParallelPrinterCard::SetRegistryConfig(void) #define SS_YAML_KEY_APPEND "Printer Append" #define SS_YAML_KEY_DUMPTOREALPRINTER "Enable Dump To Real Printer" -const std::string& ParallelPrinterCard::GetSnapshotCardName(void) +const std::string& ParallelPrinterCard::GetSnapshotCardName() { static const std::string name("Generic Printer"); return name; diff --git a/source/ParallelPrinter.h b/source/ParallelPrinter.h index 8a336e807..7b4afc0d9 100644 --- a/source/ParallelPrinter.h +++ b/source/ParallelPrinter.h @@ -16,9 +16,9 @@ class ParallelPrinterCard : public Card ResetDefaultOptions(); } - virtual ~ParallelPrinterCard(void) {} + virtual ~ParallelPrinterCard() {} - virtual void Destroy(void); + virtual void Destroy(); virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles); virtual void InitializeIO(LPBYTE pCxRomPeripheral); @@ -26,7 +26,7 @@ class ParallelPrinterCard : public Card static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); @@ -45,19 +45,19 @@ class ParallelPrinterCard : public Card return !operator==(other); } - const std::string& GetFilename(void); + const std::string& GetFilename(); void SetFilename(const std::string& prtFilename); - UINT GetIdleLimit(void) { return m_printerIdleLimit; } + UINT GetIdleLimit() { return m_printerIdleLimit; } void SetIdleLimit(UINT value) { m_printerIdleLimit = value; } - bool GetDumpToPrinter(void) { return m_bDumpToPrinter; } + bool GetDumpToPrinter() { return m_bDumpToPrinter; } void SetDumpToPrinter(bool value) { m_bDumpToPrinter = value; } - bool GetConvertEncoding(void) { return m_bConvertEncoding; } + bool GetConvertEncoding() { return m_bConvertEncoding; } void SetConvertEncoding(bool value) { m_bConvertEncoding = value; } - bool GetFilterUnprintable(void) { return m_bFilterUnprintable; } + bool GetFilterUnprintable() { return m_bFilterUnprintable; } void SetFilterUnprintable(bool value) { m_bFilterUnprintable = value; } - bool GetPrinterAppend(void) { return m_bPrinterAppend; } + bool GetPrinterAppend() { return m_bPrinterAppend; } void SetPrinterAppend(bool value) { m_bPrinterAppend = value; } - bool GetEnableDumpToRealPrinter(void) { return m_bEnableDumpToRealPrinter; } + bool GetEnableDumpToRealPrinter() { return m_bEnableDumpToRealPrinter; } void SetEnableDumpToRealPrinter(bool value) { m_bEnableDumpToRealPrinter = value; } // Set by cmd-line only void ResetDefaultOptions() @@ -70,12 +70,12 @@ class ParallelPrinterCard : public Card m_bEnableDumpToRealPrinter = false; } - void GetRegistryConfig(void); - void SetRegistryConfig(void); + void GetRegistryConfig(); + void SetRegistryConfig(); private: - bool CheckPrint(void); - void ClosePrint(void); + bool CheckPrint(); + void ClosePrint(); uint32_t m_inactivity; FILE* m_file; diff --git a/source/Pravets.cpp b/source/Pravets.cpp index ef92dbb54..876124ff5 100644 --- a/source/Pravets.cpp +++ b/source/Pravets.cpp @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Interface.h" #include "Keyboard.h" -Pravets::Pravets(void) +Pravets::Pravets() { // Pravets 8A g_CapsLockAllowed = false; @@ -43,7 +43,7 @@ Pravets::Pravets(void) P8Shift = false; } -void Pravets::Reset(void) +void Pravets::Reset() { if (GetApple2Type() == A2TYPE_PRAVETS8A) { diff --git a/source/Pravets.h b/source/Pravets.h index ee1b8ae88..68a31f9e8 100644 --- a/source/Pravets.h +++ b/source/Pravets.h @@ -3,12 +3,12 @@ class Pravets { public: - Pravets(void); - ~Pravets(void){} + Pravets(); + ~Pravets() {} - void Reset(void); + void Reset(); - void ToggleP8ACapsLock(void) { P8CAPS_ON = !P8CAPS_ON; } + void ToggleP8ACapsLock() { P8CAPS_ON = !P8CAPS_ON; } BYTE SetCapsLockAllowed(BYTE value); BYTE GetKeycode(BYTE floatingBus); diff --git a/source/RGBMonitor.cpp b/source/RGBMonitor.cpp index 3547b9ece..0a1080f95 100644 --- a/source/RGBMonitor.cpp +++ b/source/RGBMonitor.cpp @@ -419,7 +419,7 @@ BYTE MixColors(BYTE c1, BYTE c2) #undef COMBINATION } -static void CreateColorMixMap(void) +static void CreateColorMixMap() { const int FROM_NEIGHBOUR = 0x00; const int MIX_THRESHOLD = HGR_BLUE; // (skip) bottom 2 HGR colors @@ -1164,7 +1164,7 @@ void UpdateDuochromeCell(int h, int w, bgra_t* pVideoAddress, uint8_t bits, uint static LPBYTE g_pSourcePixels = NULL; -static void V_CreateDIBSections(void) +static void V_CreateDIBSections() { if (!g_pSourcePixels) // NB. Will be non-zero after a VM restart (GH#809) g_pSourcePixels = new BYTE[SRCOFFS_TOTAL * MAX_SOURCE_Y]; @@ -1248,39 +1248,39 @@ void RGB_SetVideoMode(WORD address) g_rgbPrevAN3Addr = address; } -bool RGB_Is140Mode(void) // Extended 80-Column Text/AppleColor Card's Mode 2 +bool RGB_Is140Mode() // Extended 80-Column Text/AppleColor Card's Mode 2 { // Feline falls back to this mode instead of 160 return g_rgbMode == 0 || (g_RGBVideocard == RGB_Videocard_e::LeChatMauve_Feline && g_rgbMode == 1); } -bool RGB_Is160Mode(void) // Extended 80-Column Text/AppleColor Card: N/A +bool RGB_Is160Mode() // Extended 80-Column Text/AppleColor Card: N/A { // Unsupported by Feline return g_rgbMode == 1 && (g_RGBVideocard != RGB_Videocard_e::LeChatMauve_Feline); } -bool RGB_IsMixMode(void) // Extended 80-Column Text/AppleColor Card's Mode 3 +bool RGB_IsMixMode() // Extended 80-Column Text/AppleColor Card's Mode 3 { return g_rgbMode == 2; } -bool RGB_Is560Mode(void) // Extended 80-Column Text/AppleColor Card's Mode 1 +bool RGB_Is560Mode() // Extended 80-Column Text/AppleColor Card's Mode 1 { return g_rgbMode == 3; } -bool RGB_IsMixModeInvertBit7(void) +bool RGB_IsMixModeInvertBit7() { return RGB_IsMixMode() && g_rgbInvertBit7; } -bool RGB_IsMacLCCardDLGR(void) +bool RGB_IsMacLCCardDLGR() { return g_rgbMacLCCardDLGR; } -void RGB_ResetState(void) +void RGB_ResetState() { g_rgbFlags = 0; g_rgbMode = 0; @@ -1337,7 +1337,7 @@ void RGB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT cardVersion) yamlLoadHelper.PopMap(); } -RGB_Videocard_e RGB_GetVideocard(void) +RGB_Videocard_e RGB_GetVideocard() { return g_RGBVideocard; } diff --git a/source/RGBMonitor.h b/source/RGBMonitor.h index 0145c85b5..f1e146b8e 100644 --- a/source/RGBMonitor.h +++ b/source/RGBMonitor.h @@ -31,20 +31,20 @@ void VideoInitializeOriginal(baseColors_t pBaseNtscColors); void VideoSwitchVideocardPalette(RGB_Videocard_e videocard, VideoType_e type); void RGB_SetVideoMode(WORD address); -bool RGB_Is140Mode(void); -bool RGB_Is160Mode(void); -bool RGB_IsMixMode(void); -bool RGB_Is560Mode(void); -bool RGB_IsMixModeInvertBit7(void); -bool RGB_IsMacLCCardDLGR(void); -void RGB_ResetState(void); +bool RGB_Is140Mode(); +bool RGB_Is160Mode(); +bool RGB_IsMixMode(); +bool RGB_Is560Mode(); +bool RGB_IsMixModeInvertBit7(); +bool RGB_IsMacLCCardDLGR(); +void RGB_ResetState(); void RGB_SetInvertBit7(bool state); void RGB_SetMacLCCardDLGR(bool state); void RGB_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void RGB_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT cardVersion); -RGB_Videocard_e RGB_GetVideocard(void); +RGB_Videocard_e RGB_GetVideocard(); void RGB_SetVideocard(RGB_Videocard_e videocard, int text_foreground = -1, int text_background = -1); void RGB_SetRegularTextFG(int color); void RGB_SetRegularTextBG(int color); diff --git a/source/Riff.h b/source/Riff.h index 8f114b431..214bc4872 100644 --- a/source/Riff.h +++ b/source/Riff.h @@ -1,5 +1,5 @@ #pragma once bool RiffInitWriteFile(const char* pszFile, unsigned int sample_rate, unsigned int NumChannels); -bool RiffFinishWriteFile(void); +bool RiffFinishWriteFile(); bool RiffPutSamples(const short* buf, unsigned int uSamples); diff --git a/source/SAM.cpp b/source/SAM.cpp index 1971d7f4c..f7588d565 100644 --- a/source/SAM.cpp +++ b/source/SAM.cpp @@ -93,7 +93,7 @@ void SAMCard::InitializeIO(LPBYTE pCxRomPeripheral) static const UINT kUNIT_VERSION = 1; -const std::string& SAMCard::GetSnapshotCardName(void) +const std::string& SAMCard::GetSnapshotCardName() { static const std::string name("SAM"); return name; diff --git a/source/SAM.h b/source/SAM.h index 82d958696..f4585e3de 100644 --- a/source/SAM.h +++ b/source/SAM.h @@ -9,9 +9,9 @@ class SAMCard : public Card Card(CT_SAM, slot) { } - virtual ~SAMCard(void) {} + virtual ~SAMCard() {} - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle) {} virtual void Update(const ULONG nExecutedCycles) {} @@ -19,7 +19,7 @@ class SAMCard : public Card static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/SNESMAX.cpp b/source/SNESMAX.cpp index 5c4d107ad..ab771b24c 100644 --- a/source/SNESMAX.cpp +++ b/source/SNESMAX.cpp @@ -248,7 +248,7 @@ static const UINT kUNIT_VERSION = 1; #define SS_YAML_KEY_BUTTON_INDEX "Button Index" -const std::string& SNESMAXCard::GetSnapshotCardName(void) +const std::string& SNESMAXCard::GetSnapshotCardName() { static const std::string name("SNES MAX"); return name; diff --git a/source/SNESMAX.h b/source/SNESMAX.h index de3612243..91227f247 100644 --- a/source/SNESMAX.h +++ b/source/SNESMAX.h @@ -16,9 +16,9 @@ class SNESMAXCard : public Card m_altControllerType[0] = g_cmdLine.snesMaxAltControllerType[0]; m_altControllerType[1] = g_cmdLine.snesMaxAltControllerType[1]; } - virtual ~SNESMAXCard(void) {} + virtual ~SNESMAXCard() {} - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle) {} virtual void Update(const ULONG nExecutedCycles) {} @@ -27,7 +27,7 @@ class SNESMAXCard : public Card static BYTE __stdcall IORead(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/SSI263.cpp b/source/SSI263.cpp index 054f7916d..2fca2fd3f 100644 --- a/source/SSI263.cpp +++ b/source/SSI263.cpp @@ -77,7 +77,7 @@ const uint32_t SAMPLE_RATE_SSI263 = 22050; static int ssiRegs[5]={-1,-1,-1,-1,-1}; static int totalDuration_ms = 0; -void SSI_Output(void) +void SSI_Output() { int ssi0 = ssiRegs[SSI_DURPHON]; int ssi2 = ssiRegs[SSI_RATEINF]; @@ -103,7 +103,7 @@ void SSI_Output(void) //----------------------------------------------------------------------------- -UINT64 SSI263::GetLastCumulativeCycles(void) +UINT64 SSI263::GetLastCumulativeCycles() { return dynamic_cast(GetCardMgr().GetRef(m_slot)).GetLastCumulativeCycles(); } @@ -229,7 +229,7 @@ void SSI263::Write(BYTE nReg, BYTE nValue) } } -void SSI263::SetDeviceModeAndInts(void) +void SSI263::SetDeviceModeAndInts() { if ((m_durationPhoneme & DURATION_MODE_MASK) != MODE_IRQ_DISABLED) { @@ -396,7 +396,7 @@ void SSI263::Play(unsigned int nPhoneme) m_lastUpdateCycle = GetLastCumulativeCycles(); } -void SSI263::Stop(void) +void SSI263::Stop() { if (SSI263SingleVoice.lpDSBvoice && SSI263SingleVoice.bActive) DSVoiceStop(&SSI263SingleVoice); @@ -423,7 +423,7 @@ void SSI263::PeriodicUpdate(UINT executedCycles) // Called by: // . PeriodicUpdate() -void SSI263::Update(void) +void SSI263::Update() { if (!IsPhonemeActive()) return; @@ -482,7 +482,8 @@ void SSI263::Update(void) // First time in this func (or transitioned from full-speed to normal speed, or a ring-buffer reset) #ifdef DBG_SSI263_UPDATE double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [SSUpdtInit%1d]PC=%08X, WC=%08X, Diff=%08X, Off=%08X xxx\n", fTicksSecs, m_device, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset); + LogOutput("%010.3f: [SSUpdtInit%1d]PC=%08X, WC=%08X, Diff=%08X, Off=%08X xxx\n", + fTicksSecs, m_device, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset); #endif m_byteOffset = dwCurrentWriteCursor; m_numSamplesError = 0; @@ -491,32 +492,15 @@ void SSI263::Update(void) else { // Check that our offset isn't between Play & Write positions - - if (dwCurrentWriteCursor > dwCurrentPlayCursor) + if (SoundCore_ValidateAndAlignWriteOffset(m_byteOffset, dwCurrentPlayCursor, dwCurrentWriteCursor)) { - // |-----PxxxxxW-----| - if ((m_byteOffset > dwCurrentPlayCursor) && (m_byteOffset < dwCurrentWriteCursor)) - { #ifdef DBG_SSI263_UPDATE - double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [SSUpdt%1d] PC=%08X, WC=%08X, Diff=%08X, Off=%08X xxx\n", fTicksSecs, m_device, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset); -#endif - m_byteOffset = dwCurrentWriteCursor; - m_numSamplesError = 0; - } - } - else - { - // |xxW----------Pxxx| - if ((m_byteOffset > dwCurrentPlayCursor) || (m_byteOffset < dwCurrentWriteCursor)) - { -#ifdef DBG_SSI263_UPDATE - double fTicksSecs = (double)GetTickCount() / 1000.0; - LogOutput("%010.3f: [SSUpdt%1d] PC=%08X, WC=%08X, Diff=%08X, Off=%08X XXX\n", fTicksSecs, m_device, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset); + double fTicksSecs = (double)GetTickCount() / 1000.0; + const char* tag = (dwCurrentWriteCursor > dwCurrentPlayCursor) ? "xxx" : "XXX"; + LogOutput("%010.3f: [SSUpdt%1d] PC=%08X, WC=%08X, Diff=%08X, Off=%08X %s\n", + fTicksSecs, m_device, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor - dwCurrentPlayCursor, m_byteOffset, tag); #endif - m_byteOffset = dwCurrentWriteCursor; - m_numSamplesError = 0; - } + m_numSamplesError = 0; } } @@ -740,7 +724,7 @@ void SSI263::Update(void) // Called by: // . Update() // . LoadSnapshot() -void SSI263::RepeatPhoneme(void) +void SSI263::RepeatPhoneme() { if (m_phonemeLeadoutLength != 0) return; @@ -766,7 +750,7 @@ void SSI263::RepeatPhoneme(void) // The primary way for phonemes to generate IRQ is via the ring-buffer in Update(), // but when single-stepping (eg. timing-sensitive SSI263 detection code), then this secondary method is used. -void SSI263::UpdateAccurateLength(void) +void SSI263::UpdateAccurateLength() { if (!m_phonemeAccurateLengthRemaining) return; @@ -795,7 +779,7 @@ void SSI263::UpdateAccurateLength(void) // . Update() when m_phonemeLengthRemaining -> 0 // . UpdateAccurateLength() when m_phonemeAccurateLengthRemaining -> 0 // . LoadSnapshot() -void SSI263::UpdateIRQ(void) +void SSI263::UpdateIRQ() { m_phonemeLengthRemaining = m_phonemeAccurateLengthRemaining = 0; // Prevent an IRQ from the other source @@ -819,7 +803,7 @@ void SSI263::UpdateIRQ(void) //----------------------------------------------------------------------------- // Pre: m_isVotraxPhoneme, m_cardMode, m_device -void SSI263::SetSpeechIRQ(void) +void SSI263::SetSpeechIRQ() { if (!m_isVotraxPhoneme && (m_ctrlArtAmp & CONTROL_MASK) == 0) { @@ -887,8 +871,8 @@ void SSI263::SetCardMode(PHASOR_MODE mode) //----------------------------------------------------------------------------- -// Cf. void MockingboardCardManager::UpdateSoundBuffer(void) -bool SSI263::DSInit(void) +// Cf. void MockingboardCardManager::UpdateSoundBuffer() +bool SSI263::DSInit() { if (!SSI263SingleVoice.lpDSBvoice) { @@ -910,8 +894,8 @@ bool SSI263::DSInit(void) return true; } -// Cf. bool MockingboardCardManager::Init(void) -bool SSI263::Init(void) +// Cf. bool MockingboardCardManager::Init() +bool SSI263::Init() { if (!DSAvailable()) return false; @@ -935,7 +919,7 @@ bool SSI263::Init(void) return true; } -void SSI263::DSUninit(void) +void SSI263::DSUninit() { Stop(); DSReleaseSoundBuffer(&SSI263SingleVoice); @@ -972,7 +956,7 @@ void SSI263::Reset(const bool powerCycle, const bool isPhasorCard) //----------------------------------------------------------------------------- -void SSI263::Mute(void) +void SSI263::Mute() { if (SSI263SingleVoice.bActive && !SSI263SingleVoice.bMute) { @@ -981,7 +965,7 @@ void SSI263::Mute(void) } } -void SSI263::Unmute(void) +void SSI263::Unmute() { if (SSI263SingleVoice.bActive && SSI263SingleVoice.bMute) { diff --git a/source/SSI263.h b/source/SSI263.h index 2aec1828c..0e66b2e6a 100644 --- a/source/SSI263.h +++ b/source/SSI263.h @@ -15,7 +15,7 @@ class SSI263 ResetState(true); } - ~SSI263(void) + ~SSI263() { delete [] m_pPhonemeData00; } @@ -80,20 +80,20 @@ class SSI263 SSI263Type GetSC01() { return m_hasSC01 ? SC01 : SSI263Empty; } void SetSC01(SSI263Type type) { m_hasSC01 = (type == SC01); } - void DSUninit(void); + void DSUninit(); void Reset(const bool powerCycle, const bool isPhasorCard); BYTE Read(ULONG nExecutedCycles); void Write(BYTE nReg, BYTE nValue); - void Mute(void); - void Unmute(void); + void Mute(); + void Unmute(); void SetVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void PeriodicUpdate(UINT executedCycles); - void Update(void); - void SetSpeechIRQ(void); + void Update(); + void SetSpeechIRQ(); void Votrax_Write(BYTE nValue); void SetVotraxPhoneme(bool value) { m_isVotraxPhoneme = value; } @@ -102,25 +102,25 @@ class SSI263 void LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, PHASOR_MODE mode, UINT version, UINT subunit); private: - bool IsPhonemeActive(void) + bool IsPhonemeActive() { // If SSI263.CONTROL=1 then "m_currentActivePhoneme >= 0" is still true // Also valid regardless of m_isVotraxPhoneme state return m_currentActivePhoneme >= 0; } void Play(unsigned int nPhoneme); - void Stop(void); - void UpdateIRQ(void); - void RepeatPhoneme(void); - void UpdateAccurateLength(void); - void SetDeviceModeAndInts(void); + void Stop(); + void UpdateIRQ(); + void RepeatPhoneme(); + void UpdateAccurateLength(); + void SetDeviceModeAndInts(); - UINT64 GetLastCumulativeCycles(void); + UINT64 GetLastCumulativeCycles(); void UpdateIFR(BYTE nDevice, BYTE clr_mask, BYTE set_mask); BYTE GetPCR(BYTE nDevice); - bool Init(void); - bool DSInit(void); + bool Init(); + bool DSInit(); void SC01_SaveSnapshot(YamlSaveHelper& yamlSaveHelper); void SC01_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/SaveState.cpp b/source/SaveState.cpp index 14520d6f6..37621d8e4 100644 --- a/source/SaveState.cpp +++ b/source/SaveState.cpp @@ -149,17 +149,17 @@ void Snapshot_SetFilename(const std::string& filename, const std::string& path/* Snapshot_SetPathname(pathname+filename); } -const std::string& Snapshot_GetFilename(void) +const std::string& Snapshot_GetFilename() { return g_strSaveStateFilename; } -const std::string& Snapshot_GetPath(void) +const std::string& Snapshot_GetPath() { return g_strSaveStatePath; } -const std::string& Snapshot_GetPathname(void) +const std::string& Snapshot_GetPathname() { return g_strSaveStatePathname; } @@ -187,7 +187,7 @@ void Snapshot_GetDefaultFilenameAndPath(std::string& defaultFilename, std::strin // Called by Disk2InterfaceCard::InsertDisk() and HD_Insert() after a successful insertion // Called by Disk2InterfaceCard::EjectDisk() and HD_Unplug() // Called by RepeatInitialization() when Harddisk Controller card is disabled -void Snapshot_UpdatePath(void) +void Snapshot_UpdatePath() { std::string defaultFilename; std::string defaultPath; @@ -204,25 +204,25 @@ void Snapshot_UpdatePath(void) //----------------------------------------------------------------------------- -static const std::string& GetSnapshotUnitApple2Name(void) +static const std::string& GetSnapshotUnitApple2Name() { static const std::string name("Apple2"); return name; } -static const std::string& GetSnapshotUnitSlotsName(void) +static const std::string& GetSnapshotUnitSlotsName() { static const std::string name("Slots"); return name; } -static const std::string& GetSnapshotUnitGameIOConnectorName(void) +static const std::string& GetSnapshotUnitGameIOConnectorName() { static const std::string name("Game I/O Connector"); return name; } -static const std::string& GetSnapshotUnitMiscName(void) +static const std::string& GetSnapshotUnitMiscName() { static const std::string name("Miscellaneous"); return name; @@ -259,7 +259,7 @@ static eApple2Type ParseApple2Type(std::string type) throw std::runtime_error("Load: Unknown Apple2 type"); } -static std::string GetApple2TypeAsString(void) +static std::string GetApple2TypeAsString() { switch ( GetApple2Type() ) { @@ -346,7 +346,7 @@ static void ParseSlots(YamlLoadHelper& yamlLoadHelper, UINT unitVersion) //--- -static void ParseUnit(void) +static void ParseUnit() { yamlHelper.GetMapStartEvent(); @@ -388,7 +388,7 @@ static void ParseUnit(void) } } -static void Snapshot_LoadState_v2(void) +static void Snapshot_LoadState_v2() { bool restart = false; // Only need to restart if any VM state has change HCURSOR oldcursor = SetCursor(LoadCursor(0,IDC_WAIT)); @@ -500,7 +500,7 @@ void Snapshot_LoadState() //----------------------------------------------------------------------------- -void Snapshot_SaveState(void) +void Snapshot_SaveState() { LogFileOutput("Saving Save-State to %s\n", g_strSaveStatePathname.c_str()); try diff --git a/source/SaveState.h b/source/SaveState.h index 8b2fcbc11..56e4a46ae 100644 --- a/source/SaveState.h +++ b/source/SaveState.h @@ -3,11 +3,11 @@ const bool kSaveStateOnExit_Default = false; void Snapshot_SetFilename(const std::string& filename, const std::string& path=""); -const std::string& Snapshot_GetFilename(void); -const std::string& Snapshot_GetPath(void); -const std::string& Snapshot_GetPathname(void); +const std::string& Snapshot_GetFilename(); +const std::string& Snapshot_GetPath(); +const std::string& Snapshot_GetPathname(); void Snapshot_GetDefaultFilenameAndPath(std::string& defaultFilename, std::string& defaultPath); -void Snapshot_UpdatePath(void); +void Snapshot_UpdatePath(); void Snapshot_LoadState(); void Snapshot_SaveState(); void Snapshot_Startup(); diff --git a/source/SerialComms.cpp b/source/SerialComms.cpp index c8690aba4..4bf9f1306 100644 --- a/source/SerialComms.cpp +++ b/source/SerialComms.cpp @@ -710,7 +710,7 @@ BYTE __stdcall CSuperSerialCard::CommReceive(WORD, WORD, BYTE, BYTE, ULONG) //=========================================================================== -void CSuperSerialCard::TransmitDone(void) +void CSuperSerialCard::TransmitDone() { if (m_hCommHandle != INVALID_HANDLE_VALUE) { @@ -1395,7 +1395,7 @@ void CSuperSerialCard::SetSerialPortName(const char* pSerialPortName) } } -void CSuperSerialCard::SetRegistrySerialPortName(void) +void CSuperSerialCard::SetRegistrySerialPortName() { std::string regSection = RegGetConfigSlotSection(m_slot); RegSaveString(regSection.c_str(), REGVALUE_SERIAL_PORT_NAME, true, GetSerialPortName()); @@ -1429,7 +1429,7 @@ static const UINT kUNIT_VERSION = 2; #define SS_YAML_KEY_SERIALPORTNAME "Serial Port Name" #define SS_YAML_KEY_SUPPORT_DCD "Support DCD" -const std::string& CSuperSerialCard::GetSnapshotCardName(void) +const std::string& CSuperSerialCard::GetSnapshotCardName() { static const std::string name("Super Serial Card"); return name; diff --git a/source/SerialComms.h b/source/SerialComms.h index ca0ac75a0..3cdd0b698 100644 --- a/source/SerialComms.h +++ b/source/SerialComms.h @@ -31,7 +31,7 @@ class CSuperSerialCard : public Card virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Reset(const bool powerCycle); virtual void Destroy() {} - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); @@ -68,7 +68,7 @@ class CSuperSerialCard : public Card void SetDIPSWDefaults(); UINT BaudRateToIndex(UINT uBaudRate); void UpdateCommState(); - void TransmitDone(void); + void TransmitDone(); bool CheckComm(); void CloseComm(); void CheckCommEvent(DWORD dwEvtMask); @@ -78,7 +78,7 @@ class CSuperSerialCard : public Card UINT GetNumSerialPortChoices() { return (UINT) m_vecSerialPortsItems.size(); } void ScanCOMPorts(); void SetSerialPortName(const char* pSerialPortName); - void SetRegistrySerialPortName(void); + void SetRegistrySerialPortName(); void SaveSnapshotDIPSW(class YamlSaveHelper& yamlSaveHelper, std::string key, SSC_DIPSW& dipsw); void LoadSnapshotDIPSW(class YamlLoadHelper& yamlLoadHelper, std::string key, SSC_DIPSW& dipsw); diff --git a/source/SoundCore.cpp b/source/SoundCore.cpp index 4cee1fc65..af5f25656 100644 --- a/source/SoundCore.cpp +++ b/source/SoundCore.cpp @@ -49,7 +49,7 @@ static VOICE* g_pSpeakerVoice = NULL; // NB. Also similar is done by: MockingboardCardManager::Destroy() // - which is called from WM_DESTROY (when both restarting VM & exiting the app) -VOICE::~VOICE(void) +VOICE::~VOICE() { if (lpDSBvoice) { @@ -590,3 +590,33 @@ void SysClk_StopTimer() g_bRefClockTimerActive = false; } + +bool SoundCore_ValidateAndAlignWriteOffset( + uint32_t& rByteOffset, + DWORD dwCurrentPlayCursor, + DWORD dwCurrentWriteCursor) +{ + // Verify that the write offset hasn't drifted into the unsafe hardware playback zone + // (between the play cursor and the write cursor). If it has, align it to the write cursor. + // Returns true if alignment was performed (drift/error detected), false otherwise. + if (dwCurrentWriteCursor > dwCurrentPlayCursor) + { + // |-----PxxxxxW-----| + if ((rByteOffset > dwCurrentPlayCursor) && (rByteOffset < dwCurrentWriteCursor)) + { + rByteOffset = dwCurrentWriteCursor; + return true; + } + } + else + { + // |xxW----------Pxxx| + if ((rByteOffset > dwCurrentPlayCursor) || (rByteOffset < dwCurrentWriteCursor)) + { + rByteOffset = dwCurrentWriteCursor; + return true; + } + } + + return false; +} diff --git a/source/SoundCore.h b/source/SoundCore.h index d5c0226ef..fd4aaf535 100644 --- a/source/SoundCore.h +++ b/source/SoundCore.h @@ -20,7 +20,7 @@ struct VOICE bool bRecentlyActive; // (Speaker only) false after 0.2s of speaker inactivity std::string name; - VOICE(void) + VOICE() { bActive = false; bMute = false; @@ -32,7 +32,7 @@ struct VOICE name = ""; } - ~VOICE(void); + ~VOICE(); }; typedef VOICE* PVOICE; @@ -60,6 +60,13 @@ void SoundCore_SetErrorMax(const int nErrorMax); void SoundCore_StopTimer(); +// Returns true if the write offset was in the unsafe zone and had to be aligned to the write cursor. +// Returns false if the write offset was already in a safe zone and did not need alignment. +bool SoundCore_ValidateAndAlignWriteOffset( + uint32_t& rByteOffset, + DWORD dwCurrentPlayCursor, + DWORD dwCurrentWriteCursor); + LONG NewVolume(uint32_t dwVolume, uint32_t dwVolumeMax); void SysClk_WaitTimer(); diff --git a/source/Speaker.cpp b/source/Speaker.cpp index cd4931979..70ac339fc 100644 --- a/source/Speaker.cpp +++ b/source/Speaker.cpp @@ -97,12 +97,12 @@ static void Spkr_DSUninit(); static bool g_bSpkrOutputToRiff = false; -void Spkr_OutputToRiff(void) +void Spkr_OutputToRiff() { g_bSpkrOutputToRiff = true; } -UINT Spkr_GetNumChannels(void) +UINT Spkr_GetNumChannels() { return g_nSPKR_NumChannels; } @@ -158,7 +158,7 @@ static void DisplayBenchmarkResults() static UINT g_uDCFilterState = 0; -inline void ResetDCFilter(void) +inline void ResetDCFilter() { // reset the attenuator with an additional 250ms of full gain // (10000 samples) before it starts attenuating @@ -191,18 +191,28 @@ static void QueueOneFrame(short* dest, UINT& index, short sample_in) index++; } +static uint32_t FramesToBytes(uint32_t frames) +{ + return frames * sizeof(short) * g_nSPKR_NumChannels; +} + +static uint32_t BytesToFrames(uint32_t bytes) +{ + return bytes / (sizeof(short) * g_nSPKR_NumChannels); +} + static void PadNFrames(short* dest, uint32_t sizeBytes) { if (sizeBytes) { - const UINT numSamples = sizeBytes / (sizeof(short) * g_nSPKR_NumChannels); + const UINT numFrames = BytesToFrames(sizeBytes); UINT index = 0; - for (UINT i = 0; i < numSamples; i++) + for (UINT i = 0; i < numFrames; i++) { QueueOneFrame(dest, index, g_nSpeakerData); } if (g_bSpkrOutputToRiff) - RiffPutSamples(dest, numSamples); + RiffPutSamples(dest, numFrames); } } @@ -452,7 +462,7 @@ void SpkrUpdate(uint32_t totalcycles) nSamplesUsed = Spkr_SubmitWaveBuffer(g_pSpeakerBuffer, g_nBufferIdx); _ASSERT(nSamplesUsed <= g_nBufferIdx); - memmove(g_pSpeakerBuffer, &g_pSpeakerBuffer[nSamplesUsed * g_nSPKR_NumChannels], (g_nBufferIdx - nSamplesUsed) * sizeof(short) * g_nSPKR_NumChannels); + memmove(g_pSpeakerBuffer, &g_pSpeakerBuffer[nSamplesUsed * g_nSPKR_NumChannels], FramesToBytes(g_nBufferIdx - nSamplesUsed)); g_nBufferIdx -= nSamplesUsed; } @@ -465,7 +475,7 @@ void SpkrUpdate_Timer() nSamplesUsed = Spkr_SubmitWaveBuffer_FullSpeed(g_pSpeakerBuffer, g_nBufferIdx); _ASSERT(nSamplesUsed <= g_nBufferIdx); - memmove(g_pSpeakerBuffer, &g_pSpeakerBuffer[nSamplesUsed * g_nSPKR_NumChannels], (g_nBufferIdx - nSamplesUsed) * sizeof(short) * g_nSPKR_NumChannels); + memmove(g_pSpeakerBuffer, &g_pSpeakerBuffer[nSamplesUsed * g_nSPKR_NumChannels], FramesToBytes(g_nBufferIdx - nSamplesUsed)); g_nBufferIdx -= nSamplesUsed; } @@ -518,25 +528,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa else { // Check that our offset isn't between Play & Write positions - - if(dwCurrentWriteCursor > dwCurrentPlayCursor) - { - // |-----PxxxxxW-----| - if((dwByteOffset > dwCurrentPlayCursor) && (dwByteOffset < dwCurrentWriteCursor)) - { - //LogOutput("[Submit_FS] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - dwByteOffset = dwCurrentWriteCursor; - } - } - else - { - // |xxW----------Pxxx| - if((dwByteOffset > dwCurrentPlayCursor) || (dwByteOffset < dwCurrentWriteCursor)) - { - //LogOutput("[Submit_FS] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - dwByteOffset = dwCurrentWriteCursor; - } - } + SoundCore_ValidateAndAlignWriteOffset(dwByteOffset, dwCurrentPlayCursor, dwCurrentWriteCursor); } // Calc bytes remaining to be played @@ -553,7 +545,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa if(nBytesRemaining < g_dwDSSpkrBufferSize / 4) { // < 1/4 of play-buffer remaining (need *more* data) - nNumPadSamples = ((g_dwDSSpkrBufferSize / 4) - nBytesRemaining) / (sizeof(short) * g_nSPKR_NumChannels); + nNumPadSamples = BytesToFrames((g_dwDSSpkrBufferSize / 4) - nBytesRemaining); if(nNumPadSamples > nNumSamples) nNumPadSamples -= nNumSamples; @@ -568,15 +560,15 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa UINT nBytesFree = g_dwDSSpkrBufferSize - nBytesRemaining; // Calc free buffer space ULONG nNumSamplesToUse = nNumSamples + nNumPadSamples; - if (nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels > nBytesFree) - nNumSamplesToUse = nBytesFree / (sizeof(short) * g_nSPKR_NumChannels); + if (FramesToBytes(nNumSamplesToUse) > nBytesFree) + nNumSamplesToUse = BytesToFrames(nBytesFree); // if(nNumSamplesToUse >= 128) // Limit the buffer unlock/locking to a minimum { hr = DSGetLock(SpeakerVoice.lpDSBvoice, - dwByteOffset, (uint32_t)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, + dwByteOffset, FramesToBytes(nNumSamplesToUse), &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -591,15 +583,15 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa { //LogOutput("[Submit_FS] C=%08X, PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X ***\n", nDbgSpkrCnt, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - if (nNumSamples * sizeof(short) * g_nSPKR_NumChannels <= dwDSLockedBufferSize0) + if (FramesToBytes(nNumSamples) <= dwDSLockedBufferSize0) { - dwBufferSize0 = nNumSamples * sizeof(short) * g_nSPKR_NumChannels; + dwBufferSize0 = FramesToBytes(nNumSamples); dwBufferSize1 = 0; } else { dwBufferSize0 = dwDSLockedBufferSize0; - dwBufferSize1 = nNumSamples * sizeof(short) * g_nSPKR_NumChannels - dwDSLockedBufferSize0; + dwBufferSize1 = FramesToBytes(nNumSamples) - dwDSLockedBufferSize0; if(dwBufferSize1 > dwDSLockedBufferSize1) dwBufferSize1 = dwDSLockedBufferSize1; @@ -607,15 +599,15 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa memcpy(pDSLockedBuffer0, &pSpeakerBuffer[0], dwBufferSize0); if (g_bSpkrOutputToRiff) - RiffPutSamples(pDSLockedBuffer0, dwBufferSize0 / (sizeof(short) * g_nSPKR_NumChannels)); - nNumSamples = dwBufferSize0 / (sizeof(short) * g_nSPKR_NumChannels); + RiffPutSamples(pDSLockedBuffer0, BytesToFrames(dwBufferSize0)); + nNumSamples = BytesToFrames(dwBufferSize0); if(pDSLockedBuffer1 && dwBufferSize1) { memcpy(pDSLockedBuffer1, &pSpeakerBuffer[dwDSLockedBufferSize0/sizeof(short)], dwBufferSize1); if (g_bSpkrOutputToRiff) - RiffPutSamples(pDSLockedBuffer1, dwBufferSize1 / (sizeof(short) * g_nSPKR_NumChannels)); - nNumSamples += dwBufferSize1 / (sizeof(short) * g_nSPKR_NumChannels); + RiffPutSamples(pDSLockedBuffer1, BytesToFrames(dwBufferSize1)); + nNumSamples += BytesToFrames(dwBufferSize1); } } @@ -636,7 +628,7 @@ static ULONG Spkr_SubmitWaveBuffer_FullSpeed(short* pSpeakerBuffer, ULONG nNumSa if(FAILED(hr)) return nNumSamples; - dwByteOffset = (dwByteOffset + (uint32_t)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; + dwByteOffset = (dwByteOffset + FramesToBytes(nNumSamplesToUse)) % g_dwDSSpkrBufferSize; } return nNumSamples; @@ -690,34 +682,14 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) else { // Check that our offset isn't between Play & Write positions - - if(dwCurrentWriteCursor > dwCurrentPlayCursor) - { - // |-----PxxxxxW-----| - if((dwByteOffset > dwCurrentPlayCursor) && (dwByteOffset < dwCurrentWriteCursor)) - { - double fTicksSecs = (double)GetTickCount() / 1000.0; - //LogOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - //LogFileOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - - dwByteOffset = dwCurrentWriteCursor; - nNumSamplesError = 0; - bBufferError = true; - } - } - else + if (SoundCore_ValidateAndAlignWriteOffset(dwByteOffset, dwCurrentPlayCursor, dwCurrentWriteCursor)) { - // |xxW----------Pxxx| - if((dwByteOffset > dwCurrentPlayCursor) || (dwByteOffset < dwCurrentWriteCursor)) - { - double fTicksSecs = (double)GetTickCount() / 1000.0; - //LogOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - //LogFileOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X XXX\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); + //double fTicksSecs = (double)GetTickCount() / 1000.0; + //LogOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); + //LogFileOutput("%010.3f: [Submit] PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X xxx\n", fTicksSecs, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamples); - dwByteOffset = dwCurrentWriteCursor; - nNumSamplesError = 0; - bBufferError = true; - } + nNumSamplesError = 0; + bBufferError = true; } } @@ -747,8 +719,8 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) UINT nBytesFree = g_dwDSSpkrBufferSize - nBytesRemaining; // Calc free buffer space ULONG nNumSamplesToUse = nNumSamples; - if(nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels > nBytesFree) - nNumSamplesToUse = nBytesFree / (sizeof(short) * g_nSPKR_NumChannels); + if(FramesToBytes(nNumSamplesToUse) > nBytesFree) + nNumSamplesToUse = BytesToFrames(nBytesFree); if(bBufferError) pSpeakerBuffer = &pSpeakerBuffer[(nNumSamples - nNumSamplesToUse) * g_nSPKR_NumChannels]; @@ -760,7 +732,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) //LogOutput("[Submit] C=%08X, PC=%08X, WC=%08X, Diff=%08X, Off=%08X, NS=%08X +++\n", nDbgSpkrCnt, dwCurrentPlayCursor, dwCurrentWriteCursor, dwCurrentWriteCursor-dwCurrentPlayCursor, dwByteOffset, nNumSamplesToUse); hr = DSGetLock(SpeakerVoice.lpDSBvoice, - dwByteOffset, (uint32_t)nNumSamplesToUse * sizeof(short) * g_nSPKR_NumChannels, + dwByteOffset, FramesToBytes(nNumSamplesToUse), &pDSLockedBuffer0, &dwDSLockedBufferSize0, &pDSLockedBuffer1, &dwDSLockedBufferSize1); if (FAILED(hr)) @@ -771,13 +743,13 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) memcpy(pDSLockedBuffer0, &pSpeakerBuffer[0], dwDSLockedBufferSize0); if (g_bSpkrOutputToRiff) - RiffPutSamples(pDSLockedBuffer0, dwDSLockedBufferSize0 / (sizeof(short) * g_nSPKR_NumChannels)); + RiffPutSamples(pDSLockedBuffer0, BytesToFrames(dwDSLockedBufferSize0)); if(pDSLockedBuffer1) { memcpy(pDSLockedBuffer1, &pSpeakerBuffer[dwDSLockedBufferSize0/sizeof(short)], dwDSLockedBufferSize1); if (g_bSpkrOutputToRiff) - RiffPutSamples(pDSLockedBuffer1, dwDSLockedBufferSize1 / (sizeof(short) * g_nSPKR_NumChannels)); + RiffPutSamples(pDSLockedBuffer1, BytesToFrames(dwDSLockedBufferSize1)); } // Commit sound buffer @@ -789,7 +761,7 @@ static ULONG Spkr_SubmitWaveBuffer(short* pSpeakerBuffer, ULONG nNumSamples) return nNumSamples; } - dwByteOffset = (dwByteOffset + (uint32_t)nNumSamplesToUse*sizeof(short)*g_nSPKR_NumChannels) % g_dwDSSpkrBufferSize; + dwByteOffset = (dwByteOffset + FramesToBytes(nNumSamplesToUse)) % g_dwDSSpkrBufferSize; } return bBufferError ? nNumSamples : nNumSamplesToUse; @@ -933,7 +905,7 @@ static void Spkr_DSUninit() #define SS_YAML_KEY_LASTCYCLE "Last Cycle" -static const std::string& SpkrGetSnapshotStructName(void) +static const std::string& SpkrGetSnapshotStructName() { static const std::string name("Speaker"); return name; diff --git a/source/Speaker.h b/source/Speaker.h index b414100a5..07f8994d2 100644 --- a/source/Speaker.h +++ b/source/Speaker.h @@ -16,8 +16,8 @@ void Spkr_Mute(); void Spkr_Unmute(); bool Spkr_IsActive(); bool Spkr_DSInit(); -void Spkr_OutputToRiff(void); -UINT Spkr_GetNumChannels(void); +void Spkr_OutputToRiff(); +UINT Spkr_GetNumChannels(); void SpkrSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void SpkrLoadSnapshot(class YamlLoadHelper& yamlLoadHelper); diff --git a/source/Speech.cpp b/source/Speech.cpp index e0a6581f8..09b8a555c 100644 --- a/source/Speech.cpp +++ b/source/Speech.cpp @@ -5,20 +5,20 @@ #ifdef USE_SPEECH_API #include -CSpeech::~CSpeech(void) +CSpeech::~CSpeech() { // Don't do this: causes crash on app exit! //if (m_cpVoice) // m_cpVoice->Release(); } -bool CSpeech::Init(void) +bool CSpeech::Init() { HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_INPROC, IID_ISpVoice, (LPVOID*)&m_cpVoice); return hr == S_OK; } -void CSpeech::Reset(void) +void CSpeech::Reset() { if (!m_cpVoice) return; diff --git a/source/Speech.h b/source/Speech.h index 128711f21..1cb7f6d17 100644 --- a/source/Speech.h +++ b/source/Speech.h @@ -11,9 +11,9 @@ class CSpeech } virtual ~CSpeech(); - bool Init(void); - void Reset(void); - bool IsEnabled(void) { return m_cpVoice != NULL; } + bool Init(); + void Reset(); + bool IsEnabled() { return m_cpVoice != NULL; } void Speak(const char* const pBuffer); private: diff --git a/source/SynchronousEventManager.h b/source/SynchronousEventManager.h index 9a48d4058..1777b3513 100644 --- a/source/SynchronousEventManager.h +++ b/source/SynchronousEventManager.h @@ -9,13 +9,13 @@ class SynchronousEventManager {} ~SynchronousEventManager(){} - SyncEvent* GetHead(void) { return m_syncEventHead; } + SyncEvent* GetHead() { return m_syncEventHead; } void SetHead(SyncEvent* head) { m_syncEventHead = head; } void Insert(SyncEvent* pNewEvent); bool Remove(int id); void Update(int cycles, ULONG uExecutedCycles); - void Reset(void) { m_syncEventHead = NULL; } + void Reset() { m_syncEventHead = NULL; } private: SyncEvent* m_syncEventHead; diff --git a/source/Tfe/PCapBackend.cpp b/source/Tfe/PCapBackend.cpp index 6173b8e7b..87383e45e 100644 --- a/source/Tfe/PCapBackend.cpp +++ b/source/Tfe/PCapBackend.cpp @@ -88,7 +88,7 @@ const std::string & PCapBackend::getInterfaceName() return m_interfaceName; } -int PCapBackend::tfe_enumadapter_open(void) +int PCapBackend::tfe_enumadapter_open() { return tfe_arch_enumadapter_open(); } @@ -98,12 +98,12 @@ int PCapBackend::tfe_enumadapter(std::string & name, std::string & description) return tfe_arch_enumadapter(name, description); } -int PCapBackend::tfe_enumadapter_close(void) +int PCapBackend::tfe_enumadapter_close() { return tfe_arch_enumadapter_close(); } -const char * PCapBackend::tfe_lib_version(void) +const char * PCapBackend::tfe_lib_version() { return tfe_arch_lib_version(); } diff --git a/source/Tfe/PCapBackend.h b/source/Tfe/PCapBackend.h index 20cd42ff5..c8bde5e89 100644 --- a/source/Tfe/PCapBackend.h +++ b/source/Tfe/PCapBackend.h @@ -60,10 +60,10 @@ class PCapBackend : public NetworkBackend *ppname and *ppdescription are not altered. */ - static int tfe_enumadapter_open(void); + static int tfe_enumadapter_open(); static int tfe_enumadapter(std::string & name, std::string & description); - static int tfe_enumadapter_close(void); - static const char * tfe_lib_version(void); + static int tfe_enumadapter_close(); + static const char * tfe_lib_version(); static int tfe_is_npcap_loaded(); private: diff --git a/source/Tfe/tfearch.cpp b/source/Tfe/tfearch.cpp index 89fe1c884..417abf6e6 100644 --- a/source/Tfe/tfearch.cpp +++ b/source/Tfe/tfearch.cpp @@ -69,7 +69,7 @@ typedef int (*pcap_datalink_t)(pcap_t *); typedef int (*pcap_findalldevs_t)(pcap_if_t **, char *); typedef void (*pcap_freealldevs_t)(pcap_if_t *); typedef int (*pcap_sendpacket_t)(pcap_t *p, u_char *buf, int size); -typedef const char *(*pcap_lib_version_t)(void); +typedef const char *(*pcap_lib_version_t)(); typedef char* (*pcap_geterr_t)(pcap_t* p); static pcap_open_live_t p_pcap_open_live; @@ -86,7 +86,7 @@ static pcap_geterr_t p_pcap_geterr; static HINSTANCE pcap_library = NULL; static -void TfePcapFreeLibrary(void) +void TfePcapFreeLibrary() { if (pcap_library) { if (!FreeLibrary(pcap_library)) { @@ -117,7 +117,7 @@ void TfePcapFreeLibrary(void) } static -BOOL TfePcapLoadLibrary(void) +BOOL TfePcapLoadLibrary() { if (pcap_library) { @@ -180,7 +180,7 @@ BOOL TfePcapLoadLibrary(void) #define p_pcap_lib_version pcap_lib_version #define p_pcap_geterr pcap_geterr -static BOOL TfePcapLoadLibrary(void) +static BOOL TfePcapLoadLibrary() { static bool loaded = false; if (!loaded) @@ -229,7 +229,7 @@ void debug_output( const char *text, const BYTE *what, int count ) #endif // #ifdef TFE_DEBUG_PKTDUMP static -void TfePcapCloseAdapter(void) +void TfePcapCloseAdapter() { if (TfePcapAlldevs) { (*p_pcap_freealldevs)(TfePcapAlldevs); @@ -257,7 +257,7 @@ void TfePcapCloseAdapter(void) TfeEnumAdapter() only fails if there is no more adpater; in this case, *ppname and *ppdescription are not altered. */ -int tfe_arch_enumadapter_open(void) +int tfe_arch_enumadapter_open() { if (!TfePcapLoadLibrary()) { return 0; @@ -296,7 +296,7 @@ int tfe_arch_enumadapter(std::string & name, std::string & description) return 1; } -int tfe_arch_enumadapter_close(void) +int tfe_arch_enumadapter_close() { if (TfePcapAlldevs) { (*p_pcap_freealldevs)(TfePcapAlldevs); @@ -401,7 +401,7 @@ void tfe_arch_set_hashfilter(const uint32_t hash_mask[2]) /* -void tfe_arch_receive_remove_committed_frame(void) +void tfe_arch_receive_remove_committed_frame() { #ifdef TFE_DEBUG_ARCH if(g_fh) fprintf( g_fh, "tfe_arch_receive_remove_committed_frame().\n" ); diff --git a/source/Tfe/tfearch.h b/source/Tfe/tfearch.h index 5fef75662..82683851e 100644 --- a/source/Tfe/tfearch.h +++ b/source/Tfe/tfearch.h @@ -65,9 +65,9 @@ int tfe_arch_receive(pcap_t * TfePcapFP, ); extern int tfe_arch_is_npcap_loaded(); -extern int tfe_arch_enumadapter_open(void); +extern int tfe_arch_enumadapter_open(); extern int tfe_arch_enumadapter(std::string & name, std::string & description); -extern int tfe_arch_enumadapter_close(void); +extern int tfe_arch_enumadapter_close(); extern const char * tfe_arch_lib_version(); diff --git a/source/Uthernet1.cpp b/source/Uthernet1.cpp index 17dcd9107..199230d64 100644 --- a/source/Uthernet1.cpp +++ b/source/Uthernet1.cpp @@ -153,7 +153,7 @@ WORD Uthernet1::tfe_debug_output_io_getFunc( int i ) return GET_TFE_16(i); } -void Uthernet1::tfe_debug_output_io( void ) +void Uthernet1::tfe_debug_output_io() { tfe_debug_output_general( "TFE I/O", &Uthernet1::tfe_debug_output_io_getFunc, TFE_COUNT_IO_REGISTER ); } @@ -164,7 +164,7 @@ WORD Uthernet1::tfe_debug_output_pp_getFunc( int i ) return GET_PP_16(i); } -void Uthernet1::tfe_debug_output_pp( void ) +void Uthernet1::tfe_debug_output_pp() { tfe_debug_output_general( "PacketPage", &Uthernet1::tfe_debug_output_pp_getFunc, 0x0160 /* MAX_PACKETPAGE_ARRAY */ ); } @@ -189,7 +189,7 @@ Uthernet1::Uthernet1(UINT slot) : Card(CT_Uthernet, slot) Init(); } -void Uthernet1::Init(void) +void Uthernet1::Init() { // Initialise all state member variables // in the same order as the header file to ease maintenance @@ -864,7 +864,7 @@ int Uthernet1::tfe_should_accept(unsigned char *buffer, int length, int *phashed #endif -WORD Uthernet1::tfe_receive(void) +WORD Uthernet1::tfe_receive() { WORD ret_val = 0x0004; @@ -1057,7 +1057,7 @@ void Uthernet1::Update(const ULONG nExecutedCycles) static const UINT kUNIT_VERSION = 1; -const std::string& Uthernet1::GetSnapshotCardName(void) +const std::string& Uthernet1::GetSnapshotCardName() { static const std::string name("Uthernet"); return name; diff --git a/source/Uthernet1.h b/source/Uthernet1.h index 10b865d5b..0c5478a5b 100644 --- a/source/Uthernet1.h +++ b/source/Uthernet1.h @@ -123,7 +123,7 @@ class Uthernet1 : public Card public: Uthernet1(UINT slot); - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles); @@ -133,7 +133,7 @@ class Uthernet1 : public Card BYTE tfe_read(WORD ioaddress); void tfe_store(WORD ioaddress, BYTE byte); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); private: @@ -144,7 +144,7 @@ class Uthernet1 : public Card void tfe_sideeffects_read_pp(WORD ppaddress); void tfe_proceed_rx_buffer(int oddaddress); - WORD tfe_receive(void); + WORD tfe_receive(); int tfe_should_accept(unsigned char *buffer, int length, int *phashed, int *phash_index, int *pcorrect_mac, int *pbroadcast, int *pmulticast); @@ -165,8 +165,8 @@ class Uthernet1 : public Card void tfe_debug_output_general( const char *what, WORD (Uthernet1::*getFunc)(int), int count ); WORD tfe_debug_output_io_getFunc( int i ); WORD tfe_debug_output_pp_getFunc( int i ); - void tfe_debug_output_io( void ); - void tfe_debug_output_pp( void ); + void tfe_debug_output_io(); + void tfe_debug_output_pp(); #endif /* status which received packages to accept diff --git a/source/Uthernet2.h b/source/Uthernet2.h index 9831df88a..13e5b2ec9 100644 --- a/source/Uthernet2.h +++ b/source/Uthernet2.h @@ -69,7 +69,7 @@ class Uthernet2 : public Card Uthernet2(UINT slot); virtual ~Uthernet2(); - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles); diff --git a/source/VidHD.cpp b/source/VidHD.cpp index 5d633629f..7d7517abe 100644 --- a/source/VidHD.cpp +++ b/source/VidHD.cpp @@ -99,7 +99,7 @@ void VidHDCard::VideoIOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG } } -bool VidHDCard::IsWriteAux(void) +bool VidHDCard::IsWriteAux() { return MemIsWriteAux(m_memMode); } @@ -182,13 +182,13 @@ static const UINT kUNIT_VERSION = 1; #define SS_YAML_KEY_BORDER_COLOR "Border Color" #define SS_YAML_KEY_SHADOW "Shadow" -const std::string& VidHDCard::GetSnapshotCardName(void) +const std::string& VidHDCard::GetSnapshotCardName() { static const std::string name("VidHD"); return name; } -static const std::string& MemGetSnapshotAuxMemStructName(void) +static const std::string& MemGetSnapshotAuxMemStructName() { static const std::string name("Auxiliary Memory Bank"); return name; diff --git a/source/VidHD.h b/source/VidHD.h index 0157bb10c..fe9ff664b 100644 --- a/source/VidHD.h +++ b/source/VidHD.h @@ -20,12 +20,12 @@ class VidHDCard : public Card GetVideo().SetVidHD(true); } - virtual ~VidHDCard(void) + virtual ~VidHDCard() { GetVideo().SetVidHD(false); } - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle); virtual void Update(const ULONG nExecutedCycles) {} virtual void InitializeIO(LPBYTE pCxRomPeripheral); @@ -34,13 +34,13 @@ class VidHDCard : public Card void VideoIOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - bool IsSHR(void) { return (m_NEWVIDEO & 0xC0) == 0xC0; } // 11000000 = Enable SHR(b7) | Linearize SHR video memory(b6) - bool IsDHGRBlackAndWhite(void) { return (m_NEWVIDEO & (1 << 5)) ? true : false; } - bool IsWriteAux(void); + bool IsSHR() { return (m_NEWVIDEO & 0xC0) == 0xC0; } // 11000000 = Enable SHR(b7) | Linearize SHR video memory(b6) + bool IsDHGRBlackAndWhite() { return (m_NEWVIDEO & (1 << 5)) ? true : false; } + bool IsWriteAux(); static void UpdateSHRCell(bool is640Mode, bool isColorFillMode, uint16_t addrPalette, bgra_t* pVideoAddress, uint32_t a); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); diff --git a/source/Video.cpp b/source/Video.cpp index 532762dd5..8a7b508ce 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -91,50 +91,50 @@ const char* const Video::g_apVideoModeDesc[NUM_VIDEO_MODES] = //=========================================================================== -UINT Video::GetFrameBufferBorderlessWidth(void) +UINT Video::GetFrameBufferBorderlessWidth() { return HasVidHD() ? kVideoWidthIIgs : kVideoWidthII; } -UINT Video::GetFrameBufferBorderlessHeight(void) +UINT Video::GetFrameBufferBorderlessHeight() { return HasVidHD() ? kVideoHeightIIgs : kVideoHeightII; } // NB. These border areas are not visible (... and these border areas are unrelated to the 3D border below) -UINT Video::GetFrameBufferBorderWidth(void) +UINT Video::GetFrameBufferBorderWidth() { static const UINT uBorderW = 20; return uBorderW; } -UINT Video::GetFrameBufferBorderHeight(void) +UINT Video::GetFrameBufferBorderHeight() { static const UINT uBorderH = 18; return uBorderH; } -UINT Video::GetFrameBufferWidth(void) +UINT Video::GetFrameBufferWidth() { return GetFrameBufferBorderlessWidth() + 2 * GetFrameBufferBorderWidth(); } -UINT Video::GetFrameBufferHeight(void) +UINT Video::GetFrameBufferHeight() { return GetFrameBufferBorderlessHeight() + 2 * GetFrameBufferBorderHeight(); } -UINT Video::GetFrameBufferCentringOffsetX(void) +UINT Video::GetFrameBufferCentringOffsetX() { return HasVidHD() ? ((kVideoWidthIIgs - kVideoWidthII) / 2) : 0; } -UINT Video::GetFrameBufferCentringOffsetY(void) +UINT Video::GetFrameBufferCentringOffsetY() { return HasVidHD() ? ((kVideoHeightIIgs - kVideoHeightII) / 2) : 0; } -int Video::GetFrameBufferCentringValue(void) +int Video::GetFrameBufferCentringValue() { int value = 0; @@ -161,7 +161,7 @@ void Video::VideoReinitialize(bool bInitVideoScannerAddress) //=========================================================================== -void Video::VideoResetState(void) +void Video::VideoResetState() { g_nAltCharSetOffset = 0; g_uVideoMode = VF_TEXT; @@ -242,47 +242,47 @@ BYTE Video::VideoSetMode(WORD pc, WORD address, BYTE write, BYTE d, ULONG uExecu //=========================================================================== -bool Video::VideoGetSW80COL(void) +bool Video::VideoGetSW80COL() { return SW_80COL ? true : false; } -bool Video::VideoGetSWDHIRES(void) +bool Video::VideoGetSWDHIRES() { return SW_DHIRES ? true : false; } -bool Video::VideoGetSWHIRES(void) +bool Video::VideoGetSWHIRES() { return SW_HIRES ? true : false; } -bool Video::VideoGetSW80STORE(void) +bool Video::VideoGetSW80STORE() { return SW_80STORE ? true : false; } -bool Video::VideoGetSWMIXED(void) +bool Video::VideoGetSWMIXED() { return SW_MIXED ? true : false; } -bool Video::VideoGetSWPAGE2(void) +bool Video::VideoGetSWPAGE2() { return SW_PAGE2 ? true : false; } -bool Video::VideoGetSWTEXT(void) +bool Video::VideoGetSWTEXT() { return SW_TEXT ? true : false; } -bool Video::VideoGetSWAltCharSet(void) +bool Video::VideoGetSWAltCharSet() { return g_nAltCharSetOffset != 0; } -bool Video::VideoGet80COLAUXEMPTY(void) +bool Video::VideoGet80COLAUXEMPTY() { return g_uVideoMode & VF_80COL_AUX_EMPTY ? true : false; } @@ -294,7 +294,7 @@ bool Video::VideoGet80COLAUXEMPTY(void) #define SS_YAML_KEY_CYCLES_THIS_FRAME "Cycles This Frame" #define SS_YAML_KEY_VIDEO_REFRESH_RATE "Video Refresh Rate" -const std::string& Video::VideoGetSnapshotStructName(void) +const std::string& Video::VideoGetSnapshotStructName() { static const std::string name("Video"); return name; @@ -643,7 +643,7 @@ UINT Video::GetVideoRom(const BYTE*& pVideoRom) return g_videoRomSize; } -bool Video::GetVideoRomRockerSwitch(void) +bool Video::GetVideoRomRockerSwitch() { return g_videoRomRockerSwitch; } @@ -653,7 +653,7 @@ void Video::SetVideoRomRockerSwitch(bool state) g_videoRomRockerSwitch = state; } -bool Video::IsVideoRom4K(void) +bool Video::IsVideoRom4K() { return g_videoRomSize <= kVideoRomSize4K; } @@ -737,7 +737,7 @@ void Video::Config_Save_Video() //=========================================================================== -uint32_t Video::GetVideoMode(void) +uint32_t Video::GetVideoMode() { return g_uVideoMode; } @@ -747,7 +747,7 @@ void Video::SetVideoMode(uint32_t videoMode) g_uVideoMode = videoMode; } -VideoType_e Video::GetVideoType(void) +VideoType_e Video::GetVideoType() { return (VideoType_e) g_eVideoType; } @@ -758,19 +758,19 @@ void Video::SetVideoType(VideoType_e newVideoType) g_eVideoType = newVideoType; } -VideoStyle_e Video::GetVideoStyle(void) +VideoStyle_e Video::GetVideoStyle() { return g_eVideoStyle; } -void Video::IncVideoType(void) +void Video::IncVideoType() { g_eVideoType++; if (g_eVideoType >= NUM_VIDEO_MODES) g_eVideoType = 0; } -void Video::DecVideoType(void) +void Video::DecVideoType() { if (g_eVideoType <= 0) g_eVideoType = NUM_VIDEO_MODES; @@ -794,7 +794,7 @@ bool Video::IsVideoStyle(VideoStyle_e mask) //=========================================================================== -VideoRefreshRate_e Video::GetVideoRefreshRate(void) +VideoRefreshRate_e Video::GetVideoRefreshRate() { return (g_bVideoScannerNTSC == false) ? VR_50HZ : VR_60HZ; } @@ -810,7 +810,7 @@ void Video::SetVideoRefreshRate(VideoRefreshRate_e rate) //=========================================================================== -const char* Video::VideoGetAppWindowTitle(void) +const char* Video::VideoGetAppWindowTitle() { static const char *apVideoMonitorModeDesc[ 2 ] = { @@ -846,7 +846,7 @@ void Video::Initialize(uint8_t* frameBuffer, bool resetState) #endif } -void Video::Destroy(void) +void Video::Destroy() { SetFrameBuffer(NULL); NTSC_Destroy(); @@ -870,14 +870,14 @@ void Video::VideoRefreshBuffer(uint32_t uRedrawWholeScreenVideoMode, bool bRedra } } -void Video::ClearFrameBuffer(void) +void Video::ClearFrameBuffer() { UINT32* frameBuffer = (UINT32*)GetFrameBuffer(); std::fill(frameBuffer, frameBuffer + GetFrameBufferWidth() * GetFrameBufferHeight(), OPAQUE_BLACK); } // Called when entering debugger, and after viewing Apple II video screen from debugger -void Video::ClearSHRResidue(void) +void Video::ClearSHRResidue() { ClearFrameBuffer(); GetFrame().VideoPresentScreen(); diff --git a/source/Video.h b/source/Video.h index de6a00287..7b0b6887e 100644 --- a/source/Video.h +++ b/source/Video.h @@ -187,7 +187,7 @@ struct WinBmpHeader4_t class Video { public: - Video(void) + Video() { g_pFramebufferbits = NULL; // last drawn frame (initialized in WinVideoInitialize) g_nAltCharSetOffset = 0; @@ -201,47 +201,47 @@ class Video m_hasVidHD = false; } - ~Video(void){} + ~Video() {} void Initialize(uint8_t* frameBuffer, bool resetState); // Do not call directly. Call FrameBase::Initialize() - void Destroy(void); // Call FrameBase::Destroy() + void Destroy(); // Call FrameBase::Destroy() - uint8_t* GetFrameBuffer(void) { return g_pFramebufferbits; } + uint8_t* GetFrameBuffer() { return g_pFramebufferbits; } // size of the video buffer stored in g_pFramebufferbits - UINT GetFrameBufferBorderlessWidth(void); - UINT GetFrameBufferBorderlessHeight(void); - UINT GetFrameBufferBorderWidth(void); - UINT GetFrameBufferBorderHeight(void); - UINT GetFrameBufferWidth(void); - UINT GetFrameBufferHeight(void); - UINT GetFrameBufferCentringOffsetX(void); - UINT GetFrameBufferCentringOffsetY(void); - int GetFrameBufferCentringValue(void); - - COLORREF GetMonochromeRGB(void) { return g_nMonochromeRGB; } + UINT GetFrameBufferBorderlessWidth(); + UINT GetFrameBufferBorderlessHeight(); + UINT GetFrameBufferBorderWidth(); + UINT GetFrameBufferBorderHeight(); + UINT GetFrameBufferWidth(); + UINT GetFrameBufferHeight(); + UINT GetFrameBufferCentringOffsetX(); + UINT GetFrameBufferCentringOffsetY(); + int GetFrameBufferCentringValue(); + + COLORREF GetMonochromeRGB() { return g_nMonochromeRGB; } void SetMonochromeRGB(COLORREF colorRef) { g_nMonochromeRGB = colorRef; } void VideoReinitialize(bool bInitVideoScannerAddress); - void VideoResetState(void); + void VideoResetState(); void VideoRefreshBuffer(uint32_t uRedrawWholeScreenVideoMode, bool bRedrawWholeScreen); - void ClearFrameBuffer(void); - void ClearSHRResidue(void); + void ClearFrameBuffer(); + void ClearSHRResidue(); enum VideoScanner_e {VS_FullAddr, VS_PartialAddrV, VS_PartialAddrH}; WORD VideoGetScannerAddress(uint32_t nCycles, VideoScanner_e videoScannerAddr = VS_FullAddr); bool VideoGetVblBarEx(const uint32_t dwCyclesThisFrame); bool VideoGetVblBar(const uint32_t uExecutedCycles); - bool VideoGetSW80COL(void); - bool VideoGetSWDHIRES(void); - bool VideoGetSWHIRES(void); - bool VideoGetSW80STORE(void); - bool VideoGetSWMIXED(void); - bool VideoGetSWPAGE2(void); - bool VideoGetSWTEXT(void); - bool VideoGetSWAltCharSet(void); - bool VideoGet80COLAUXEMPTY(void); + bool VideoGetSW80COL(); + bool VideoGetSWDHIRES(); + bool VideoGetSWHIRES(); + bool VideoGetSW80STORE(); + bool VideoGetSWMIXED(); + bool VideoGetSWPAGE2(); + bool VideoGetSWTEXT(); + bool VideoGetSWAltCharSet(); + bool VideoGet80COLAUXEMPTY(); void VideoSaveSnapshot(class YamlSaveHelper& yamlSaveHelper); void VideoLoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version); @@ -259,31 +259,31 @@ class Video bool ReadVideoRomFile(const char* pRomFile); UINT GetVideoRom(const BYTE*& pVideoRom); - bool GetVideoRomRockerSwitch(void); + bool GetVideoRomRockerSwitch(); void SetVideoRomRockerSwitch(bool state); - bool IsVideoRom4K(void); + bool IsVideoRom4K(); - void Config_Load_Video(void); - void Config_Save_Video(void); + void Config_Load_Video(); + void Config_Save_Video(); - uint32_t GetVideoMode(void); + uint32_t GetVideoMode(); void SetVideoMode(uint32_t videoMode); - VideoType_e GetVideoType(void); + VideoType_e GetVideoType(); void SetVideoType(VideoType_e newVideoType); - void IncVideoType(void); - void DecVideoType(void); - VideoStyle_e GetVideoStyle(void); + void IncVideoType(); + void DecVideoType(); + VideoStyle_e GetVideoStyle(); void SetVideoStyle(VideoStyle_e newVideoStyle); bool IsVideoStyle(VideoStyle_e style, VideoStyle_e mask); bool IsVideoStyle(VideoStyle_e mask); - VideoRefreshRate_e GetVideoRefreshRate(void); + VideoRefreshRate_e GetVideoRefreshRate(); void SetVideoRefreshRate(VideoRefreshRate_e rate); - const char* VideoGetAppWindowTitle(void); - const char* GetVideoChoices(void) { return g_aVideoChoices; } + const char* VideoGetAppWindowTitle(); + const char* GetVideoChoices() { return g_aVideoChoices; } - bool HasVidHD(void) { return m_hasVidHD; } + bool HasVidHD() { return m_hasVidHD; } void SetVidHD(bool hasVidHD) { m_hasVidHD = hasVidHD; } static const UINT kVideoRomSize2K = 1024*2; @@ -296,7 +296,7 @@ class Video private: void SetFrameBuffer(uint8_t* frameBuffer) { g_pFramebufferbits = frameBuffer; } - const std::string& VideoGetSnapshotStructName(void); + const std::string& VideoGetSnapshotStructName(); int g_nAltCharSetOffset; uint32_t g_uVideoMode; // Current Video Mode (this is the last set one as it may change mid-scan line!) diff --git a/source/Windows/AppleWin.cpp b/source/Windows/AppleWin.cpp index 44c8f8f41..d9921ea72 100644 --- a/source/Windows/AppleWin.cpp +++ b/source/Windows/AppleWin.cpp @@ -69,7 +69,7 @@ static bool g_fullScreenResolutionChangedByUser = false; //=========================================================================== -bool GetLoadedSaveStateFlag(void) +bool GetLoadedSaveStateFlag() { return g_bLoadedSaveState; } @@ -79,22 +79,22 @@ void Win32Frame::SetLoadedSaveStateFlag(const bool bFlag) g_bLoadedSaveState = bFlag; } -bool GetHookAltTab(void) +bool GetHookAltTab() { return g_bHookAltTab; } -bool GetHookAltGrControl(void) +bool GetHookAltGrControl() { return g_bHookAltGrControl; } -bool GetFullScreenResolutionChangedByUser(void) +bool GetFullScreenResolutionChangedByUser() { return g_fullScreenResolutionChangedByUser; } -static void ResetToLogoMode(void) +static void ResetToLogoMode() { g_nAppMode = MODE_LOGO; GetFrame().SetLoadedSaveStateFlag(false); @@ -105,7 +105,7 @@ static void ResetToLogoMode(void) static bool g_bPriorityNormal = true; // Make APPLEWIN process higher priority -void SetPriorityAboveNormal(void) +void SetPriorityAboveNormal() { if (!g_bPriorityNormal) return; @@ -118,7 +118,7 @@ void SetPriorityAboveNormal(void) } // Make APPLEWIN process normal priority -void SetPriorityNormal(void) +void SetPriorityNormal() { if (g_bPriorityNormal) return; @@ -135,7 +135,7 @@ void SetPriorityNormal(void) static UINT g_uModeStepping_Cycles = 0; static bool g_uModeStepping_LastGetKey_ScrollLock = false; -static void ContinueExecution(void) +static void ContinueExecution() { #ifdef LOG_PERF_TIMINGS PerfMarker* pPerfMarkerTotal = new PerfMarker(g_timeTotal); @@ -290,7 +290,7 @@ void SingleStep(bool bReinit) //=========================================================================== -void EnterMessageLoop(void) +void EnterMessageLoop() { MSG message; @@ -342,7 +342,7 @@ void EnterMessageLoop(void) //=========================================================================== -static void GetProgramDirectory(void) +static void GetProgramDirectory() { char programDir[MAX_PATH]; GetModuleFileName((HINSTANCE)0, programDir, MAX_PATH); @@ -363,7 +363,7 @@ static void GetProgramDirectory(void) //=========================================================================== -void RegisterExtensions(void) +void RegisterExtensions() { char szModuleFileName[MAX_PATH]; GetModuleFileName(static_cast(NULL), szModuleFileName, sizeof(szModuleFileName)); @@ -456,7 +456,7 @@ void RegisterExtensions(void) //=========================================================================== // NB. On a restart, it's OK to call RegisterHotKey() again since the old g_hFrameWindow has been destroyed -static void RegisterHotKeys(void) +static void RegisterHotKeys() { BOOL bStatus[3] = {0,0,0}; @@ -514,10 +514,10 @@ static void ExceptionHandler(const char* pError) //--------------------------------------------------------------------------- -static void GetAppleWinVersion(void); +static void GetAppleWinVersion(); static void OneTimeInitialization(HINSTANCE passinstance); -static void RepeatInitialization(void); -static void Shutdown(void); +static void RepeatInitialization(); +static void Shutdown(); int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) { @@ -584,7 +584,7 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) return 0; } -static void GetAppleWinVersion(void) +static void GetAppleWinVersion() { char szPath[_MAX_PATH]; @@ -671,7 +671,7 @@ static void OneTimeInitialization(HINSTANCE passinstance) } // DO INITIALIZATION THAT MUST BE REPEATED FOR A RESTART -static void RepeatInitialization(void) +static void RepeatInitialization() { KeybReset(); GetVideo().SetVidHD(false); // Set true later (eg. by LoadConfiguration() or cmd-line) if VidHDCard is instantiated @@ -1004,7 +1004,7 @@ static void RepeatInitialization(void) } } -static void Shutdown(void) +static void Shutdown() { // NB. WM_CLOSE has already called SetNormalMode() to exit full screen mode & restore default resolution @@ -1029,19 +1029,19 @@ static void Shutdown(void) GetCardMgr().Remove(SLOT7); } -IPropertySheet& GetPropertySheet(void) +IPropertySheet& GetPropertySheet() { static CPropertySheet sg_PropertySheet; return sg_PropertySheet; } -FrameBase& GetFrame(void) +FrameBase& GetFrame() { static Win32Frame sg_Win32Frame; return sg_Win32Frame; } -Video& GetVideo(void) +Video& GetVideo() { static Video video; return video; diff --git a/source/Windows/AppleWin.h b/source/Windows/AppleWin.h index 16e4f03da..200fc2a20 100644 --- a/source/Windows/AppleWin.h +++ b/source/Windows/AppleWin.h @@ -5,9 +5,9 @@ void SingleStep(bool bReinit); //=========================================== // Win32 -bool GetLoadedSaveStateFlag(void); -bool GetHookAltTab(void); -bool GetHookAltGrControl(void); -bool GetFullScreenResolutionChangedByUser(void); +bool GetLoadedSaveStateFlag(); +bool GetHookAltTab(); +bool GetHookAltGrControl(); +bool GetFullScreenResolutionChangedByUser(); extern bool g_bRestartFullScreen; diff --git a/source/Windows/HookFilter.cpp b/source/Windows/HookFilter.cpp index b9f7a9e8e..b4755572c 100644 --- a/source/Windows/HookFilter.cpp +++ b/source/Windows/HookFilter.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Interface.h" #include "Log.h" -HookFilter& GetHookFilter(void) +HookFilter& GetHookFilter() { static HookFilter hookFilter; return hookFilter; @@ -103,7 +103,7 @@ LRESULT CALLBACK HookFilter::LowLevelKeyboardProc(_In_ int nCode, _In_ WPARAM wP // The hook filter code can be static (within the application) rather than in a DLL. // Pre: g_hFrameWindow must be valid -bool HookFilter::HookFilterForKeyboard(void) +bool HookFilter::HookFilterForKeyboard() { _ASSERT(GetFrame().g_hFrameWindow); @@ -133,7 +133,7 @@ bool HookFilter::HookFilterForKeyboard(void) return false; } -void HookFilter::UnhookFilterForKeyboard(void) +void HookFilter::UnhookFilterForKeyboard() { UnhookWindowsHookEx(m_hhook); } @@ -159,7 +159,7 @@ DWORD WINAPI HookFilter::HookThread(LPVOID lpParameter) return 0; } -bool HookFilter::InitHookThread(void) +bool HookFilter::InitHookThread() { m_hHookThread = CreateThread(NULL, // lpThreadAttributes 0, // dwStackSize @@ -174,7 +174,7 @@ bool HookFilter::InitHookThread(void) return true; } -void HookFilter::UninitHookThread(void) +void HookFilter::UninitHookThread() { if (m_hHookThread) { diff --git a/source/Windows/HookFilter.h b/source/Windows/HookFilter.h index 809f14831..65a4abf7c 100644 --- a/source/Windows/HookFilter.h +++ b/source/Windows/HookFilter.h @@ -17,13 +17,13 @@ class HookFilter { } - bool InitHookThread(void); - void UninitHookThread(void); + bool InitHookThread(); + void UninitHookThread(); private: static LRESULT CALLBACK LowLevelKeyboardProc(_In_ int nCode, _In_ WPARAM wParam, _In_ LPARAM lParam); - bool HookFilterForKeyboard(void); - void UnhookFilterForKeyboard(void); + bool HookFilterForKeyboard(); + void UnhookFilterForKeyboard(); static DWORD WINAPI HookThread(LPVOID lpParameter); HWND m_hFrameWindow; @@ -35,4 +35,4 @@ class HookFilter DWORD m_HookThreadId; }; -HookFilter& GetHookFilter(void); +HookFilter& GetHookFilter(); diff --git a/source/Windows/Win32Frame.cpp b/source/Windows/Win32Frame.cpp index f2174d8a2..1f7d0acb5 100644 --- a/source/Windows/Win32Frame.cpp +++ b/source/Windows/Win32Frame.cpp @@ -219,7 +219,7 @@ void Win32Frame::Initialize(bool resetVideoState) #endif } -void Win32Frame::Destroy(void) +void Win32Frame::Destroy() { // DESTROY BUFFERS delete[] g_pFramebufferinfo; @@ -243,7 +243,7 @@ void Win32Frame::Destroy(void) } //=========================================================================== -void Win32Frame::Benchmark(void) +void Win32Frame::Benchmark() { _ASSERT(g_nAppMode == MODE_BENCHMARK); Sleep(500); @@ -446,7 +446,7 @@ void Win32Frame::VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, i //=========================================================================== -void Win32Frame::DisplayLogo(void) +void Win32Frame::DisplayLogo() { Video& video = GetVideo(); int nLogoX = 0, nLogoY = 0; @@ -520,7 +520,7 @@ void Win32Frame::DisplayLogo(void) //=========================================================================== -void Win32Frame::VideoPresentScreen(void) +void Win32Frame::VideoPresentScreen() { HDC hFrameDC = FrameGetDC(); @@ -573,7 +573,7 @@ BOOL CALLBACK Win32Frame::DDEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lp return TRUE; } -bool Win32Frame::DDInit(void) +bool Win32Frame::DDInit() { #ifdef NO_DIRECT_X @@ -616,14 +616,14 @@ bool Win32Frame::DDInit(void) // From SoundCore.h #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } } -void Win32Frame::DDUninit(void) +void Win32Frame::DDUninit() { SAFE_RELEASE(g_lpDD); } #undef SAFE_RELEASE -void Win32Frame::ApplyVideoModeChange(void) +void Win32Frame::ApplyVideoModeChange() { Video& video = GetVideo(); video.Config_Save_Video(); diff --git a/source/Windows/Win32Frame.h b/source/Windows/Win32Frame.h index 2595a07c9..1ddd4eace 100644 --- a/source/Windows/Win32Frame.h +++ b/source/Windows/Win32Frame.h @@ -26,8 +26,8 @@ class Video; class Win32Frame : public FrameBase { public: - Win32Frame(void); - virtual ~Win32Frame(void) {} + Win32Frame(); + virtual ~Win32Frame() {} static Win32Frame& GetWin32Frame(); static LRESULT CALLBACK FrameWndProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); @@ -48,9 +48,9 @@ class Win32Frame : public FrameBase virtual void SetLoadedSaveStateFlag(const bool bFlag); virtual void Initialize(bool resetVideoState); - virtual void Destroy(void); - virtual void VideoPresentScreen(void); - virtual void ResizeWindow(void); + virtual void Destroy(); + virtual void VideoPresentScreen(); + virtual void ResizeWindow(); virtual int FrameMessageBox(LPCSTR lpText, LPCSTR lpCaption, UINT uType); virtual void GetBitmap(WORD id, LONG cb, LPVOID lpvBits); @@ -62,20 +62,20 @@ class Win32Frame : public FrameBase virtual std::shared_ptr CreateNetworkBackend(const std::string& interfaceName); virtual std::shared_ptr CreateSoundBuffer(uint32_t dwBufferSize, uint32_t nSampleRate, int nChannels, const char* pszVoiceName); - bool GetFullScreenShowSubunitStatus(void); - bool GetWindowedModeShowDiskiiStatus(void); - int GetFullScreenOffsetX(void); - int GetFullScreenOffsetY(void); - bool IsFullScreen(void); + bool GetFullScreenShowSubunitStatus(); + bool GetWindowedModeShowDiskiiStatus(); + int GetFullScreenOffsetX(); + int GetFullScreenOffsetY(); + bool IsFullScreen(); void FrameRegisterClass(); - void FrameCreateWindow(void); - UINT Get3DBorderWidth(void); - UINT Get3DBorderHeight(void); - int GetViewportScale(void); + void FrameCreateWindow(); + UINT Get3DBorderWidth(); + UINT Get3DBorderHeight(); + int GetViewportScale(); void GetViewportCXCY(int& nViewportCX, int& nViewportCY); void SetFullScreenViewportScale(int nNewXScale, int nNewYScale); - void ApplyVideoModeChange(void); + void ApplyVideoModeChange(); HDC FrameGetDC(); void FrameReleaseDC(); @@ -90,11 +90,11 @@ class Win32Frame : public FrameBase void VideoCreateDIBSection(bool resetVideoState); void VideoDrawLogoBitmap(HDC hDstDC, int xoff, int yoff, int srcw, int srch, int scale); - bool DDInit(void); - void DDUninit(void); + bool DDInit(); + void DDUninit(); - void Benchmark(void); - void DisplayLogo(void); + void Benchmark(); + void DisplayLogo(); void GetTrackSector(UINT slot, int& drive1Track, int& drive2Track, int& activeFloppy); void CreateTrackSectorStrings(int track, int sector, std::string& strTrack, std::string& strSector); void DrawTrackSector(HDC dc, UINT slot, int drive1Track, int drive1Sector, int drive2Track, int drive2Sector); @@ -111,22 +111,22 @@ class Win32Frame : public FrameBase bool ConfirmReboot(bool bFromButtonUI); void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive); void RelayEvent(UINT message, WPARAM wparam, LPARAM lparam); - void SetFullScreenMode(void); - void SetNormalMode(void); + void SetFullScreenMode(); + void SetNormalMode(); void SetUsingCursor(BOOL bNewValue); - void SetupTooltipControls(void); + void SetupTooltipControls(); void FrameResizeWindow(int nNewScale); void RevealCursor(); void ScreenWindowResize(const bool bCtrlKey); void UpdateMouseInAppleViewport(int iOutOfBoundsX, int iOutOfBoundsY, int x = 0, int y = 0); void DrawCrosshairsMouse(); void FrameSetCursorPosByMousePos(int x, int y, int dx, int dy, bool bLeavingAppleScreen); - void CreateGdiObjects(void); - void DeleteGdiObjects(void); + void CreateGdiObjects(); + void DeleteGdiObjects(); void FrameShowCursor(BOOL bShow); - void FullScreenRevealCursor(void); + void FullScreenRevealCursor(); void GetWidthHeight(int& nWidth, int& nHeight); - void SetSlotUIOffsets(void); + void SetSlotUIOffsets(); bool g_bAltEnter_ToggleFullScreen; // Default for ALT+ENTER is to toggle between windowed and full-screen modes bool g_bIsFullScreen; diff --git a/source/Windows/WinFrame.cpp b/source/Windows/WinFrame.cpp index 8229b5542..3371751e9 100644 --- a/source/Windows/WinFrame.cpp +++ b/source/Windows/WinFrame.cpp @@ -115,12 +115,12 @@ void Win32Frame::SetAltEnterToggleFullScreen(bool mode) // - Optional: Draw status area to frame DC // -UINT Win32Frame::Get3DBorderWidth(void) +UINT Win32Frame::Get3DBorderWidth() { return IsFullScreen() ? 0 : VIEWPORTX; } -UINT Win32Frame::Get3DBorderHeight(void) +UINT Win32Frame::Get3DBorderHeight() { return IsFullScreen() ? 0 : VIEWPORTY; } @@ -179,7 +179,7 @@ void Win32Frame::RevealCursor() // . WM_MOUSEMOVE event // . Switch from full-screen to normal (windowed) mode // . AppleWin's main window is activated/deactivated -void Win32Frame::FullScreenRevealCursor(void) +void Win32Frame::FullScreenRevealCursor() { if (!g_bIsFullScreen) return; @@ -202,7 +202,7 @@ void Win32Frame::FullScreenRevealCursor(void) LR_LOADMAP3DCOLORS | \ LR_LOADTRANSPARENT); -void Win32Frame::CreateGdiObjects(void) +void Win32Frame::CreateGdiObjects() { memset(buttonbitmap, 0, BUTTONS*sizeof(HBITMAP)); @@ -267,7 +267,7 @@ void Win32Frame::CreateGdiObjects(void) } //=========================================================================== -void Win32Frame::DeleteGdiObjects(void) +void Win32Frame::DeleteGdiObjects() { for (int loop = 0; loop < BUTTONS; loop++) _ASSERT(DeleteObject(buttonbitmap[loop])); @@ -533,12 +533,12 @@ void Win32Frame::DrawFrameWindow (bool bPaintingWindow/*=false*/) //=========================================================================== -bool Win32Frame::IsFullScreen(void) +bool Win32Frame::IsFullScreen() { return g_bIsFullScreen; } -bool Win32Frame::GetFullScreenShowSubunitStatus(void) +bool Win32Frame::GetFullScreenShowSubunitStatus() { return g_bFullScreen_ShowSubunitStatus; } @@ -548,7 +548,7 @@ void Win32Frame::SetFullScreenShowSubunitStatus(bool bShow) g_bFullScreen_ShowSubunitStatus = bShow; } -bool Win32Frame::GetWindowedModeShowDiskiiStatus(void) +bool Win32Frame::GetWindowedModeShowDiskiiStatus() { return m_showDiskiiStatus; } @@ -560,7 +560,7 @@ void Win32Frame::SetWindowedModeShowDiskiiStatus(bool bShow) SetSlotUIOffsets(); } -void Win32Frame::SetSlotUIOffsets(void) +void Win32Frame::SetSlotUIOffsets() { if (m_showDiskiiStatus) { @@ -2723,17 +2723,17 @@ void Win32Frame::RelayEvent (UINT message, WPARAM wparam, LPARAM lparam) { //=========================================================================== -int Win32Frame::GetFullScreenOffsetX(void) +int Win32Frame::GetFullScreenOffsetX() { return g_win_fullscreen_offsetx; } -int Win32Frame::GetFullScreenOffsetY(void) +int Win32Frame::GetFullScreenOffsetY() { return g_win_fullscreen_offsety; } -void Win32Frame::SetFullScreenMode(void) +void Win32Frame::SetFullScreenMode() { #ifdef NO_DIRECT_X @@ -2808,7 +2808,7 @@ void Win32Frame::SetFullScreenMode(void) } //=========================================================================== -void Win32Frame::SetNormalMode(void) +void Win32Frame::SetNormalMode() { if (m_changedDisplaySettings) { @@ -2874,7 +2874,7 @@ void Win32Frame::SetUsingCursor (BOOL bNewValue) } } -int Win32Frame::GetViewportScale(void) +int Win32Frame::GetViewportScale() { return g_nViewportScale; } @@ -2904,7 +2904,7 @@ void Win32Frame::SetFullScreenViewportScale(int nNewXScale, int nNewYScale) buttony = BUTTONY; } -void Win32Frame::SetupTooltipControls(void) +void Win32Frame::SetupTooltipControls() { TOOLINFO toolinfo; toolinfo.cbSize = sizeof(toolinfo); @@ -2979,7 +2979,7 @@ void Win32Frame::GetWidthHeight(int& nWidth, int& nHeight) } // Window frame's border size has changed (eg. VidHD added/removed) -void Win32Frame::ResizeWindow(void) +void Win32Frame::ResizeWindow() { FrameResizeWindow(GetViewportScale()); } @@ -3032,7 +3032,7 @@ void Win32Frame::FrameResizeWindow(int nNewScale) //=========================================================================== -void Win32Frame::FrameCreateWindow(void) +void Win32Frame::FrameCreateWindow() { int nWidth, nHeight; @@ -3360,7 +3360,7 @@ void Win32Frame::GetViewportCXCY(int& nViewportCX, int& nViewportCY) } // Call all funcs with dependency on g_Apple2Type -void Win32Frame::FrameUpdateApple2Type(void) +void Win32Frame::FrameUpdateApple2Type() { DeleteGdiObjects(); CreateGdiObjects(); diff --git a/source/YamlHelper.cpp b/source/YamlHelper.cpp index f757ac7f3..b738f98be 100644 --- a/source/YamlHelper.cpp +++ b/source/YamlHelper.cpp @@ -47,7 +47,7 @@ int YamlHelper::InitParser(const char* pPathname) return 1; } -void YamlHelper::FinaliseParser(void) +void YamlHelper::FinaliseParser() { if (m_hFile) fclose(m_hFile); @@ -83,7 +83,7 @@ UINT YamlHelper::ParseFileHdr(const char* tag) return yamlLoadHelper.LoadUint(SS_YAML_KEY_VERSION); } -void YamlHelper::GetNextEvent(void) +void YamlHelper::GetNextEvent() { yaml_event_delete(&m_newEvent); if (!yaml_parser_parse(&m_parser, &m_newEvent)) @@ -133,7 +133,7 @@ int YamlHelper::GetScalar(std::string& scalar) return res; } -void YamlHelper::GetMapStartEvent(void) +void YamlHelper::GetMapStartEvent() { GetNextEvent(); @@ -258,7 +258,7 @@ void YamlHelper::GetMapRemainder(std::string& mapName, MapYaml& mapYaml) // -void YamlHelper::MakeAsciiToHexTable(void) +void YamlHelper::MakeAsciiToHexTable() { memset(m_AsciiToHex, -1, sizeof(m_AsciiToHex)); diff --git a/source/YamlHelper.h b/source/YamlHelper.h index 409203b44..61ea56d96 100644 --- a/source/YamlHelper.h +++ b/source/YamlHelper.h @@ -29,7 +29,7 @@ class YamlHelper friend class YamlLoadHelper; // YamlLoadHelper can access YamlHelper's private members public: - YamlHelper(void) : + YamlHelper() : m_hFile(NULL) { memset(&m_parser, 0, sizeof(m_parser)); @@ -37,28 +37,28 @@ friend class YamlLoadHelper; // YamlLoadHelper can access YamlHelper's private m MakeAsciiToHexTable(); } - ~YamlHelper(void) + ~YamlHelper() { FinaliseParser(); } int InitParser(const char* pPathname); - void FinaliseParser(void); + void FinaliseParser(); UINT ParseFileHdr(const char* tag); int GetScalar(std::string& scalar); - void GetMapStartEvent(void); + void GetMapStartEvent(); private: - void GetNextEvent(void); + void GetNextEvent(); int ParseMap(MapYaml& mapYaml); std::string GetMapValue(MapYaml& mapYaml, const std::string &key, bool& bFound); UINT LoadMemory(MapYaml& mapYaml, const LPBYTE pMemBase, const size_t kAddrSpaceSize, const UINT offset); bool GetSubMap(MapYaml** mapYaml, const std::string &key, const bool canBeNull=false); void GetMapRemainder(std::string& mapName, MapYaml& mapYaml); - void MakeAsciiToHexTable(void); + void MakeAsciiToHexTable(); yaml_parser_t m_parser; yaml_event_t m_newEvent; @@ -91,7 +91,7 @@ class YamlLoadHelper } } - ~YamlLoadHelper(void) + ~YamlLoadHelper() { if (m_bDoGetMapRemainder) m_yamlHelper.GetMapRemainder(m_topLevelMapName, m_yamlHelper.m_mapYaml); @@ -120,7 +120,7 @@ class YamlLoadHelper return res; } - void PopMap(void) + void PopMap() { if (m_stackMap.empty()) return; @@ -132,7 +132,7 @@ class YamlLoadHelper m_currentMapName = item.mapName; } - std::string GetMapNextSlotNumber(void) + std::string GetMapNextSlotNumber() { if (!m_bIteratingOverMap) { @@ -252,7 +252,7 @@ class YamlSaveHelper _ASSERT(yamlSaveHelper.m_indent < yamlSaveHelper.kMaxIndent); } - ~Label(void) + ~Label() { yamlSaveHelper.m_indent -= 2; _ASSERT(yamlSaveHelper.m_indent >= 0); @@ -271,7 +271,7 @@ class YamlSaveHelper rYamlSaveHelper.Save("%s: %d\n", SS_YAML_KEY_VERSION, version); } - ~Slot(void) {} + ~Slot() {} }; void FileHdr(UINT version); diff --git a/source/Z80VICE/z80.cpp b/source/Z80VICE/z80.cpp index 7ee580b0d..6d3457188 100644 --- a/source/Z80VICE/z80.cpp +++ b/source/Z80VICE/z80.cpp @@ -95,13 +95,13 @@ static int z80_bank_limit; #if 0 // [AppleWin-TC] Not used -void z80_trigger_dma(void) +void z80_trigger_dma() { dma_request = 1; } #endif -void z80_reset(void) +void z80_reset() { z80_reg_pc = 0; z80_regs.reg_pc = 0; @@ -419,7 +419,7 @@ static const BYTE SZP[256] = { z80_regs_t z80_regs; -static void import_registers(void) +static void import_registers() { reg_a = z80_regs.reg_af >> 8; reg_f = z80_regs.reg_af & 0xff; @@ -447,7 +447,7 @@ static void import_registers(void) reg_l2 = z80_regs.reg_hl2 & 0xff; } -static void export_registers(void) +static void export_registers() { z80_regs.reg_af = (reg_a << 8) | reg_f; z80_regs.reg_bc = (reg_b << 8) | reg_c; @@ -6456,13 +6456,13 @@ void z80_WRMEM(WORD Addr, BYTE Value) #define SS_YAML_KEY_REGL2 "L'" #define SS_YAML_KEY_ACTIVE "Active" -const std::string& Z80_GetSnapshotCardNameOld(void) +const std::string& Z80_GetSnapshotCardNameOld() { static const std::string name("Z80"); return name; } -const std::string& Z80_GetSnapshotCardName(void) +const std::string& Z80_GetSnapshotCardName() { static const std::string name("Z80 SoftCard"); return name; diff --git a/source/Z80VICE/z80.h b/source/Z80VICE/z80.h index 5b2ae0394..b45de4f40 100644 --- a/source/Z80VICE/z80.h +++ b/source/Z80VICE/z80.h @@ -34,17 +34,17 @@ extern struct z80_regs_s z80_regs; //struct interrupt_cpu_status_s; //struct alarm_context_s; -extern void z80_reset(void); +extern void z80_reset(); //extern void z80_mainloop(struct interrupt_cpu_status_s *cpu_int_status, // struct alarm_context_s *cpu_alarm_context); DWORD z80_mainloop(ULONG uTotalCycles, ULONG uExecutedCycles); -//extern void z80_trigger_dma(void); +//extern void z80_trigger_dma(); BYTE z80_RDMEM(WORD Addr); void z80_WRMEM(WORD Addr, BYTE Value); -const std::string& Z80_GetSnapshotCardNameOld(void); -const std::string& Z80_GetSnapshotCardName(void); +const std::string& Z80_GetSnapshotCardNameOld(); +const std::string& Z80_GetSnapshotCardName(); void Z80_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper, const UINT uSlot); bool Z80_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT uSlot, UINT version); diff --git a/source/Z80VICE/z80mem.cpp b/source/Z80VICE/z80mem.cpp index c1cdd2071..b22f6c818 100644 --- a/source/Z80VICE/z80mem.cpp +++ b/source/Z80VICE/z80mem.cpp @@ -80,7 +80,7 @@ read_func_ptr_t io_read_tab[0x101]; // { NULL } //}; // -//int z80mem_resources_init(void) +//int z80mem_resources_init() //{ // return resources_register_int(resources_int); //} @@ -90,7 +90,7 @@ read_func_ptr_t io_read_tab[0x101]; // { NULL } //}; // -//int z80mem_cmdline_options_init(void) +//int z80mem_cmdline_options_init() //{ // return cmdline_register_options(cmdline_options); //} @@ -141,7 +141,7 @@ static void store_unconnected_io(WORD addr, BYTE value) // log_message(z80mem_log, "Store to unconnected IO %04x %02x", addr, value); // [AppleWin-TC] } -void z80mem_initialize(void) +void z80mem_initialize() { int i, j; @@ -431,7 +431,7 @@ void z80mem_update_config(int config) */ } -int z80mem_load(void) +int z80mem_load() { // if (z80mem_log == LOG_ERR) // [AppleWin-TC] // z80mem_log = log_open("Z80MEM"); diff --git a/source/Z80VICE/z80mem.h b/source/Z80VICE/z80mem.h index d9662c1f4..08966715a 100644 --- a/source/Z80VICE/z80mem.h +++ b/source/Z80VICE/z80mem.h @@ -29,16 +29,16 @@ #include "../CommonVICE/mem.h" // [AppleWin-TC] -extern int z80mem_resources_init(void); -extern int z80mem_cmdline_options_init(void); +extern int z80mem_resources_init(); +extern int z80mem_cmdline_options_init(); extern void z80mem_set_bank_pointer(BYTE **base, int *limit); extern void z80mem_update_config(int config); -extern int z80mem_load(void); +extern int z80mem_load(); extern BYTE z80bios_rom[0x1000]; -extern void z80mem_initialize(void); +extern void z80mem_initialize(); /* Pointers to the currently used memory read and write tables. */ extern read_func_ptr_t *_z80mem_read_tab_ptr; diff --git a/source/z80emu.cpp b/source/z80emu.cpp index f5ffac0e6..31e618e66 100644 --- a/source/z80emu.cpp +++ b/source/z80emu.cpp @@ -40,12 +40,12 @@ void Z80Card::InitializeIO(LPBYTE pCxRomPeripheral) //=========================================================================== -const std::string& Z80Card::GetSnapshotCardNameOld(void) +const std::string& Z80Card::GetSnapshotCardNameOld() { return Z80_GetSnapshotCardNameOld(); } -const std::string& Z80Card::GetSnapshotCardName(void) +const std::string& Z80Card::GetSnapshotCardName() { return Z80_GetSnapshotCardName(); } diff --git a/source/z80emu.h b/source/z80emu.h index a61b72003..e1b133b4b 100644 --- a/source/z80emu.h +++ b/source/z80emu.h @@ -9,9 +9,9 @@ class Z80Card : public Card Card(CT_Z80, slot) { } - virtual ~Z80Card(void) {} + virtual ~Z80Card() {} - virtual void Destroy(void) {} + virtual void Destroy() {} virtual void Reset(const bool powerCycle) {} virtual void Update(const ULONG nExecutedCycles) {} @@ -19,8 +19,8 @@ class Z80Card : public Card static BYTE __stdcall IOWrite(WORD pc, WORD addr, BYTE bWrite, BYTE value, ULONG nExecutedCycles); - static const std::string& GetSnapshotCardNameOld(void); - static const std::string& GetSnapshotCardName(void); + static const std::string& GetSnapshotCardNameOld(); + static const std::string& GetSnapshotCardName(); virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper); virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version); }; diff --git a/test/TestCPU6502/TestCPU6502.cpp b/test/TestCPU6502/TestCPU6502.cpp index fa26a09cc..01c3e3cc6 100644 --- a/test/TestCPU6502/TestCPU6502.cpp +++ b/test/TestCPU6502/TestCPU6502.cpp @@ -25,7 +25,7 @@ iofunction IOWrite[256] = {0}; // TODO: Init static bool g_isMemCacheValid = true; -bool GetIsMemCacheValid(void) +bool GetIsMemCacheValid() { return g_isMemCacheValid; } @@ -46,12 +46,12 @@ bool g_irqOnLastOpcodeCycle = false; static eCpuType g_ActiveCPU = CPU_65C02; -eCpuType GetActiveCpu(void) +eCpuType GetActiveCpu() { return g_ActiveCPU; } -void SetIrqOnLastOpcodeCycle(void) +void SetIrqOnLastOpcodeCycle() { } @@ -156,7 +156,7 @@ void NTSC_VideoUpdateCycles( long cycles6502 ) //------------------------------------- -void init(void) +void init() { // memory must be zero initialised like MemInitiaize() does. mem = (LPBYTE)calloc(64, 1024); @@ -174,7 +174,7 @@ void init(void) memreadPageType[i] = MEM_IORead; } -void reset(void) +void reset() { regs.a = 0; regs.x = 0; @@ -205,7 +205,7 @@ uint32_t TestCpu65C02(uint32_t uTotalCycles) //------------------------------------- -int GH264_test(void) +int GH264_test() { // No page-cross reset(); @@ -290,7 +290,7 @@ void INC_ABSX(BYTE x, WORD base, BYTE d) mem[regs.pc+2] = base>>8; } -int GH271_test(void) +int GH271_test() { // asl abs,x { @@ -704,7 +704,7 @@ int GH278_Bcc(BYTE op, BYTE ps_not_taken, BYTE ps_taken) return 0; } -int GH278_BRA(void) +int GH278_BRA() { // No page-cross { @@ -735,7 +735,7 @@ int GH278_BRA(void) return 0; } -int GH278_JMP_INDX(void) +int GH278_JMP_INDX() { // No page-cross reset(); @@ -825,7 +825,7 @@ int GH278_ADC_SBC(UINT op) return 0; } -int GH278_ADC(void) +int GH278_ADC() { const BYTE adc[] = {0x61,0x65,0x69,0x6D,0x71,0x72,0x75,0x79,0x7D}; @@ -837,7 +837,7 @@ int GH278_ADC(void) return 0; } -int GH278_SBC(void) +int GH278_SBC() { const BYTE sbc[] = {0xE1,0xE5,0xE9,0xED,0xF1,0xF2,0xF5,0xF9,0xFD}; @@ -849,7 +849,7 @@ int GH278_SBC(void) return 0; } -int GH278_test(void) +int GH278_test() { int variant = 0; @@ -1015,7 +1015,7 @@ uint32_t XAS_ABSY(BYTE a, BYTE x, BYTE y, WORD base) return TestCpu6502(0); } -int GH282_test(void) +int GH282_test() { // axa (zp),y { @@ -1140,7 +1140,7 @@ BYTE __stdcall fn_C000(WORD, WORD, BYTE, BYTE, ULONG) return 42; } -int GH292_test(void) +int GH292_test() { // Undocumented 65C02 NOPs: 1 cycle & 1 byte for (UINT op=0; op<256; op+=0x10) @@ -1370,7 +1370,7 @@ int testCB(int id, int cycles, ULONG uExecutedCycles) return 0; } -int SyncEvents_test(void) +int SyncEvents_test() { SyncEvent syncEvent0(0, 0x10, testCB); SyncEvent syncEvent1(1, 0x20, testCB); @@ -1421,7 +1421,7 @@ int SyncEvents_test(void) //------------------------------------- -int DoTest(void) +int DoTest() { int res = 1; init(); diff --git a/test/TestDebugger/TestDebugger.cpp b/test/TestDebugger/TestDebugger.cpp index 50d98e293..ca2051d81 100644 --- a/test/TestDebugger/TestDebugger.cpp +++ b/test/TestDebugger/TestDebugger.cpp @@ -31,7 +31,7 @@ regsrec regs; static eCpuType g_MainCPU = CPU_65C02; -eCpuType GetMainCpu(void) +eCpuType GetMainCpu() { return g_MainCPU; } @@ -79,12 +79,12 @@ bool FindAddressFromSymbol ( const char* pSymbol, WORD * pAddress_, int * iTable //------------------------------------- -void init(void) +void init() { mem = (LPBYTE)VirtualAlloc(NULL,128*1024,MEM_COMMIT,PAGE_READWRITE); // alloc >64K to test wrap-around at 64K boundary } -void reset(void) +void reset() { regs.a = 0; regs.x = 0; @@ -160,7 +160,7 @@ int GH445_test_abs(BYTE op) return 0; } -int GH445_test_jsr(void) +int GH445_test_jsr() { bool bRes; int TargetAddr[3]; @@ -187,7 +187,7 @@ int GH445_test_jsr(void) return 0; } -int GH445_test_brk(void) +int GH445_test_brk() { bool bRes; int TargetAddr[3]; @@ -292,7 +292,7 @@ int GH445_test_jmp(BYTE op) } // bIgnoreBranch == true (default) -int GH445_test_Bcc(void) +int GH445_test_Bcc() { bool bRes; int TargetAddr[3]; @@ -432,7 +432,7 @@ int GH445_test_sub(bool bIs65C02) return 0; } -int GH445_test(void) +int GH445_test() { int res; @@ -471,7 +471,7 @@ int GH451_test_abs(BYTE op) return 0; } -int GH451_test_jsr(void) +int GH451_test_jsr() { bool bRes; int TargetAddr[3]; @@ -494,7 +494,7 @@ int GH451_test_jsr(void) return 0; } -int GH451_test_brk(void) +int GH451_test_brk() { bool bRes; int TargetAddr[3]; @@ -592,7 +592,7 @@ int GH451_test_jmp(BYTE op) } // bIgnoreBranch == true -int GH451_test_Bcc(void) +int GH451_test_Bcc() { bool bRes; int TargetAddr[3]; @@ -693,7 +693,7 @@ int GH451_test_sub(bool bIs65C02) // debugger command 'bpm[r|w] addr16': JSR abs should not trigger a breakpoint at addr16 // . similarly for all other control flow opcodes (eg. Bcc, BRK, JMP, RTI, RTS) -int GH451_test(void) +int GH451_test() { int res;