From b501a1deae9e7983d45b846fa8be70e8ab369512 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 3 Jan 2021 03:40:53 +0000 Subject: [PATCH] DEV9: Run clang format on ATA code --- pcsx2/DEV9/ATA/ATA.h | 11 +++++------ pcsx2/DEV9/ATA/ATA_Info.cpp | 2 ++ pcsx2/DEV9/ATA/ATA_State.cpp | 2 +- pcsx2/DEV9/ATA/ATA_Transfer.cpp | 2 +- pcsx2/DEV9/DEV9.cpp | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pcsx2/DEV9/ATA/ATA.h b/pcsx2/DEV9/ATA/ATA.h index 60221a198d..2ac9822bfb 100644 --- a/pcsx2/DEV9/ATA/ATA.h +++ b/pcsx2/DEV9/ATA/ATA.h @@ -31,7 +31,7 @@ class ATA public: //Transfer bool dmaReady = false; - int nsector = 0; //sector count + int nsector = 0; //sector count int nsectorLeft = 0; //sectors left to transfer private: const bool lba48Supported = false; @@ -51,7 +51,7 @@ private: u8 curMultipleSectorsSetting = 128; - u8 identifyData[512] = { 0 }; + u8 identifyData[512] = {0}; //LBA48 in use? bool lba48 = false; @@ -143,7 +143,7 @@ private: int pioPtr; int pioEnd; u8 pioBuffer[512]; - + int sectorsPerInterrupt; void (ATA::*pioDRQEndTransferFunc)() = nullptr; //PIO Buffer @@ -175,7 +175,7 @@ public: u16 ATAreadPIO(); //ATAwritePIO; - private: +private: //Info void CreateHDDinfo(int sizeMb); void CreateHDDinfoCsum(); @@ -231,7 +231,7 @@ public: void PostCmdDMADataFromHost(); void HDD_ReadDMA(bool isLBA48); void HDD_WriteDMA(bool isLBA48); - + void PreCmdExecuteDeviceDiag(); void PostCmdExecuteDeviceDiag(); void HDD_ExecuteDeviceDiag(); @@ -273,4 +273,3 @@ public: static void WriteUInt64(u8* data, int* index, u64 value); static void WritePaddedString(u8* data, int* index, std::string value, u32 len); }; - diff --git a/pcsx2/DEV9/ATA/ATA_Info.cpp b/pcsx2/DEV9/ATA/ATA_Info.cpp index 22517e19b9..34d52a01c0 100644 --- a/pcsx2/DEV9/ATA/ATA_Info.cpp +++ b/pcsx2/DEV9/ATA/ATA_Info.cpp @@ -260,6 +260,7 @@ void ATA::CreateHDDinfo(int sizeMb) //Command set/feature enabled/supported (See word 82) WriteUInt16(identifyData, &index, (u16)((fetSmartEnabled << 0) | (fetSecurityEnabled << 1) | (fetWriteCacheEnabled << 5) | (fetHostProtectedAreaEnabled << 10) | (1 << 14))); //Fixed //word 85 //Command set/feature enabled/supported (See word 83) + // clang-format off WriteUInt16(identifyData, &index, (u16)( /*(1 << 8) | //SET MAX */ ((lba48Supported ? 1 : 0) << 10) | //Fixed @@ -270,6 +271,7 @@ void ATA::CreateHDDinfo(int sizeMb) WriteUInt16(identifyData, &index, (u16)( (1) | //Fixed ((1) << 1))); //Fixed //word 87 + // clang-format on //UDMA modes /* * bits 0-7: ultraword modes supported (0,1,2,4,5,6,7) diff --git a/pcsx2/DEV9/ATA/ATA_State.cpp b/pcsx2/DEV9/ATA/ATA_State.cpp index 9ce3b5f891..4342b24967 100644 --- a/pcsx2/DEV9/ATA/ATA_State.cpp +++ b/pcsx2/DEV9/ATA/ATA_State.cpp @@ -310,7 +310,7 @@ void ATA::Async(uint cycles) if (waitingCmd != nullptr) //Are we waiting to continue a command? { //Log_Info("Running waiting command"); - void(ATA::*cmd)() = waitingCmd; + void (ATA::*cmd)() = waitingCmd; waitingCmd = nullptr; (this->*cmd)(); } diff --git a/pcsx2/DEV9/ATA/ATA_Transfer.cpp b/pcsx2/DEV9/ATA/ATA_Transfer.cpp index c7e6871b5d..fec13ac19b 100644 --- a/pcsx2/DEV9/ATA/ATA_Transfer.cpp +++ b/pcsx2/DEV9/ATA/ATA_Transfer.cpp @@ -38,7 +38,7 @@ void ATA::IO_Thread() ioType = 0; else if (ioWrite) ioType = 1; - + ioWaitHandle.unlock(); //Read or Write diff --git a/pcsx2/DEV9/DEV9.cpp b/pcsx2/DEV9/DEV9.cpp index 3d89e584d9..6bf075f3eb 100644 --- a/pcsx2/DEV9/DEV9.cpp +++ b/pcsx2/DEV9/DEV9.cpp @@ -269,7 +269,7 @@ s32 DEV9open(void* pDsp) ghc::filesystem::path path(GetSettingsFolder().ToUTF8().data()); hddPath = path / hddPath; } - + if (config.hddEnable) { if (dev9.ata->Open(hddPath) != 0) @@ -876,7 +876,7 @@ void DEV9write16(u32 addr, u16 value) dev9.fifo_bytes_write = 0; dev9.fifo_bytes_read = 0; dev9.xfr_ctrl &= ~SPD_XFR_WRITE; //? - dev9.if_ctrl |= SPD_IF_READ; //? + dev9.if_ctrl |= SPD_IF_READ; //? FIFOIntr(); }