diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-10-17 00:32:59 +0200 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-10-20 16:54:44 +0200 |
| commit | 7a2e6dd9550376f7a0511e73b33194170d712384 (patch) | |
| tree | 25c3e1f61176767753e0566bc0685ab52c50504a /libpsn00b | |
| parent | 0a7f59de1eb079930e7c25ad35adc39c9946958c (diff) | |
| download | psn00bsdk-7a2e6dd9550376f7a0511e73b33194170d712384.tar.gz | |
CMake fixes, improved CPack support, Windows instructions
Diffstat (limited to 'libpsn00b')
| -rw-r--r-- | libpsn00b/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | libpsn00b/cmake/internal_setup.cmake | 17 | ||||
| -rw-r--r-- | libpsn00b/readme.txt | 32 |
3 files changed, 46 insertions, 12 deletions
diff --git a/libpsn00b/CMakeLists.txt b/libpsn00b/CMakeLists.txt index 52914d3..bfe27c6 100644 --- a/libpsn00b/CMakeLists.txt +++ b/libpsn00b/CMakeLists.txt @@ -40,12 +40,13 @@ foreach(_library IN LISTS PSN00BSDK_LIBRARIES) psn00bsdk_add_library(${_library} STATIC ${_sources}) endforeach() -# Extract libgcc's contents and merge them into libc after building. +# Copy libgcc.a and merge the PSn00bSDK libc into it after building. add_custom_command( TARGET c POST_BUILD - COMMAND ${CMAKE_AR} x ${PSN00BSDK_LIBGCC} - COMMAND ${CMAKE_AR} rsuU $<TARGET_FILE:c> *.o - COMMENT "Merging libgcc contents into SDK libc" + COMMAND ${CMAKE_COMMAND} -E copy ${PSN00BSDK_LIBGCC} $<TARGET_FILE:c> + #COMMAND ${CMAKE_AR} rsuU $<TARGET_FILE:c> *.o + COMMAND ${CMAKE_AR} rsuU $<TARGET_FILE:c> $<JOIN:"$<TARGET_OBJECTS:c>"," "> + COMMENT "Merging SDK libc contents into libgcc" ) ## Installation diff --git a/libpsn00b/cmake/internal_setup.cmake b/libpsn00b/cmake/internal_setup.cmake index e3d4be7..377afbc 100644 --- a/libpsn00b/cmake/internal_setup.cmake +++ b/libpsn00b/cmake/internal_setup.cmake @@ -79,6 +79,12 @@ function(psn00bsdk_add_executable name type) message(FATAL_ERROR "Invalid executable type: ${type} (must be STATIC or DYNAMIC)") endif() + # Throw an error if elf2x was not found (which should never happen if the + # SDK is installed properly). + if(ELF2X STREQUAL "ELF2X-NOTFOUND") + message(FATAL_ERROR "Failed to locate elf2x. Check your PATH environment variable.") + endif() + add_executable (${name} ${ARGN}) target_link_libraries(${name} psn00bsdk_${_type}_exe) set_target_properties(${name} PROPERTIES PREFIX "" SUFFIX ".elf") @@ -146,6 +152,13 @@ endfunction() # [additional options passed to add_custom_target()] # ) function(psn00bsdk_add_cd_image name image_name config_file) + # Throw an error if mkpsxiso was not found. Performing this check manually + # (instead of just marking mkpsxiso as required) allows simple projects to + # be built even if mkpsxiso is not installed. + if(MKPSXISO STREQUAL "MKPSXISO-NOTFOUND") + message(FATAL_ERROR "Failed to locate mkpsxiso. If mkpsxiso wasn't installed alongside the SDK, check your PATH environment variable.") + endif() + set(CD_IMAGE_NAME ${image_name}) configure_file(${config_file} _gen_${config_file}) @@ -158,4 +171,6 @@ function(psn00bsdk_add_cd_image name image_name config_file) ) endfunction() -## Helper functions for assets (TODO) +## Helper functions for assets + +# TODO: add them diff --git a/libpsn00b/readme.txt b/libpsn00b/readme.txt index 9f6ebc6..cfff733 100644 --- a/libpsn00b/readme.txt +++ b/libpsn00b/readme.txt @@ -11,11 +11,11 @@ from scratch in a mix of C and hand optimized assembly language for optimal software performance. These libraries can only be compiled using a build of GCC that targets -mipsel-unknown-elf. Compiler version shouldn't matter much and it should work -fine with GCC 9.1.0, though 7.4.0 is the recommended version as that is what -LibPSn00b is most tested most on. +mipsel-unknown-elf (or mipsel-none-elf). Compiler version shouldn't matter +much and it should work fine with the latest GCC release, though 7.4.0 is the +recommended version as that is what LibPSn00b is most tested most on. + - Brief summary of libraries: libc - Standard C library. Covers only a small subset of the full @@ -33,7 +33,8 @@ Brief summary of libraries: psxapi - Provides function calls for using functions provided by the PS1 BIOS. - psxetc - Provides some miscellaneous features such as debug font. + psxetc - Provides some miscellaneous features used by the other libraries + as well as a dynamic linker for loading DLLs at runtime. psxspu - SPU library (work in progress). Currently supports hardware init, sample data upload via DMA and playing sound samples. @@ -49,7 +50,12 @@ Brief summary of libraries: must be covered in the changelog.txt file. -Compiling (OUTDATED): +Compiling: + + Refer to INSTALL.md in the parent directory for up-to-date installation + instructions. + + --- THE SECTION BELOW IS OUTDATED AND ONLY KEPT FOR REFERENCE --- To compile the LibPSn00b libraries, you will first need a working GCC toolchain which you can either build yourself as described in the @@ -94,6 +100,10 @@ Documentation: library documents. It may be wise to export the document as a PDF document for easier viewing. + The PSn00bSDK CMake toolchain script also defines several macros and + helpers that can be used in project build scripts, documented in + cmake_reference.md. + Contributing: @@ -138,4 +148,12 @@ LibPSn00b Library to-do list: psxpress - MDEC and data decompression library. May use DEFLATE or LZ77 for compressing MDEC data instead of Huffman as used in the official libraries. It may yield better compression which may - potentially result in higher quality FMVs.
\ No newline at end of file + potentially result in higher quality FMVs. + + psxexp - Support library for various devices connected to the serial or + expansion port, including both official ones (e.g. PCMCIA cards + and IDE drives used by some PS1-based arcade systems) as well + as cheat devices, RAM expanders or even ESP8266/ESP32 wireless + modules. May also include APIs for accessing the filesystem on + a connected drive (possibly by overriding psxcd and psxmcrd + functions) or reliably transferring data from/to a PC. |
