Skip to content

Partial changelog for ApiHawk

James Groom edited this page Sep 17, 2024 · 57 revisions

2.9.1 to 2.10 dev (note: changes to ApiHawk in dev builds may not make it into the next release):

  • meta: The .NET 8 SDK is now required for working with BizHawk. The VS installer will automatically include this with VS2022 updates.
  • Fix confusing failures when an ApiContainer prop is accidentally marked with [RequiredApi]/[OptionalApi]. commit
  • Ext. tools now receive ToolFormUpdateType.General events regularly while paused (and while unpaused! you should have been checking the enum anyway). commit
    • If you're subclassing ToolFormBase, this will have no impact on your existing code, but you can choose to override GeneralUpdate to make use of it.
  • Fix signature of IMemoryApi.WriteFloat (the value param is now float and not double—the implementation was converting it to a float anyway). commit
  • Add an overload IGuiApi.WithSurface(DisplaySurfaceID, Action<IGuiApi>) and deprecate the old one. commit
    • For the time being, there will be no difference between using the lambda parameter as instructed, and discarding it and continuing to make calls to whatever IGuiApi instance you were using.
  • Remove the deprecated IGameInfoApi library. commit
  • Remove the deprecated attributes [RomWhitelist], [SingleRom(CoreSystem, string)], and [SingleSystem(CoreSystem)]. commit
  • Rewrite most of GuiApi (the implementation of IGuiApi). Parity with the old implementation is a goal, but there may be bugs. TODO link commit(s)

2.9 to 2.9.1:

  • (no changes)

2.8 to 2.9:

  • Change return type of IEmulationApi.GetRegisters and IMovieApi.GetHeader from Dictionary to IReadOnlyDictionary, and change return type of IMovie.GetComments and IMovie.GetSubtitles from List to IReadOnlyList. commit
  • Remove useless yield methods from IEmulationApi. commit
  • Merge IGameInfoApi into IEmulationApi. IGameInfoApi will remain with a deprecation warning for a while. commit
  • Deprecate constructors for ExternalToolApplicability.* attributes which take a CoreSystem enum in favour of new overloads which take a string. commit
    • You should use the constants in VSystemID.Raw, like in the HelloWorld sample (see linked commit), rather than string literals.
  • Rename RomWhitelist to RomList. commit
  • Change return type of IEmulationApi.Disassemble to (string, int) tuple. commit
  • Change SocketServer.SendScreenshot to include the same length prefix in its sent message as SendString. commit
  • Add IUserDataApi.Keys. commit
  • Change the return type of IMemoryApi.ReadByteRange from List<byte> to IReadOnlyList<byte>, the type of the memoryblock param of IMemoryApi.WriteByteRange from List<byte> to IReadOnlyList<byte>, and the return type of IMemoryApi.GetMemoryDomainList from List<string> to IReadOnlyCollection<string>. commit
  • Change the return type of IEmuClientApi.LoadState, IEmuClientApi.OpenRom, ISaveStateApi.Load, and ISaveStateApi.LoadSlot from void to bool. commit 1, commit 2
  • Deprecate IGuiApi.DrawText in favour of new method PixelText (to match Lua). commit
  • Change ApiContainer.MemoryEvents and ApiContainer.MemorySaveState to return null instead of throwing if the loaded core doesn't support the necessary features. commit

2.7 to 2.8:

  • meta: The .NET 6 SDK is now required for working with BizHawk. The VS installer will automatically include this with VS2019 updates.
  • Use int? in IJoypadApi.SetAnalog overloads (instead of object) to match Set overloads. commit
  • Add optional duration param to IGuiApi.AddMessage (overrides config for a single call). commit
  • Add IInputApi.GetPressedButtons, deprecating IInputApi.Get. commit
  • Add IInputApi.GetPressedAxes. commit
  • Change return type of IInputApi.GetMouse from Dictionary to IReadOnlyDictionary. commit

