aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-07 18:57:48 +0100
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2021-11-07 18:57:48 +0100
commitb3ef4c5874f579c968f2d26843d0db420e9ed40e (patch)
tree85f60b460901bfe14b1cb6b30eeedadd6398eee3 /doc
parentc377ec612422ac82afe034d92eedb45fb8a17a39 (diff)
downloadpsn00bsdk-b3ef4c5874f579c968f2d26843d0db420e9ed40e.tar.gz
Added io/pads example, psxpad.h definitions, bugfixes
Diffstat (limited to 'doc')
-rw-r--r--doc/dev notes.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/dev notes.txt b/doc/dev notes.txt
index 1bc9ccd..d825ee7 100644
--- a/doc/dev notes.txt
+++ b/doc/dev notes.txt
@@ -53,6 +53,44 @@ IRQs are only triggered on transfer completion.
Additional notes by spicyjpeg:
+* The controller/memory card SPI interface is poorly implemented in most
+emulators, making custom controller polling code insanely hard to write and
+debug. The only emulator that comes close to real hardware is no$psx, which
+seems to correctly implement all features of the SPI port (even those not used
+by the BIOS pad driver, such as TX/RX interrupts). DuckStation only emulates
+the bare minimum required by the BIOS and Sony libraries, and pcsx-redux has
+major bugs that break most custom polling implementations. This pretty much
+means TX/RX IRQs and many flags in the JOY_* registers should not be used
+unless you are willing to break compatibility with emulators.
+
+* As if communicating with controllers wasn't difficult enough already,
+DualShock pads also have a built-in watchdog timer that gets enabled when first
+putting them in configuration mode (and is NOT disabled after exiting config
+mode). If no polling commands are sent to the controller for about 1 second,
+vibration motors are switched off and analog mode is disabled; the same happens
+if the analog button is pressed while in analog mode. In order to always keep
+the pad in analog mode you must:
+
+ * Poll both controller ports at least once per frame by sending command 42h.
+ Polling at a higher rate might be desirable in some cases (such as rhythm
+ games) to increase timing accuracy.
+ * If a digital pad response (type = 4) is received from a port that hasn't
+ previously been flagged as digital-only, attempt to put the pad into config
+ mode using command 43h.
+ * If the pad doesn't recognize the config command, flag it as digital-only
+ and treat all further digital pad responses from it as valid.
+ * If the pad recognizes the command, it will reply by identifying as an
+ analog pad in config mode (type = 15). Send command 44h immediately
+ (without sending 42h first, otherwise the pad will exit config mode) to
+ enable analog mode and turn on the LED.
+ * Pressing the analog button will result in the controller identifying as
+ digital even though it is not flagged as such, thus re-triggering the
+ configuration process and putting it back into analog mode.
+ * All analog pad responses (type = 7) can be treated as valid, as they will
+ come from controllers that have already been configured.
+ * If no valid response is received, assume no controller is connected and
+ reset the port's digital-only flag.
+
* The SDK provides no support yet for replacing the BIOS exception handler with
a custom one, however it can be done (if you are ok with losing all BIOS
controller, memory card and file functionality). In order not to break anything