#define FOV_JOLLY 80.0
#define FOV_MAX 170.0
-#define STICK_WALK_THRESHOLD 0.2 /* move the stick until the player moves */
-#define STICK_ROTATE_THRESHOLD 0.2 /* move the stick until the player rotates */
-#define STICK_THRUST_THRESHOLD 0.2 /* move the stick until the craft moves */
+#define STICK_WALK_THRESHOLD 0.3 /* move the stick until the player moves */
+#define STICK_ROTATE_THRESHOLD 0.3 /* move the stick until the player rotates */
+#define STICK_THRUST_THRESHOLD 0.3 /* move the stick until the craft moves */
static int config_ctrl_c = 0;
static int config_amiga_speed = 0; /* fast speed */
move_east[1] -= move_east[0];
move_north[1] -= move_north[0];
/* the game takes 4 steps to move the player */
- mercenary_vr_move(1, move_east, move_north);
+ mercenary_vr_move(1, move_east, move_north,
+ 256,
+ (int)(256.0 * fabs(stick_right_y) - STICK_WALK_THRESHOLD / (1.0 - STICK_WALK_THRESHOLD) + 0.5));
} else {
/* don't change what the game actually does when moving joystick in y-direction */
- mercenary_vr_move(0, NULL, NULL);
+ mercenary_vr_move(0, NULL, NULL, 256, 256);
}
}
#endif
int index;
int32_t east[4];
int32_t north[4];
+ int yaw, pitch;
};
extern const struct cpu_stop mercenary_stop_at[];
int mercenary_background_index(void);
uint32_t mercenary_planet_scale_index(void);
uint32_t mercenary_star_table(void);
-void mercenary_vr_move(int override, int32_t *east, int32_t *north);
+void mercenary_vr_move(int override, int32_t *east, int32_t *north, int yaw, int pitch);
extern const char *mercenary_name;
extern const char *mercenary_gamesavesuffix;
{ 0x528C4, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
{ 0x45806, STOP_AT_PATCH_RENDER }, /* patch away planet rendering (would crash without check above) */
{ 0x53276, STOP_AT_PATCH_RENDER }, /* patch away beacon check (not visible on screen) */
- { 0x58EA8, STOP_AT_PATCH_VR }, /* step that moves player */
+ { 0x58EA8, STOP_AT_PATCH_VR }, /* step that moves player on surface */
+ { 0x58060, STOP_AT_PATCH_VR }, /* soft pitch over planet */
+ { 0x58918, STOP_AT_PATCH_VR }, /* soft pitch in space */
{ 0x0, STOP_AT_END }, /* end */
};
vr_move.index++;
}
break;
+ case 0x58060: /* soft pitch over surface */
+ if (vr_move.override) {
+ REG_D[1] = ((int16_t)REG_D[1] * vr_move.pitch / 256) & 0xfff;
+ }
+ break;
}
}
return 0x005D8C0;
}
-void mercenary_vr_move(int override, int32_t *east, int32_t *north)
+void mercenary_vr_move(int override, int32_t *east, int32_t *north, int yaw, int pitch)
{
vr_move.override = override;
if (east)
memcpy(vr_move.east, east, sizeof(vr_move.east));
if (north)
memcpy(vr_move.north, north, sizeof(vr_move.north));
+ vr_move.yaw = yaw;
+ vr_move.pitch = pitch;
vr_move.index = 0;
}
+
const char *mercenary_name = "Mercenary II - Damocles";
const char *mercenary_gamesavesuffix = ".m2save";
{ 0x537B0, STOP_AT_PATCH_RENDER }, /* patch away planet check (behind observer) */
{ 0x45806, STOP_AT_PATCH_RENDER }, /* patch away planet rendering (would crash without check above) */
{ 0x5406E, STOP_AT_PATCH_RENDER }, /* patch away beacon check (not visible on screen) */
- { 0x59A00, STOP_AT_PATCH_VR }, /* step that moves player */
+ { 0x59A00, STOP_AT_PATCH_VR }, /* step that moves player on surface */
+ { 0x58F44, STOP_AT_PATCH_VR }, /* soft pitch over planet */
+ { 0x5946E, STOP_AT_PATCH_VR }, /* soft pitch in space */
{ 0x0, STOP_AT_END }, /* end */
};
vr_move.index++;
}
break;
+ case 0x58F44: /* soft pitch over surface */
+ if (vr_move.override) {
+ REG_D[1] = ((int16_t)REG_D[1] * vr_move.pitch / 256) & 0xfff;
+ }
+ break;
+#if 0
+ case 0x5946E: /* pitch in space doesn't work! */
+ if (vr_move.override) {
+ REG_D[1] = ((int32_t)REG_D[1] * vr_move.pitch / 256) & 0xffffff00;
+ printf("unten factor %d reg_d1 = %d\n", vr_move.pitch, (int32_t)REG_D[1]);
+ }
+ break;
+#endif
}
}
return DS_84+0x6A;
}
-void mercenary_vr_move(int override, int32_t *east, int32_t *north)
+void mercenary_vr_move(int override, int32_t *east, int32_t *north, int yaw, int pitch)
{
vr_move.override = override;
if (east)
memcpy(vr_move.east, east, sizeof(vr_move.east));
if (north)
memcpy(vr_move.north, north, sizeof(vr_move.north));
+ vr_move.yaw = yaw;
+ vr_move.pitch = pitch;
vr_move.index = 0;
}