aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2022-10-16 23:58:05 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2022-10-16 23:58:05 +0200
commit8770122c970eeedb145ee903e2243b7d4a18605b (patch)
tree40c5c63ebd9b10bc624050215ef566a198106f34
parent03434a230d8c3ed2e32a3885128e05e42ee11769 (diff)
downloadpsn00bsdk-8770122c970eeedb145ee903e2243b7d4a18605b.tar.gz
Fix sound/spustream, update README and changelog
-rw-r--r--CHANGELOG.md23
-rw-r--r--examples/README.md11
-rw-r--r--examples/io/pads/spi.c6
-rw-r--r--examples/sound/spustream/main.c12
-rw-r--r--template/iso.xml54
5 files changed, 91 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f04108..461d2b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,7 +19,28 @@ to ensure the changelog can be parsed correctly.
-------------------------------------------------------------------------------
-## 2022-10-11: 0.21
+## 2022-10-16: 0.21
+
+spicyjpeg:
+
+- psxetc: Fixed (another) critical bug in the IRQ callback dispatcher. This
+ also fixed some examples that were broken ever since the library was
+ rewritten in C. Made the dynamic linker less verbose, improving DLL loading
+ speed in debug mode.
+
+- psxcd: Added `CdDataSync()`. Renamed `CdlModeSize0` and `CdlModeSize1` to
+ `CdlModeIgnore` and `CdlModeSize` respectively.
+
+- psxpress: Fixed a bug in the Huffman decompression API that would make it
+ crash if the bitstream header didn't contain a valid decompressed length,
+ even if the bitstream was properly encoded. This fix makes the API fully
+ usable for video playback (as demonstrated by the new example).
+
+- examples: Added `mdec/strvideo` FMV playback example. Fixed
+ `system/childexec` not properly uninstalling BIOS callbacks before launching
+ the child executable. Added pause/resume code to `sound/spustream`.
+
+## 2022-10-11
spicyjpeg:
diff --git a/examples/README.md b/examples/README.md
index b63b2a9..ade94b0 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -24,7 +24,8 @@ Additional information may be found in the source code of each example.
| [`io/pads`](./io/pads) | Demonstrates reading controllers via low-level access | EXE | 3 |
| [`io/system573`](./io/system573) | Konami System 573 (PS1-based arcade board) example | CD | |
| [`lowlevel/cartrom`](./lowlevel/cartrom) | ROM firmware for cheat devices written using GNU GAS | ROM | 4 |
-| [`mdec/mdecimage`](./mdec/mdecimage) | Displays a (raw) MDEC format image using libpsxpress | EXE | |
+| [`mdec/mdecimage`](./mdec/mdecimage) | Displays a (raw) MDEC format image | EXE | |
+| [`mdec/strvideo`](./mdec/strvideo) | Plays a .STR video file using the MDEC | CD | 1 |
| [`sound/spustream`](./sound/spustream) | Custom (non XA) CD-ROM audio streaming using the SPU | CD | |
| [`sound/vagsample`](./sound/vagsample) | Demonstrates playing VAG sound files using the SPU | EXE | |
| [`system/childexec`](./system/childexec) | Loading a child program and returning to parent | EXE | |
@@ -35,9 +36,9 @@ Additional information may be found in the source code of each example.
Notes:
-1. `cdrom/cdxa` does not come with an example XA audio file. In order to run
- this example you'll have to provide your own file and build the CD image
- manually.
+1. `cdrom/cdxa` and `mdec/strvideo` do not come with example files. In order
+ to run these examples you'll have to provide your own files and build the CD
+ image manually.
2. `demos/n00bdemo` suffers from flickering on real hardware, especially when
masking/stencil buffering is used.
3. `io/pads` seems to work on real hardware, but fails to automatically enable
@@ -84,4 +85,4 @@ are for rebuilding the examples *after* the SDK has been installed.
CD images for each example.
-----------------------------------------
-_Last updated on 2022-10-11 by spicyjpeg_
+_Last updated on 2022-10-16 by spicyjpeg_
diff --git a/examples/io/pads/spi.c b/examples/io/pads/spi.c
index 133782c..292e682 100644
--- a/examples/io/pads/spi.c
+++ b/examples/io/pads/spi.c
@@ -46,9 +46,9 @@ typedef struct _SPI_Context {
SPI_Callback callback;
} SPI_Context;
-static volatile SPI_Context _context;
-static volatile SPI_Request volatile *_current_req;
-static volatile SPI_Callback _default_cb;
+static volatile SPI_Context _context;
+static volatile SPI_Request *_current_req;
+static volatile SPI_Callback _default_cb;
/* Request queue management */
diff --git a/examples/sound/spustream/main.c b/examples/sound/spustream/main.c
index acd4f60..1fee883 100644
--- a/examples/sound/spustream/main.c
+++ b/examples/sound/spustream/main.c
@@ -181,12 +181,14 @@ void display(RenderContext *ctx) {
#define CHUNK_SIZE (BUFFER_SIZE * NUM_CHANNELS)
typedef struct {
- int lba, length, pos;
- int spu_addr, spu_pos;
- int db_active;
+ int lba, length;
+
+ volatile int pos;
+ volatile int spu_addr, spu_pos;
+ volatile int db_active;
} StreamContext;
-static volatile StreamContext str_ctx;
+static StreamContext str_ctx;
// This buffer is used by cd_event_handler() as a temporary area for sectors
// read from the CD and uploaded to SPU RAM. Due to DMA limitations it can't be
@@ -328,8 +330,8 @@ void start_stream(void) {
SPU_CH_VOL_L(1) = 0x0000;
SPU_CH_VOL_R(1) = 0x3fff;
- spu_irq_handler();
SPU_KEY_ON = CHANNEL_MASK;
+ spu_irq_handler();
}
// This is basically a variant of reset_spu_channels() that only resets the
diff --git a/template/iso.xml b/template/iso.xml
index 87162b2..29fbd2d 100644
--- a/template/iso.xml
+++ b/template/iso.xml
@@ -11,6 +11,21 @@
cue_sheet="${CD_IMAGE_NAME}.cue"
>
<track type="data">
+ <!--
+ The "volume", "volume_set", "publisher", "data_preparer" and
+ "copyright" strings below can be freely modified. The ISO9660
+ specification, however, imposes the following limitations:
+
+ - "volume" and "volume_set" must be 32 characters or less, and can
+ only contain uppercase letters, digits and underscores.
+ - "publisher" and "data_preparer" can be up to 128 characters long
+ and can additionally contain spaces and some special characters.
+ - "copyright" should be a path to a file on the disc, even one that
+ does not exist (but in practice it can be set to anything).
+
+ "system" and "application" must always be set to "PLAYSTATION" in
+ order for the disc to be recognized as valid.
+ -->
<identifiers
system ="PLAYSTATION"
volume ="PSN00BSDK_TEMPLATE"
@@ -21,14 +36,51 @@
copyright ="README.TXT;1"
/>
+ <!--
+ You may optionally include a license file using the <license> tag.
+ Some consoles, particularly Japanese or PAL models with a modchip,
+ require the disc to contain valid license data and will refuse to
+ boot if it is missing. License files are usually not required on
+ US consoles or when booting via softmods or cheat cartridges.
+
+ License files are region-specific and are not distributed with
+ PSn00bSDK for obvious reasons, but can be dumped from an official
+ game using dumpsxiso or extracted from the Sony SDK.
+ -->
+ <!--<license file="${PROJECT_SOURCE_DIR}/license.dat" />-->
+
+ <!--
+ Files and directories can be added to the disc by placing <file>
+ and <dir> tags below. All file names are case-insensitive and must
+ be in 8.3 format, i.e. no more than 8 characters for the name and 3
+ for the optional extension. Directories cannot have extensions.
+
+ A boot configuration file (SYSTEM.CNF) or executable (PSX.EXE) must
+ be present in the root directory. Due to BIOS limitations the root
+ directory cannot hold more than 30 files or directories, and the
+ entire disc must contain 45 directories or less. Subdirectories can
+ contain any number of files.
+ -->
<directory_tree>
<file name="SYSTEM.CNF" type="data" source="${PROJECT_SOURCE_DIR}/system.cnf" />
<file name="TEMPLATE.EXE" type="data" source="template.exe" />
+ <!--
+ This file is only required if you are using dynamic linking
+ (see the system/dynlink example). It contains the executable's
+ symbol map and can be used to obtain the address of a function
+ or global variable by its name.
+ -->
<!--<file name="TEMPLATE.MAP" type="data" source="template.map" />-->
<dummy sectors="1024"/>
</directory_tree>
</track>
- <!--<track type="audio" source="track2.wav" />-->
+ <!--
+ CD-DA tracks can be added to the CD image by using one or more <track>
+ tags. The source attribute must be a path to an audio file in WAV, FLAC
+ or MP3 format (using WAV or FLAC is highly recommended to preserve
+ audio quality if you have a lossless copy of the source track).
+ -->
+ <!--<track type="audio" source="${PROJECT_SOURCE_DIR}/track2.wav" />-->
</iso_project>