Skip to content

Commit

Permalink
(pad.cpp) Minor style nit clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgleaver committed Jul 12, 2021
1 parent 6b9ff38 commit 4a587ad
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions src/pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,13 @@ unsigned char PAD2_startPoll()
return 0xFF;
}

static uint8_t stdpar[8] = {0xFF, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80};

static uint8_t unk46[8] = {0xFF, 0x5A, 0x00, 0x00, 0x01, 0x02, 0x00, 0x0A};

static uint8_t unk47[8] = {0xFF, 0x5A, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00};

static uint8_t unk4c[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

static uint8_t unk4d[8] = {0xFF, 0x5A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

static uint8_t stdmode[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

static uint8_t stdcfg[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

static uint8_t stdmodel[8] = {
static const uint8_t unk46[8] = {0xFF, 0x5A, 0x00, 0x00, 0x01, 0x02, 0x00, 0x0A};
static const uint8_t unk47[8] = {0xFF, 0x5A, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00};
static const uint8_t unk4c[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t unk4d[8] = {0xFF, 0x5A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
static const uint8_t stdmode[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t stdcfg[8] = {0xFF, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t stdmodel[8] = {
0xFF,
0x5A,
0x01, // 03 - dualshock2, 01 - dualshock
Expand All @@ -95,7 +87,6 @@ unsigned char PAD1_poll(unsigned char value) {

n = pad_read(0);


// Don't enable Analog/Vibration for a Digital or DualAnalog controller
CurCmd = value;
g.CurByte1++;
Expand All @@ -105,22 +96,28 @@ unsigned char PAD1_poll(unsigned char value) {
g.CmdLen1 = 8;

switch (CurCmd) {
case CMD_SET_MODE_AND_LOCK: memcpy(buf, stdmode, 8);
case CMD_SET_MODE_AND_LOCK:
memcpy(buf, stdmode, sizeof(buf));
return 0xF3;
case CMD_QUERY_MODEL_AND_MODE: memcpy(buf, stdmodel, 8);
case CMD_QUERY_MODEL_AND_MODE:
memcpy(buf, stdmodel, sizeof(buf));
buf[4] = player_controller[0].pad_mode;
return 0xF3;
case CMD_QUERY_ACT: memcpy(buf, unk46, 8);
case CMD_QUERY_ACT:
memcpy(buf, unk46, sizeof(buf));
return 0xF3;
case CMD_QUERY_COMB: memcpy(buf, unk47, 8);
case CMD_QUERY_COMB:
memcpy(buf, unk47, sizeof(buf));
return 0xF3;
case CMD_QUERY_MODE: memcpy(buf, unk4c, 8);
case CMD_QUERY_MODE:
memcpy(buf, unk4c, sizeof(buf));
return 0xF3;
case CMD_VIBRATION_TOGGLE: memcpy(buf, unk4d, 8);
case CMD_VIBRATION_TOGGLE:
memcpy(buf, unk4d, sizeof(buf));
return 0xF3;
case CMD_CONFIG_MODE:
if (player_controller[0].configmode) {
memcpy(buf, stdcfg, 8);
memcpy(buf, stdcfg, sizeof(buf));
return 0xF3;
}
// else FALLTHROUGH
Expand Down

0 comments on commit 4a587ad

Please sign in to comment.