From e157d109d16f978c432bd8f65573e4960040b385 Mon Sep 17 00:00:00 2001 From: azubisinmir Date: Sat, 22 Apr 2023 19:59:23 +0200 Subject: [PATCH] Left stick support and editor export --- platform/psp/export/export.cpp | 51 +++++++++++++++++++++++++++++++++ platform/psp/export/export.h | 31 ++++++++++++++++++++ platform/psp/logo.png | Bin 2331 -> 1492 bytes platform/psp/os_psp.cpp | 7 +++++ 4 files changed, 89 insertions(+) create mode 100644 platform/psp/export/export.cpp create mode 100644 platform/psp/export/export.h diff --git a/platform/psp/export/export.cpp b/platform/psp/export/export.cpp new file mode 100644 index 000000000000..e5acf0182ba2 --- /dev/null +++ b/platform/psp/export/export.cpp @@ -0,0 +1,51 @@ +/*************************************************************************/ +/* export.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +#include "export.h" +#include "editor/editor_import_export.h" +#include "platform/psp/logo.gen.h" +#include "scene/resources/texture.h" + +void register_psp_exporter() { + + Image img(_psp_logo); + Ref logo = memnew(ImageTexture); + logo->create_from_image(img); + + { + Ref exporter = Ref(memnew(EditorExportPlatformPC)); + exporter->set_binary_extension("PBP"); + exporter->set_release_binary32("EBOOT.PBP"); + exporter->set_name("PSP"); + exporter->set_logo(logo); + exporter->set_chmod_flags(0755); + EditorImportExport::get_singleton()->add_export_platform(exporter); + } +} diff --git a/platform/psp/export/export.h b/platform/psp/export/export.h new file mode 100644 index 000000000000..d16a9aa5fa7e --- /dev/null +++ b/platform/psp/export/export.h @@ -0,0 +1,31 @@ +/*************************************************************************/ +/* export.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ + +void register_psp_exporter(); diff --git a/platform/psp/logo.png b/platform/psp/logo.png index 5e98ac26eca57e764a4a3d9e99ec6fcae8cb7451..24217cb6f487a7306ef28d1765ebb102c5f20f54 100644 GIT binary patch delta 1459 zcmV;k1x)&z64VQjBnkm@Qb$4nuFf3kks%X*32;bRa{vGf6951U69E94oEQKA1!+k{ zK~z{rtyf)0Raq2XUhmEP%`l9DN+l&N?J~+pqY&vsipn6Oa1B%hUxeww9s+S7n3pkn z5eXk;H0Yr}Dh(w@nI05I7-;+ZO?v*4_K;wf6ph z)?RzPE|;qapI+2cA|fIZsY87Q^;uLWzI^%e2=&3oj~}m6w-a`B zASWj$BPuHDB1n87kA?^clvn}15;#El2>p%q_4W3tsi~)?i6cTffEmYNz+WOGBYy&^ zhs2tkaB@JGrV|wZ=g*%zVf!;8vZf4wY;bhI>-DC)-R}D!JPro}#9Fq4j)Zmu4zQfw z*x0C?n3(v-Gz(zMXx{-K{2j6nPJ~Ttht&~~(}^X>*}nnPL?LKY&K$&lf;fo$zrgAQ zgiicmjYOnbsx=4M9|(C0$#vN6NJ>hQ#>Ph3y?eJTFE7idPoGSUGxQi{83QSQI(YEl zwS|QRKN|uL?BBotSCIa=9XUYC5 zr~u(bh({CabqghS(4n_)-!g%JrL(hBnwy(L_9KVMb&=n$w6wH6D1F~b{_fp7>FDT? zyLa!JEh6X6os*K1l92sPE+4sFNTxD0M2G7D)==4L@SE))K724+Hc?Ykv!ySEAQw5w zjeJvQy8;b3;C7-1v4ZV(WMpIr53%j~liP&`ulXJDawoCFshvA1Ha0eYsGr>qbuW`J z#rz0c>~Lx$ct+U!YB7<*2qfB-+ldpLbgy2$Qs;uTuY)Ag0o6g5JHc)js$Wk}k6GIa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zrY6Z|vqU3N!r>^=wvo1tz4W;z0d1<+ssS9w;o_xpIK@S->$;KR`O~~Sc9CTJ4(hk> zrL?Y{;-Np$+?*np%aO^Ga14gTIfkmIF)sV**P8u1=sjV0dUCogQc3zI{k3aDPe*D6KFbOfgng%Gw1|Sa9EN!;Le-cnw82zLKe)Fqe)ANEwcSpH8 zifM&Xx;iPXFu5YzWqn6NX9^<*eFMesyb)%zy zodgzv9H3V9KxQ(nZ~ehf02oh=Fg2AXH#du0ws`A8E0%GWW`9617?f7a1&~r!A4?ET zB)R>LJE@EL(Cz{?{@~1uFTME7BX7TT7#IPHpW1{So$K~bPt819m)y?fu^1!6qj;qP zGdF!5NBF53e4qI22+FN6zp#L1eSG|EUk$hJy^9^&x1cH|Y+s0r0~Ze*IPmO#DdiwA zx8^CZh40aLEPuxM_+=WK<8R@4sg*Hy7>e z`;b&RMI;hIRTSCW9B0m)=G?h{uD$j~I(Bpsv?~Mx0e`~bXuhZC*w0>j?UldZ)y4Fy zeXMC${b%&>Bm1`Bb?2S;`+UA{IF55mE|+C!c!+YTOnXN=!V>iN_p^R|6RA|{FV8>! z=cj6GYg4&gPOlyMGYGhH?UPUb^sDvt$@~0%|J^s-(A}EP=Q(`%&69@?z5Zxl--o9F z?{oP3?|)57iDlW1k3IJIUash)&ujk%H|e~BDyu2Q0000bbVXQnWMOn=I%9HWVRU5x zGB7bVEig7MGBQ*$Fgi0iIx;pZFfuwYFv+dRQUCw|C3HntbYx+4WjbwdWNBu305UK! qHZ3qVEiy7xGB7$bIXW^nD=;!TFfh3AaP9yA00{s|MNUMnLSTX&)Jt9f diff --git a/platform/psp/os_psp.cpp b/platform/psp/os_psp.cpp index a3a6b2fb09c4..c5b4a4c4c8e0 100644 --- a/platform/psp/os_psp.cpp +++ b/platform/psp/os_psp.cpp @@ -323,6 +323,13 @@ void OS_PSP::process_keys() { } } + InputDefault::JoyAxis ly, lx; + + lx.value = (pad.Lx / 127) - 1; + ly.value = (pad.Ly / 127) - 1; + + input->joy_axis(0, 0, 0, lx); + input->joy_axis(0, 0, 1, ly); } void OS_PSP::delete_main_loop() {