diff --git a/src/Audio.c b/src/Audio.c index 435f37579..341264a04 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -19,7 +19,7 @@ #endif int Audio_SoundsVolume, Audio_MusicVolume; -const cc_string Sounds_ZipPathMC = String_FromConst("audio/default.zip"); +const cc_string Sounds_ZipPathMC = String_FromConst("audio/default.zip"); const cc_string Sounds_ZipPathCC = String_FromConst("audio/classicube.zip"); static const cc_string audio_dir = String_FromConst("audio"); diff --git a/src/Deflate.c b/src/Deflate.c index 0e8970501..ed1d3680a 100644 --- a/src/Deflate.c +++ b/src/Deflate.c @@ -1126,7 +1126,7 @@ void ZLib_MakeStream(struct Stream* stream, struct ZLibState* state, struct Stre /*########################################################################################################################* *--------------------------------------------------------ZipReader--------------------------------------------------------* *#########################################################################################################################*/ -#define ZIP_MAXNAMELEN 512 +#define ZIP_MAXNAMELEN 512 #define ZIP_MAX_ENTRIES 1024 /* Stores state for reading and processing entries in a .zip archive */ @@ -1216,7 +1216,6 @@ static cc_result Zip_ReadCentralDirectory(struct ZipState* state) { if (state->usedEntries >= ZIP_MAX_ENTRIES) return ZIP_ERR_TOO_MANY_ENTRIES; entry = &state->entries[state->usedEntries++]; - entry->CRC32 = Stream_GetU32_LE(&header[12]); entry->CompressedSize = Stream_GetU32_LE(&header[16]); entry->UncompressedSize = Stream_GetU32_LE(&header[20]); entry->LocalHeaderOffset = Stream_GetU32_LE(&header[38]); diff --git a/src/Deflate.h b/src/Deflate.h index 60d92f81b..2c886ad1b 100644 --- a/src/Deflate.h +++ b/src/Deflate.h @@ -120,7 +120,7 @@ CC_API void ZLib_MakeStream( struct Stream* stream, struct ZLibState* stat typedef void (*FP_ZLib_MakeStream)(struct Stream* stream, struct ZLibState* state, struct Stream* underlying); /* Minimal data needed to describe an entry in a .zip archive */ -struct ZipEntry { cc_uint32 CompressedSize, UncompressedSize, LocalHeaderOffset, CRC32; }; +struct ZipEntry { cc_uint32 CompressedSize, UncompressedSize, LocalHeaderOffset; }; /* Callback function to process the data in a .zip archive entry */ /* Return non-zero to indicate an error and stop further processing */ /* NOTE: data stream MAY NOT be seekable (i.e. entry data might be compressed) */ diff --git a/src/Graphics_3DS.c b/src/Graphics_3DS.c index 08164e8d9..f9a500a6e 100644 --- a/src/Graphics_3DS.c +++ b/src/Graphics_3DS.c @@ -129,7 +129,7 @@ static void SetDefaultState(void) { } static void InitCitro3D(void) { - C3D_Init(C3D_DEFAULT_CMDBUF_SIZE); + C3D_Init(C3D_DEFAULT_CMDBUF_SIZE * 2); topTarget = C3D_RenderTargetCreate(240, 400, GPU_RB_RGBA8, GPU_RB_DEPTH24_STENCIL8); C3D_RenderTargetSetOutput(topTarget, GFX_TOP, GFX_LEFT, DISPLAY_TRANSFER_FLAGS); diff --git a/src/Platform_Posix.c b/src/Platform_Posix.c index 04d2f26c0..751b99ddd 100644 --- a/src/Platform_Posix.c +++ b/src/Platform_Posix.c @@ -344,10 +344,16 @@ void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char* if (res) Logger_Abort2(res, "Creating thread"); pthread_attr_destroy(&attrs); - #if defined CC_BUILD_LINUX || defined CC_BUILD_HAIKU - extern int pthread_setname_np(pthread_t thread, const char *name); +#if defined CC_BUILD_LINUX || defined CC_BUILD_HAIKU + extern int pthread_setname_np(pthread_t thread, const char* name); pthread_setname_np(*ptr, name); - #endif +#elif defined CC_BUILD_FREEBSD || defined CC_BUILD_OPENBSD + extern int pthread_set_name_np(pthread_t thread, const char* name); + pthread_set_name_np(*ptr, name); +#elif defined CC_BUILD_NETBSD + extern int pthread_setname_np(pthread_t thread, const char* fmt, const char* arg); + pthread_setname_np(*ptr, "%s", name); +#endif } void Thread_Detach(void* handle) { diff --git a/src/Window_3DS.c b/src/Window_3DS.c index cb99c7de0..11e25a565 100644 --- a/src/Window_3DS.c +++ b/src/Window_3DS.c @@ -110,12 +110,12 @@ static void HandleButtons(u32 mods) { } #define AXIS_SCALE 8.0f -static void ProcessJoystickInput(circlePosition* pos, double delta) { +static void ProcessCircleInput(int axis, circlePosition* pos, double delta) { // May not be exactly 0 on actual hardware if (Math_AbsI(pos->dx) <= 16) pos->dx = 0; if (Math_AbsI(pos->dy) <= 16) pos->dy = 0; - Gamepad_SetAxis(PAD_AXIS_RIGHT, pos->dx / AXIS_SCALE, -pos->dy / AXIS_SCALE, delta); + Gamepad_SetAxis(axis, pos->dx / AXIS_SCALE, -pos->dy / AXIS_SCALE, delta); } static void ProcessTouchInput(int mods) { @@ -143,16 +143,15 @@ void Window_ProcessEvents(double delta) { ProcessTouchInput(mods); - if (Input.RawMode) { - circlePosition pos; - hidCircleRead(&pos); - ProcessJoystickInput(&pos, delta); - } - if (Input.RawMode && irrst_result == 0) { - circlePosition pos; + circlePosition hid_pos; + hidCircleRead(&hid_pos); + ProcessCircleInput(PAD_AXIS_RIGHT, &hid_pos, delta); + + if (irrst_result == 0) { + circlePosition stk_pos; irrstScanInput(); - irrstCstickRead(&pos); - ProcessJoystickInput(&pos, delta); + irrstCstickRead(&stk_pos); + ProcessCircleInput(PAD_AXIS_LEFT, &stk_pos, delta); } }