2015-07-02 03:17:14 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
#include "../Core/MessageManager.h"
|
|
|
|
#include "../Core/Console.h"
|
|
|
|
#include "../Windows/Renderer.h"
|
|
|
|
#include "../Windows/SoundManager.h"
|
2015-07-11 01:07:24 +00:00
|
|
|
#include "../Windows/WindowsKeyManager.h"
|
2015-07-02 03:17:14 +00:00
|
|
|
#include "../Core/GameServer.h"
|
|
|
|
#include "../Core/GameClient.h"
|
|
|
|
#include "../Core/ClientConnectionData.h"
|
|
|
|
#include "../Core/SaveStateManager.h"
|
2015-07-05 23:05:33 +00:00
|
|
|
#include "../Core/CheatManager.h"
|
2015-07-18 00:58:57 +00:00
|
|
|
#include "../Core/EmulationSettings.h"
|
2015-07-24 03:16:31 +00:00
|
|
|
#include "../Core/VideoDecoder.h"
|
2015-12-26 22:11:00 +00:00
|
|
|
#include "../Core/AutoRomTest.h"
|
2016-01-29 01:47:16 +00:00
|
|
|
#include "../Core/FDS.h"
|
2016-05-01 00:08:53 +00:00
|
|
|
#include "../Core/VsControlManager.h"
|
2016-06-05 18:36:20 +00:00
|
|
|
#include "../Core/SoundMixer.h"
|
2016-06-18 00:53:05 +00:00
|
|
|
#include "../Core/RomLoader.h"
|
2015-07-02 03:17:14 +00:00
|
|
|
|
2015-12-26 22:11:00 +00:00
|
|
|
NES::Renderer *_renderer = nullptr;
|
|
|
|
SoundManager *_soundManager = nullptr;
|
|
|
|
HWND _windowHandle = nullptr;
|
|
|
|
HWND _viewerHandle = nullptr;
|
|
|
|
string _returnString;
|
2016-06-19 20:54:34 +00:00
|
|
|
string _logString;
|
2015-12-26 22:11:00 +00:00
|
|
|
AutoRomTest *_autoRomTest = nullptr;
|
2015-07-02 03:17:14 +00:00
|
|
|
|
|
|
|
typedef void (__stdcall *NotificationListenerCallback)(int);
|
|
|
|
|
|
|
|
namespace InteropEmu {
|
|
|
|
class InteropNotificationListener : public INotificationListener
|
|
|
|
{
|
|
|
|
NotificationListenerCallback _callback;
|
|
|
|
public:
|
|
|
|
InteropNotificationListener(NotificationListenerCallback callback)
|
|
|
|
{
|
|
|
|
_callback = callback;
|
|
|
|
}
|
|
|
|
|
2015-12-26 22:11:00 +00:00
|
|
|
void ProcessNotification(ConsoleNotificationType type, void* parameter)
|
2015-07-02 03:17:14 +00:00
|
|
|
{
|
|
|
|
_callback((int)type);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-06-18 00:53:05 +00:00
|
|
|
struct RomInfo
|
|
|
|
{
|
|
|
|
const char* RomName;
|
|
|
|
uint32_t Crc32;
|
|
|
|
};
|
|
|
|
|
2015-07-02 03:17:14 +00:00
|
|
|
extern "C" {
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall TestDll()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-02-09 04:23:31 +00:00
|
|
|
DllExport uint32_t __stdcall GetMesenVersion() { return EmulationSettings::GetMesenVersion(); }
|
|
|
|
|
2015-12-30 01:54:55 +00:00
|
|
|
DllExport void __stdcall InitializeEmu(const char* homeFolder, HWND windowHandle, HWND dxViewerHandle)
|
2015-07-02 03:17:14 +00:00
|
|
|
{
|
2015-07-05 23:21:49 +00:00
|
|
|
FolderUtilities::SetHomeFolder(homeFolder);
|
|
|
|
|
2015-08-23 15:45:13 +00:00
|
|
|
if(windowHandle != nullptr && dxViewerHandle != nullptr) {
|
|
|
|
_windowHandle = windowHandle;
|
|
|
|
_viewerHandle = dxViewerHandle;
|
2015-07-02 03:17:14 +00:00
|
|
|
|
2015-08-23 15:45:13 +00:00
|
|
|
_renderer = new NES::Renderer(_viewerHandle);
|
|
|
|
_soundManager = new SoundManager(_windowHandle);
|
2015-07-11 01:07:24 +00:00
|
|
|
|
2015-08-23 15:45:13 +00:00
|
|
|
ControlManager::RegisterKeyManager(new WindowsKeyManager(_windowHandle));
|
2015-07-11 01:07:24 +00:00
|
|
|
}
|
2015-07-02 03:17:14 +00:00
|
|
|
}
|
|
|
|
|
2016-02-14 17:58:35 +00:00
|
|
|
DllExport bool __stdcall IsRunning() { return Console::IsRunning(); }
|
|
|
|
|
2016-06-18 00:53:05 +00:00
|
|
|
DllExport void __stdcall LoadROM(char* filename, int32_t archiveFileIndex) { Console::LoadROM(filename, nullptr, archiveFileIndex); }
|
2015-12-27 23:41:38 +00:00
|
|
|
DllExport void __stdcall ApplyIpsPatch(char* filename) { Console::ApplyIpsPatch(filename); }
|
2015-07-11 12:27:22 +00:00
|
|
|
DllExport void __stdcall AddKnowGameFolder(char* folder) { FolderUtilities::AddKnowGameFolder(folder); }
|
2015-07-06 02:23:44 +00:00
|
|
|
|
2016-06-18 00:53:05 +00:00
|
|
|
DllExport const char* __stdcall GetArchiveRomList(char* filename) {
|
|
|
|
std::ostringstream out;
|
|
|
|
for(string romName : RomLoader::GetArchiveRomList(filename)) {
|
|
|
|
out << romName << "/";
|
|
|
|
}
|
|
|
|
_returnString = out.str();
|
|
|
|
return _returnString.c_str();
|
|
|
|
}
|
|
|
|
|
2016-02-06 04:14:27 +00:00
|
|
|
DllExport void __stdcall SetControllerType(uint32_t port, ControllerType type) { EmulationSettings::SetControllerType(port, type); }
|
|
|
|
DllExport void __stdcall SetControllerKeys(uint32_t port, KeyMappingSet mappings) { EmulationSettings::SetControllerKeys(port, mappings); }
|
|
|
|
DllExport void __stdcall SetExpansionDevice(ExpansionPortDevice device) { EmulationSettings::SetExpansionDevice(device); }
|
|
|
|
DllExport void __stdcall SetConsoleType(ConsoleType type) { EmulationSettings::SetConsoleType(type); }
|
|
|
|
|
2016-02-14 17:58:35 +00:00
|
|
|
DllExport bool __stdcall HasZapper() { return EmulationSettings::HasZapper(); }
|
|
|
|
DllExport bool __stdcall HasArkanoidPaddle() { return EmulationSettings::HasArkanoidPaddle(); }
|
|
|
|
|
|
|
|
DllExport void __stdcall SetMousePosition(double x, double y) { ControlManager::SetMousePosition(x, y); }
|
2015-07-11 01:07:24 +00:00
|
|
|
|
|
|
|
DllExport uint32_t __stdcall GetPressedKey() { return ControlManager::GetPressedKey(); }
|
2015-07-11 12:27:22 +00:00
|
|
|
DllExport const char* __stdcall GetKeyName(uint32_t keyCode)
|
|
|
|
{
|
|
|
|
_returnString = ControlManager::GetKeyName(keyCode);
|
|
|
|
return _returnString.c_str();
|
|
|
|
}
|
2016-02-06 04:14:27 +00:00
|
|
|
DllExport uint32_t __stdcall GetKeyCode(char* keyName) {
|
|
|
|
if(keyName) {
|
|
|
|
return ControlManager::GetKeyCode(keyName);
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2015-07-11 01:07:24 +00:00
|
|
|
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall Run()
|
|
|
|
{
|
|
|
|
if(Console::GetInstance()) {
|
|
|
|
Console::GetInstance()->Run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-18 00:58:57 +00:00
|
|
|
DllExport void __stdcall Resume() { EmulationSettings::ClearFlags(EmulationFlags::Paused); }
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall IsPaused() { return EmulationSettings::CheckFlag(EmulationFlags::Paused); }
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall Stop()
|
|
|
|
{
|
|
|
|
if(Console::GetInstance()) {
|
|
|
|
Console::GetInstance()->Stop();
|
|
|
|
}
|
|
|
|
}
|
2016-06-18 00:53:05 +00:00
|
|
|
|
|
|
|
DllExport const void __stdcall GetRomInfo(RomInfo &romInfo, char* filename, int32_t archiveFileIndex)
|
2015-07-05 23:05:33 +00:00
|
|
|
{
|
2016-06-18 00:53:05 +00:00
|
|
|
string romPath = filename;
|
|
|
|
if(romPath.empty()) {
|
|
|
|
_returnString = Console::GetRomName();
|
|
|
|
romInfo.RomName = _returnString.c_str();
|
|
|
|
romInfo.Crc32 = Console::GetCrc32();
|
|
|
|
} else {
|
|
|
|
RomLoader romLoader;
|
|
|
|
if(romLoader.LoadFile(filename, nullptr, "", archiveFileIndex)) {
|
|
|
|
RomData romData = romLoader.GetRomData();
|
|
|
|
|
|
|
|
_returnString = romData.RomName;
|
|
|
|
romInfo.RomName = _returnString.c_str();
|
|
|
|
romInfo.Crc32 = romData.Crc32;
|
|
|
|
}
|
|
|
|
}
|
2015-07-05 23:05:33 +00:00
|
|
|
}
|
|
|
|
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall Reset() { Console::Reset(); }
|
|
|
|
|
2016-02-06 20:33:45 +00:00
|
|
|
DllExport void __stdcall StartServer(uint16_t port, char* hostPlayerName) { GameServer::StartServer(port, hostPlayerName); }
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall StopServer() { GameServer::StopServer(); }
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall IsServerRunning() { return GameServer::Started(); }
|
2015-07-02 03:17:14 +00:00
|
|
|
|
2016-02-06 20:33:45 +00:00
|
|
|
DllExport void __stdcall Connect(char* host, uint16_t port, char* playerName, uint8_t* avatarData, uint32_t avatarSize, bool spectator)
|
2015-07-02 03:17:14 +00:00
|
|
|
{
|
|
|
|
shared_ptr<ClientConnectionData> connectionData(new ClientConnectionData(
|
|
|
|
host,
|
|
|
|
port,
|
|
|
|
playerName,
|
|
|
|
avatarData,
|
2016-02-06 20:33:45 +00:00
|
|
|
avatarSize,
|
|
|
|
spectator
|
|
|
|
));
|
2015-07-02 03:17:14 +00:00
|
|
|
|
|
|
|
GameClient::Connect(connectionData);
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall Disconnect() { GameClient::Disconnect(); }
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall IsConnected() { return GameClient::Connected(); }
|
2016-02-06 20:33:45 +00:00
|
|
|
DllExport ControllerType __stdcall NetPlayGetControllerType(int32_t port) { return EmulationSettings::GetControllerType(port); }
|
|
|
|
|
|
|
|
DllExport int32_t __stdcall NetPlayGetAvailableControllers()
|
|
|
|
{
|
|
|
|
if(GameServer::Started()) {
|
|
|
|
return GameServer::GetAvailableControllers();
|
|
|
|
} else {
|
|
|
|
return GameClient::GetAvailableControllers();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall NetPlaySelectController(int32_t port)
|
|
|
|
{
|
|
|
|
if(GameServer::Started()) {
|
|
|
|
return GameServer::SetHostControllerPort(port);
|
|
|
|
} else {
|
|
|
|
return GameClient::SelectController(port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport int32_t __stdcall NetPlayGetControllerPort()
|
|
|
|
{
|
|
|
|
if(GameServer::Started()) {
|
|
|
|
return GameServer::GetHostControllerPort();
|
|
|
|
} else {
|
|
|
|
return GameClient::GetControllerPort();
|
|
|
|
}
|
|
|
|
}
|
2015-07-02 03:17:14 +00:00
|
|
|
|
|
|
|
DllExport void __stdcall Pause()
|
|
|
|
{
|
|
|
|
if(!IsConnected()) {
|
2015-07-18 00:58:57 +00:00
|
|
|
EmulationSettings::SetFlags(EmulationFlags::Paused);
|
2015-07-02 03:17:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall Release()
|
|
|
|
{
|
2015-07-21 03:20:41 +00:00
|
|
|
Console::Release();
|
2015-07-02 03:17:14 +00:00
|
|
|
GameServer::StopServer();
|
|
|
|
GameClient::Disconnect();
|
|
|
|
MessageManager::RegisterMessageManager(nullptr);
|
|
|
|
delete _renderer;
|
|
|
|
delete _soundManager;
|
|
|
|
}
|
|
|
|
|
2016-06-18 00:53:05 +00:00
|
|
|
DllExport void __stdcall TakeScreenshot() { VideoDecoder::GetInstance()->TakeScreenshot(); }
|
2015-07-02 03:17:14 +00:00
|
|
|
|
|
|
|
DllExport INotificationListener* __stdcall RegisterNotificationCallback(NotificationListenerCallback callback)
|
|
|
|
{
|
|
|
|
INotificationListener* listener = new InteropNotificationListener(callback);
|
|
|
|
MessageManager::RegisterNotificationListener(listener);
|
|
|
|
return listener;
|
|
|
|
}
|
|
|
|
DllExport void __stdcall UnregisterNotificationCallback(INotificationListener *listener) { MessageManager::UnregisterNotificationListener(listener); }
|
|
|
|
|
2016-02-19 18:05:04 +00:00
|
|
|
DllExport void __stdcall DisplayMessage(char* title, char* message, char* param1) { MessageManager::DisplayMessage(title, message, param1 ? param1 : ""); }
|
2016-06-19 20:54:34 +00:00
|
|
|
DllExport const char* __stdcall GetLog()
|
|
|
|
{
|
|
|
|
_logString = MessageManager::GetLog();
|
|
|
|
return _logString.c_str();
|
|
|
|
}
|
2015-07-05 23:05:33 +00:00
|
|
|
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall SaveState(uint32_t stateIndex) { SaveStateManager::SaveState(stateIndex); }
|
|
|
|
DllExport uint32_t __stdcall LoadState(uint32_t stateIndex) { return SaveStateManager::LoadState(stateIndex); }
|
|
|
|
DllExport int64_t __stdcall GetStateInfo(uint32_t stateIndex) { return SaveStateManager::GetStateInfo(stateIndex); }
|
|
|
|
|
2015-07-11 12:27:22 +00:00
|
|
|
DllExport void __stdcall MoviePlay(char* filename) { Movie::Play(filename); }
|
2015-08-02 23:27:02 +00:00
|
|
|
DllExport void __stdcall MovieRecord(char* filename, bool reset) { Movie::Record(filename, reset); }
|
2015-07-02 03:17:14 +00:00
|
|
|
DllExport void __stdcall MovieStop() { Movie::Stop(); }
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall MoviePlaying() { return Movie::Playing(); }
|
|
|
|
DllExport bool __stdcall MovieRecording() { return Movie::Recording(); }
|
2015-07-05 23:05:33 +00:00
|
|
|
|
2016-06-05 18:36:20 +00:00
|
|
|
DllExport void __stdcall WaveRecord(char* filename) { SoundMixer::StartRecording(filename); }
|
|
|
|
DllExport void __stdcall WaveStop() { SoundMixer::StopRecording(); }
|
|
|
|
DllExport bool __stdcall WaveIsRecording() { return SoundMixer::IsRecording(); }
|
|
|
|
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport int32_t __stdcall RomTestRun(char* filename)
|
2015-12-26 22:11:00 +00:00
|
|
|
{
|
|
|
|
AutoRomTest romTest;
|
|
|
|
return romTest.Run(filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall RomTestRecord(char* filename, bool reset)
|
|
|
|
{
|
|
|
|
if(_autoRomTest) {
|
|
|
|
delete _autoRomTest;
|
|
|
|
}
|
|
|
|
_autoRomTest = new AutoRomTest();
|
|
|
|
_autoRomTest->Record(filename, reset);
|
|
|
|
}
|
|
|
|
|
2015-12-27 14:13:52 +00:00
|
|
|
DllExport void __stdcall RomTestRecordFromMovie(char* testFilename, char* movieFilename)
|
|
|
|
{
|
|
|
|
_autoRomTest = new AutoRomTest();
|
|
|
|
_autoRomTest->RecordFromMovie(testFilename, movieFilename);
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall RomTestRecordFromTest(char* newTestFilename, char* existingTestFilename)
|
|
|
|
{
|
|
|
|
_autoRomTest = new AutoRomTest();
|
|
|
|
_autoRomTest->RecordFromTest(newTestFilename, existingTestFilename);
|
|
|
|
}
|
|
|
|
|
2015-12-26 22:11:00 +00:00
|
|
|
DllExport void __stdcall RomTestStop()
|
|
|
|
{
|
|
|
|
if(_autoRomTest) {
|
|
|
|
_autoRomTest->Stop();
|
|
|
|
delete _autoRomTest;
|
|
|
|
_autoRomTest = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-17 00:33:10 +00:00
|
|
|
DllExport bool __stdcall RomTestRecording() { return _autoRomTest != nullptr; }
|
2015-12-26 22:11:00 +00:00
|
|
|
|
2015-08-02 23:27:02 +00:00
|
|
|
DllExport void __stdcall CheatAddCustom(uint32_t address, uint8_t value, int32_t compareValue, bool isRelativeAddress) { CheatManager::AddCustomCode(address, value, compareValue, isRelativeAddress); }
|
2015-07-05 23:05:33 +00:00
|
|
|
DllExport void __stdcall CheatAddGameGenie(char* code) { CheatManager::AddGameGenieCode(code); }
|
|
|
|
DllExport void __stdcall CheatAddProActionRocky(uint32_t code) { CheatManager::AddProActionRockyCode(code); }
|
|
|
|
DllExport void __stdcall CheatClear() { CheatManager::ClearCodes(); }
|
2015-07-18 00:58:57 +00:00
|
|
|
|
2016-01-07 01:34:45 +00:00
|
|
|
DllExport void __stdcall SetFlags(EmulationFlags flags) { EmulationSettings::SetFlags(flags); }
|
|
|
|
DllExport void __stdcall ClearFlags(EmulationFlags flags) { EmulationSettings::ClearFlags(flags); }
|
2016-02-19 18:05:04 +00:00
|
|
|
DllExport void __stdcall SetDisplayLanguage(Language lang) { EmulationSettings::SetDisplayLanguage(lang); }
|
2015-07-18 00:58:57 +00:00
|
|
|
DllExport void __stdcall SetChannelVolume(uint32_t channel, double volume) { EmulationSettings::SetChannelVolume((AudioChannel)channel, volume); }
|
2016-01-14 06:21:09 +00:00
|
|
|
DllExport void __stdcall SetMasterVolume(double volume) { EmulationSettings::SetMasterVolume(volume); }
|
2016-01-15 00:33:16 +00:00
|
|
|
DllExport void __stdcall SetSampleRate(uint32_t sampleRate) { EmulationSettings::SetSampleRate(sampleRate); }
|
2015-07-18 00:58:57 +00:00
|
|
|
DllExport void __stdcall SetAudioLatency(uint32_t msLatency) { EmulationSettings::SetAudioLatency(msLatency); }
|
2016-02-21 20:31:39 +00:00
|
|
|
DllExport void __stdcall SetStereoFilter(StereoFilter stereoFilter) { EmulationSettings::SetStereoFilter(stereoFilter); }
|
|
|
|
DllExport void __stdcall SetStereoDelay(int32_t delay) { EmulationSettings::SetStereoDelay(delay); }
|
|
|
|
DllExport void __stdcall SetStereoPanningAngle(double angle) { EmulationSettings::SetStereoPanningAngle(angle); }
|
|
|
|
DllExport void __stdcall SetReverbParameters(double strength, double delay) { EmulationSettings::SetReverbParameters(strength, delay); }
|
|
|
|
|
2015-07-22 03:05:27 +00:00
|
|
|
DllExport void __stdcall SetNesModel(uint32_t model) { EmulationSettings::SetNesModel((NesModel)model); }
|
2015-07-24 03:16:31 +00:00
|
|
|
DllExport void __stdcall SetOverscanDimensions(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) { EmulationSettings::SetOverscanDimensions(left, right, top, bottom); }
|
2015-08-25 00:27:07 +00:00
|
|
|
DllExport void __stdcall SetEmulationSpeed(uint32_t emulationSpeed) { EmulationSettings::SetEmulationSpeed(emulationSpeed); }
|
2016-06-12 22:11:31 +00:00
|
|
|
DllExport void __stdcall SetOverclockRate(uint32_t overclockRate, bool adjustApu) { EmulationSettings::SetOverclockRate(overclockRate, adjustApu); }
|
2016-02-07 18:05:32 +00:00
|
|
|
DllExport void __stdcall SetVideoScale(double scale) { EmulationSettings::SetVideoScale(scale); }
|
|
|
|
DllExport void __stdcall SetVideoAspectRatio(VideoAspectRatio aspectRatio) { EmulationSettings::SetVideoAspectRatio(aspectRatio); }
|
2016-01-06 02:28:38 +00:00
|
|
|
DllExport void __stdcall SetVideoFilter(VideoFilterType filter) { EmulationSettings::SetVideoFilterType(filter); }
|
2016-05-24 23:45:58 +00:00
|
|
|
DllExport void __stdcall SetVideoResizeFilter(VideoResizeFilter filter) { EmulationSettings::SetVideoResizeFilter(filter); }
|
2016-01-17 19:21:31 +00:00
|
|
|
DllExport void __stdcall GetRgbPalette(uint32_t *paletteBuffer) { EmulationSettings::GetRgbPalette(paletteBuffer); }
|
|
|
|
DllExport void __stdcall SetRgbPalette(uint32_t *paletteBuffer) { EmulationSettings::SetRgbPalette(paletteBuffer); }
|
2016-05-27 02:32:20 +00:00
|
|
|
DllExport void __stdcall SetPictureSettings(double brightness, double contrast, double saturation, double hue, double scanlineIntensity) { EmulationSettings::SetPictureSettings(brightness, contrast, saturation, hue, scanlineIntensity); }
|
|
|
|
DllExport void __stdcall SetNtscFilterSettings(double artifacts, double bleed, double fringing, double gamma, double resolution, double sharpness, bool mergeFields) { EmulationSettings::SetNtscFilterSettings(artifacts, bleed, fringing, gamma, resolution, sharpness, mergeFields); }
|
2015-07-18 00:58:57 +00:00
|
|
|
|
2016-01-18 03:16:20 +00:00
|
|
|
DllExport const char* __stdcall GetAudioDevices()
|
|
|
|
{
|
|
|
|
_returnString = _soundManager->GetAvailableDevices();
|
|
|
|
return _returnString.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall SetAudioDevice(char* audioDevice) { _soundManager->SetAudioDevice(audioDevice); }
|
|
|
|
|
2016-02-07 18:05:32 +00:00
|
|
|
DllExport void __stdcall GetScreenSize(ScreenSize &size, bool ignoreScale) { VideoDecoder::GetInstance()->GetScreenSize(size, ignoreScale); }
|
2016-01-29 01:47:16 +00:00
|
|
|
|
|
|
|
//FDS functions
|
|
|
|
DllExport uint32_t __stdcall FdsGetSideCount() { return FDS::GetSideCount(); }
|
|
|
|
DllExport void __stdcall FdsEjectDisk() { FDS::EjectDisk(); }
|
|
|
|
DllExport void __stdcall FdsInsertDisk(uint32_t diskNumber) { FDS::InsertDisk(diskNumber); }
|
|
|
|
DllExport void __stdcall FdsSwitchDiskSide() { FDS::SwitchDiskSide(); }
|
2016-05-01 00:08:53 +00:00
|
|
|
|
|
|
|
//VS System functions
|
|
|
|
DllExport bool __stdcall IsVsSystem() { return VsControlManager::GetInstance() != nullptr; }
|
|
|
|
DllExport void __stdcall VsInsertCoin(uint32_t port)
|
|
|
|
{
|
|
|
|
VsControlManager* vs = VsControlManager::GetInstance();
|
|
|
|
if(vs) {
|
|
|
|
vs->InsertCoin(port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DllExport void __stdcall VsSetGameConfig(PpuModel model, uint8_t dipSwitches)
|
|
|
|
{
|
|
|
|
VsControlManager* vs = VsControlManager::GetInstance();
|
|
|
|
if(vs) {
|
|
|
|
EmulationSettings::SetPpuModel(model);
|
|
|
|
vs->SetDipSwitches(dipSwitches);
|
|
|
|
}
|
|
|
|
}
|
2015-07-02 03:17:14 +00:00
|
|
|
}
|
|
|
|
}
|