From 6474f25728540259e899e9c8b6be4ec17fc2ac32 Mon Sep 17 00:00:00 2001 From: Macdu Date: Wed, 14 Jun 2023 15:58:50 +0200 Subject: [PATCH] modules/SceError: Implement GetExternalString. --- vita3k/modules/SceDriverUser/SceErrorUser.cpp | 10 ++++++--- vita3k/modules/SceError/SceError.cpp | 11 +++++++--- vita3k/modules/SceError/SceError.h | 22 +++++++++++++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 vita3k/modules/SceError/SceError.h diff --git a/vita3k/modules/SceDriverUser/SceErrorUser.cpp b/vita3k/modules/SceDriverUser/SceErrorUser.cpp index 9a724ce544..bc7e05588c 100644 --- a/vita3k/modules/SceDriverUser/SceErrorUser.cpp +++ b/vita3k/modules/SceDriverUser/SceErrorUser.cpp @@ -15,10 +15,14 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -#include +#include <../SceError/SceError.h> -EXPORT(int, sceErrorGetExternalString) { - return UNIMPLEMENTED(); +#include +TRACY_MODULE_NAME(SceErrorUser); + +EXPORT(SceInt32, sceErrorGetExternalString, char *result, int err) { + TRACY_FUNC(sceErrorGetExternalString, result, err); + return CALL_EXPORT(_sceErrorGetExternalString, result, err); } EXPORT(int, sceErrorHistoryClearError) { diff --git a/vita3k/modules/SceError/SceError.cpp b/vita3k/modules/SceError/SceError.cpp index 41b821b1a3..7788572d53 100644 --- a/vita3k/modules/SceError/SceError.cpp +++ b/vita3k/modules/SceError/SceError.cpp @@ -15,10 +15,15 @@ // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -#include +#include "SceError.h" -EXPORT(int, _sceErrorGetExternalString) { - return UNIMPLEMENTED(); +#include +TRACY_MODULE_NAME(SceError); + +EXPORT(SceInt32, _sceErrorGetExternalString, char *result, int err) { + TRACY_FUNC(_sceErrorGetExternalString, result, err); + sprintf(result, "0x%08X", err); + return 0; } EXPORT(int, _sceErrorHistoryClearError) { diff --git a/vita3k/modules/SceError/SceError.h b/vita3k/modules/SceError/SceError.h new file mode 100644 index 0000000000..a082bcf280 --- /dev/null +++ b/vita3k/modules/SceError/SceError.h @@ -0,0 +1,22 @@ +// Vita3K emulator project +// Copyright (C) 2024 Vita3K team +// +// 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; either version 2 of the License, or +// (at your option) any later version. +// +// 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 for more details. +// +// You should have received a copy of the GNU General Public License along +// with this program; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +#pragma once + +#include + +DECL_EXPORT(SceInt32, _sceErrorGetExternalString, char *result, int err);