|
| 1 | +// Copyright (c) 2012- PPSSPP Project. |
| 2 | + |
| 3 | +// This program is free software: you can redistribute it and/or modify |
| 4 | +// it under the terms of the GNU General Public License as published by |
| 5 | +// the Free Software Foundation, version 2.0 or later versions. |
| 6 | + |
| 7 | +// This program is distributed in the hope that it will be useful, |
| 8 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | +// GNU General Public License 2.0 for more details. |
| 11 | + |
| 12 | +// A copy of the GPL 2.0 should have been included with the program. |
| 13 | +// If not, see http://www.gnu.org/licenses/ |
| 14 | + |
| 15 | +// Official git repository and contact information can be found at |
| 16 | +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. |
| 17 | + |
| 18 | +#ifdef __MINGW32__ |
| 19 | +#include <unistd.h> |
| 20 | +#endif |
| 21 | +#include <ctime> |
| 22 | + |
| 23 | +#include "Common/System/System.h" |
| 24 | +#include "Common/System/Request.h" |
| 25 | +#include "Common/Serialize/Serializer.h" |
| 26 | +#include "Common/Serialize/SerializeFuncs.h" |
| 27 | +#include "Core/HLE/HLE.h" |
| 28 | +#include "Core/HLE/sceSircs.h" |
| 29 | +#include "Core/HLE/FunctionWrappers.h" |
| 30 | +#include "Core/MemMapHelpers.h" |
| 31 | + |
| 32 | +int sceSircsSend(u32 dataAddr, int count) { |
| 33 | + auto data = PSPPointer<SircsData>::Create(dataAddr); |
| 34 | + if (data.IsValid()) { |
| 35 | + INFO_LOG(HLE, "%s (version=0x%x, command=0x%x, address=0x%x, count=%d)", |
| 36 | + __FUNCTION__, data->version, data->command, data->address, count); |
| 37 | + #if PPSSPP_PLATFORM(ANDROID) |
| 38 | + char command[40] = {0}; |
| 39 | + snprintf(command, sizeof(command), "sircs_%d_%d_%d_%d", |
| 40 | + data->version, data->command, data->address, count); |
| 41 | + System_InfraredCommand(command); |
| 42 | + #endif |
| 43 | + data.NotifyRead("sceSircsSend"); |
| 44 | + } |
| 45 | + return 0; |
| 46 | +} |
| 47 | + |
| 48 | +const HLEFunction sceSircs[] = |
| 49 | +{ |
| 50 | + {0X62411801, nullptr, "sceSircsInit", '?', "" }, |
| 51 | + {0X19155A2F, nullptr, "sceSircsEnd", '?', "" }, |
| 52 | + {0X71EEF62D, &WrapI_UI<sceSircsSend>, "sceSircsSend", 'i', "xi" }, |
| 53 | + {0x83381633, nullptr, "sceSircsReceive", '?', "" }, |
| 54 | +}; |
| 55 | + |
| 56 | +void Register_sceSircs() |
| 57 | +{ |
| 58 | + RegisterModule("sceSircs", ARRAY_SIZE(sceSircs), sceSircs); |
| 59 | +} |
0 commit comments