2.6.3 to 2.7:

  • Add IEmuClientApi.GetApproxFramerate. commit
  • Encode screenshots as JPEG if file extension is ".jpg". commit
  • Add VSystemID.Raw class (to complement the CoreNames class). You can use it when applying [ExternalToolApplicability.*] to your tool, or when calling IEmulationApi.GetSystemId. commit
  • Replace Dictionary/IDictionary with IReadOnlyDictionary in these methods' signatures: IGameInfo.GetOptions, IJoypadApi.Get, IJoypadApi.GetImmediate, IJoypadApi.GetWithMovie, IJoypadApi.Set, IJoypadApi.SetAnalog, and IMovieApi.GetInput. commit
  • Merged various IGameInfoApi methods into a single IGameInfo? GetGameInfo() which then has the same properties exposed. commit

2.6.2 to 2.6.3:

  • Add ICommApi.MMF.ReadBytesFromFile. commit
  • Allow using most of ICommApi.MMF w/o passing --mmf on the command-line. commit

2.6.1 to 2.6.2:

  • Remove methods IEmuClientApi.GetInput and IEmuClientApi.SetInput. If you were using these, you may find a lot of missing types when updating. IInputApi (host) and IJoypadApi (virtual), which were the preferred choice, are now the only public APIs for input. commit
  • Change encoding used by SocketServer from ASCII to UTF-8. commit
  • Add params to SocketServer.SendString and SocketServer.ReceiveMessage for overriding the default encoding. commit
  • Change SocketServer.SendString to prefix the sent message with length, and change SocketServer.ReceiveMessage (now renamed ReceiveString) to expect the same. commit
    • You can still use SocketServer.SendBytes to send arbitrary messages, though at that point you might as well ditch the whole wrapper. It's only needed for Lua.
    • SocketServer.SendScreenshot was missed, so it does not prefix the sent message with length, though it does expect the received message to be prefixed.
  • Refactor some abstract properties in IToolForm (superinterface of IExternalToolForm). commit
    • This is to make the semantics of "hidden"/"background" tools clearer. If you plan making your tool run in the background, look to the sole example of RAM Watch (in the linked commit).
    • If your tool has EmuHawk.ToolFormBase as a supertype, no change is required.

2.6 to 2.6.1:

  • (no changes)

2.5.2 to 2.6:

  • meta: The .NET 5 SDK is now required for working with BizHawk. The VS installer will automatically include this with VS2019 updates.
  • Add get-only prop IToolApi.AvailableTools of type IEnumerable<Type>. commit
  • Allow disabling frame skip by passing 0 to IEmuClient.FrameSkip. commit
  • Remove parameter from internal-use method IEmuClient.OnRomLoaded, and remove internal-use method IEmuClient.UpdateEmulatorAndVP. commit
  • Allow ext. tools to have a single prop ApiContainer? _apiContainer which is set by EmuHawk, so multiple [RequiredApi] props can be replaced with one. commit
  • Change Type IToolApi.GetTool() to IToolForm IToolApi.GetTool() (it now returns the tool instance as expected, instead of the type). commit
  • Add get-only prop IMemoryApi.MainMemoryName of type string. As the main memory domain isn't always the first one, using this prop will guarantee using the correct domain (this brings feature-parity with Lua as the mainmemory lib has always done this). commit
  • Removed ClientApi (the static one). Make sure you're using an instance of IEmuClientApi! commit
  • Removed [BizHawkExternalTool] and [BizHawkExternalToolUsage] (previously deprecated in favour of [ExternalTool] and [ExternalToolApplicability.*]). commit
  • Added an enum param to most IGuiApi methods, which is the surface on which to draw. Passing this for every draw call is a bit annoying though, so there's also... commit
  • Added IGuiApi.WithSurface, which takes an enum (the surface) and an Action (put your draw calls in here, leaving the surface as the default null). commit
  • Deprecated IGuiApi.DrawNew, IGuiApi.DrawFinish, and IGuiApi.HasGUISurface. commit

