Files
MesenCE/Core/Netplay/GameInformationMessage.h
NovaSquirrelandSour 325c78fcbd GB: Link cable support with two local consoles (#77)
* GB: Link cable support with two local consoles

* GB: Fix crash when color blending is enabled

* GB: Fix formatting

* GB: Link UI fixes, control fixes, audio fixes

Copied from Sour's branch. Also a separate change to use separate savefiles.

* GB: Try to avoid crashes from buffer overflows

* GB: Separate savefiles with linked multiplayer

* GB: Add support for faster link speed

* GB: Move enum to correct file

* GB: Refactor, move serial transfer to function

* -Fixed secondary console sometimes running far ahead of the main console when frame counters did not match (e.g because one console had their LCD disabled longer, etc.) This would cause buffer overflows in the audio buffer.
-Fixed screen tearing when both consoles are not perfectly in sync (because of the LCD being disabled for a different amount of time, etc.)
-Fixed main console not calling PlayQueuedAudio properly mid-frame
-Reuse VS Dualsystem code to merge audio/video when possible/simple and moved that to AvMergeUtilities

Some visual glitches can appear on the secondary screen (for GB) while rewinding, but this can't really be fixed.

* Fixed warning (unused local variable)

* Prevent loading single-console save states when in dual-console modes

* Disable debugger for VS DualSystem's subconsole. Fixes issues when debugging VS DualSystem games

* Code cleanup

* Rework solution to disable debugger on second console to improve performance
Added InternalRunFrame for nes & gb to avoid checking for the presence of the second console after each cpu instruction

* Don't enable the linked GB option by default

* Removed unused function

* Netplay: Force game to reload after updating emulation settings when connecting to the server (or when the host changes game)
This ensures that e.g the GB link cable setting is applied and that the game loads correctly, regardless of the client's link cable settings (otherwise the game could load without the link mode enabled, etc.)

---------

Co-authored-by: Sour <[email protected]>
2026-05-15 02:35:27 -07:00

64 lines
1.2 KiB
C++

#pragma once
#include "pch.h"
#include "Shared/EmuSettings.h"
#include "Netplay/NetMessage.h"
#include "Netplay/NetplayTypes.h"
#include "Utilities/FolderUtilities.h"
class GameInformationMessage : public NetMessage
{
private:
string _romFilename;
uint32_t _crc32 = 0;
NetplayControllerInfo _controller = {};
bool _paused = false;
EmuSettings* _settings = nullptr;
protected:
void Serialize(Serializer& s) override
{
if(_settings) {
SV(*_settings);
}
SV(_romFilename);
SV(_crc32);
SV(_controller.Port);
SV(_controller.SubPort);
SV(_paused);
}
public:
GameInformationMessage(EmuSettings* settings, void* buffer, uint32_t length) : NetMessage(buffer, length)
{
_settings = settings;
}
GameInformationMessage(EmuSettings* settings, string filepath, uint32_t crc32, NetplayControllerInfo controller, bool paused) : NetMessage(MessageType::GameInformation)
{
_settings = settings;
_romFilename = FolderUtilities::GetFilename(filepath, true);
_crc32 = crc32;
_controller = controller;
_paused = paused;
}
NetplayControllerInfo GetPort()
{
return _controller;
}
string GetRomFilename()
{
return _romFilename;
}
uint32_t GetCrc32()
{
return _crc32;
}
bool IsPaused()
{
return _paused;
}
};