From a53f692bfb4bb0a809f57ebc260d085850b42b72 Mon Sep 17 00:00:00 2001 From: xeonliu <62530004+xeonliu@users.noreply.github.com> Date: Mon, 9 Oct 2023 18:13:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c5bea54..b937686 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # PSPDevNote Take notes on PlayStation Portable development. + +Homepage: https://xeonliu.github.io/PSPDevNote/ \ No newline at end of file From f6aaf047128ff98fc1948bccd7752ff0d74811b3 Mon Sep 17 00:00:00 2001 From: xeonliu <62530004+xeonliu@users.noreply.github.com> Date: Fri, 3 Nov 2023 17:33:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20makefilesample.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/makefilesample.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/makefilesample.md b/docs/makefilesample.md index f20a947..3386ba6 100644 --- a/docs/makefilesample.md +++ b/docs/makefilesample.md @@ -186,4 +186,23 @@ Create a .SFO file for XMB use Strip the .elf file to shrink size and reduce redundancy Create an EBOOT.PBP file, which houses additional XMB information (see pack-pbp --help) -https://en.wikibooks.org/wiki/PSP_Development/Hello_World_Application \ No newline at end of file +https://en.wikibooks.org/wiki/PSP_Development/Hello_World_Application + +# 链接SDL2 +## GCC预定义的宏 + +你是Linux系统,那么GNUC会给你宏linux,__linux,__linux__三个宏中的一个。如果你是安卓系统,那么就会给ANDROID,__ANDROID__宏中的一个。 所以跨平台就是根据这些GNUC给出的宏来判断的。根据源码,我们可以知道GUNC会给出如下的宏: * linux系统:linux, __linux, __linux__ * 苹果系统:__APPLE__ * 苹果电脑:__MACOSX__ * 苹果手机:__IPHONEOS__ * 苹果电视:__TVOS__ * 安卓系统:__ANDROID__ * windows系统:WIN32, _WIN32, __CYGWIN__, __MINGW32__,__WINDOWS__ * PSP系统:__PSP__ + +https://visualgmq.gitee.io/2019/07/28/%E5%90%84%E7%A7%8D%E5%BA%93%E6%98%AF%E5%A6%82%E4%BD%95%E5%81%9A%E5%88%B0%E8%B7%A8%E5%B9%B3%E5%8F%B0%E7%9A%84/ +## SDL_main +SDL 使用了一种技巧,通过宏定义将用户的 main 函数重命名为 SDL_main,然后提供自己的 main 函数。这样,当你在你的代码中写 main 函数时,预处理器实际上会将其重命名为 SDL_main +```c +#elif defined(__PSP__) +/* On PSP SDL provides a main function that sets the module info, + activates the GPU and starts the thread required to be able to exit + the software. + + If you provide this yourself, you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE +``` \ No newline at end of file