dsda: pass all non-sync settings to the core once they change
This commit is contained in:
parent
9d80ea12b3
commit
45e16c0ec2
Binary file not shown.
|
@ -149,10 +149,23 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PackedRenderInfo renderInfo = new PackedRenderInfo();
|
PackedRenderInfo renderInfo = new PackedRenderInfo()
|
||||||
renderInfo.RenderVideo = renderVideo ? 1 : 0;
|
{
|
||||||
renderInfo.RenderAudio = renderAudio ? 1 : 0;
|
ScaleFactor = _settings.ScaleFactor,
|
||||||
renderInfo.PlayerPointOfView = _settings.DisplayPlayer - 1;
|
Gamma = _settings.Gamma,
|
||||||
|
HeadsUpMode = (int)_settings.HeadsUpMode,
|
||||||
|
RenderVideo = renderVideo ? 1 : 0,
|
||||||
|
RenderAudio = renderAudio ? 1 : 0,
|
||||||
|
DoUpdate = _settings.DoUpdate ? 1 : 0,
|
||||||
|
ShowMessages = _settings.ShowMessages ? 1 : 0,
|
||||||
|
ReportSecrets = _settings.ReportSecrets ? 1 : 0,
|
||||||
|
DsdaExHud = _settings.DsdaExHud ? 1 : 0,
|
||||||
|
DisplayCommands = _settings.DisplayCommands ? 1 : 0,
|
||||||
|
MapTotals = _settings.MapTotals ? 1 : 0,
|
||||||
|
MapTime = _settings.MapTime ? 1 : 0,
|
||||||
|
MapCoordinates = _settings.MapCoordinates ? 1 : 0,
|
||||||
|
PlayerPointOfView = _settings.DisplayPlayer - 1,
|
||||||
|
};
|
||||||
|
|
||||||
IsLagFrame = _core.dsda_frame_advance(
|
IsLagFrame = _core.dsda_frame_advance(
|
||||||
commonButtons,
|
commonButtons,
|
||||||
|
@ -162,6 +175,11 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
ref players[3],
|
ref players[3],
|
||||||
ref renderInfo);
|
ref renderInfo);
|
||||||
|
|
||||||
|
if (_settings.DoUpdate)
|
||||||
|
{
|
||||||
|
_settings.DoUpdate = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (renderVideo)
|
if (renderVideo)
|
||||||
UpdateVideo();
|
UpdateVideo();
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,9 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
[CoreSettings]
|
[CoreSettings]
|
||||||
public class DoomSettings
|
public class DoomSettings
|
||||||
{
|
{
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool DoUpdate = false;
|
||||||
|
|
||||||
[DisplayName("Internal Resolution Scale Factor")]
|
[DisplayName("Internal Resolution Scale Factor")]
|
||||||
[Description("Which factor to increase internal resolution by [1 - 12]. Affects \"quality\" of rendered image at the cost of accuracy. Native resolution is 320x200 resized to 4:3 DAR on a CRT monitor.")]
|
[Description("Which factor to increase internal resolution by [1 - 12]. Affects \"quality\" of rendered image at the cost of accuracy. Native resolution is 320x200 resized to 4:3 DAR on a CRT monitor.")]
|
||||||
[Range(1, 12)]
|
[Range(1, 12)]
|
||||||
|
@ -166,17 +169,17 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
|
|
||||||
[DisplayName("Automap Totals")]
|
[DisplayName("Automap Totals")]
|
||||||
[Description("Shows counts for kills, items, and secrets on automap.")]
|
[Description("Shows counts for kills, items, and secrets on automap.")]
|
||||||
[DefaultValue(true)]
|
[DefaultValue(false)]
|
||||||
public bool MapTotals { get; set; }
|
public bool MapTotals { get; set; }
|
||||||
|
|
||||||
[DisplayName("Automap Time")]
|
[DisplayName("Automap Time")]
|
||||||
[Description("Shows elapsed time on automap.")]
|
[Description("Shows elapsed time on automap.")]
|
||||||
[DefaultValue(true)]
|
[DefaultValue(false)]
|
||||||
public bool MapTime { get; set; }
|
public bool MapTime { get; set; }
|
||||||
|
|
||||||
[DisplayName("Automap Coordinates")]
|
[DisplayName("Automap Coordinates")]
|
||||||
[Description("Shows in-level coordinates on automap.")]
|
[Description("Shows in-level coordinates on automap.")]
|
||||||
[DefaultValue(true)]
|
[DefaultValue(false)]
|
||||||
public bool MapCoordinates { get; set; }
|
public bool MapCoordinates { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -193,8 +196,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
public DoomSettings Clone()
|
public DoomSettings Clone()
|
||||||
=> (DoomSettings)MemberwiseClone();
|
=> (DoomSettings)MemberwiseClone();
|
||||||
|
|
||||||
public static bool NeedsReboot(DoomSettings x, DoomSettings y)
|
public static bool NeedsReboot(DoomSettings x, DoomSettings y) => false;
|
||||||
=> !DeepEquality.DeepEquals(x, y);
|
|
||||||
}
|
}
|
||||||
public PutSettingsDirtyBits PutSettings(DoomSettings o)
|
public PutSettingsDirtyBits PutSettings(DoomSettings o)
|
||||||
{
|
{
|
||||||
|
@ -204,6 +206,7 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
if (_settings.DisplayPlayer == 2 && !_syncSettings.Player2Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
if (_settings.DisplayPlayer == 2 && !_syncSettings.Player2Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
||||||
if (_settings.DisplayPlayer == 3 && !_syncSettings.Player3Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
if (_settings.DisplayPlayer == 3 && !_syncSettings.Player3Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
||||||
if (_settings.DisplayPlayer == 4 && !_syncSettings.Player4Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
if (_settings.DisplayPlayer == 4 && !_syncSettings.Player4Present) throw new Exception($"Trying to set display player '{_settings.DisplayPlayer}' but it is not active in this movie.");
|
||||||
|
_settings.DoUpdate = true;
|
||||||
return ret ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None;
|
return ret ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
|
Console.WriteLine($"Reserving {totalWadSizeKb}kb for WAD file memory");
|
||||||
|
|
||||||
string hudMode = "";
|
string hudMode = "";
|
||||||
|
|
||||||
switch (_settings.HeadsUpMode)
|
switch (_settings.HeadsUpMode)
|
||||||
{
|
{
|
||||||
case HudMode.Vanilla:
|
case HudMode.Vanilla:
|
||||||
|
|
|
@ -59,8 +59,19 @@ namespace BizHawk.Emulation.Cores.Computers.Doom
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public struct PackedRenderInfo
|
public struct PackedRenderInfo
|
||||||
{
|
{
|
||||||
|
public int DoUpdate;
|
||||||
public int RenderVideo;
|
public int RenderVideo;
|
||||||
public int RenderAudio;
|
public int RenderAudio;
|
||||||
|
public int ScaleFactor;
|
||||||
|
public int Gamma;
|
||||||
|
public int ShowMessages;
|
||||||
|
public int ReportSecrets;
|
||||||
|
public int HeadsUpMode;
|
||||||
|
public int DsdaExHud;
|
||||||
|
public int DisplayCommands;
|
||||||
|
public int MapTotals;
|
||||||
|
public int MapTime;
|
||||||
|
public int MapCoordinates;
|
||||||
public int PlayerPointOfView;
|
public int PlayerPointOfView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,26 @@ ECL_EXPORT void dsda_get_video(int *w, int *h, int *pitch, uint8_t **buffer, int
|
||||||
|
|
||||||
ECL_EXPORT bool dsda_frame_advance(CommonButtons commonButtons, struct PackedPlayerInput *player1Inputs, struct PackedPlayerInput *player2Inputs, struct PackedPlayerInput *player3Inputs, struct PackedPlayerInput *player4Inputs, struct PackedRenderInfo *renderInfo)
|
ECL_EXPORT bool dsda_frame_advance(CommonButtons commonButtons, struct PackedPlayerInput *player1Inputs, struct PackedPlayerInput *player2Inputs, struct PackedPlayerInput *player3Inputs, struct PackedPlayerInput *player4Inputs, struct PackedRenderInfo *renderInfo)
|
||||||
{
|
{
|
||||||
|
if (renderInfo->DoUpdate)
|
||||||
|
{
|
||||||
|
char setting_buffer[512];
|
||||||
|
sprintf(setting_buffer, "%dx%d", NATIVE_X * renderInfo->ScaleFactor, NATIVE_Y * renderInfo->ScaleFactor);
|
||||||
|
dsda_UpdateStringConfig(dsda_config_screen_resolution, setting_buffer, true);
|
||||||
|
printf("dsda_config_screen_resolution = %s\n", setting_buffer);
|
||||||
|
|
||||||
|
dsda_UpdateIntConfig(dsda_config_screenblocks, renderInfo->HeadsUpMode ? 11 : 10, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_hud_displayed, renderInfo->HeadsUpMode == 2 ? 0 : 1, true);
|
||||||
|
|
||||||
|
dsda_UpdateIntConfig(dsda_config_usegamma, renderInfo->Gamma, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_show_messages, renderInfo->ShowMessages, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_hudadd_secretarea, renderInfo->ReportSecrets, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_exhud, renderInfo->DsdaExHud, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_command_display, renderInfo->DisplayCommands, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_map_totals, renderInfo->MapTotals, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_map_time, renderInfo->MapTime, true);
|
||||||
|
dsda_UpdateIntConfig(dsda_config_map_coordinates, renderInfo->MapCoordinates, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Setting inputs
|
// Setting inputs
|
||||||
headlessClearTickCommand();
|
headlessClearTickCommand();
|
||||||
common_input(commonButtons);
|
common_input(commonButtons);
|
||||||
|
|
|
@ -90,6 +90,12 @@ enum MemoryArrayType
|
||||||
ARRAY_SECTORS = 2
|
ARRAY_SECTORS = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum NativeResolution
|
||||||
|
{
|
||||||
|
NATIVE_X = 320,
|
||||||
|
NATIVE_Y = 200
|
||||||
|
};
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
|
@ -150,8 +156,19 @@ struct PackedPlayerInput
|
||||||
|
|
||||||
struct PackedRenderInfo
|
struct PackedRenderInfo
|
||||||
{
|
{
|
||||||
|
int DoUpdate;
|
||||||
int RenderVideo;
|
int RenderVideo;
|
||||||
int RenderAudio;
|
int RenderAudio;
|
||||||
|
int ScaleFactor;
|
||||||
|
int Gamma;
|
||||||
|
int ShowMessages;
|
||||||
|
int ReportSecrets;
|
||||||
|
int HeadsUpMode;
|
||||||
|
int DsdaExHud;
|
||||||
|
int DisplayCommands;
|
||||||
|
int MapTotals;
|
||||||
|
int MapTime;
|
||||||
|
int MapCoordinates;
|
||||||
int PlayerPointOfView;
|
int PlayerPointOfView;
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue