aboutsummaryrefslogtreecommitdiff
path: root/examples/io/system573/k573io.c
diff options
context:
space:
mode:
authorspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-06-27 22:18:11 +0200
committerspicyjpeg <88942473+spicyjpeg@users.noreply.github.com>2022-06-27 22:18:11 +0200
commitef776e728cfa67fbca38bb375152b336fa0b5200 (patch)
tree4eea0faf910d2671446c3f1ff1b9714d23e53cb7 /examples/io/system573/k573io.c
parentf56ade9b10c7c2d37f1b0af9191560cd5f0295b4 (diff)
downloadpsn00bsdk-ef776e728cfa67fbca38bb375152b336fa0b5200.tar.gz
Clean up io/system573 example and libpsxpress
Diffstat (limited to 'examples/io/system573/k573io.c')
-rw-r--r--examples/io/system573/k573io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/io/system573/k573io.c b/examples/io/system573/k573io.c
index bc13852..53c109f 100644
--- a/examples/io/system573/k573io.c
+++ b/examples/io/system573/k573io.c
@@ -75,7 +75,7 @@ uint32_t K573_GetJAMMAInputs(void) {
inputs |= ((K573_IO_CHIP[IO_REG_IN1_HIGH] >> 8) & 0x1f) << 24;
inputs |= (K573_IO_CHIP[IO_REG_IN1_LOW] & 0x07) << 29;
- return inputs;
+ return ~inputs;
}
void K573_SetLights(uint32_t lights) {
@@ -120,5 +120,10 @@ void K573_Init(void) {
EXP1_ADDR = 0x1f000000;
EXP1_DELAY_SIZE = 0x24173f47; // 573 BIOS uses this value
+ // Bit 6 of this register controls the audio DAC and must be set, otherwise
+ // no sound will be output. Most of the other bits are data clocks/strobes
+ // and should be pulled high when not in use.
+ K573_IO_CHIP[IO_REG_OUT0] = 0x01e7;
+
K573_RESET_WATCHDOG();
}