aboutsummaryrefslogtreecommitdiff
path: root/examples/sound/cdstream/main.c
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2024-01-08 19:15:28 +0100
committerspicyjpeg <thatspicyjpeg@gmail.com>2024-01-08 19:15:28 +0100
commita149dc9e3b84922a7e52d31e9a56f255a5597dff (patch)
tree8f30aacab5d7e0d2569e821c2d3b83c6e703b81e /examples/sound/cdstream/main.c
parentdd85f9f993427ae69ab905486f8ef372d3960664 (diff)
downloadpsn00bsdk-a149dc9e3b84922a7e52d31e9a56f255a5597dff.tar.gz
Fix examples, update submodules and CI script
Diffstat (limited to 'examples/sound/cdstream/main.c')
-rw-r--r--examples/sound/cdstream/main.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/examples/sound/cdstream/main.c b/examples/sound/cdstream/main.c
index 2bd2142..2a9bbab 100644
--- a/examples/sound/cdstream/main.c
+++ b/examples/sound/cdstream/main.c
@@ -152,13 +152,6 @@ typedef struct {
char name[16];
} VAG_Header;
-#define SWAP_ENDIAN(x) ( \
- (((uint32_t) (x) & 0x000000ff) << 24) | \
- (((uint32_t) (x) & 0x0000ff00) << 8) | \
- (((uint32_t) (x) & 0x00ff0000) >> 8) | \
- (((uint32_t) (x) & 0xff000000) >> 24) \
-)
-
/* Helper functions */
#define DUMMY_BLOCK_ADDR 0x1000
@@ -250,14 +243,14 @@ void setup_stream(const CdlLOC *pos) {
int num_channels = vag->channels ? vag->channels : 2;
int num_chunks =
- (SWAP_ENDIAN(vag->size) + vag->interleave - 1) / vag->interleave;
+ (__builtin_bswap32(vag->size) + vag->interleave - 1) / vag->interleave;
__builtin_memset(&config, 0, sizeof(Stream_Config));
config.spu_address = STREAM_BUFFER_ADDR;
config.interleave = vag->interleave;
config.buffer_size = RAM_BUFFER_SIZE;
- config.sample_rate = SWAP_ENDIAN(vag->sample_rate);
+ config.sample_rate = __builtin_bswap32(vag->sample_rate);
// Use the first N channels of the SPU and pan them left/right in pairs
// (this assumes the stream contains one or more stereo tracks).