mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-09 07:18:34 -04:00
DC: INIT_FLAGS, optimization flags, dual analog
1) Hand-tuned KOS_INIT_FLAGS() to only include what was actually needed (shaving off ~50KB for a GCC14 relese build). 2) Set optimization to best known flags in DC-specific Makefile. 3) Implemented dual-analog stick support when detected.
This commit is contained in:
parent
5c7109bfd9
commit
96926776bd
@ -5,7 +5,7 @@ TARGET := ClassiCube-dc
|
||||
S_FILES := $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.S))
|
||||
C_FILES := $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.c))
|
||||
OBJS := $(addprefix $(BUILD_DIR)/, $(notdir $(C_FILES:%.c=%.o) $(S_FILES:%.S=%.o)))
|
||||
CFLAGS := -g -O2 -pipe -fno-math-errno -Ithird_party/bearssl/inc
|
||||
CFLAGS := -g -DNDEBUG -O3 -fipa-pta -fno-pie -flto=auto -fomit-frame-pointer -fbuiltin -ffast-math -ffp-contract=fast -mfsrra -mfsca -pipe -fno-math-errno -Ithird_party/bearssl/inc
|
||||
|
||||
# Dependency tracking
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.d
|
||||
|
@ -23,7 +23,9 @@
|
||||
#include <fat/fs_fat.h>
|
||||
#include <kos/dbgio.h>
|
||||
#include "_PlatformConsole.h"
|
||||
KOS_INIT_FLAGS(INIT_DEFAULT | INIT_NET);
|
||||
|
||||
KOS_INIT_FLAGS(INIT_CONTROLLER | INIT_KEYBOARD | INIT_MOUSE |
|
||||
INIT_VMU | INIT_CDROM | INIT_NET);
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
|
@ -258,12 +258,19 @@ static void HandleJoystick(int port, int axis, int x, int y, float delta) {
|
||||
Gamepad_SetAxis(port, axis, x / AXIS_SCALE, y / AXIS_SCALE, delta);
|
||||
}
|
||||
|
||||
static void HandleController(int port, cont_state_t* state, float delta) {
|
||||
static void HandleController(int port, bool dual_analog, cont_state_t* state, float delta) {
|
||||
Gamepad_SetButton(port, CCPAD_L, state->ltrig > 10);
|
||||
Gamepad_SetButton(port, CCPAD_R, state->rtrig > 10);
|
||||
// TODO second joystick
|
||||
// TODO: verify values are right
|
||||
if(dual_analog)
|
||||
{
|
||||
HandleJoystick(port, PAD_AXIS_LEFT, state->joyx, state->joyy, delta);
|
||||
HandleJoystick(port, PAD_AXIS_RIGHT, state->joy2x, state->joy2y, delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleJoystick(port, PAD_AXIS_RIGHT, state->joyx, state->joyy, delta);
|
||||
}
|
||||
}
|
||||
|
||||
void Gamepads_Process(float delta) {
|
||||
@ -277,8 +284,11 @@ void Gamepads_Process(float delta) {
|
||||
state = (cont_state_t*)maple_dev_status(cont);
|
||||
if (!state) return;
|
||||
|
||||
int dual_analog = cont_has_capabilities(cont, CONT_CAPABILITIES_DUAL_ANALOG);
|
||||
if(dual_analog == -1) dual_analog = 0;
|
||||
|
||||
HandleButtons(port, state->buttons);
|
||||
HandleController(port, state, delta);
|
||||
HandleController(port, dual_analog, state, delta);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user