diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-17 22:42:00 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-17 22:42:00 +0200 |
| commit | 2f100c78c0f12b56bcd73c203e6216d415d9f772 (patch) | |
| tree | 932b600b32b53a47727dc9a898417ec12793fac7 /libpsn00b/psxcd/psxcd.c | |
| parent | 8770122c970eeedb145ee903e2243b7d4a18605b (diff) | |
| download | psn00bsdk-2f100c78c0f12b56bcd73c203e6216d415d9f772.tar.gz | |
Remove interrupt disabling calls in psxcd callback APIs
Diffstat (limited to 'libpsn00b/psxcd/psxcd.c')
| -rw-r--r-- | libpsn00b/psxcd/psxcd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libpsn00b/psxcd/psxcd.c b/libpsn00b/psxcd/psxcd.c index f48542d..6730531 100644 --- a/libpsn00b/psxcd/psxcd.c +++ b/libpsn00b/psxcd/psxcd.c @@ -1,6 +1,7 @@ #include <stdint.h> #include <stdio.h> #include <psxgpu.h> +#include <psxapi.h> #include "psxcd.h" #define READ_TIMEOUT 600 // 10 seconds for NTSC @@ -293,8 +294,10 @@ int CdRead(int sectors, uint32_t *buf, int mode) _cd_read_counter = VSync(-1); // Set read callback + EnterCriticalSection(); _cd_read_oldcb = CdReadyCallback(_CdReadReadyCallback); - + ExitCriticalSection(); + // Set specified mode CdControl(CdlSetmode, (uint8_t*)&mode, 0); @@ -320,9 +323,11 @@ static void CdDoRetry() // Reset timeout _cd_read_counter = VSync(-1); - + + EnterCriticalSection(); CdReadyCallback(_CdReadReadyCallback); - + ExitCriticalSection(); + // Retry read CdControl(CdlSetloc, (void*)&_cd_last_setloc, 0); CdControl(CdlReadN, 0, (uint8_t*)_cd_read_result); |
