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 5e98ac26eca5..24217cb6f487 100644 Binary files a/platform/psp/logo.png and b/platform/psp/logo.png differ 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() {