From 373499dee286a073c61fe2e2316d4cb85f527149 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Thu, 26 May 2022 22:15:25 +0800 Subject: [PATCH] PSX: add psx_poll (for heartbeat). --- support/psx/psx.cpp | 5 +++++ support/psx/psx.h | 1 + user_io.cpp | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/support/psx/psx.cpp b/support/psx/psx.cpp index 395b509..7285521 100644 --- a/support/psx/psx.cpp +++ b/support/psx/psx.cpp @@ -779,3 +779,8 @@ void psx_mount_cd(int f_index, int s_index, const char *filename) mount_cd(0, s_index); } } + +void psx_poll() +{ + spi_uio_cmd(UIO_CD_GET); +} diff --git a/support/psx/psx.h b/support/psx/psx.h index 0045127..749d325 100644 --- a/support/psx/psx.h +++ b/support/psx/psx.h @@ -5,5 +5,6 @@ void psx_mount_cd(int f_index, int s_index, const char *filename); void psx_fill_blanksave(uint8_t *buffer, uint32_t lba, int cnt); void psx_read_cd(uint8_t *buffer, int lba, int cnt); const char* psx_get_game_id(); +void psx_poll(); #endif diff --git a/user_io.cpp b/user_io.cpp index 0be94f0..0bf10f0 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -2699,7 +2699,7 @@ void user_io_send_buttons(char force) { if (is_minimig()) minimig_reset(); if (is_megacd()) mcd_reset(); - if (is_pce()) pcecd_reset(); + if (is_pce()) pcecd_reset(); if (is_saturn()) saturn_reset(); if (is_x86()) x86_init(); ResetUART(); @@ -3363,6 +3363,7 @@ void user_io_poll() if (is_megacd()) mcd_poll(); if (is_pce()) pcecd_poll(); if (is_saturn()) saturn_poll(); + if (is_psx()) psx_poll(); process_ss(0); }