mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
3DS: Bind stick input to left pad axis instead (so moves player), double GPU command buffer size
Also implement thread naming on BSD systems
This commit is contained in:
parent
d7b805a480
commit
02b068c7dc
@ -1216,7 +1216,6 @@ static cc_result Zip_ReadCentralDirectory(struct ZipState* state) {
|
|||||||
if (state->usedEntries >= ZIP_MAX_ENTRIES) return ZIP_ERR_TOO_MANY_ENTRIES;
|
if (state->usedEntries >= ZIP_MAX_ENTRIES) return ZIP_ERR_TOO_MANY_ENTRIES;
|
||||||
entry = &state->entries[state->usedEntries++];
|
entry = &state->entries[state->usedEntries++];
|
||||||
|
|
||||||
entry->CRC32 = Stream_GetU32_LE(&header[12]);
|
|
||||||
entry->CompressedSize = Stream_GetU32_LE(&header[16]);
|
entry->CompressedSize = Stream_GetU32_LE(&header[16]);
|
||||||
entry->UncompressedSize = Stream_GetU32_LE(&header[20]);
|
entry->UncompressedSize = Stream_GetU32_LE(&header[20]);
|
||||||
entry->LocalHeaderOffset = Stream_GetU32_LE(&header[38]);
|
entry->LocalHeaderOffset = Stream_GetU32_LE(&header[38]);
|
||||||
|
@ -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);
|
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 */
|
/* 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 */
|
/* Callback function to process the data in a .zip archive entry */
|
||||||
/* Return non-zero to indicate an error and stop further processing */
|
/* 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) */
|
/* NOTE: data stream MAY NOT be seekable (i.e. entry data might be compressed) */
|
||||||
|
@ -129,7 +129,7 @@ static void SetDefaultState(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void InitCitro3D(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);
|
topTarget = C3D_RenderTargetCreate(240, 400, GPU_RB_RGBA8, GPU_RB_DEPTH24_STENCIL8);
|
||||||
C3D_RenderTargetSetOutput(topTarget, GFX_TOP, GFX_LEFT, DISPLAY_TRANSFER_FLAGS);
|
C3D_RenderTargetSetOutput(topTarget, GFX_TOP, GFX_LEFT, DISPLAY_TRANSFER_FLAGS);
|
||||||
|
@ -347,6 +347,12 @@ void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char*
|
|||||||
#if defined CC_BUILD_LINUX || defined CC_BUILD_HAIKU
|
#if defined CC_BUILD_LINUX || defined CC_BUILD_HAIKU
|
||||||
extern int pthread_setname_np(pthread_t thread, const char* name);
|
extern int pthread_setname_np(pthread_t thread, const char* name);
|
||||||
pthread_setname_np(*ptr, name);
|
pthread_setname_np(*ptr, name);
|
||||||
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,12 +110,12 @@ static void HandleButtons(u32 mods) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define AXIS_SCALE 8.0f
|
#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
|
// May not be exactly 0 on actual hardware
|
||||||
if (Math_AbsI(pos->dx) <= 16) pos->dx = 0;
|
if (Math_AbsI(pos->dx) <= 16) pos->dx = 0;
|
||||||
if (Math_AbsI(pos->dy) <= 16) pos->dy = 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) {
|
static void ProcessTouchInput(int mods) {
|
||||||
@ -143,16 +143,15 @@ void Window_ProcessEvents(double delta) {
|
|||||||
|
|
||||||
ProcessTouchInput(mods);
|
ProcessTouchInput(mods);
|
||||||
|
|
||||||
if (Input.RawMode) {
|
circlePosition hid_pos;
|
||||||
circlePosition pos;
|
hidCircleRead(&hid_pos);
|
||||||
hidCircleRead(&pos);
|
ProcessCircleInput(PAD_AXIS_RIGHT, &hid_pos, delta);
|
||||||
ProcessJoystickInput(&pos, delta);
|
|
||||||
}
|
if (irrst_result == 0) {
|
||||||
if (Input.RawMode && irrst_result == 0) {
|
circlePosition stk_pos;
|
||||||
circlePosition pos;
|
|
||||||
irrstScanInput();
|
irrstScanInput();
|
||||||
irrstCstickRead(&pos);
|
irrstCstickRead(&stk_pos);
|
||||||
ProcessJoystickInput(&pos, delta);
|
ProcessCircleInput(PAD_AXIS_LEFT, &stk_pos, delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user