diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50b8cea2..a3bc1a33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,21 +53,21 @@ jobs: path: ./git-artifcats/Dusk if-no-files-found: error - build-vita: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - name: Set up Docker - uses: docker/setup-docker-action@v5 - - name: Build Vita - run: ./scripts/build-vita-docker.sh - - name: Upload Vita binary - uses: actions/upload-artifact@v6 - with: - name: dusk-vita - path: build-vita/Dusk.vpk - if-no-files-found: error + # build-vita: + # runs-on: ubuntu-latest + # steps: + # - name: Checkout repository + # uses: actions/checkout@v6 + # - name: Set up Docker + # uses: docker/setup-docker-action@v5 + # - name: Build Vita + # run: ./scripts/build-vita-docker.sh + # - name: Upload Vita binary + # uses: actions/upload-artifact@v6 + # with: + # name: dusk-vita + # path: build-vita/Dusk.vpk + # if-no-files-found: error build-knulli: runs-on: ubuntu-latest diff --git a/cmake/targets/dolphin.cmake b/cmake/targets/dolphin.cmake index 2f10c8d6..f42f9040 100644 --- a/cmake/targets/dolphin.cmake +++ b/cmake/targets/dolphin.cmake @@ -4,6 +4,7 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC DUSK_INPUT_GAMEPAD DUSK_DISPLAY_WIDTH=640 DUSK_DISPLAY_HEIGHT=480 + DUSK_THREAD_PTHREAD ) # Custom compiler flags diff --git a/cmake/targets/linux.cmake b/cmake/targets/linux.cmake index 197e9612..7c02bdae 100644 --- a/cmake/targets/linux.cmake +++ b/cmake/targets/linux.cmake @@ -42,5 +42,5 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC DUSK_INPUT_GAMEPAD DUSK_TIME_DYNAMIC DUSK_NETWORK_IPV6 - THREAD_PTHREAD=1 + DUSK_THREAD_PTHREAD ) \ No newline at end of file diff --git a/cmake/targets/psp.cmake b/cmake/targets/psp.cmake index 6beec75e..be3e853b 100644 --- a/cmake/targets/psp.cmake +++ b/cmake/targets/psp.cmake @@ -44,7 +44,7 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC DUSK_OPENGL_LEGACY DUSK_DISPLAY_WIDTH=480 DUSK_DISPLAY_HEIGHT=272 - THREAD_PTHREAD=1 + DUSK_THREAD_PTHREAD ) # Postbuild, create .pbp file for PSP. diff --git a/src/dusk/thread/thread.c b/src/dusk/thread/thread.c index 83a22def..5627527c 100644 --- a/src/dusk/thread/thread.c +++ b/src/dusk/thread/thread.c @@ -18,7 +18,7 @@ void threadInit(thread_t *thread, const threadcallback_t callback) { thread->state = THREAD_STATE_STOPPED; thread->callback = callback; - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD thread->threadId = 0; #endif } @@ -30,7 +30,7 @@ void threadStartRequest(thread_t *thread) { thread->state = THREAD_STATE_STARTING; threadMutexUnlock(&thread->stateMutex); - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD assertTrue(thread->threadId == 0, "Thread id not 0."); pthread_create( @@ -93,7 +93,7 @@ bool_t threadShouldStop(thread_t *thread) { return state; } -#if THREAD_PTHREAD +#ifdef DUSK_THREAD_PTHREAD void * threadHandler(thread_t *thread) { assertNotNull(thread, "Thread cannot be NULL."); diff --git a/src/dusk/thread/thread.h b/src/dusk/thread/thread.h index 8235f335..3b1f352a 100644 --- a/src/dusk/thread/thread.h +++ b/src/dusk/thread/thread.h @@ -8,12 +8,6 @@ #pragma once #include "thread/threadmutex.h" -#if THREAD_PTHREAD - #include -#else - #error "At least one threading implementation must be defined." -#endif - typedef struct thread_s thread_t; typedef void (*threadcallback_t)(thread_t *thread); @@ -40,7 +34,7 @@ typedef struct thread_s { threadcallback_t callback; void *data; - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_t threadId; #endif } thread_t; @@ -93,7 +87,7 @@ void threadStop(thread_t *thread); */ bool_t threadShouldStop(thread_t *thread); -#if THREAD_PTHREAD +#ifdef DUSK_THREAD_PTHREAD /** * Handles the thread's lifecycle for pthreads. * @param thread Pointer to the thread structure to handle. diff --git a/src/dusk/thread/threadmutex.c b/src/dusk/thread/threadmutex.c index e19164af..74f0544e 100644 --- a/src/dusk/thread/threadmutex.c +++ b/src/dusk/thread/threadmutex.c @@ -8,43 +8,43 @@ #include "threadmutex.h" void threadMutexInit(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_mutex_init(&lock->mutex, NULL); #endif } void threadMutexLock(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_mutex_lock(&lock->mutex); #endif } bool_t threadMutexTryLock(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD return pthread_mutex_trylock(&lock->mutex) == 0; #endif } void threadMutexUnlock(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_mutex_unlock(&lock->mutex); #endif } void threadMutexWaitLock(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_cond_wait(&lock->cond, &lock->mutex); #endif } void threadMutexSignal(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_cond_signal(&lock->cond); #endif } void threadMutexDispose(threadmutex_t *lock) { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_mutex_destroy(&lock->mutex); #endif } \ No newline at end of file diff --git a/src/dusk/thread/threadmutex.h b/src/dusk/thread/threadmutex.h index 4a684a2d..362fa1f1 100644 --- a/src/dusk/thread/threadmutex.h +++ b/src/dusk/thread/threadmutex.h @@ -8,14 +8,14 @@ #pragma once #include "dusk.h" -#if THREAD_PTHREAD +#ifdef DUSK_THREAD_PTHREAD #include #else #error "At least one threading implementation must be defined." #endif typedef struct threadlock_t { - #if THREAD_PTHREAD + #ifdef DUSK_THREAD_PTHREAD pthread_mutex_t mutex; pthread_cond_t cond; #endif diff --git a/src/duskdolphin/duskplatform.h b/src/duskdolphin/duskplatform.h index 6625b736..c2e801fb 100644 --- a/src/duskdolphin/duskplatform.h +++ b/src/duskdolphin/duskplatform.h @@ -6,10 +6,13 @@ */ #pragma once + #include #include #include +#define consoleInit consoleInitDolhpin + #ifdef DUSK_GAMECUBE #define CONF_ASPECT_4_3 0 #define CONF_ASPECT_16_9 1