aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxetc
diff options
context:
space:
mode:
Diffstat (limited to 'libpsn00b/psxetc')
-rw-r--r--libpsn00b/psxetc/dl.c4
-rw-r--r--libpsn00b/psxetc/interrupts.c4
-rw-r--r--libpsn00b/psxetc/logging.c50
3 files changed, 4 insertions, 54 deletions
diff --git a/libpsn00b/psxetc/dl.c b/libpsn00b/psxetc/dl.c
index ccf7a7c..1d73eb6 100644
--- a/libpsn00b/psxetc/dl.c
+++ b/libpsn00b/psxetc/dl.c
@@ -450,9 +450,9 @@ DLL *DL_CreateDLL(DLL *dll, void *ptr, size_t size, DL_ResolveMode mode) {
}
}
- EnterCriticalSection();
+ FastEnterCriticalSection();
FlushCache();
- ExitCriticalSection();
+ FastExitCriticalSection();
// Call the DLL's global constructors. This is the same thing we'd do in
// _start() for regular executables, but we have to do it outside of the
diff --git a/libpsn00b/psxetc/interrupts.c b/libpsn00b/psxetc/interrupts.c
index 0d926c4..2dacaed 100644
--- a/libpsn00b/psxetc/interrupts.c
+++ b/libpsn00b/psxetc/interrupts.c
@@ -137,13 +137,13 @@ void *DMACallback(DMA_Channel dma, void (*func)(void)) {
DMA_DICR |= (0x10000 << dma) | (1 << 23);
if (!(_num_dma_handlers++))
- InterruptCallback(3, &_global_dma_handler);
+ InterruptCallback(IRQ_DMA, &_global_dma_handler);
} else if (old_callback && !func) {
if (--_num_dma_handlers) {
DMA_DICR &= ~(0x10000 << dma);
} else {
DMA_DICR = 0;
- InterruptCallback(3, 0);
+ InterruptCallback(IRQ_DMA, 0);
}
}
diff --git a/libpsn00b/psxetc/logging.c b/libpsn00b/psxetc/logging.c
deleted file mode 100644
index 5199190..0000000
--- a/libpsn00b/psxetc/logging.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * PSn00bSDK internal debug logger
- * (C) 2022 spicyjpeg - MPL licensed
- *
- * This file provides the (admittedly minimal) logging system used by all
- * PSn00bSDK libraries. Log messages and warnings are issued using the
- * _sdk_log() macro and collected into a buffer, whose contents can be flushed
- * by calling _sdk_dump_log() (by default this is done by VSync()). Logging is
- * only enabled in debug builds of libpsn00b.
- */
-
-#include <stddef.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <psxapi.h>
-#include <psxetc.h>
-
-#define LOG_BUFFER_SIZE 256
-
-#ifndef NDEBUG
-
-/* Internal globals */
-
-static char _log_buffer[LOG_BUFFER_SIZE];
-static size_t _log_buffer_length = 0;
-
-/* Internal logging API */
-
-void _sdk_log_inner(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- _log_buffer_length += vsnprintf(
- &_log_buffer[_log_buffer_length],
- LOG_BUFFER_SIZE - _log_buffer_length,
- fmt,
- ap
- );
- va_end(ap);
-}
-
-void _sdk_dump_log_inner(void) {
- if (!_log_buffer_length)
- return;
-
- write(1, _log_buffer, _log_buffer_length);
- _log_buffer_length = 0;
-}
-
-#endif