dsda: fix lmp import

only tested on doom, no idea if movies for other 2 even exist lol
This commit is contained in:
feos 2025-02-25 23:21:23 +03:00
parent d628f035f7
commit f6538289dc
11 changed files with 14 additions and 36 deletions

Binary file not shown.

View File

@ -61,16 +61,15 @@ namespace BizHawk.Client.Common
void ParsePlayer(string playerPfx)
{
controller.AcceptNewAxis(playerPfx + "Run Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Strafing Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Turning Speed", unchecked((sbyte) input[i++]));
var specialValue = input[i++];
controller[playerPfx + "Fire"] = (specialValue & 0b00000001) is not 0;
controller[playerPfx + "Use"] = (specialValue & 0b00000010) is not 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", (specialValue & 0b00011100) >> 2);
controller[playerPfx + "Alt Weapon"] = (specialValue & 0b00100000) is not 0;
bool changeWeapon = (specialValue & 0b00000100) is not 0;
int weapon = changeWeapon ? (((specialValue & 0b00111000) >> 3) + 1) : 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", weapon);
}
do
{

View File

@ -41,19 +41,15 @@ namespace BizHawk.Client.Common
void ParsePlayer(string playerPfx)
{
controller.AcceptNewAxis(playerPfx + "Run Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Strafing Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Turning Speed", unchecked((sbyte) input[i++]));
var specialValue = input[i++];
controller[playerPfx + "Fire"] = (specialValue & 0b00000001) is not 0;
controller[playerPfx + "Use"] = (specialValue & 0b00000010) is not 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", (specialValue & 0b00011100) >> 2);
controller[playerPfx + "Alt Weapon"] = (specialValue & 0b00100000) is not 0;
bool changeWeapon = (specialValue & 0b00000100) is not 0;
int weapon = changeWeapon ? (((specialValue & 0b00111000) >> 3) + 1) : 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", weapon);
controller.AcceptNewAxis(playerPfx + "Fly / Look", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Use Artifact", unchecked((sbyte) input[i++]));
}
do

View File

@ -53,19 +53,15 @@ namespace BizHawk.Client.Common
void ParsePlayer(string playerPfx)
{
controller.AcceptNewAxis(playerPfx + "Run Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Strafing Speed", unchecked((sbyte) input[i++]));
controller.AcceptNewAxis(playerPfx + "Turning Speed", unchecked((sbyte) input[i++]));
var specialValue = input[i++];
controller[playerPfx + "Fire"] = (specialValue & 0b00000001) is not 0;
controller[playerPfx + "Use"] = (specialValue & 0b00000010) is not 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", (specialValue & 0b00011100) >> 2);
controller[playerPfx + "Alt Weapon"] = (specialValue & 0b00100000) is not 0;
bool changeWeapon = (specialValue & 0b00000100) is not 0;
int weapon = changeWeapon ? (((specialValue & 0b00111000) >> 3) + 1) : 0;
controller.AcceptNewAxis(playerPfx + "Weapon Select", weapon);
controller.AcceptNewAxis(playerPfx + "Fly / Look", unchecked((sbyte) input[i++]));
var useArtifact = input[i++];
controller.AcceptNewAxis(playerPfx + "Use Artifact", useArtifact & 0b00111111);
controller[playerPfx + "End Player"] = (useArtifact & 0b01000000) is not 0;

View File

@ -819,8 +819,7 @@ namespace BizHawk.Emulation.Common
["RESET"] = 'r',
},
[VSystemID.Raw.Doom] = new()
{
["Alt Weapon"] = 'X',
{
["Backward"] = 'v',
["End Player"] = 'E',
["Fire"] = 'F',

View File

@ -93,8 +93,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
var actionsBitfield = portReaders[i](controller);
players[i]._Fire = actionsBitfield & 0b00001;
players[i]._Action = (actionsBitfield & 0b00010) >> 1;
players[i]._AltWeapon = (actionsBitfield & 0b00100) >> 2;
players[i]._Automap = (actionsBitfield & 0b01000) >> 3;
players[i]._Automap = (actionsBitfield & 0b00100) >> 2;
// Raven Games
if (_syncSettings.InputFormat is DoomControllerTypes.Heretic or DoomControllerTypes.Hexen)

View File

@ -50,7 +50,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[
"Fire",
"Use",
"Alt Weapon",
"Forward",
"Backward",
"Turn Left",
@ -74,8 +73,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
if (c.IsPressed($"P{PortNum} Fire")) { result |= 0b0001; }
if (c.IsPressed($"P{PortNum} Use")) { result |= 0b0010; }
if (c.IsPressed($"P{PortNum} Alt Weapon")) { result |= 0b0100; }
if (c.IsPressed($"P{PortNum} Automap")) { result |= 0b1000; }
if (c.IsPressed($"P{PortNum} Automap")) { result |= 0b0100; }
return result;
}
@ -129,7 +127,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
[
"Fire",
"Use",
"Alt Weapon",
"Forward",
"Backward",
"Turn Left",
@ -152,7 +149,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
if (c.IsPressed($"P{PortNum} Fire")) { result |= 0b0001; }
if (c.IsPressed($"P{PortNum} Use")) { result |= 0b0010; }
if (c.IsPressed($"P{PortNum} Alt Weapon")) { result |= 0b0100; }
return result;
}
@ -270,7 +266,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
if (c.IsPressed($"P{PortNum} Fire")) { result |= 0b00001; }
if (c.IsPressed($"P{PortNum} Use")) { result |= 0b00010; }
if (c.IsPressed($"P{PortNum} Alt Weapon")) { result |= 0b00100; }
if (c.IsPressed($"P{PortNum} Jump")) { result |= 0b01000; }
if (c.IsPressed($"P{PortNum} End Player")) { result |= 0b10000; }

View File

@ -40,7 +40,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
public int _WeaponSelect;
public int _Fire;
public int _Action;
public int _AltWeapon;
public int _Automap;
// Hexen + Heretic (Raven Games)

View File

@ -50,7 +50,6 @@ ECL_EXPORT void dsda_frame_advance(struct PackedPlayerInput *player1Inputs, stru
player1Inputs->_Fire,
player1Inputs->_Action,
player1Inputs->_WeaponSelect,
player1Inputs->_AltWeapon,
player1Inputs->_Automap,
player1Inputs->_FlyLook,
player1Inputs->_ArtifactUse,
@ -68,7 +67,6 @@ ECL_EXPORT void dsda_frame_advance(struct PackedPlayerInput *player1Inputs, stru
player2Inputs->_Fire,
player2Inputs->_Action,
player2Inputs->_WeaponSelect,
player2Inputs->_AltWeapon,
player2Inputs->_Automap,
player2Inputs->_FlyLook,
player2Inputs->_ArtifactUse,
@ -86,7 +84,6 @@ ECL_EXPORT void dsda_frame_advance(struct PackedPlayerInput *player1Inputs, stru
player3Inputs->_Fire,
player3Inputs->_Action,
player3Inputs->_WeaponSelect,
player3Inputs->_AltWeapon,
player3Inputs->_Automap,
player3Inputs->_FlyLook,
player3Inputs->_ArtifactUse,
@ -104,7 +101,6 @@ ECL_EXPORT void dsda_frame_advance(struct PackedPlayerInput *player1Inputs, stru
player4Inputs->_Fire,
player4Inputs->_Action,
player4Inputs->_WeaponSelect,
player4Inputs->_AltWeapon,
player4Inputs->_Automap,
player4Inputs->_FlyLook,
player4Inputs->_ArtifactUse,

View File

@ -20,7 +20,7 @@ extern "C"
void headlessRunSingleTick();
void headlessUpdateSounds(void);
void headlessClearTickCommand();
void headlessSetTickCommand(int playerId, int forwardSpeed, int strafingSpeed, int turningSpeed, int fire, int action, int weapon, int altWeapon, int automap, int lookfly, int artifact, int jump, int endPlayer);
void headlessSetTickCommand(int playerId, int forwardSpeed, int strafingSpeed, int turningSpeed, int fire, int action, int weapon, int automap, int lookfly, int artifact, int jump, int endPlayer);
// Video-related functions
void headlessUpdateVideo(void);
@ -89,7 +89,6 @@ struct PackedPlayerInput
int _WeaponSelect;
int _Fire;
int _Action;
int _AltWeapon;
int _Automap;
int _FlyLook;
int _ArtifactUse;

@ -1 +1 @@
Subproject commit 67b2144c7605c3d69726afc418abcee0c6c8013c
Subproject commit 792aca883a380d18182545413f6b0fa441fb4524