-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preliminary implementation of the Triforce Baseboard
- Loading branch information
Showing
9 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2013 Dolphin Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#include "Core/HW/EXI/EXI_DeviceBaseboard.h" | ||
|
||
#include "Common/Assert.h" | ||
#include "Common/ChunkFile.h" | ||
#include "Common/CommonTypes.h" | ||
#include "Common/Logging/Log.h" | ||
|
||
namespace ExpansionInterface | ||
{ | ||
CEXIBaseboard::CEXIBaseboard() = default; | ||
|
||
void CEXIBaseboard::SetCS(int cs) | ||
{ | ||
if (cs) | ||
m_position = 0; | ||
} | ||
|
||
bool CEXIBaseboard::IsPresent() const | ||
{ | ||
return true; | ||
} | ||
|
||
void CEXIBaseboard::TransferByte(u8& byte) | ||
{ | ||
if (m_position == 0) | ||
{ | ||
m_command = byte; | ||
} | ||
else | ||
{ | ||
switch (m_command) | ||
{ | ||
case 0x00: | ||
{ | ||
static constexpr std::array<u8, 4> ID = {0x06, 0x04, 0x10, 0x00}; | ||
byte = ID[(m_position - 2) & 3]; | ||
break; | ||
} | ||
default: | ||
ERROR_LOG_FMT(EXPANSIONINTERFACE, "EXI BASEBOARD: Unhandled command {:#x} {:#x}", m_command, | ||
m_position); | ||
} | ||
} | ||
m_position++; | ||
} | ||
|
||
void CEXIBaseboard::DoState(PointerWrap& p) | ||
{ | ||
p.Do(m_position); | ||
p.Do(m_command); | ||
} | ||
} // namespace ExpansionInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2013 Dolphin Emulator Project | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include "Core/HW/EXI/EXI_Device.h" | ||
|
||
class PointerWrap; | ||
|
||
namespace ExpansionInterface | ||
{ | ||
class CEXIBaseboard : public IEXIDevice | ||
{ | ||
public: | ||
CEXIBaseboard(); | ||
void SetCS(int CS) override; | ||
bool IsPresent() const override; | ||
void DoState(PointerWrap& p) override; | ||
|
||
private: | ||
// STATE_TO_SAVE | ||
u32 m_position = 0; | ||
u32 m_command = 0; | ||
|
||
void TransferByte(u8& byte) override; | ||
}; | ||
} // namespace ExpansionInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters