aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-12-30 14:58:14 +0100
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-12-30 14:58:14 +0100
commitde9047f568f2f3509b56a2b566d7353cae616eb7 (patch)
treef2e4b1b9dd8125709a2f64c54c26433a0321bb6c
parentba03884e3d52d47a4fa1b474ca7dc6b419ee6898 (diff)
downloadpsn00bsdk-de9047f568f2f3509b56a2b566d7353cae616eb7.tar.gz
Add known_bugs.md, fix sound/vagsample and declarations
-rw-r--r--CMakeLists.txt6
-rw-r--r--doc/known_bugs.md52
-rw-r--r--examples/sound/vagsample/0proyt.h2
-rw-r--r--examples/sound/vagsample/threedeeffeggzz.h2
-rw-r--r--libpsn00b/include/psxcd.h6
-rw-r--r--libpsn00b/include/psxspu.h4
-rw-r--r--libpsn00b/psxcd/psxcd.c8
7 files changed, 69 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a20a0e..2079fd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,6 +78,12 @@ set(
-DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/examples
)
+# Ensure PSn00bSDK isn't being built using the toolchain file from PSn00bSDK
+# itself (or from another version of it).
+if(CMAKE_TOOLCHAIN_FILE MATCHES ".*libpsn00b[/\\]cmake[/\\]sdk\.cmake$")
+ message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE is set to the toolchain file of an existing PSn00bSDK installation. It must be unset or overridden by passing '-DCMAKE_TOOLCHAIN_FILE=\"\"' to CMake.")
+endif()
+
## Subprojects
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/tools/mkpsxiso/CMakeLists.txt)
diff --git a/doc/known_bugs.md b/doc/known_bugs.md
new file mode 100644
index 0000000..2af9e3f
--- /dev/null
+++ b/doc/known_bugs.md
@@ -0,0 +1,52 @@
+
+# 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.
+
+## Libraries
+
+`psxspu`:
+
+- 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.
+
+`psxetc`:
+
+- `DL_LoadSymbolMapFromFile()`, `DL_LoadDLLFromFile()` and `dlopen()` have been
+ disabled due to bugs in the BIOS file APIs. The dynamic linker can still be
+ used by loading DLL binaries into RAM manually and calling `DL_CreateDLL()`
+ on them (see the `system/dynlink` example).
+
+## Tools
+
+- The `mkpsxiso` submodule is temporarily set to point to a fork of `mkpsxiso`
+ with bugfixed CMake scripts (the main repo is broken to the point it fails to
+ build). There is [another fork](https://github.com/CookiePLMonster/mkpsxiso)
+ which is currently work-in-progress and includes more fixes as well as a tool
+ to dump existing CD images: PSn00bSDK will switch back to the main `mkpsxiso`
+ repo once the changes get upstreamed.
+
+## Examples
+
+- `cdrom/cdxa` and `sound/spustream` demonstrate how to stream an audio file
+ from CD-ROM. Such a file isn't provided however, as PSn00bSDK does not yet
+ come with the tooling required for transcoding audio from a source file. In
+ order to run these examples you'll have to provide your own audio files,
+ convert them and build the CD image manually.
+
+- `demos/n00bdemo` suffers from flickering on real hardware, especially when
+ masking/stencil buffering is used.
+
+- `graphics/render2tex` gets stuck after initialization on real hardware.
+
+- `io/pads` seems to work on real hardware, but fails to automatically enable
+ analog mode on DualShock controllers. This example needs more testing with
+ official and unofficial controllers.
+
+- `io/system573` hasn't been tested on a real Konami System 573. It runs on
+ MAME, however MAME's System 573 emulation is *very* inaccurate.
+
+-----------------------------------------
+_Last updated on 2021-12-30 by spicyjpeg_
diff --git a/examples/sound/vagsample/0proyt.h b/examples/sound/vagsample/0proyt.h
index 4402b9a..73629f9 100644
--- a/examples/sound/vagsample/0proyt.h
+++ b/examples/sound/vagsample/0proyt.h
@@ -12616,6 +12616,6 @@ unsigned char proyt[] = {
0xf2,0xf0,0xf2,0x15,0xc2,0x1b,0x00,0x00,0x01,0xe3,0x31,0x13,0xf3,0x1f,0xe2,
0x2f,0x13,0xd6,0x20,0x6e,0x2d,0x1b,0x00,0x03,0x42,0xc3,0x14,0x30,0x20,0x21,
0x21,0x32,0x0e,0x32,0x12,0x42,0xf0,0x39,0x01,0x13,0x12,0x04,0xb3,0x06,0x1f,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x77,0x77,0x77,0x77,0x77,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x05,0x77,0x77,0x77,0x77,0x77,
0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
};
diff --git a/examples/sound/vagsample/threedeeffeggzz.h b/examples/sound/vagsample/threedeeffeggzz.h
index ed0e098..f0815aa 100644
--- a/examples/sound/vagsample/threedeeffeggzz.h
+++ b/examples/sound/vagsample/threedeeffeggzz.h
@@ -15194,6 +15194,6 @@ unsigned char tdfx[] = {
0x0b,0x1e,0x21,0xa0,0x4f,0xe2,0x2d,0x17,0x00,0xd2,0x02,0x1d,0xd1,0xf0,0x21,
0xfa,0x2e,0xc4,0x1e,0xfe,0xf2,0x2f,0x24,0x17,0x00,0xef,0xee,0x1f,0xf2,0xce,
0x0d,0x25,0x01,0x3e,0xcb,0xe1,0x30,0xeb,0xc4,0x17,0x01,0x1f,0x1f,0xaf,0x22,
-0xfd,0xe0,0xf3,0x0b,0x2e,0xdd,0xc3,0xde,0x12,0x2d,0x07,0x00,0x77,0x77,0x77,
+0xfd,0xe0,0xf3,0x0b,0x2e,0xdd,0xc3,0xde,0x12,0x2d,0x07,0x05,0x77,0x77,0x77,
0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
};
diff --git a/libpsn00b/include/psxcd.h b/libpsn00b/include/psxcd.h
index ffbe86b..3336963 100644
--- a/libpsn00b/include/psxcd.h
+++ b/libpsn00b/include/psxcd.h
@@ -132,9 +132,9 @@ CdlLOC* CdIntToPos(int i, CdlLOC *p);
int CdPosToInt(CdlLOC *p);
int CdGetToc(CdlLOC *toc);
-int CdControl(u_char com, u_char *param, u_char *result);
-int CdControlB(u_char com, u_char *param, u_char *result);
-int CdControlF(u_char com, u_char *param);
+int CdControl(u_char com, const void *param, u_char *result);
+int CdControlB(u_char com, const void *param, u_char *result);
+int CdControlF(u_char com, const void *param);
int CdSync(int mode, u_char *result);
u_long CdSyncCallback(CdlCB func);
diff --git a/libpsn00b/include/psxspu.h b/libpsn00b/include/psxspu.h
index a87e347..da000e3 100644
--- a/libpsn00b/include/psxspu.h
+++ b/libpsn00b/include/psxspu.h
@@ -115,7 +115,7 @@ extern "C" {
void SpuInit();
-void SpuSetVoiceRaw( int voice, SpuVoiceRaw* param );
+void SpuSetVoiceRaw( int voice, const SpuVoiceRaw* param );
void SpuReverbOn( int voice );
void SpuSetReverb();
@@ -128,7 +128,7 @@ void SpuSetKey(int on_off, u_int voice_bit);
// SPU transfer functions
int SpuSetTransferMode(int mode);
int SpuSetTransferStartAddr(int addr);
-int SpuWrite(unsigned char* addr, int size);
+int SpuWrite(const unsigned char* addr, int size);
void SpuWait();
#ifdef __cplusplus
diff --git a/libpsn00b/psxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c
index 76415f9..8f19c8d 100644
--- a/libpsn00b/psxcd/psxcd.c
+++ b/libpsn00b/psxcd/psxcd.c
@@ -21,7 +21,7 @@ volatile int _cd_last_sector_count;
int _cd_media_changed;
void _cd_init(void);
-void _cd_control(unsigned char com, unsigned char *param, int plen);
+void _cd_control(unsigned char com, const void *param, int plen);
void _cd_wait_ack(void);
void _cd_wait(void);
@@ -50,7 +50,7 @@ int CdInit(void)
return 1;
}
-int CdControl(unsigned char com, unsigned char *param, unsigned char *result)
+int CdControl(unsigned char com, const void *param, unsigned char *result)
{
// Don't issue command if ack is not received yet
if( _cd_ack_wait )
@@ -72,7 +72,7 @@ int CdControl(unsigned char com, unsigned char *param, unsigned char *result)
return 1;
}
-int CdControlB(unsigned char com, unsigned char *param, unsigned char *result)
+int CdControlB(unsigned char com, const void *param, unsigned char *result)
{
if( !CdControl(com, param, result) )
{
@@ -83,7 +83,7 @@ int CdControlB(unsigned char com, unsigned char *param, unsigned char *result)
return 1;
}
-int CdControlF(unsigned char com, unsigned char *param)
+int CdControlF(unsigned char com, const void *param)
{
int param_len=0;