Skip to content
Permalink
Browse files
Merge pull request #11331 from deReeperJosh/skylandersportal
Emulate Skylanders Portals within Dolphin
  • Loading branch information
AdmiralCurtiss committed Jan 24, 2023
2 parents 7002831 + c76d2c1 commit d4d6f3d
Show file tree
Hide file tree
Showing 21 changed files with 2,016 additions and 28 deletions.
@@ -399,6 +399,8 @@ add_library(core
IOS/USB/Bluetooth/WiimoteHIDAttr.h
IOS/USB/Common.cpp
IOS/USB/Common.h
IOS/USB/Emulated/Skylander.cpp
IOS/USB/Emulated/Skylander.h
IOS/USB/Host.cpp
IOS/USB/Host.h
IOS/USB/OH0/OH0.cpp
@@ -551,6 +551,11 @@ void SetUSBDeviceWhitelist(const std::set<std::pair<u16, u16>>& devices)
Config::SetBase(Config::MAIN_USB_PASSTHROUGH_DEVICES, SaveUSBWhitelistToString(devices));
}

// Main.EmulatedUSBDevices

const Info<bool> MAIN_EMULATE_SKYLANDER_PORTAL{
{System::Main, "EmulatedUSBDevices", "EmulateSkylanderPortal"}, false};

// The reason we need this function is because some memory card code
// expects to get a non-NTSC-K region even if we're emulating an NTSC-K Wii.
DiscIO::Region ToGameCubeRegion(DiscIO::Region region)
@@ -342,6 +342,10 @@ extern const Info<std::string> MAIN_USB_PASSTHROUGH_DEVICES;
std::set<std::pair<u16, u16>> GetUSBDeviceWhitelist();
void SetUSBDeviceWhitelist(const std::set<std::pair<u16, u16>>& devices);

// Main.EmulatedUSBDevices

extern const Info<bool> MAIN_EMULATE_SKYLANDER_PORTAL;

// GameCube path utility functions

// Replaces NTSC-K with some other region, and doesn't replace non-NTSC-K regions
@@ -29,7 +29,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
for (const std::string_view section :
{"NetPlay", "General", "GBA", "Display", "Network", "Analytics", "AndroidOverlayButtons",
"DSP", "GameList", "FifoPlayer", "AutoUpdate", "Movie", "Input", "Debug",
"BluetoothPassthrough", "USBPassthrough", "Interface"})
"BluetoothPassthrough", "USBPassthrough", "Interface", "EmulatedUSBDevices"})
{
if (config_location.section == section)
return true;
@@ -38,6 +38,13 @@ void TransferCommand::OnTransferComplete(s32 return_value) const
m_ios.EnqueueIPCReply(ios_request, return_value, 0, CoreTiming::FromThread::NON_CPU);
}

void TransferCommand::ScheduleTransferCompletion(s32 return_value, u32 expected_time_us) const
{
auto ticks = SystemTimers::GetTicksPerSecond();
s64 cycles_in_future = static_cast<s64>((static_cast<u64>(ticks) * expected_time_us) / 1'000'000);
m_ios.EnqueueIPCReply(ios_request, return_value, cycles_in_future, CoreTiming::FromThread::ANY);
}

void IsoMessage::SetPacketReturnValue(const size_t packet_num, const u16 return_value) const
{
auto& system = Core::System::GetInstance();
@@ -109,6 +109,7 @@ struct TransferCommand
// Called after a transfer has completed to reply to the IPC request.
// This can be overridden for additional processing before replying.
virtual void OnTransferComplete(s32 return_value) const;
void ScheduleTransferCompletion(s32 return_value, u32 expected_time_us) const;
std::unique_ptr<u8[]> MakeBuffer(size_t size) const;
void FillBuffer(const u8* src, size_t size) const;

0 comments on commit d4d6f3d

Please sign in to comment.