mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
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:
@ -775,6 +775,18 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="SDI - SD Interface"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\HW\SDInterface.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\HW\SDInterface.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="PowerPC"
|
Name="PowerPC"
|
||||||
|
26
Source/Core/Core/Src/HW/SDInterface.cpp
Normal file
26
Source/Core/Core/Src/HW/SDInterface.cpp
Normal 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
|
||||||
|
}
|
||||||
|
}
|
29
Source/Core/Core/Src/HW/SDInterface.h
Normal file
29
Source/Core/Core/Src/HW/SDInterface.h
Normal 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
|
@ -21,42 +21,36 @@
|
|||||||
|
|
||||||
#include "../HW/CPU.h"
|
#include "../HW/CPU.h"
|
||||||
#include "../HW/Memmap.h"
|
#include "../HW/Memmap.h"
|
||||||
|
#include "../HW/SDInterface.h"
|
||||||
#include "../Core.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 )
|
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName )
|
||||||
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
|
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
|
||||||
//
|
|
||||||
CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0()
|
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");
|
LOG(WII_IPC_SD, "SD: Open");
|
||||||
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
|
Memory::Write_U32(GetDeviceID(), _CommandAddress + 0x4);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
|
||||||
CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
|
|
||||||
{
|
{
|
||||||
LOG(WII_IPC_SD, "SD: Close");
|
LOG(WII_IPC_SD, "SD: Close");
|
||||||
Memory::Write_U32(0, _CommandAddress + 0x4);
|
Memory::Write_U32(0, _CommandAddress + 0x4);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
|
||||||
// The front SD slot
|
// The front SD slot
|
||||||
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
||||||
{
|
{
|
||||||
@ -104,8 +98,15 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 11: // sd_get_status
|
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);
|
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
|
Memory::Write_U32(2, BufferOut); // SD card is not inserted
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
PanicAlert("Unknown SD command (0x%08x)", Cmd);
|
PanicAlert("Unknown SD command (0x%08x)", Cmd);
|
||||||
@ -124,8 +125,6 @@ bool CWII_IPC_HLE_Device_sdio_slot0::IOCtl(u32 _CommandAddress)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
|
||||||
//
|
|
||||||
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
bool CWII_IPC_HLE_Device_sdio_slot0::IOCtlV(u32 _CommandAddress)
|
||||||
{
|
{
|
||||||
PanicAlert("CWII_IPC_HLE_Device_sdio_slot0::IOCtlV() unknown");
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// __________________________________________________________________________________________________
|
|
||||||
//
|
|
||||||
u32 CWII_IPC_HLE_Device_sdio_slot0::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 _BufferOut, u32 _BufferOutSize)
|
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
|
/* The game will send us a SendCMD with this information. To be able to read and write
|
||||||
|
@ -57,6 +57,7 @@ files = ["Console.cpp",
|
|||||||
"HW/VideoInterface.cpp",
|
"HW/VideoInterface.cpp",
|
||||||
"HW/WII_IOB.cpp",
|
"HW/WII_IOB.cpp",
|
||||||
"HW/WII_IPC.cpp",
|
"HW/WII_IPC.cpp",
|
||||||
|
"HW/SDInterface.cpp",
|
||||||
"IPC_HLE/WII_IPC_HLE.cpp",
|
"IPC_HLE/WII_IPC_HLE.cpp",
|
||||||
"IPC_HLE/WII_IPC_HLE_Device_DI.cpp",
|
"IPC_HLE/WII_IPC_HLE_Device_DI.cpp",
|
||||||
"IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp",
|
"IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp",
|
||||||
|
Reference in New Issue
Block a user