diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-11-28 17:31:33 +0100 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-11-28 17:31:33 +0100 |
| commit | 603b42797c4b0e7a3e2a3cac320daecf1ee34feb (patch) | |
| tree | ff11eb37407bdb399bf53e69d2111f12af17d4b2 | |
| parent | 45123e1b968d1883fed9b8526157ce2c4bffc4a7 (diff) | |
| download | psn00bsdk-603b42797c4b0e7a3e2a3cac320daecf1ee34feb.tar.gz | |
Add GitHub Actions CI/release workflow, rewrite changelog
| -rw-r--r-- | .github/scripts/generate_release_notes.py | 194 | ||||
| -rw-r--r-- | .github/workflows/build.yml | 208 | ||||
| -rw-r--r-- | CHANGELOG.md | 671 | ||||
| -rw-r--r-- | CMakePresets.json | 13 | ||||
| -rw-r--r-- | changelog.txt | 605 |
5 files changed, 1086 insertions, 605 deletions
diff --git a/.github/scripts/generate_release_notes.py b/.github/scripts/generate_release_notes.py new file mode 100644 index 0000000..f3e4870 --- /dev/null +++ b/.github/scripts/generate_release_notes.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +# PSn00bSDK release notes generator +# (C) 2021 spicyjpeg - MPL licensed + +import sys, re +from time import gmtime, strptime +from argparse import ArgumentParser, FileType + +## Helpers + +VERSION_REGEX = re.compile(r"^(?:refs\/tags\/)?(?:v|ver|version|release)? *(.*)") + +def parse_date(date): + return strptime(date.strip(), "%Y-%m-%d") + +def normalize_version(version): + match = VERSION_REGEX.match(version.lower()) + if not match: + raise ValueError(f"invalid version string: {version}") + + return match.group(1) + +## Changelog parser + +BLOCK_REGEX = re.compile(r"^#{2,}[ \t]*([0-9]{4}-[0-9]{2}-[0-9]{2})(?:[:\- \t]+(.+?))?$", re.MULTILINE) +AUTHOR_REGEX = re.compile(r"^([A-Za-z0-9_].*?)[ \t]*:.*?$", re.MULTILINE) +FIRST_VERSION = "initial" + +def parse_authors(block): + # [ _crap, author, body, author, body, ... ] + items = AUTHOR_REGEX.split(block.strip()) + + if items[0].strip(): + raise RuntimeError("a block has changes listed with no author specified") + + authors = {} + for i in range(1, len(items), 2): + name, body = items[i:i + 2] + + name = name.strip() + body = body.strip() + if name not in authors: + authors[name] = "" + + authors[name] += body + + return authors + +def parse_blocks(changelog): + # [ _crap, date, version, body, date, version, body, ... ] + items = BLOCK_REGEX.split(changelog.strip()) + + #if items[0].strip(): + #raise RuntimeError("the changelog doesn't start with a valid block") + + # Iterate over all blocks from bottom to top (i.e. oldest first). + last_version = FIRST_VERSION + + for i in range(len(items), 1, -3): + date, version, body = items[i - 3:i] + + # If no version is present in the header, assume it's the same as the + # previous block's version. + if version: + version = normalize_version(version) + last_version = version + else: + version = last_version + + yield parse_date(date), version, parse_authors(body) + +## Release notes generation + +VERSION_TEMPLATE = """New in version **{version}** (contributed by {authors}): + +{changes} + +""" +NOTES_TEMPLATE = """{notes} + +------------------------------------------------------- +_These notes have been generated automatically._ +_See the changelog or commit history for more details._ +""" + +NO_VERSIONS_TEMPLATE = "No information available about this release." +AUTHOR_LINK_TEMPLATE = "**{0}**" +#AUTHOR_LINK_TEMPLATE = "[{0}](https://github.com/{0})" + +def generate_notes(versions): + notes = "" + + for version, ( authors, changes ) in versions.items(): + _authors = list(set(authors)) + _authors.sort() + _authors = map(AUTHOR_LINK_TEMPLATE.format, _authors) + + notes += VERSION_TEMPLATE.format( + version = version, + authors = ", ".join(_authors), + changes = "\n\n".join(changes) + ) + + if not notes: + notes = NO_VERSIONS_TEMPLATE + + return NOTES_TEMPLATE.format(notes = notes.strip()) + +## Main + +def get_args(): + parser = ArgumentParser( + description = "Generates and outputs release notes from a Markdown changelog file.", + add_help = False + ) + + tools_group = parser.add_argument_group("Tools") + tools_group.add_argument( + "-h", "--help", + action = "help", + help = "Show this help message and exits" + ) + + files_group = parser.add_argument_group("Files") + files_group.add_argument( + "changelog", + type = FileType("rt"), + help = "Markdown changelog file to parse" + ) + files_group.add_argument( + "-o", "--output", + type = FileType("wt"), + default = sys.stdout, + help = "Where to output release notes (stdout by default)", + metavar = "file" + ) + + filter_group = parser.add_argument_group("Filters") + filter_group.add_argument( + "-v", "--version", + action = "append", + type = str, + help = "Ignore all changes not belonging to a version (can be specified multiple times)", + metavar = "name" + ) + filter_group.add_argument( + "-f", "--from-date", + type = parse_date, + default = parse_date("2000-01-01"), + help = "Ignore all changes before date", + metavar = "yyyy-mm-dd" + ) + filter_group.add_argument( + "-t", "--to-date", + type = parse_date, + default = gmtime(), + help = "Ignore all changes after date", + metavar = "yyyy-mm-dd" + ) + + return parser.parse_args() + +def main(): + args = get_args() + version_list = list(map(normalize_version, args.version or [])) + + with args.changelog as _file: + changelog = _file.read() + + # Iterate over all blocks in the changelog and sort them by version, + # merging all changes and authors for each version. + versions = {} + + for date, version, authors in parse_blocks(changelog): + # Apply version and date filters. + if version_list and (version not in version_list): + continue + if date < args.from_date or date > args.to_date: + continue + + if version not in versions: + versions[version] = [], [] + + _authors, _changes = versions[version] + _authors.extend(authors.keys()) + _changes.extend(authors.values()) + + notes = generate_notes(versions) + + with args.output as _file: + _file.write(notes) + +if __name__ == "__main__": + main() diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d6746b0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,208 @@ +# PSn00bSDK GitHub Actions CI script +# (C) 2021 spicyjpeg - MPL licensed + +# The GCC toolchain is stored in the GitHub Actions cache after being built. To +# minimize build times, all the toolchain build steps are skipped if there is a +# cached copy of the toolchain that has not expired (even though the build-gcc +# job still has to run in order to check the cache's contents). The cache is +# shared between all actions in a repo. + +name: Build PSn00bSDK +on: [ push, pull_request ] +env: + BINUTILS_VERSION: 2.36 + GCC_VERSION: 11.1.0 + GCC_TARGET: mipsel-none-elf + +jobs: + # This is based on doc/toolchain.md, no surprises here other than the cache. + build-gcc: + name: Build GCC toolchain + runs-on: ubuntu-latest + + steps: + - name: Initialize toolchain cache + id: _cache + uses: actions/cache@v2 + with: + key: gcc-${{ env.GCC_TARGET }}-${{ env.GCC_VERSION }} + path: gcc + + - name: Install prerequisites + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends make g++-mingw-w64-x86-64 + + - name: Download and extract sources + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + wget -q -O binutils.tar.xz https://ftpmirror.gnu.org/gnu/binutils/binutils-${{ env.BINUTILS_VERSION }}.tar.xz + wget -q -O gcc.tar.xz https://ftpmirror.gnu.org/gnu/gcc/gcc-${{ env.GCC_VERSION }}/gcc-${{ env.GCC_VERSION }}.tar.xz + tar xf binutils.tar.xz + tar xf gcc.tar.xz + cd gcc-${{ env.GCC_VERSION }} + contrib/download_prerequisites + + - name: Build binutils for Linux + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + mkdir binutils_linux + cd binutils_linux + ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --with-float=soft + make -j 2 + make install-strip + echo "${{ github.workspace }}/gcc/linux/bin" >>$GITHUB_PATH + + - name: Build GCC for Linux + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + mkdir gcc_linux + cd gcc_linux + ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/linux --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --with-float=soft --enable-languages=c,c++ --with-gnu-as --with-gnu-ld + make -j 2 + make install-strip + + - name: Build binutils for Windows + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + mkdir binutils_windows + cd binutils_windows + ../binutils-${{ env.BINUTILS_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --with-float=soft + make -j 2 + make install-strip + + - name: Build GCC for Windows + if: ${{ steps._cache.outputs.cache-hit != 'true' }} + run: | + mkdir gcc_windows + cd gcc_windows + ../gcc-${{ env.GCC_VERSION }}/configure --prefix=${{ github.workspace }}/gcc/windows --build=x86_64-linux-gnu --host=x86_64-w64-mingw32 --target=${{ env.GCC_TARGET }} --disable-docs --disable-nls --disable-libada --disable-libssp --disable-libquadmath --disable-libstdc++-v3 --with-float=soft --enable-languages=c,c++ --with-gnu-as --with-gnu-ld + make -j 2 + make install-strip + + # No surprises here either. The GitHub Actions VMs even come with most of the + # dependencies required to build PSn00bSDK preinstalled. + build-sdk-windows: + name: Build PSn00bSDK on Windows + runs-on: windows-latest + needs: build-gcc + + steps: + # Due to a bug in the cache action (and in order to use Ninja and pacman) + # the directories MSys2 stores binaries in must be added to PATH. For + # some reason they are not present in PATH by default. + # https://github.com/actions/cache/issues/576 + - name: Add MSys2 to PATH + run: | + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Initialize toolchain cache + uses: actions/cache@v2 + with: + key: gcc-${{ env.GCC_TARGET }}-${{ env.GCC_VERSION }} + path: gcc + + - name: Install prerequisites + run: | + pacman -S --noconfirm mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc + + - name: Fetch repo contents + uses: actions/checkout@v2 + with: + path: sdk + + - name: Update repo submodules + run: | + cd sdk + git submodule update --init --recursive --remote + + - name: Build and package PSn00bSDK + run: | + cmake --preset ci -S sdk -DPSN00BSDK_TC=${{ github.workspace }}\gcc\windows + cmake --build build + cmake --build build -t package + + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: psn00bsdk-windows + path: | + build/packages/* + !build/packages/_CPack_Packages + + build-sdk-linux: + name: Build PSn00bSDK on Linux + runs-on: ubuntu-latest + needs: build-gcc + + steps: + - name: Initialize toolchain cache + uses: actions/cache@v2 + with: + key: gcc-${{ env.GCC_TARGET }}-${{ env.GCC_VERSION }} + path: gcc + + - name: Install prerequisites + run: | + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends ninja-build + + - name: Fetch repo contents + uses: actions/checkout@v2 + with: + path: sdk + + - name: Update repo submodules + run: | + cd sdk + git submodule update --init --recursive --remote + + - name: Build and package PSn00bSDK + run: | + cmake --preset ci -S sdk -DPSN00BSDK_TC=${{ github.workspace }}/gcc/linux + cmake --build build + cmake --build build -t package + + - name: Upload build artifacts + uses: actions/upload-artifact@v2 + with: + name: psn00bsdk-linux + path: | + build/packages/* + !build/packages/_CPack_Packages + + # 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: + name: Create release + runs-on: ubuntu-latest + needs: [ build-sdk-windows, build-sdk-linux ] + + steps: + - name: Fetch repo contents + uses: actions/checkout@v2 + with: + path: sdk + + - name: Fetch build artifacts + if: ${{ github.ref_type == 'tag' }} + uses: actions/download-artifact@v2 + with: + path: . + + - name: Generate release notes + if: ${{ github.ref_type == 'tag' }} + run: | + sdk/.github/scripts/generate_release_notes.py -v ${{ github.ref_name }} -o release.md sdk/CHANGELOG.md + + - name: Publish release + if: ${{ github.ref_type == 'tag' }} + uses: softprops/action-gh-release@v1 + with: + fail_on_unmatched_files: true + body_path: release.md + files: | + psn00bsdk-windows/* + psn00bsdk-linux/* diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c05105e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,671 @@ + +# PSn00bSDK changelog + +**NOTE**: this file is parsed by a script to generate release notes. When +contributing to PSn00bSDK, add a new block at the top following this template: + +``` +## <year>-<month>-<day>: <new version> + +<contributor>: + +- ... + +- ... +``` + +You may run `.github/scripts/generate_release_notes.py CHANGELOG.md` afterwards +to ensure the changelog can be parsed correctly. + +-------- + +## 2021-11-28: 0.18 + +spicyjpeg: + +- libc: Removed `STACK_MAX_SIZE` and added `_mem_init()` back. RAM and stack + size can now be set by calling `_mem_init()` manually before allocating any + memory. + +- libc: `sprintf()` now supports fixed padding when using the `%@` (binary + integer) format specifier. + +- psxcd: File paths with forward slashes instead of backslashes are now + accepted. + +- psxapi: Added wrapper around BIOS function `GetSystemInfo()`. + +- examples: Added `pads` and `system573` examples. Also added CMake build + script to `cartrom`, which is now built alongside all other examples. + +- Header files are now installed to `include/libpsn00b` instead of + `lib/libpsn00b/include`. + +- Deprecated `malloc.h` and removed all references to it (`stdlib.h` should be + used instead). Moved `int*_t` and `uint*_t` types to `stdint.h`. + +- Fixed file permission errors when attempting to install the SDK on macOS and + made some small updates to `INSTALL.md`, which is now `doc/installation.md`. + +## 2021-10-31 + +spicyjpeg: + +- Added `tinyxml2` and `mkpsxiso` as git submodules and removed the (admittedly + short-lived) `SKIP_*` options completely. CMake's `ExternalProject` is no + longer used to download dependencies at build time. + +- Added CMake presets file with presets for building installer packages. + +## 2021-10-25 + +Lameguy64: + +- Made a very tiny change in the readme file. + +- Included some of the indev directory from the SVN repository. + +## 2021-10-17: 0.17 + +spicyjpeg: + +- Added `SKIP_TINYXML2` and `SKIP_MKPSXISO` build options in place of the old + `SKIP_DOWNLOAD` option, and a new `BUNDLE_TOOLCHAIN` option for building + packages. Updated `INSTALL.md` accordingly and fixed git branch error when + downloading mkpsxiso during build. + +- Rewritten `toolchain.txt` (which is now `TOOLCHAIN.md`) and added proper + Windows toolchain build instructions. + +- Added safety checks in CMake scripts to ensure `elf2x`/`mkpsxiso` are + installed before attempting to build an executable or CD image. + +- examples: Added CMake build script to (and removed makefile from) `vagsample`. + +## 2021-06-10 + +Lameguy64: + +- psxspu: Fixed register typo in `SpyKeyOn` causing unpredictable instability. + +- psxspu: Fixed bug where `SpuKeyOn` does not set the key-on bits for voices 16 + to 23. + +- examples: Added `vagsample` SPU example. + +## 2021-09-27 + +spicyjpeg: + +- liblzp, tools: Fixed tools not building on MSVC and cleaned up LZP API + declarations (replaced meaningless `void*` pointers with proper types). + +- libpsn00b: Added missing `PSN00BSDK_VERSION` CMake variable. + +- examples: Fixed childexec (`parent.exe`) example crashing due to the child + executable not being relocated in the new build script. Patched n00bdemo to + suppress `liblzp` pointer type warnings. + +- Fixed another MSVC linker error when building `tinyxml2` automatically, as + well as various toolchain/compiler test errors sometimes thrown by CMake. + Updated `INSTALL.md` with more details. + +## 2021-09-13 + +spicyjpeg: + +- Migrated libpsn00b, tools, examples and template to CMake, added a top-level + `CMakeLists.txt` and the `libpsn00b/cmake` directory for CMake setup scripts, + got rid of the old makefiles and installation method. + +- Updated docs to match the new build system, moved installation instructions + to `INSTALL.md` and added `doc/cmake_reference.md` describing the SDK's CMake + API and variables. + +- mkpsxiso: Added rules to automatically download, build and install mkpsxiso + (as well as its dependencies) as part of the SDK. + +- cpack: Added initial CPack support and created the cpack directory containing + branding assets for installers built through CPack. A shell script is + provided to regenerate the assets from their source SVGs. + +- liblzp: Copied library headers to `libpsn00b/include/lzp`. + +- psxetc: Fixed a random typo in a javadoc comment (those should be eventually + rewritten into proper documentation anyway). + +- Added CMake, VS Code and DLL related entries to `.gitignore`. + +## 2021-08-16: 0.16 + +spicyjpeg: + +- psxetc: Added dynamic linking APIs (`dl*`, `DL_*`), implemented in `dl.c` and + `_dl_resolve_wrapper.s`. The APIs can be accessed by including `dlfcn.h`, + while another header (`elf.h`) provides structs and enums to help with manual + parsing of library headers. + +- libc: Removed `_mem_init.s`, improved heap initialization code. Added support + for setting how much RAM to use for the stack (by defining `STACK_MAX_SIZE`) + and for overriding/replacing the default memory allocator. + +- psxapi: Added wrapper around BIOS function `FlushCache()`. + +- psxspu: Fixed wrong bounds check in `SpuSetTransferStartAddr()`. + +- examples: Added an example showing how to compile dynamically-loaded + libraries (DLLs) and load them at runtime using the new dynamic linker. + +- libpsn00b: Added `libpsn00b/ldscripts` directory and linker scripts for both + executables and DLLs. Also fixed several broken header files (`psxgpu.h` not + including `sys/types.h`, missing `scanf()` declarations, ...). + +- Rewritten most makefiles (both for libraries and examples) and centralized + all compiler flags into a single `psn00bsdk-setup.mk` file for consistency + and easier editing. Added flags to build libpsn00b without gp-relative + addressing for compatibility with the dynamic linker. Also added `nm` + commands to generate symbol maps required by the linker. + +## 2021-07-01 + +Lameguy64: + +- Libpsn00b: Added `int8_t`, `int16_t`, `int32_t`, `int64_t`, `uint8_t`, + `uint16_t`, `uint32_t` and `uint64_t` variable types in `sys/types.h`. + +- psxgte: Replaced unsigned int variable types with `u_long` to further improve + compatibility with code written for the official Sony SDK and to make my + tutorial examples easier to compile on PSn00bSDK. Example programs have been + updated to account for this change. + +- psxcd: Changed type of 2nd argument of `CdRead()` from `u_int` to `u_long`, + as well as changing the type of the size element in `CdlFILE` from `u_int` to + `u_long`. + +## 2021-02-17 + +Lameguy64: + +- Improved build instructions in readme file and fixed some typos. + +- Improved `toolchain.txt` instructions. + +- tools: Added experimental `elf2cpe` converter for executing PSn00bSDK + programs in official development units. No debug symbols however. + +- Fixed prefixes to allow SDK libraries and examples to be built + with `mipsel-none-elf`. + +- examples: Fixed typo in `plasma_tbl.h` causing multiple definitions when + compiling with newer versions of GCC in `n00bdemo`. + +- examples: `cartrom` example now marked as obsoleted, but still kept for + reference purposes. + +- Includes alextrevisan's GTE macros in `inline_c.h`. + +- Added makefile template. + +## 2021-01-05 + +Lameguy64: + +- psxgpu: Added struct names to many primitives. + +- psxgte: Defined `SquareRoot0()` and `SquareRoot12()`. + +- psxgte: Added `gte_lddp()` C macro. + +- examples: Added C++ demo. + +- Updated readme a bit. + +## 2020-11-29 + +Lameguy64: + +- libpsn00b: Defined MDEC hardware and related DMA registers in `hwregs_a.h` + file. + +- psxgte: Fixed entry typo in table of `squareroot.s` (pointed out by + SoapyMan). + +- libc: `memmove` updated to account for forward-looped memory move (by + ckosmic). + +- examples: Removed redundant toolchain executable definitions in the + makefiles. + +- examples: Included HDTV example for Github repo. + +## 2020-09-19 + +Lameguy64: + +- Revised makefiles for building the libraries and examples in a way to make + building with different toolchain versions easier with the `PSN00BSDK_TC` + environment variable. Library installation and linking is also made easier + with the `PSN00BSDK_LIBS` environment variable. See readme in the `libpsn00b` + directory for details. + +- examples: Fixed libgcc not found error when compiling some of the examples. + +- libc: Added `strtok()`. + +- libc: Added support for command line arguments. Pass arguments via + `SYSTEM.CNF` `BOOT=` string or a string array with `Exec()`. Arguments can + be read via `argc`/`argv[]` in `main()` or `__argc`/`__argv` anywhere else. + +- libc: Added `SetHeapSize()`. + +- psxgpu: Moved ISR and callback subsystem to `psxetc`. You'll have to link + psxetc after `psxgpu` and `psxapi` after `psxetc` in your library string. + +- psxetc: Moved debug font functions (`FntInit()`, `FntOpen()`, etc) to `psxgpu`. + +- psxetc: Fixed stack management in `RestartCallback()`. + +- examples: Added argument passing in `childexec` example. + +- psxcd: Fixed crashing on PSIO and possibly some emulators by implementing + a response buffer read limiter. + +- psxgpu: Interrupts are now disabled before setting up ISR and callbacks in + `ResetGraph()`, as `LoadExec()` still has interrupts enabled when jumping to + the loaded PS-EXE's entrypoint. Fixes programs made with PSn00bSDK crashing + at `ResetGraph()` on PSIO when loading from the Menu System and possibly some + emulators. + +## 2020-07-25 + +Lameguy64: + +- psxgte: Added `ScaleMatrixL()`. + +- doc: Corrected documentation for `CdReadSync()` function. + +- psxcd: Added new define: `CdlIsoLidOpen`. + +- psxcd: Updated media change detection logic, media change is checked + by lid open status bit in all CD-ROM file functions. `CdControl()` calls will + also trigger the media change status on lid open. + +- psxcd: Fixed bug in `CdGetVolumeLabel()` where it constantly reparses the + file system regardless of media change status. + +- examples: Updated `cdrom/cdbrowse` example slightly. + +- psxcd: Added `CdLoadSession()`. + +- psxcd: Fixed bug where `CdReadDir()` locks up in an infinite loop when it + encounters a NULL directory record, and the parser has not yet exceeded the + length of the directory record. + +- doc: Replaced library version numbers with SVN revision numbers in the + introduced fields. + +- doc: Started work on CD-ROM library overview. + +## 2020-04-24 + +Lameguy64: + +- Refined toolchain instructions a bit. + +- psxcd: Added automatic read retry for `CdRead()` operations, as long as + `CdReadSync()` is called until read completion. + +- psxapi: Added BIOS `atoi()` and `atol()` calls. Temporary, may be replaced + with a faster implementation. + +- psxsio: Added `ioctl()` support for `FIOCSCAN` to probe for pending input in + serial tty driver. + +- examples: Reorganized examples, added new `tty` and `console` examples. + +## 2020-03-11 + +Lameguy64: + +- psxcd: Fixed `CdInit()` syntax (there should be no arguments). + +- psxcd: Fixed `CdlFILE`, `loc` variable renamed to `pos`. + +- documentation: Improved and updated toolchain instructions a bit. + +## 2020-02-28 + +Lameguy64: + +- documentation: Added docs for `CdOpenDir()`, `CdReadDir()` and + `CdCloseDir()`. + +- psxgpu: Added `GetODE()`. + +- psxspu: Fixed `SpuKeyOn()` bug where only 16 of the 24 channels can be + activated, due to channel bits being written as a 16-bit word. + +- psxcd: Added `CdOpenDir()`, `CdReadDir()` and `CdCloseDir()` for parsing + directories. + +- psxcd: Issuing `CdlNop` (`GetStat`) commands now triggers the media change + flag internal to the libraries when CD lid is opened, so file system + functions can update the cached ISO descriptor when the disc has been + changed. + +- psxcd: Made internal variables and functions for iso9660 parsing static. + +## 2020-02-25 + +thp: + +- libc: Added `abs()` and `labs()` functions. + +## 2020-01-06 + +Lameguy64: + +- libpsn00b: Renamed `libpsxcd` directory to `psxcd` to match with other + libraries. + +- examples: Added obligatory hello world example. + +- documentation: Added CD-ROM library documentation. + +## 2019-11-22: 0.15b + +Lameguy64: + +- psxapi: Added root counter or timer functions and related definitions. + +- examples: Added timer example. + +- psxgpu: Added `DR_AREA`, `DR_OFFSET` and `DR_TWIN` primitives and + accompanying `setDrawArea()`, `setDrawOffset()` and `setTexWindow()` macros. + +- psxgpu: Added parenthesis to argument value in `setlen()`, `setaddr()` and + `setcode()` macros, preventing `addPrims()` from being used in a more + sensible manner (ie. `addPrims(ot, sub_ot+3, sub_ot)`). + +- examples: Added render2tex render to texture example. + +- psxspu: Fixed typo in `spuinit.s` on section specifier specifying a data + section instead of text section, resulting to jump to + non-instruction-aligned linker errors. + +- psxgpu: Increased ISR stack size to 2048 bytes. + +- psxsio: Added `kbhit()` to poll keyboard input asynchronously and stdin + is now buffered with an IRQ handler. + +- psxapi: Added `AddDummyTty()` (for psxsio `DelSIO()` fix). + +- psxsio: `DelSIO()` now calls `AddDummyTty()`. + +- libc: Fixed bug in `strncpy()` not placing a NULL byte at end of string. + +- libc: Fixed `strchr()` and `strrchr()` declarations commented out in + `string.h`. + +- libpsn00b: Added the long awaited libpsxcd library with cdxa example. + Documentation will come soon but existing libcd docs should be good + enough for awhile. + +- psxgpu: Fixed non functioning GPU DMA wait in `DrawSync()`. + +- LibPSn00b run-time library is now officially 0.15b. + +## 2019-10-11 + +Lameguy64: + +- psxetc: Added `FntOpen()`, `FntPrint()` and `FntFlush()` functions. + +- psxgpu: Fixed typo in `termPrim()` macro (value too long). + +- examples: Added billboarding sprites example. + +- psxapi: Transferred `putchar()` BIOS function to libc. + +- libpsn00b: Updated makefiles adding `-fdata-sections` and + `-ffunction-sections` so unused functions will be stripped out, which yields + smaller executables. + +- libc: Fixed negative integers not displaying properly in + `vsprintf()`/`vsnprintf()`. + +- libc: Fixed zero padding not working in `vsprintf()`/`vsnprintf()`. + +- fpscam: Added debug text using `FntOpen()`, `FntPrint()` and `FntFlush()`. + Also added `_boot()` call for returning to CD based serial loaders. + +## 2019-09-23 + +Lameguy64: + +- libc: Added `strcat()` function. + +- Included PSn00bSDK logo vector. + +- psxgte: Added `gte_stsz()` macro. + +- psxgpu: Fixed typos in `setUVWH()` macro. + +- Added `_boot()` BIOS function (A(A0h) aka Warmboot, useful for CD based + serial loaders). + +## 2019-08-17: 0.13b + +Lameguy64: + +- LibPSn00b run-time library is officially version 0.13b. + +- examples: updated balls and n00bdemo examples for the `setDrawTPage()` + correction. + +- psxgpu: Fixed error on `setDrawTPage()` syntax and removed + `setDrawTPageVal()` macro (not needed). + +- psxapi: Added event handler definitions related to memory cards. + +- psxapi: Added BIOS memory card functions. + +- examples: Added childexec example demonstrating a parent executable + transferring execution to a child executable and back. + +- elf2x: `s_addr` no longer set on PS-EXE header, console BIOS already sets it + by STACK value in `SYSTEM.CNF` and allows child executables to return to + parent if left zero. + +- psxapi: Renamed `_InitPad()`, `_StartPad()` and `_StopPad()` to `InitPAD()`, + `StartPAD()` and `StopPAD()` respectively. Fpscam example updated to new + syntax. + +## 2019-07-18 + +Lameguy64: + +- Added `fpscam` example. + +- Gave examples small descriptions. + +- Updated readme a little. + +## 2019-07-17: 0.12b + +Lameguy64: + +- LibPSn00b run-time library is officially version 0.12b. + +- libc: Added basic C++ support (many thanks to ijacquez). + +- libc: Updated start function that should make it possible for a child + executable to return to a parent executable, return logic automatically + calls `EnterCriticalSection()`. + +- libc: Updated build method which takes libgcc from the compiler and adds + its own object files into it, eliminating linker problems caused by having + to order libc and libgcc libraries in a specific manner. + +- psxgpu: Added `RestartCallback()`. + +- psxgpu: Added `StoreImage()` function. + +- psxgpu: Fixed bugged `setRECT()` macro. + +- libc: Added `assert.h`. + +- examples: Balls example now has 166% more balls. + +- psxgpu: Increased ISR stack size to 1024 bytes so printf can be used in + callbacks safely. + +- libc: Removed `int64` (long long) printing in `vsprintf()` for better + performance, as the R3000 does not support 64-bit arithmetic natively + so its emulated like floats. `int64` still used for processing floats and + doubles and old `vsprintf.c` file is still included for those who really + want int64 support for whatever reason. + +- libc: Removed `stdarg.h` which is part of GCC and not license compatible + with MPL. The toolchain compiled with libgcc provides `stdarg.h` and other + standard headers. + +- examples: Updated `sdk-common.mk` variable convention for better flexibility. + +- libpsn00b: Added `common.mk` file containing global values for all libraries. + +- Updated library and toolchain build instructions. + +- psxgpu: Fixed bug in DMACallback where the internal DMA handler would fail + to install due to `GetInterruptCallback()` retrieving the callback value + immediately in the branch delay slot of a jr instruction, which resuls to + an inconsistent return value. This also broke `DrawSyncCallback()`. + +- psxsio: Done fixes on `_sio_control()` from the aformentioned issues with + load instructions in delay slots. + +- psxgte: Added `DVECTOR` struct. + +- psxgpu: Added `setLineF2()`, `setLineG2()`, `setLineF3()` and `setLineG3()` + primitive macros. + +- Added more functions in documentation. + +## 2019-07-01 + +williamblair: + +- Fixed `FntLoad()` Y coordinate not working properly for debug font (due to + Y coordinate not being specified for the `getTPage()` macro. + +## 2019-06-23: 0.10b + +Lameguy64: + +- LibPSn00b Run-time Library is officially version 0.10b. + +- Reworked readme file with improved build instructions. + +- libpsn00b: Added missing C extern groups for C++ compatibility in + `psxapi.h`, `stdlib.h` and `string.h`. + +- libpsn00b: Removed changelogs in the readmes of each libpsn00b library + as its much easier to keep track of changes in a single changelog than + scattering them across multiple changelogs. + +- psxapi: Added `Exec()` function and EXEC struct. + +- psxgpu: Added `DrawPrim()` function (uses direct I/O). + +- psxgpu: `VSync()` function completely overhauled. Logic is now based on + Sony's code but more efficient and can return total number of vblanks + elapsed, number of hblanks since last call and wait up to n vblanks + specified by an appropriate argument value. It will also generate a timeout + when vblank interrupt stops working and would attempt to restart it. + +- psxapi: Added `gets()` and `getc()` BIOS functions. + +- psxapi: Corrected a `putc()`/`putchar()` discrepancy. `putc()` puts a + character to a file stream, `putchar()` puts a character to stdout. + +- Completely revised library reference manual with better formatting and + more functions documented. + +- psxgpu: Added `DrawSyncCallback()`. + +- psxgpu: Implemented DMA interrupt callback system with `DMACallback()` + allowing to handle DMA interrupts very easily. + +- libpsn00b: Implemented Serial I/O library (`psxsio`) with serial tty device + (installed using `AddSIO`) and serial callback support. Serial library + is also fully documented. + +- psxgpu: Implemented IRQ callback system with `InterruptCallback()` allowing + to set interrupt callbacks very easily. + +- psxgpu: Implemented proper IRQ handler installed using HookEntryInt or + `SetCustomExitFromException()` for handling VSync and other interrupts. + `ChangeClearPAD(0)` must now be called after `_InitPad()` or vsync timeout + will occur. + +- libpsn00b: Started making local labels prefixed with `.L` instead of `.` + making them not appear in symbol lists resulting in a cleaner symbol dump. + Still not possible to do function-scope local labels like in ASMPSX because + GAS syntax is ASS (or ASS GAS which is farts, GAS is farts). + +- psxgpu: `DrawSync()` function now waits for DMA completion and GPU transfer + ready instead of simply waiting for GPU transfer ready which is the likely + cause of subtle GPU related timing issues, it also sets GPU DMA transfer + mode to off afterwards. It can also read number of words remaining in DMA + transfer if a0 is non-zero but it likely only returns the correct value on + VRAM transfers. Exact way how `DrawSync()` returns the count in the official + SDK is currently unknown. + +## 2019-06-07 + +qbradq: + +- lzpack: Swapped a buffer length litteral with sizeof operator, fixing a stack + overflow bug in some instances. + +## 2019-05-23 + +Lameguy64: + +- Added `dev notes.txt` file in docs that includes notes about the many quirks + quirks about the console discovered during the development of this SDK + project. + +- Updated `libn00bref.odf` a little. + +- Added `cartrom` example. + +- Added `rgb24` example. + +- Got custom exit handler set using `SetCustomExitFromException()` (BIOS + function B(19h)) working. Currently used to acknowledge VSync IRQ but + actual VSync handling is still done with events and needs to be + transferred to the custom exit handler. At least it lets BIOS + controller functions to work now. See doc/dev `notes.txt` for details + on how this handler behaves. + +- Made stack usage in `ResetGraph()` less wasteful. You only need to + allocate N words on stack based on N arguments of the function + being called. + +- VSync IRQ handling now done using a custom exit from exception handler. + Actual VSync handling is yet to be moved to the custom exit handler + though. + +- Made stack usage in `start.s` of libc a lot less wasteful. + +- Implemented controller support via BIOS functions (use `_InitPad()`, + `_StartPad()` and `_StopPad()`). BIOS memory card functions may also + work as well but its not tested yet. + +- Removed duplicate `initpad.s` and `initcard.s` functions in psxapi. + +- Added `_InitCd()` function to psxapi which is a safer version of `_96_init()` + as it preserves other DMA channel settings. Use BIOS file functions such + as `open()`, `read()` and `close()` with path names starting with `cdrom:/` + to access files from CD after calling `_InitCd()`. diff --git a/CMakePresets.json b/CMakePresets.json index f550e82..7c9fdd3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -24,6 +24,19 @@ "SKIP_EXAMPLES": "ON", "BUNDLE_TOOLCHAIN": "ON" } + }, + { + "name": "ci", + "displayName": "CI build", + "description": "This preset is used by GitHub Actions to build PSn00bSDK.", + "generator": "Ninja", + "binaryDir": "${sourceDir}/../build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "BUNDLE_TOOLCHAIN": "ON", + "BUILD_INFO": "Built by GitHub Actions ($env{GITHUB_REF_NAME} $env{GITHUB_SHA})", + "PSN00BSDK_TARGET": "$env{GCC_TARGET}" + } } ] } diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index 3efa7a0..0000000 --- a/changelog.txt +++ /dev/null @@ -1,605 +0,0 @@ -PSn00bSDK changelog - -Items that are lower in the log are more recently implemented. - -11-19-2021 by spicyjpeg: - -* libc: Removed STACK_MAX_SIZE and added _mem_init() back. RAM and stack size - can now be set by calling _mem_init() manually before allocating any memory. - -* libc: sprintf() now supports fixed padding when using %@ (binary integer). - -* psxapi: Added wrapper around BIOS function GetSystemInfo(). - -* examples: Added pads example. Also added CMake build script to cartrom, which - is now built alongside all other examples. - -* Deprecated malloc.h and removed all references to it (stdlib.h should be used - instead). Moved int*_t and uint*_t types to stdint.h. - -* Fixed file permission errors when attempting to install the SDK on macOS. - Made some small updates to INSTALL.md. - - -10-31-2021 by spicyjpeg: - -* Added tinyxml2 and mkpsxiso as git submodules and removed the (admittedly - short-lived) SKIP_* options completely. CMake's ExternalProject is no longer - used to download dependencies at build time. - -* Added CMake presets file with presets for building installer packages. - - -10-25-2021 by Lameguy64: - -* Made a very tiny change in the readme file. - -* Included some of the indev directory from the SVN repository. - - -10-17-2021 by spicyjpeg: - -* Added SKIP_TINYXML2 and SKIP_MKPSXISO build options in place of the old - SKIP_DOWNLOAD option, and a new BUNDLE_TOOLCHAIN option for building packages. - Updated INSTALL.md accordingly and fixed git branch error when downloading - mkpsxiso during build. - -* Rewritten toolchain.txt (which is now TOOLCHAIN.md) and added proper Windows - toolchain build instructions. - -* Added safety checks in CMake scripts to ensure elf2x/mkpsxiso are installed - before attempting to build an executable or CD image. - -* examples: Added CMake build script to (and removed makefile from) vagsample. - - -10-06-2021 by Lameguy64: - -* psxspu: Fixed register typo in SpyKeyOn causing unpredictable instability. - -* psxspu: Fixed bug where SpuKeyOn does not set the key-on bits for voices 16 to 23. - -* examples: Added vagsample SPU example. - - -09-27-2021 by spicyjpeg: - -* liblzp, tools: Fixed tools not building on MSVC and cleaned up LZP API - declarations (replaced meaningless void* pointers with proper types). - -* libpsn00b: Added missing PSN00BSDK_VERSION CMake variable. - -* examples: Fixed childexec (parent.exe) example crashing due to the child - executable not being relocated in the new build script. Patched n00bdemo to - suppress liblzp pointer type warnings. - -* Fixed another MSVC linker error when building tinyxml2 automatically, as well - as various toolchain/compiler test errors sometimes thrown by CMake. Updated - INSTALL.md with more details. - - -09-13-2021 by spicyjpeg: - -* Migrated libpsn00b, tools, examples and template to CMake, added a top-level - CMakeLists.txt and the libpsn00b/cmake directory for CMake setup scripts, got - rid of the old makefiles and installation method. - -* Updated docs to match the new build system, moved installation instructions - to INSTALL.md and added doc/cmake_reference.md describing the SDK's CMake - API and variables. - -* mkpsxiso: Added rules to automatically download, build and install mkpsxiso - (as well as its dependencies) as part of the SDK. - -* cpack: Added initial CPack support and created the cpack directory containing - branding assets for installers built through CPack. A shell script is - provided to regenerate the assets from their source SVGs. - -* liblzp: Copied library headers to libpsn00b/include/lzp. - -* psxetc: Fixed a random typo in a javadoc comment (those should be eventually - rewritten into proper documentation anyway). - -* Added CMake, VS Code and DLL related entries to .gitignore. - - -08-16-2021 by spicyjpeg: - -* psxetc: Added dynamic linking APIs (dl*, DL_*), implemented in dl.c and - _dl_resolve_wrapper.s. The APIs can be accessed by including dlfcn.h, while - another header (elf.h) provides structs and enums to help with manual parsing - of library headers. - -* libc: Removed _mem_init.s, improved heap initialization code. Added support - for setting how much RAM to use for the stack (by defining STACK_MAX_SIZE) - and for overriding/replacing the default memory allocator. - -* psxapi: Added wrapper around BIOS function FlushCache(). - -* psxspu: Fixed wrong bounds check in SpuSetTransferStartAddr(). - -* examples: Added an example showing how to compile dynamically-loaded - libraries (DLLs) and load them at runtime using the new dynamic linker. - -* libpsn00b: Added libpsn00b/ldscripts directory and linker scripts for both - executables and DLLs. Also fixed several broken header files (psxgpu.h not - including sys/types.h, missing scanf() declarations, ...). - -* Rewritten most makefiles (both for libraries and examples) and centralized - all compiler flags into a single psn00bsdk-setup.mk file for consistency and - easier editing. Added flags to build libpsn00b without gp-relative addressing - for compatibility with the dynamic linker. Also added nm commands to generate - symbol maps required by the linker. - - -07-01-2021 by Lameguy64: - -* Libpsn00b: Added int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, - uint32_t and uint64_t variable types in sys/types.h. - -* psxgte: Replaced unsigned int variable types with u_long to further - improve compatibility with code written for the official Sony SDK and - to make my tutorial examples easier to compile on PSn00bSDK. Example - programs have been updated to account for this change. - -* psxcd: Changed type of 2nd argument of CdRead() from u_int to u_long, - as well as changing the type of the size element in CdlFILE from u_int - to u_long. - - -02-17-2021 by Lameguy64: - -* Improved build instructions in readme file and fixed some typos. - -* Improved toolchain.txt instructions. - -* tools: Added experimental elf2cpe converter for executing PSn00bSDK - programs in official development units. No debug symbols however. - -* Fixed prefixes to allow SDK libraries and examples to be built - with mipsel-none-elf. - -* examples: Fixed typo in plasma_tbl.h causing multiple definitions when - compiling with newer versions of GCC in n00bdemo. - -* examples: cartrom example now marked as obsoleted, but still kept for - reference purposes. - -* Includes alextrevisan's GTE macros in inline_c.h. - -* Added makefile template. - - -01-05-2021 by Lameguy64: - -* psxgpu: Added struct names to many primitives. - -* psxgte: Defined SquareRoot0() and SquareRoot12(). - -* psxgte: Added gte_lddp() C macro. - -* examples: Added C++ demo. - -* Updated readme a bit. - - -11-29-2020 by Lameguy64: - -* libpsn00b: Defined MDEC hardware and related DMA registers in hwregs_a.h file. - -* psxgte: Fixed entry typo in table of squareroot.s (pointed out by SoapyMan). - -* libc: memmove updated to account for forward-looped memory move (by ckosmic). - -* examples: Removed redundant toolchain executable definitions in the makefiles. - -* examples: Included HDTV example for Github repo. - - -09-19-2020 by Lameguy64: - -* Revised makefiles for building the libraries and examples in a way to make - building with different toolchain versions easier with the PSN00BSDK_TC - environment variable. Library installation and linking is also made easier - with the PSN00BSDK_LIBS environment variable. See readme in the libpsn00b - directory for details. - -* examples: Fixed libgcc not found error when compiling some of the examples. - -* libc: Added strtok(). - -* libc: Added support for command line arguments. Pass arguments via - SYSTEM.CNF BOOT= string or a string array with Exec(). Arguments can - be read via argc/argv[] in main() or __argc/__argv anywhere else. - -* libc: Added SetHeapSize(). - -* psxgpu: Moved ISR and callback subsystem to psxetc. You'll have to link - psxetc after psxgpu and psxapi after psxetc in your library string. - -* psxetc: Moved debug font functions (FntInit(), FntOpen(), etc) to psxgpu. - -* psxetc: Fixed stack management in RestartCallback(). - -* examples: Added argument passing in childexec example. - -* psxcd: Fixed crashing on PSIO and possibly some emulators by implementing - a response buffer read limiter. - -* psxgpu: Interrupts are now disabled before setting up ISR and callbacks - in ResetGraph(), as LoadExec() still has interrupts enabled when jumping - to the loaded PS-EXE's entrypoint. Fixes programs made with PSn00bSDK - crashing at ResetGraph() on PSIO when loading from the Menu System and - possibly some emulators. - - -07-25-2020 by Lameguy64: - -* psxgte: Added ScaleMatrixL(). - -* doc: Corrected documentation for CdReadSync() function. - -* psxcd: Added new define: CdlIsoLidOpen. - -* psxcd: Updated media change detection logic, media change is checked - by lid open status bit in all CD-ROM file functions. CdControl() calls will - also trigger the media change status on lid open. - -* psxcd: Fixed bug in CdGetVolumeLabel() where it constantly reparses the file - system regardless of media change status. - -* examples: Updated cdrom/cdbrowse example slightly. - -* psxcd: Added CdLoadSession(). - -* psxcd: Fixed bug where CdReadDir() locks up in an infinite loop when it - encounters a NULL directory record, and the parser has not yet exceeded the - length of the directory record. - -* doc: Replaced library version numbers with SVN revision numbers in the - introduced fields. - -* doc: Started work on CD-ROM library overview. - - -04-24-2020 by Lameguy64: - -* Refined toolchain instructions a bit. - -* psxcd: Added automatic read retry for CdRead() operations, as long as - CdReadSync() is called until read completion. - -* psxapi: Added BIOS atoi() and atol() calls. Temporary, may be replaced with - a faster implementation - -* psxsio: Added ioctl() support for FIOCSCAN to probe for pending input in - serial tty driver. - -* examples: Reorganized examples, added new tty and console examples. - - -03-11-2020 by Lameguy64: - -* psxcd: Fixed CdInit() syntax (there should be no arguments). - -* psxcd: Fixed CdlFILE, loc variable renamed to pos. - -* documentation: Improved and updated toolchain instructions a bit. - - -02-28-2020 by Lameguy64: - -* documentation: Added docs for CdOpenDir(), CdReadDir() and CdCloseDir(). - -* psxgpu: Added GetODE(). - -* psxspu: Fixed SpuKeyOn() bug where only 16 of the 24 channels can be - activated, due to channel bits being written as a 16-bit word. - -* psxcd: Added CdOpenDir(), CdReadDir() and CdCloseDir() for parsing directories. - -* psxcd: Issuing CdlNop (GetStat) commands now triggers the media change flag - internal to the libraries when CD lid is opened, so file system functions can - update the cached ISO descriptor when the disc has been changed. - -* psxcd: Made internal variables and functions for iso9660 parsing static. - - -02-25-2020 by thp: - -* libc: Added abs and labs() functions. - - -01-06-2020 by Lameguy64: - -* libpsn00b: Renamed libpsxcd directory to psxcd to match with other libraries. - -* examples: Added obligatory hello world example. - -* documentation: Added CD-ROM library documentation. - - -11-22-2019 by Lameguy64: - -* psxapi: Added root counter or timer functions and related definitions. - -* examples: Added timer example. - -* psxgpu: Added DR_AREA, DR_OFFSET and DR_TWIN primitives and accompanying - setDrawArea(), setDrawOffset() and setTexWindow() macros. - -* psxgpu: Added parenthesis to argument value in setlen(), setaddr() and - setcode() macros, preventing addPrims() from being used in a more - sensible manner (ie. addPrims(ot, sub_ot+3, sub_ot)). - -* examples: Added render2tex render to texture example. - -* psxspu: Fixed typo in spuinit.s on section specifier specifying a data - section instead of text section, resulting to jump to - non-instruction-aligned linker errors. - -* psxgpu: Increased ISR stack size to 2048 bytes. - -* psxsio: Added kbhit() to poll keyboard input asynchronously and stdin - is now buffered with an IRQ handler. - -* psxapi: Added AddDummyTty() (for psxsio DelSIO() fix). - -* psxsio: DelSIO() now calls AddDummyTty(). - -* libc: Fixed bug in strncpy() not placing a NULL byte at end of string. - -* libc: Fixed strchr() and strrchr() declarations commented out in string.h. - -* libpsn00b: Added the long awaited libpsxcd library with cdxa example. - Documentation will come soon but existing libcd docs should be good - enough for awhile. - -* psxgpu: Fixed non functioning GPU DMA wait in DrawSync(). - -* LibPSn00b run-time library is now officially 0.15b. - - -10-11-2019 by Lameguy64: - -* psxetc: Added FntOpen(), FntPrint() and FntFlush() functions. - -* psxgpu: Fixed typo in termPrim() macro (value too long). - -* examples: Added billboarding sprites example. - -* psxapi: Transferred putchar() BIOS function to libc. - -* libpsn00b: Updated makefiles adding -fdata-sections and -ffunction-sections - so unused functions will be stripped out, which yields smaller executables. - -* libc: Fixed negative integers not displaying properly in vsprintf()/vsnprintf(). - -* libc: Fixed zero padding not working in vsprintf()/vsnprintf(). - -* fpscam: Added debug text using FntOpen(), FntPrint() and FntFlush(). Also added - _boot() call for returning to CD based serial loaders. - - -09-23-2019 by Lameguy64: - -* libc: Added strcat() function. - -* Included PSn00bSDK logo vector. - -* psxgte: Added gte_stsz() macro. - -* psxgpu: Fixed typos in setUVWH() macro. - -* Added _boot() BIOS function (A(A0h) aka Warmboot, useful for CD based - serial loaders). - - -08-17-2019 by Lameguy64: - -* LibPSn00b run-time library is officially version 0.13b. - -* examples: updated balls and n00bdemo examples for the setDrawTPage() - correction. - -* psxgpu: Fixed error on setDrawTPage() syntax and removed setDrawTPageVal() - macro (not needed). - -* psxapi: Added event handler definitions related to memory cards. - -* psxapi: Added BIOS memory card functions. - -* examples: Added childexec example demonstrating a parent executable - transferring execution to a child executable and back. - -* elf2x: s_addr no longer set on PS-EXE header, console BIOS already sets it - by STACK value in SYSTEM.CNF and allows child executables to return to - parent if left zero. - -* psxapi: Renamed _InitPad(), _StartPad() and _StopPad() to InitPAD(), - StartPAD() and StopPAD() respectively. Fpscam example updated to new - syntax. - - -07-18-2019 by Lameguy64: - -* Added fpscam example. - -* Gave examples small descriptions. - -* Updated readme a little. - - -07-17-2019 by Lameguy64: - -* LibPSn00b run-time library is officially version 0.12b. - -* libc: Added basic C++ support (many thanks to ijacquez). - -* libc: Updated start function that should make it possible for a child - executable to return to a parent executable, return logic automatically - calls EnterCriticalSection(). - -* libc: Updated build method which takes libgcc from the compiler and adds - its own object files into it, eliminating linker problems caused by having - to order libc and libgcc libraries in a specific manner. - -* psxgpu: Added RestartCallback(). - -* psxgpu: Added StoreImage() function. - -* psxgpu: Fixed bugged setRECT() macro. - -* libc: Added assert.h. - -* examples: Balls example now has 166% more balls. - -* psxgpu: Increased ISR stack size to 1024 bytes so printf can be used in - callbacks safely. - -* libc: Removed int64 (long long) printing in vsprintf() for better - performance, as the R3000 does not support 64-bit arithmetic natively - so its emulated like floats. int64 still used for processing floats and - doubles and old vsprintf.c file is still included for those who really - want int64 support for whatever reason. - -* libc: Removed stdarg.h which is part of GCC and not license compatible - with MPL. The toolchain compiled with libgcc provides stdarg.h and other - standard headers. - -* examples: Updated sdk-common.mk variable convention for better flexibility. - -* libpsn00b: Added common.mk file containing global values for all libraries. - -* Updated library and toolchain build instructions. - -* psxgpu: Fixed bug in DMACallback where the internal DMA handler would fail - to install due to GetInterruptCallback() retrieving the callback value - immediately in the branch delay slot of a jr instruction, which resuls to - an inconsistent return value. This also broke DrawSyncCallback(). - -* psxsio: Done fixes on _sio_control() from the aformentioned issues with load - instructions in delay slots. - -* psxgte: Added DVECTOR struct. - -* psxgpu: Added setLineF2(), setLineG2(), setLineF3() and setLineG3() - primitive macros. - -* Added more functions in documentation. - - -07-01-2019 by williamblair: - -* Fixed FntLoad() Y coordinate not working properly for debug font (due to - Y coordinate not being specified for the getTPage() macro. - - -06-23-2019 by Lameguy64: - -* LibPSn00b Run-time Library is officially version 0.10b. - -* Reworked readme file with improved build instructions. - -* libpsn00b: Added missing C extern groups for C++ compatibility in - psxapi.h, stdlib.h and string.h. - -* libpsn00b: Removed changelogs in the readmes of each libpsn00b library - as its much easier to keep track of changes in a single changelog than - scattering them across multiple changelogs. - -* psxapi: Added Exec() function and EXEC struct. - -* psxgpu: Added DrawPrim() function (uses direct I/O). - -* psxgpu: VSync() function completely overhauled. Logic is now based on - Sony's code but more efficient and can return total number of vblanks - elapsed, number of hblanks since last call and wait up to n vblanks - specified by an appropriate argument value. It will also generate a - timeout when vblank interrupt stops working and would attempt to - restart it. - -* psxapi: Added gets() and getc() BIOS functions. - -* psxapi: Corrected a putc()/putchar() discrepancy. putc() puts a character - to a file stream, putchar() puts a character to stdout. - -* Completely revised library reference manual with better formatting and - more functions documented. - -* psxgpu: Added DrawSyncCallback(). - -* psxgpu: Implemented DMA interrupt callback system with DMACallback() - allowing to handle DMA interrupts very easily. - -* libpsn00b: Implemented Serial I/O library (psxsio) with serial tty device - (installed using AddSIO) and serial callback support. Serial library - is also fully documented. - -* psxgpu: Implemented IRQ callback system with InterruptCallback() allowing - to set interrupt callbacks very easily. - -* psxgpu: Implemented proper IRQ handler installed using HookEntryInt or - SetCustomExitFromException() for handling VSync and other interrupts. - ChangeClearPAD(0) must now be called after _InitPad() or vsync timeout - will occur. - -* libpsn00b: Started making local labels prefixed with .L instead of . making - them not appear in symbol lists resulting in a cleaner symbol dump. Still - not possible to do function-scope local labels like in ASMPSX because GAS - syntax is ASS (or ASS GAS which is farts, GAS is farts). - -* psxgpu: DrawSync() function now waits for DMA completion and GPU transfer - ready instead of simply waiting for GPU transfer ready which is the likely - cause of subtle GPU related timing issues, it also sets GPU DMA transfer - mode to off afterwards. It can also read number of words remaining in DMA - transfer if a0 is non-zero but it likely only returns the correct value on - VRAM transfers. Exact way how DrawSync() returns the count in the official - SDK is currently unknown. - - -06-07-2019 by qbradq: - -* lzpack: Swapped a buffer length litteral with sizeof operator, fixing a - stack overflow bug in some instances. - - -05-23-2019 by Lameguy64: - -* Added dev notes.txt file in docs that includes notes about the many - quirks about the console discovered during the development of this - SDK project. - -* Updated libn00bref.odf a little. - -* Added turboboot example. - -* Added rgb24 example. - -* Got custom exit handler set using SetCustomExitFromException() (BIOS - function B(19h)) working. Currently used to acknowledge VSync IRQ but - actual VSync handling is still done with events and needs to be - transferred to the custom exit handler. At least it lets BIOS - controller functions to work now. See doc/dev notes.txt for details - on how this handler behaves. - -* Made stack usage in ResetGraph() less wasteful. You only need to - allocate N words on stack based on N arguments of the function - being called. - -* VSync IRQ handling now done using a custom exit from exception handler. - Actual VSync handling is yet to be moved to the custom exit handler - though. - -* Made stack usage in start.s of libc a lot less wasteful. - -* Implemented controller support via BIOS functions (use _InitPad(), - _StartPad() and _StopPad()). BIOS memory card functions may also - work as well but its not tested yet. - -* Removed duplicate initpad.s and initcard.s functions in psxapi. - -* Added _InitCd() function to psxapi which is a safer version of _96_init() - as it preserves other DMA channel settings. Use BIOS file functions such - as open(), read() and close() with path names starting with cdrom:/ to - access files from CD after calling _InitCd(). |
