Fixed build

This commit is contained in:
2026-04-20 15:43:18 -05:00
parent b640295be2
commit 1646dc2dbd
9 changed files with 35 additions and 37 deletions
+15 -15
View File
@@ -53,21 +53,21 @@ jobs:
path: ./git-artifcats/Dusk path: ./git-artifcats/Dusk
if-no-files-found: error if-no-files-found: error
build-vita: # build-vita:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Checkout repository # - name: Checkout repository
uses: actions/checkout@v6 # uses: actions/checkout@v6
- name: Set up Docker # - name: Set up Docker
uses: docker/setup-docker-action@v5 # uses: docker/setup-docker-action@v5
- name: Build Vita # - name: Build Vita
run: ./scripts/build-vita-docker.sh # run: ./scripts/build-vita-docker.sh
- name: Upload Vita binary # - name: Upload Vita binary
uses: actions/upload-artifact@v6 # uses: actions/upload-artifact@v6
with: # with:
name: dusk-vita # name: dusk-vita
path: build-vita/Dusk.vpk # path: build-vita/Dusk.vpk
if-no-files-found: error # if-no-files-found: error
build-knulli: build-knulli:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+1
View File
@@ -4,6 +4,7 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
DUSK_INPUT_GAMEPAD DUSK_INPUT_GAMEPAD
DUSK_DISPLAY_WIDTH=640 DUSK_DISPLAY_WIDTH=640
DUSK_DISPLAY_HEIGHT=480 DUSK_DISPLAY_HEIGHT=480
DUSK_THREAD_PTHREAD
) )
# Custom compiler flags # Custom compiler flags
+1 -1
View File
@@ -42,5 +42,5 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
DUSK_INPUT_GAMEPAD DUSK_INPUT_GAMEPAD
DUSK_TIME_DYNAMIC DUSK_TIME_DYNAMIC
DUSK_NETWORK_IPV6 DUSK_NETWORK_IPV6
THREAD_PTHREAD=1 DUSK_THREAD_PTHREAD
) )
+1 -1
View File
@@ -44,7 +44,7 @@ target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC
DUSK_OPENGL_LEGACY DUSK_OPENGL_LEGACY
DUSK_DISPLAY_WIDTH=480 DUSK_DISPLAY_WIDTH=480
DUSK_DISPLAY_HEIGHT=272 DUSK_DISPLAY_HEIGHT=272
THREAD_PTHREAD=1 DUSK_THREAD_PTHREAD
) )
# Postbuild, create .pbp file for PSP. # Postbuild, create .pbp file for PSP.
+3 -3
View File
@@ -18,7 +18,7 @@ void threadInit(thread_t *thread, const threadcallback_t callback) {
thread->state = THREAD_STATE_STOPPED; thread->state = THREAD_STATE_STOPPED;
thread->callback = callback; thread->callback = callback;
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
thread->threadId = 0; thread->threadId = 0;
#endif #endif
} }
@@ -30,7 +30,7 @@ void threadStartRequest(thread_t *thread) {
thread->state = THREAD_STATE_STARTING; thread->state = THREAD_STATE_STARTING;
threadMutexUnlock(&thread->stateMutex); threadMutexUnlock(&thread->stateMutex);
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
assertTrue(thread->threadId == 0, "Thread id not 0."); assertTrue(thread->threadId == 0, "Thread id not 0.");
pthread_create( pthread_create(
@@ -93,7 +93,7 @@ bool_t threadShouldStop(thread_t *thread) {
return state; return state;
} }
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
void * threadHandler(thread_t *thread) { void * threadHandler(thread_t *thread) {
assertNotNull(thread, "Thread cannot be NULL."); assertNotNull(thread, "Thread cannot be NULL.");
+2 -8
View File
@@ -8,12 +8,6 @@
#pragma once #pragma once
#include "thread/threadmutex.h" #include "thread/threadmutex.h"
#if THREAD_PTHREAD
#include <pthread.h>
#else
#error "At least one threading implementation must be defined."
#endif
typedef struct thread_s thread_t; typedef struct thread_s thread_t;
typedef void (*threadcallback_t)(thread_t *thread); typedef void (*threadcallback_t)(thread_t *thread);
@@ -40,7 +34,7 @@ typedef struct thread_s {
threadcallback_t callback; threadcallback_t callback;
void *data; void *data;
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_t threadId; pthread_t threadId;
#endif #endif
} thread_t; } thread_t;
@@ -93,7 +87,7 @@ void threadStop(thread_t *thread);
*/ */
bool_t threadShouldStop(thread_t *thread); bool_t threadShouldStop(thread_t *thread);
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
/** /**
* Handles the thread's lifecycle for pthreads. * Handles the thread's lifecycle for pthreads.
* @param thread Pointer to the thread structure to handle. * @param thread Pointer to the thread structure to handle.
+7 -7
View File
@@ -8,43 +8,43 @@
#include "threadmutex.h" #include "threadmutex.h"
void threadMutexInit(threadmutex_t *lock) { void threadMutexInit(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_mutex_init(&lock->mutex, NULL); pthread_mutex_init(&lock->mutex, NULL);
#endif #endif
} }
void threadMutexLock(threadmutex_t *lock) { void threadMutexLock(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_mutex_lock(&lock->mutex); pthread_mutex_lock(&lock->mutex);
#endif #endif
} }
bool_t threadMutexTryLock(threadmutex_t *lock) { bool_t threadMutexTryLock(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
return pthread_mutex_trylock(&lock->mutex) == 0; return pthread_mutex_trylock(&lock->mutex) == 0;
#endif #endif
} }
void threadMutexUnlock(threadmutex_t *lock) { void threadMutexUnlock(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_mutex_unlock(&lock->mutex); pthread_mutex_unlock(&lock->mutex);
#endif #endif
} }
void threadMutexWaitLock(threadmutex_t *lock) { void threadMutexWaitLock(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_cond_wait(&lock->cond, &lock->mutex); pthread_cond_wait(&lock->cond, &lock->mutex);
#endif #endif
} }
void threadMutexSignal(threadmutex_t *lock) { void threadMutexSignal(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_cond_signal(&lock->cond); pthread_cond_signal(&lock->cond);
#endif #endif
} }
void threadMutexDispose(threadmutex_t *lock) { void threadMutexDispose(threadmutex_t *lock) {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_mutex_destroy(&lock->mutex); pthread_mutex_destroy(&lock->mutex);
#endif #endif
} }
+2 -2
View File
@@ -8,14 +8,14 @@
#pragma once #pragma once
#include "dusk.h" #include "dusk.h"
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
#include <pthread.h> #include <pthread.h>
#else #else
#error "At least one threading implementation must be defined." #error "At least one threading implementation must be defined."
#endif #endif
typedef struct threadlock_t { typedef struct threadlock_t {
#if THREAD_PTHREAD #ifdef DUSK_THREAD_PTHREAD
pthread_mutex_t mutex; pthread_mutex_t mutex;
pthread_cond_t cond; pthread_cond_t cond;
#endif #endif
+3
View File
@@ -6,10 +6,13 @@
*/ */
#pragma once #pragma once
#include <ogcsys.h> #include <ogcsys.h>
#include <gccore.h> #include <gccore.h>
#include <malloc.h> #include <malloc.h>
#define consoleInit consoleInitDolhpin
#ifdef DUSK_GAMECUBE #ifdef DUSK_GAMECUBE
#define CONF_ASPECT_4_3 0 #define CONF_ASPECT_4_3 0
#define CONF_ASPECT_16_9 1 #define CONF_ASPECT_16_9 1