2.5.1 to 2.5.2:

  • (no changes)

2.5 to 2.5.1:

  • Change signatures of some IJoypadApi methods to use IDictionary<,> instead of Dictionary<,>. commit
  • Change signatures of some IJoypadApi methods to use int? instead of float? or float. commit

2.4.2 to 2.5:

  • IToolForm (which IExternalToolForm inherits from) was changed so all the update callbacks are now consolidated. This should make it easier to manage once-per-frame processing. commit 1, commit 2
  • You can now ship dependencies! A string[] parameter LoadAssemblyFiles was added to [ExternalTool], just put the filenames in there. Make sure your users put the extra assemblies in the ext. tool dir alongside your tool before they try loading it. commit
  • (no commits for these sorry, they're all over the place)
    • Rename API types:
      • ICommICommApi
      • IEmuIEmulationApi
      • IGameInfoIGameInfoApi
      • IGuiIGuiApi
      • IInputIInputApi
      • IInputMovieIMovieApi
      • IJoypadIJoypadApi
      • IMemIMemoryApi
      • IMemEventsIMemoryEventsApi
      • IMemorySaveStateIMemorySaveStateApi
      • ISaveStateISaveStateApi
      • ISqlISQLiteApi
      • IToolIToolApi
      • IUserDataIUserDataApi
    • Replace ClientApi with IEmuClientApi (which is an IExternalApi; a static ClientApi is still present to make migration easier).
    • Remove most of ICommApi (fmr. IComm), and expose the helper classes which were previously used in their implementations.
    • As usual, a bunch of types were moved around (mostly from BizHawk.Client.EmuHawk to BizHawk.Client.Common). You may have to update your usings or <Reference/>s.
  • Add overloads for IGuiApi.DrawImage/IGuiApi.DrawImageRegion (fmr. IGui.DrawImage/IGui.DrawImageRegion) that take Images instead of filenames. commit
  • IMovieApi.Length (fmr. IInputMovie.Length) now returns int instead of double. commit
  • Remove IEmuClientApi.UnpauseEmulation (fmr. ClientApi.UnpauseEmulation). It was a duplicate of IEmuClientApi.Unpause, so use that. commit
  • Rename IEmuClientApi.SetExtraPadding (fmr. ClientApi.SetExtraPadding) to SetClientExtraPadding. commit
  • Remove IEmuClientApi.CloseEmulatorWithCode (fmr. ClientApi.CloseEmulatorWithCode). IEmuClientApi.CloseEmulator now takes an optional exit code. commit
  • Remove IEmuClientApi.RunningSystem (fmr. ClientApi.RunningSystem). This probably won't affect anyone, as IEmulationApi.GetSystemId is more accurate and has been available for a while. commit

2.4 to 2.4.2:

  • meta: BizHawk.Client.EmuHawk and some other assemblies were updated from .NET Framework 4.6.1 to 4.8; however most are now .NET Standard 2.0 (this is only relevant if your VS installation is older and is missing the new targeting packs)
  • some ApiHawk types changed namespace to either BizHawk.Client.Common or BizHawk.Client.EmuHawk (the BizHawk.Client.ApiHawk namespace and assembly was removed entirely): commit 1, commit 2
  • attributes are nicer; using a new attribute, IETFs can be called anything: commit 1, commit 2, commit 3
  • IETFs can be in any namespace
  • return type of IEmu.PutSettings was changed from bool to a flag-type enum PutSettingsDirtyBits
  • return types of IInput.GetMouse, IInputMovie.GetInput, IJoypad.Get, IJoypad.GetImmediate, and ISql.ReadCommand now use object instead of dynamic
  • return type of IGui.GetPadding was changed from Padding to ValueTuple<int, int, int, int>
  • some bugs were fixed idk check the commit history
Clone this wiki locally