FW: clang-format

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-09-19 16:26:40 +02:00 committed by refractionpcsx2
parent 385c698212
commit 6f98fd4b65
5 changed files with 149 additions and 142 deletions

View File

@ -570,7 +570,6 @@ Global
{2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38} {2F6C0388-20CB-4242-9F6C-A6EBB6A83F47} = {78EBE642-7A4D-4EA7-86BE-5639C6646C38}
{E4081455-398C-4610-A87C-90A8A7D72DC3} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF} {E4081455-398C-4610-A87C-90A8A7D72DC3} = {703FD00B-D7A0-41E3-BD03-CEC86B385DAF}
{BF7B81A5-E348-4F7C-A69F-F74C8EEEAD70} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E} {BF7B81A5-E348-4F7C-A69F-F74C8EEEAD70} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E}
{3D0EB14D-32F3-4D82-9C6D-B806ADBB859C} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E}
{04439C5F-05FB-4A9C-AAD1-5388C25377DB} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E} {04439C5F-05FB-4A9C-AAD1-5388C25377DB} = {E1828E40-2FBB-48FE-AE7F-5587755DCE0E}
{A51123F5-9505-4EAE-85E7-D320290A272C} = {88F517F9-CE1C-4005-9BDF-4481FEB55053} {A51123F5-9505-4EAE-85E7-D320290A272C} = {88F517F9-CE1C-4005-9BDF-4481FEB55053}
{4639972E-424E-4E13-8B07-CA403C481346} = {88F517F9-CE1C-4005-9BDF-4481FEB55053} {4639972E-424E-4E13-8B07-CA403C481346} = {88F517F9-CE1C-4005-9BDF-4481FEB55053}

View File

@ -13,6 +13,8 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "PrecompiledHeader.h"
#include <stdlib.h> #include <stdlib.h>
#include <string> #include <string>
using namespace std; using namespace std;
@ -20,7 +22,7 @@ using namespace std;
#include "FW.h" #include "FW.h"
u8 phyregs[16]; u8 phyregs[16];
s8 *fwregs; s8* fwregs;
void (*FWirq)(); void (*FWirq)();
@ -28,8 +30,9 @@ s32 FWopen()
{ {
memset(phyregs, 0, sizeof(phyregs)); memset(phyregs, 0, sizeof(phyregs));
// Initializing our registers. // Initializing our registers.
fwregs = (s8 *)calloc(0x10000, 1); fwregs = (s8*)calloc(0x10000, 1);
if (fwregs == NULL) { if (fwregs == NULL)
{
DevCon.WriteLn("FW: Error allocating Memory"); DevCon.WriteLn("FW: Error allocating Memory");
return -1; return -1;
} }
@ -41,7 +44,6 @@ void FWclose()
// Freeing the registers. // Freeing the registers.
free(fwregs); free(fwregs);
fwregs = NULL; fwregs = NULL;
} }
void PHYWrite() void PHYWrite()
@ -73,7 +75,8 @@ u32 FWread32(u32 addr)
{ {
u32 ret = 0; u32 ret = 0;
switch (addr) { switch (addr)
{
//Node ID Register the top part is default, bottom part i got from my ps2 //Node ID Register the top part is default, bottom part i got from my ps2
case 0x1f808400: case 0x1f808400:
ret = /*(0x3ff << 22) | 1;*/ 0xffc00001; ret = /*(0x3ff << 22) | 1;*/ 0xffc00001;
@ -107,7 +110,8 @@ u32 FWread32(u32 addr)
void FWwrite32(u32 addr, u32 value) void FWwrite32(u32 addr, u32 value)
{ {
switch (addr) { switch (addr)
{
// Include other memory locations we want to catch here. // Include other memory locations we want to catch here.
// For example: // For example:
// //
@ -126,7 +130,8 @@ void FWwrite32(u32 addr, u32 value)
if (value & 0x40000000) //Writing to PHY if (value & 0x40000000) //Writing to PHY
{ {
PHYWrite(); PHYWrite();
} else if (value & 0x80000000) //Reading from PHY }
else if (value & 0x80000000) //Reading from PHY
{ {
PHYRead(); PHYRead();
} }

View File

@ -20,9 +20,9 @@
#define FWdefs #define FWdefs
// Our main memory storage, and defines for accessing it. // Our main memory storage, and defines for accessing it.
extern s8 *fwregs; extern s8* fwregs;
#define fwRs32(mem) (*(s32 *)&fwregs[(mem)&0xffff]) #define fwRs32(mem) (*(s32*)&fwregs[(mem)&0xffff])
#define fwRu32(mem) (*(u32 *)&fwregs[(mem)&0xffff]) #define fwRu32(mem) (*(u32*)&fwregs[(mem)&0xffff])
//PHY Access Address for ease of use :P //PHY Access Address for ease of use :P
#define PHYACC fwRu32(0x8414) #define PHYACC fwRu32(0x8414)

View File

@ -154,6 +154,9 @@
<Filter Include="System\Ps2\Iop\CDVD\Linux"> <Filter Include="System\Ps2\Iop\CDVD\Linux">
<UniqueIdentifier>{a5904fb6-e846-4cbf-940c-ca1c604140a0}</UniqueIdentifier> <UniqueIdentifier>{a5904fb6-e846-4cbf-940c-ca1c604140a0}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="System\Ps2\Iop\FW">
<UniqueIdentifier>{157740ae-b338-4d7f-81cb-cffa9d39a756}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\Utilities\folderdesc.txt"> <None Include="..\..\Utilities\folderdesc.txt">
@ -893,7 +896,7 @@
<Filter>System</Filter> <Filter>System</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\FW.cpp"> <ClCompile Include="..\..\FW.cpp">
<Filter>System</Filter> <Filter>System\Ps2\Iop\FW</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -1354,7 +1357,7 @@
<Filter>System\Include</Filter> <Filter>System\Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\FW.h"> <ClInclude Include="..\..\FW.h">
<Filter>System\Include</Filter> <Filter>System\Ps2\Iop\FW</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>