aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-06-29 13:09:57 +0200
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-06-29 13:09:57 +0200
commit8deeb216cbff4e578284fc040d8f0b51e96d4b04 (patch)
tree28b262c95d47f75c870b4d0bd5899d3e1a36cc9c
parent6120304537470e7e5ff94b3bf19a33787ca69083 (diff)
downloadpsn00bsdk-8deeb216cbff4e578284fc040d8f0b51e96d4b04.tar.gz
Add -g to default flags, update changelog and known bugs
-rw-r--r--.github/scripts/generate_release_notes.py76
-rw-r--r--CHANGELOG.md51
-rw-r--r--doc/known_bugs.md23
-rw-r--r--libpsn00b/cmake/flags.cmake3
4 files changed, 103 insertions, 50 deletions
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"(?<!\n)[ \t]*?\n[ \t]*(?!\n)", re.MULTILINE)
def parse_date(date):
if isinstance(date, struct_time):
@@ -19,11 +20,27 @@ def parse_date(date):
def normalize_version(version):
return VERSION_REGEX.match(version.lower()).group(1)
+def unwrap_text(text):
+ return TEXT_WRAP_REGEX.sub(" ", text.strip())
+
+def deduplicate_authors(authors):
+ _authors = []
+ folded = []
+
+ for name in authors:
+ if (fold := name.lower()) in folded:
+ continue
+
+ _authors.append(name)
+ folded.append(fold)
+
+ _authors.sort()
+ return _authors
+
## 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"
+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)
def parse_authors(block):
# [ _crap, author, body, author, body, ... ]
@@ -35,13 +52,10 @@ def parse_authors(block):
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:
+ if (name := name.strip()) not in authors:
authors[name] = ""
- authors[name] += body
+ authors[name] += body.strip()
return authors
@@ -49,21 +63,18 @@ def parse_blocks(changelog):
# [ _crap, date, version, body, date, version, body, ... ]
items = BLOCK_REGEX.split(changelog.strip())
- # Iterate over all blocks from bottom to top (i.e. oldest first).
- last_version = FIRST_VERSION
+ # Iterate over all blocks from bottom to top (i.e. oldest first) and group
+ # them by the version number of the block they precede.
+ blocks = []
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
+ blocks.append(( parse_date(date), parse_authors(body) ))
- yield parse_date(date), version, parse_authors(body)
+ if version:
+ yield normalize_version(version), tuple(blocks)
+ blocks = []
## Release notes generation
@@ -74,9 +85,8 @@ VERSION_TEMPLATE = """New in version **{version}** (contributed by {authors}):
"""
NOTES_TEMPLATE = """{notes}
--------------------------------------------------------
-_These notes have been generated automatically._
-_See the changelog or commit history for more details._
+------------------------------------------------------------------------------------------------------
+_These notes have been generated automatically. See the changelog or commit history for more details._
"""
NO_VERSIONS_TEMPLATE = "No information available about this release."
@@ -87,8 +97,10 @@ def generate_notes(versions):
notes = ""
for version, ( authors, changes ) in versions.items():
- _authors = list(set(authors))
- _authors.sort()
+ if not changes:
+ continue
+
+ _authors = deduplicate_authors(authors)
_authors = map(AUTHOR_LINK_TEMPLATE.format, _authors)
notes += VERSION_TEMPLATE.format(
@@ -100,7 +112,7 @@ def generate_notes(versions):
if not notes:
notes = NO_VERSIONS_TEMPLATE
- return NOTES_TEMPLATE.format(notes = notes.strip())
+ return NOTES_TEMPLATE.format(notes = unwrap_text(notes))
## Main
@@ -155,19 +167,21 @@ def main():
# merging all changes and authors for each version.
versions = {}
- for date, version, authors in parse_blocks(changelog):
- # Apply version and date filters.
+ for version, blocks in parse_blocks(changelog):
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())
+
+ 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)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c2e6d1c..2f4bbfc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,37 +19,63 @@ to ensure the changelog can be parsed correctly.
-------------------------------------------------------------------------------
-## 2022-03-30:
+## 2022-06-26
+
+spicyjpeg:
+
+- psxgpu: Rewritten the entire library in C, fixing a few bugs (including one
+ that made 384x240 and 384x256 modes unusable) and adding a drawing queue in
+ the process. `DrawOTag()` can now be called while another OT is being drawn
+ to enqueue up to 8 other OTs.
+
+- psxgpu: Added missing `setXYWH()` macro and implemented `ClearOTag()`,
+ `DrawOTag2()`, `DrawOTagEnv()` and `GsGetTimInfo()`.
+
+- libpsn00b: Renamed `_start()` to `_start_inner()` and added a `_start()` stub
+ that can be overridden to insert custom startup code. Modified the linker
+ scripts to assume RAM is 8 MB by default, to make it easier to target arcade
+ or development hardware.
+
+- examples: Fixed some functions in `io/system573`.
+
+- tools: `elf2x` now warns if the converted executable crosses the 2 MB RAM
+ boundary.
+
+- Debugging symbols in ELF files are now generated by default for all target
+ types. This does not affect the size of built executables or DLLs, as those
+ are always stripped.
+
+## 2022-03-30
lameguy64:
-- indev: psxmdec prototype is now functional through psxpress.
+- indev: psxmdec prototype is now functional through `psxpress`.
## 2022-03-25: 0.19
lameguy64:
-- examples: Replaced sample image of mdec/mdecimage with different artwork.
- Original image: http://lameguy64.net/?page=drawings&post_id=9
+- examples: Replaced sample image of `mdec/mdecimage` with different artwork.
+ Original image [here](http://lameguy64.net/?page=drawings&post_id=9).
- examples: Updated readme file in examples directory to reference the new
- mdecimage example program.
+ `mdec/mdecimage` example program.
- psxsio: Added dummy hooks to unsupported device functions for tty device.
-- docs: Minor corrections on dev_notes.md.
+- docs: Minor corrections on `dev_notes.md`.
-- docs: Updated documentation for CdGetSector() and CdReadCallback()
- functions in libn00bref.odt.
+- docs: Updated documentation for `CdGetSector()` and `CdReadCallback()`
+ functions in `libn00bref.odt`.
-## 2022-02-27:
+## 2022-02-27
spicyjpeg:
- libpsn00b: Added `hwregs_c.h` header and renamed some registers in
`hwregs_a.h`. Added `assert()` as a proper macro.
-- libpsn00b: Added new MDEC library; psxpress.
+- libpsn00b: Added new MDEC library; `psxpress`.
- psxspu: Fixed critical bug in `SpuSetReverb()`.
@@ -82,9 +108,8 @@ spicyjpeg:
Lameguy64:
-- docs: Removed old and incomplete `libn00bref.odt` document (a percussor of
- the LibPSn00b Library Reference document) as it got included into a commit by
- accident at some point.
+- docs: Removed old and incomplete `libn00bref.odt` document (a precursor of
+ the LibPSn00b Library Reference document).
- examples: Improved description of `hdtv` example. Examples directory is now
copied into `share/psn00bsdk` directory for both installation and package
diff --git a/doc/known_bugs.md b/doc/known_bugs.md
index e39da43..9e83f03 100644
--- a/doc/known_bugs.md
+++ b/doc/known_bugs.md
@@ -1,8 +1,9 @@
# Known PSn00bSDK bugs
-This is an incomplete list of things that are currently broken (or not behaving
-as they should, or untested on real hardware) and haven't yet been fixed.
+This is an incomplete list of things that are known to be currently broken (or
+not behaving as they should, or untested on real hardware) and haven't yet been
+fixed.
## Toolchain
@@ -15,18 +16,28 @@ as they should, or untested on real hardware) and haven't yet been fixed.
them. It might be necessary to list such symbols in a dummy array to prevent
the compiler from stripping them away from the executable.
+- Link-time optimization is broken due to GCC not supporting it when linking
+ weak functions written in assembly.
+
## Libraries
`psxgpu`:
-- In some *very rare* cases, `VSync()` seems to crash the system by performing
- unaligned accesses for unknown reasons.
+- `LoadImage()` and `StoreImage()` use DMA to transfer data to/from the GPU.
+ As the DMA channel is configured to transfer 8 words (32 bytes) at a time,
+ the length of the data *must* be a multiple of 32 bytes. Attempting to
+ transfer any data whose length isn't a multiple of 32 bytes will result in
+ `DrawSync()` hanging and never returning, however a warning will be printed
+ on the debug console.
`psxspu`:
+- `SpuCtrlSync()` locks up on MAME, making any code that tries to initialize
+ the SPU hang. It works on other emulators as well as on real hardware.
+
- Calls to `SpuSetTransferMode()` are ignored. SPU transfers are always
performed using DMA, which imposes limitations such as the data length having
- to be a multiple of 64 bytes.
+ to be a multiple of 16 words (64 bytes, see above).
`psxetc`:
@@ -40,4 +51,4 @@ as they should, or untested on real hardware) and haven't yet been fixed.
See [README.md in the examples directory](../examples/README.md#examples-summary).
-----------------------------------------
-_Last updated on 2022-02-03 by spicyjpeg_
+_Last updated on 2022-06-29 by spicyjpeg_
diff --git a/libpsn00b/cmake/flags.cmake b/libpsn00b/cmake/flags.cmake
index e31773f..5d9c751 100644
--- a/libpsn00b/cmake/flags.cmake
+++ b/libpsn00b/cmake/flags.cmake
@@ -42,6 +42,8 @@ target_compile_options(
-march=r3000
-mtune=r3000
-mabi=32
+ -mno-mt
+ -mno-llsc
-mdivide-breaks
-O2
# Standard library options
@@ -49,6 +51,7 @@ target_compile_options(
-fno-builtin
-nostdlib
# Other options
+ -g
-fdata-sections
-ffunction-sections
-fsigned-char