Skip to content

Commit

Permalink
set octoshock fps overrides to mednafen values (#1781)
Browse files Browse the repository at this point in the history
* set octoshock fps overrides to mednafen values

game version should not be a required field for submission

* remove GameVersion initialization

* random typo
  • Loading branch information
vadosnaprimer authored Mar 3, 2024
1 parent 79667e1 commit 84c264a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions TASVideos.Parsers/Parsers/Bk2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ internal class Bk2 : ParserBase, IParser
private const double NtscNesFramerate = 60.0988138974405;
private const double NtscSnesFramerate = 60.0988138974405;
private const double PalSnesFramerate = 50.0069789081886;
// mednafen values to match current octoshock

Check warning on line 16 in TASVideos.Parsers/Parsers/Bk2.cs

View workflow job for this annotation

GitHub Actions / build

private const double NtscPsxFramerate = 59.94006013870239;
private const double PalPsxFramerate = 50.00028192996979;

protected virtual string[] InvalidArchiveEntries => new[]
{
Expand Down Expand Up @@ -180,6 +183,14 @@ public async Task<IParseResult> Parse(Stream file, long length)
}
}

// TASVideos.Core\Services\QueueService.cs line 433 implies we only ever have a list of framerates for cores with framerate overrides, but it doesn't distinguish by core. nymashock has cycle count but octoshock has to rely on mednafen framerates for now. so we override with a constant for octoshock, to prevent picking random wrong values from nymashock overrides
if (core == "octoshock")
{
result.FrameRateOverride = result.Region == RegionType.Pal
? PalPsxFramerate
: NtscPsxFramerate;
}

if (result.CycleCount.HasValue)
{
if (ValidClockRates.Contains(clockRate))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class SubmissionCreateModel
{
[Display(Name = "Game Version", Description = "Example: USA")]
[StringLength(20)]
public string GameVersion { get; set; } = "";
public string? GameVersion { get; set; }

[Display(Name = "Game Name", Description = "Example: Mega Man 2")]
[StringLength(100)]
Expand Down
2 changes: 1 addition & 1 deletion TASVideos/Pages/Systems/EditFramerate.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task<IActionResult> OnPost()
await ConcurrentSave(
_db,
$"FrameRate {displayName} updated.",
$"Unable to updated {displayName} due to an unknown error");
$"Unable to update {displayName} due to an unknown error");
await _gameSystemService.FlushCache();
return BasePageRedirect("Edit", new { Id = FrameRate.SystemId });
}
Expand Down

0 comments on commit 84c264a

Please sign in to comment.