Skip to content

Commit

Permalink
Updated d_jackal.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
redenvelope2000 authored Feb 18, 2024
1 parent 1eef824 commit f631d66
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/burn/drv/konami/d_jackal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static UINT8 DrvJoy3[8];
static UINT8 DrvInputs[3];
static UINT8 DrvDips[3];
static UINT8 DrvReset;
static UINT16 AimStickX[2], AimStickY[2];
static int AimStickD[2];

static INT32 watchdog;
static INT32 layer_offset_x = 8;
Expand All @@ -57,6 +59,8 @@ static INT32 nRotateTry[2] = {0, 0};
static UINT32 nRotateTime[2] = {0, 0};
static UINT8 game_rotates = 0;

#define A(a, b, c, d) { a, b, (UINT8*)(c), d }

static struct BurnInputInfo DrvInputList[] = {
{"P1 Coin", BIT_DIGITAL, DrvJoy3 + 0, "p1 coin" },
{"P1 Start", BIT_DIGITAL, DrvJoy3 + 3, "p1 start" },
Expand Down Expand Up @@ -115,6 +119,11 @@ static struct BurnInputInfo DrvrotateInputList[] = {
{"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" },
{"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" },
{"Dip C", BIT_DIPSWITCH, DrvDips + 2, "dip" },

A("P1 Aim-stick X (analog)", BIT_ANALOG_ABS, &AimStickX[0], "p1 aim-stick X-axis"),
A("P1 Aim-stick Y (analog)", BIT_ANALOG_ABS, &AimStickY[0], "p1 aim-stick Y-axis"),
A("P2 Aim-stick X (analog)", BIT_ANALOG_ABS, &AimStickX[1], "p2 aim-stick X-axis"),
A("P2 Aim-stick Y (analog)", BIT_ANALOG_ABS, &AimStickY[1], "p2 aim-stick Y-axis"),
};

STDINPUTINFO(Drvrotate)
Expand Down Expand Up @@ -285,6 +294,8 @@ static void RotateReset() {
nRotateTarget[playernum] = -1;
nRotateTime[playernum] = 0;
nRotateHoldInput[0] = nRotateHoldInput[1] = 0;
AimStickX[playernum] = AimStickY[playernum] = 32767;
AimStickD[playernum] = 0;
}
}

Expand Down Expand Up @@ -419,6 +430,8 @@ static void RotateDoTick() {
}
}

#include "aimstick.h"

static void SuperJoy2Rotate() {
for (INT32 i = 0; i < 2; i++) { // p1 = 0, p2 = 1
if (DrvFakeInput[4 + i]) { // rotate-button had been pressed
Expand All @@ -434,6 +447,14 @@ static void SuperJoy2Rotate() {
// ground and need to rotate your gun WITHOUT getting up.
nRotateHoldInput[i] = DrvInputs[i];
}

// aim-stick
int jk_x = 32767 - AimStickX[i];
int jk_y = 32767 - AimStickY[i];
int steps = 8;
if (aim_stick_range (jk_x, jk_y, &AimStickD[i])) {
nRotateTarget[i] = rotate_gunpos_multiplier * aim_angle (jk_x, jk_y, steps);
}
}

RotateDoTick();
Expand Down

0 comments on commit f631d66

Please sign in to comment.