Some groundwork for SD Interface

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2050 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox 2009-02-01 13:28:57 +00:00
parent bef60f8ec0
commit 929e003b5e
5 changed files with 83 additions and 18 deletions

View File

@ -775,6 +775,18 @@
>
</File>
</Filter>
<Filter
Name="SDI - SD Interface"
>
<File
RelativePath=".\Src\HW\SDInterface.cpp"
>
</File>
<File
RelativePath=".\Src\HW\SDInterface.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="PowerPC"

View File

@ -0,0 +1,26 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "SDInterface.h"
namespace SDInterface {
bool IsCardInserted()
{
return false; // TODO
}
}

View File

@ -0,0 +1,29 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _SDINTERFACE_H
#define _SDINTERFACE_H
#include "Common.h"
namespace SDInterface
{
bool IsCardInserted();
}
#endif

View File

@ -21,42 +21,36 @@
#include "../HW/CPU.h"
#include "../HW/Memmap.h"
#include "../HW/SDInterface.h"
#include "../Core.h"
// __________________________________________________________________________________________________
//
using namespace SDInterface;
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName )
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{
}
// __________________________________________________________________________________________________
//
CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0()
{
}
// __________________________________________________________________________________________________
//
bool
CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
bool CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
{
LOG(WII_IPC_SD, "SD: Open");
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
return true;
}
bool
CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
{
LOG(WII_IPC_SD, "SD: Close");
Memory::Write_U32(0, _CommandAddress + 0x4);
return true;
}
// __________________________________________________________________________________________________
// The front SD slot
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
{
@ -103,9 +97,16 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
ReturnValue = ExecuteCommand(BufferIn, BufferInSize, BufferOut, BufferOutSize);
break;
case 11: // sd_get_status
LOGV(WII_IPC_SD, 0, "SD: sd_get_status. Answer: SD card is not inserted", BufferOut);
Memory::Write_U32(2, BufferOut); // SD card is not inserted
case 11: // sd_get_status
if (IsCardInserted())
{
// TODO
}
else
{
LOGV(WII_IPC_SD, 0, "SD: sd_get_status. Answer: SD card is not inserted", BufferOut);
Memory::Write_U32(2, BufferOut); // SD card is not inserted
}
break;
default:
PanicAlert("Unknown SD command (0x%08x)", Cmd);
@ -124,8 +125,6 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
return true;
}
// __________________________________________________________________________________________________
//
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
{
PanicAlert("CWII_IPC_HLE_Device_sdio_slot0::IOCtlV() unknown");
@ -136,8 +135,6 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
return true;
}
// __________________________________________________________________________________________________
//
u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 _BufferOut, u32 _BufferOutSize)
{
/* The game will send us a SendCMD with this information. To be able to read and write

View File

@ -57,6 +57,7 @@ files = ["Console.cpp",
"HW/VideoInterface.cpp",
"HW/WII_IOB.cpp",
"HW/WII_IPC.cpp",
"HW/SDInterface.cpp",
"IPC_HLE/WII_IPC_HLE.cpp",
"IPC_HLE/WII_IPC_HLE_Device_DI.cpp",
"IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp",