From 8deeb216cbff4e578284fc040d8f0b51e96d4b04 Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Wed, 29 Jun 2022 13:09:57 +0200 Subject: Add -g to default flags, update changelog and known bugs --- .github/scripts/generate_release_notes.py | 76 ++++++++++++++++++------------- 1 file changed, 45 insertions(+), 31 deletions(-) (limited to '.github') diff --git a/.github/scripts/generate_release_notes.py b/.github/scripts/generate_release_notes.py index e3fbc7f..c706191 100644 --- a/.github/scripts/generate_release_notes.py +++ b/.github/scripts/generate_release_notes.py @@ -8,7 +8,8 @@ from argparse import ArgumentParser, FileType ## Helpers -VERSION_REGEX = re.compile(r"^(?:refs\/tags\/)?(?:v|ver|version|release)? *(.*)") +VERSION_REGEX = re.compile(r"^(?:refs\/tags\/)?(?:v|ver|version|release)? *(.*)") +TEXT_WRAP_REGEX = re.compile(r"(? args.to_date: - continue if version not in versions: versions[version] = [], [] _authors, _changes = versions[version] - _authors.extend(authors.keys()) - _changes.extend(authors.values()) + + for date, authors in blocks: + if date < args.from_date or date > args.to_date: + continue + + _authors.extend(authors.keys()) + _changes.extend(authors.values()) notes = generate_notes(versions) -- cgit v1.2.3 From 5746b6ef9df16447d78e77d00ad21a4dba0fe169 Mon Sep 17 00:00:00 2001 From: spicyjpeg Date: Wed, 21 Sep 2022 23:49:20 +0200 Subject: Bump GCC to 12.2.0, update docs and installation guide --- .github/workflows/build.yml | 15 +++-------- CHANGELOG.md | 17 ++++++++++++ README.md | 15 +++++++---- cpack/setup.cmake | 4 +-- doc/installation.md | 61 ++++++++++++++++++++++++++++++++------------ libpsn00b/psxpress/README.md | 42 ++++++++++++++++++++++++++++++ 6 files changed, 120 insertions(+), 34 deletions(-) create mode 100644 libpsn00b/psxpress/README.md (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f42e41..f35872d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,8 @@ name: Build PSn00bSDK on: [ push, pull_request ] env: - BINUTILS_VERSION: 2.36 - GCC_VERSION: 11.1.0 + BINUTILS_VERSION: 2.39 + GCC_VERSION: 12.2.0 GCC_TARGET: mipsel-none-elf jobs: @@ -131,7 +131,7 @@ jobs: - name: Upload build artifacts (NSIS) uses: actions/upload-artifact@v2 with: - name: psn00bsdk-windows-nsis + name: psn00bsdk-windows-installer path: build/packages/*.exe build-sdk-linux: @@ -169,12 +169,6 @@ jobs: name: psn00bsdk-linux path: build/packages/*.zip - - name: Upload build artifacts (DEB) - uses: actions/upload-artifact@v2 - with: - name: psn00bsdk-linux-deb - path: build/packages/*.deb - # This job takes care of creating a new release and upload the build # artifacts if the last commit is associated to a tag. create-release: @@ -224,6 +218,5 @@ jobs: files: | *.zip psn00bsdk-windows/* - psn00bsdk-windows-nsis/* + psn00bsdk-windows-installer/* psn00bsdk-linux/* - psn00bsdk-linux-deb/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f131c..b477b54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,23 @@ to ensure the changelog can be parsed correctly. ------------------------------------------------------------------------------- +## 2022-08-21: 0.20 + +spicyjpeg: + +- psxgpu: Added `VSyncHaltFunction()`. + +- psxetc: Rewritten the library in C, making `RestartCallback()` behave more + like its official SDK counterpart. Added `StopCallback()` and + `ResetCallback()`. + +- psxspu: `SpuInit()` now properly resets the starting address of all channels, + preventing them from accidentally triggering the SPU IRQ. + +- examples: Added an example audio file to `sound/spustream` and a texture to + `graphics/gte`. Replaced `ball16c.h` in all examples that included it with a + binary .TIM file embedded through CMake. + ## 2022-07-31 spicyjpeg: diff --git a/README.md b/README.md index 29e73a0..e4a2d15 100644 --- a/README.md +++ b/README.md @@ -85,14 +85,19 @@ As of March 28, 2022 ## Obtaining PSn00bSDK -Prebuilt PSn00bSDK packages for Windows and Linux are available through GitHub -Actions which includes the libraries, a copy of the GCC MIPS toolchain, command -line tools, examples and documentation. CMake is **not** included and must be +Prebuilt PSn00bSDK packages for Windows and Linux are available on the releases +page and include the libraries, a copy of the GCC MIPS toolchain, command-line +tools, examples and documentation. CMake is **not** included and must be installed separately, either from [its website](https://cmake.org/download) or via MSys2 or your distro's package manager. -See [installation.md](doc/installation.md) for a quick start guide and for -details on how to build the SDK yourself. +The releases can be installed by simply extracting the archives into any +directory and adding the `bin` subfolder to the `PATH` environment variable. +`share/psn00bsdk/template` contains a barebones example project that can be +used as a starting point. + +For more information on how to get started, or if you wish to build the SDK +yourself from source instead, refer to [installation.md](doc/installation.md). ## Examples diff --git a/cpack/setup.cmake b/cpack/setup.cmake index 45580f7..13da515 100644 --- a/cpack/setup.cmake +++ b/cpack/setup.cmake @@ -108,8 +108,8 @@ if(NOT DEFINED CPACK_GENERATOR) elseif(APPLE) # TODO: add a macOS installer and related options set(CPACK_GENERATOR ZIP) - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(CPACK_GENERATOR ZIP DEB) + #elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + #set(CPACK_GENERATOR ZIP DEB RPM) else() set(CPACK_GENERATOR ZIP) endif() diff --git a/doc/installation.md b/doc/installation.md index 2d058ab..382c721 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -1,18 +1,43 @@ # Getting started with PSn00bSDK -**IMPORTANT**: due to a bug in `libflac` (used by `mkpsxiso`), building using -MinGW on Windows currently requires `-DMKPSXISO_NO_LIBFLAC=ON` to be passed to -CMake when configuring PSn00bSDK. This will result in the `dumpsxiso` utility -being built without support for ripping CD audio tracks to FLAC, however the -`mkpsxiso` command will still retain FLAC support. +## Installing a prebuilt release (recommended) + +1. Install prerequisites. Currently CMake is the only external dependency; you + can install it from [here](https://cmake.org/download) or using MSys2 or + your distro's package manager. Make sure you have at least CMake 3.20. + +2. Head over to the releases page, download the latest release's ZIP for your + operating system and extract its contents to a directory of your choice, + preferably one whose absolute path is short (such as `C:\PSn00bSDK` or + `/opt/psn00bsdk`). Proceed to add the `bin` subdirectory you extracted (e.g. + `C:\PSn00bSDK\bin` or `/opt/psn00bsdk/bin`) to your `PATH` environment + variable, through System Properties on Windows or by modifying your profile + script on Linux. + +3. You may optionally set the `PSN00BSDK_LIBS` environment variable to point to + the `lib/libpsn00b` subdirectory (again, the full path would be something + like `C:\PSn00bSDK\lib\libpsn00b` or `/opt/psn00bsdk/lib/libpsn00b`). Doing + so is highly recommended as it will save you from having to hardcode a path + to the SDK in your projects later on. -## Building and installing +4. You should now be able to invoke the compiler (`mipsel-none-elf-gcc`) as + well as PSn00bSDK commands such as `elf2x` and `mkpsxiso`. If you get + "command not found" errors try rebooting, otherwise you can skip to + [Creating a project](#creating-a-project). + +## Building from source The instructions below are for Windows and Linux. Building on macOS hasn't been tested extensively yet, however it should work once the GCC toolchain is built and installed properly. +**IMPORTANT**: due to a bug in `libflac` (used by `mkpsxiso`), building using +MinGW on Windows currently requires `-DMKPSXISO_NO_LIBFLAC=ON` to be passed to +CMake when configuring PSn00bSDK. This will result in the `dumpsxiso` utility +being built without support for ripping CD audio tracks to FLAC, however the +`mkpsxiso` command will still retain FLAC support. + 1. Install prerequisites and a host compiler toolchain. On Linux (most distros) install the following packages from your distro's package manager: @@ -80,7 +105,7 @@ and installed properly. If you want to install the SDK to a custom location rather than the default one (`C:\Program Files\PSn00bSDK` or `/usr/local` depending on your OS), add - `--install-prefix ` to the first command. Remember to add + `--install-prefix ` to the first command. Remember to add `-DPSN00BSDK_TARGET=mipsel-unknown-elf` if necessary. **NOTE**: Ninja is used by default to build the SDK. If you can't get it to @@ -95,15 +120,18 @@ and installed properly. cmake --install ./build ``` - This will create and populate the following directories: + This will create and populate the following subfolders in the installation + directory: - - `/bin` - - `/lib/libpsn00b` - - `/share/psn00bsdk` + - `bin` + - `lib/libpsn00b` + - `share/psn00bsdk` 7. You may optionally set the `PSN00BSDK_LIBS` environment variable to point to - the `lib/libpsn00b` subfolder inside the install directory. You might also - want to add the `bin` folder to `PATH` if it's not listed already. + the `lib/libpsn00b` subfolder inside the install directory. Doing so is + highly recommended as it will save you from having to hardcode a path to the + SDK in your projects later on. You might also want to add the `bin` folder + to `PATH` if it's not listed already. Although not strictly required, you'll probably want to install a PS1 emulator with debugging capabilities such as [no$psx](https://problemkaputt.de/psx.htm) @@ -134,8 +162,9 @@ far from being feature-complete. ## Creating a project -1. Copy the contents of `/share/psn00bsdk/template` (or the - `template` folder within the repo) to your new project's root directory. +1. Copy the contents of `share/psn00bsdk/template` within the PSn00bSDK + installation directory (or the `template` folder within the repo) to a new + empty folder, which will become your project's root directory. 2. If you haven't set the `PSN00BSDK_LIBS` environment variable previously or if you want to use a different PSn00bSDK installation for the project, edit @@ -156,4 +185,4 @@ The toolchain script defines a few CMake macros to create PS1 executables, DLLs and CD images. See the [reference](cmake_reference.md) for details. ----------------------------------------- -_Last updated on 2022-02-06 by spicyjpeg_ +_Last updated on 2022-09-21 by spicyjpeg_ diff --git a/libpsn00b/psxpress/README.md b/libpsn00b/psxpress/README.md new file mode 100644 index 0000000..a894874 --- /dev/null +++ b/libpsn00b/psxpress/README.md @@ -0,0 +1,42 @@ + +# PSn00bSDK MDEC library + +This is a fully open source reimplementation of the official SDK's "data +compression" library. This library is made up of two parts, the MDEC API and +functions to decompress Huffman-encoded bitstreams (.BS files, or frames in +.STR files) into data to be fed to the MDEC. FMV playback is not part of this +library (nor the official one) per se, but can implemented by using these APIs +alongside some code to stream data from the CD drive. + +**Currently only version 1 and 2 bitstreams are supported**. + +## MDEC API + +The MDEC data input/output API is almost identical to the official one, with +only two minor differences: + +- `DecDCTPutEnv()` takes a second argument specifying whether the MDEC shall be + put into monochrome or color mode (the original API only supported color). +- A `DecDCTinRaw()` function was added for easier feeding of headerless data + buffers to the MDEC. This function does not affect how `DecDCTin()` works. + +## Decompression API + +The following functions are currently provided: + +- `DecDCTvlcStart()`, `DecDCTvlcContinue()`: a decompressor implementation that + uses a small (<1 KB) lookup table and leverages the GTE, written in assembly. + `DecDCTvlcCopyTable()` can optionally be called to temporarily move the table + to the scratchpad region to improve decompression speed. +- `DecDCTvlcStart2()`, `DecDCTvlcContinue2()`: a different implementation using + a large (34 KB) lookup table in main RAM, written in C. The table must be + decompressed ahead of time using `DecDCTvlcBuild()`, but can be deallocated + when no longer needed. +- `DecDCTvlc()`, `DecDCTvlc2()`: wrappers around the functions listed above, + for compatibility with the Sony SDK. Using them is not recommended. + +## SPU ADPCM encoding API + +The Sony library has functions that can be used to convert raw 16-bit PCM audio +data to SPU ADPCM. These are currently unimplemented due to their limited +usefulness, but might be added at some point. -- cgit v1.2.3