Core: Reset/Power Cycle support (+ fixed power on state for DMA controller)
This commit is contained in:
parent
c7ecf754da
commit
63f6de6a8e
31 changed files with 302 additions and 80 deletions
|
@ -39,7 +39,6 @@ private:
|
|||
void MapBanks(MemoryManager &mm, vector<unique_ptr<IMemoryHandler>> &handlers, uint8_t startBank, uint8_t endBank, uint16_t startPage = 0, uint16_t endPage = 0x0F, uint16_t pageIncrement = 0, bool mirror = false);
|
||||
|
||||
void LoadBattery();
|
||||
void SaveBattery();
|
||||
|
||||
int32_t GetHeaderScore(uint32_t addr);
|
||||
void DisplayCartInfo();
|
||||
|
@ -51,6 +50,8 @@ public:
|
|||
|
||||
void Init();
|
||||
|
||||
void SaveBattery();
|
||||
|
||||
RomInfo GetRomInfo();
|
||||
string GetSha1Hash();
|
||||
|
||||
|
|
|
@ -29,4 +29,5 @@ struct RomInfo
|
|||
{
|
||||
SnesCartInformation Header;
|
||||
VirtualFile RomFile;
|
||||
VirtualFile PatchFile;
|
||||
};
|
|
@ -169,11 +169,52 @@ void Console::Stop(bool sendNotification)
|
|||
}
|
||||
}
|
||||
|
||||
bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile)
|
||||
void Console::Reset()
|
||||
{
|
||||
Lock();
|
||||
shared_ptr<Debugger> debugger = _debugger;
|
||||
if(debugger) {
|
||||
debugger->Run();
|
||||
}
|
||||
|
||||
_dmaController->Reset();
|
||||
_internalRegisters->Reset();
|
||||
_memoryManager->Reset();
|
||||
_spc->Reset();
|
||||
_cpu->Reset();
|
||||
_ppu->Reset();
|
||||
//_cart->Reset();
|
||||
//_controlManager->Reset();
|
||||
|
||||
if(debugger) {
|
||||
debugger->Step(1);
|
||||
}
|
||||
Unlock();
|
||||
}
|
||||
|
||||
void Console::PowerCycle()
|
||||
{
|
||||
shared_ptr<BaseCartridge> cart = _cart;
|
||||
if(cart) {
|
||||
RomInfo info = cart->GetRomInfo();
|
||||
Lock();
|
||||
LoadRom(info.RomFile, info.PatchFile, false);
|
||||
Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom)
|
||||
{
|
||||
if(_cart) {
|
||||
//Make sure the battery is saved to disk before we load another game (or reload the same game)
|
||||
_cart->SaveBattery();
|
||||
}
|
||||
|
||||
shared_ptr<BaseCartridge> cart = BaseCartridge::CreateCartridge(romFile, patchFile);
|
||||
if(cart) {
|
||||
Stop(false);
|
||||
if(stopRom) {
|
||||
Stop(false);
|
||||
}
|
||||
|
||||
vector<uint8_t> spcRomData;
|
||||
VirtualFile spcBios(FolderUtilities::CombinePath(FolderUtilities::GetHomeFolder(), "spc700.rom"));
|
||||
|
@ -201,12 +242,13 @@ bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile)
|
|||
|
||||
_controlManager->UpdateControlDevices();
|
||||
|
||||
//if(_debugger) {
|
||||
if(_debugger) {
|
||||
//Reset debugger if it was running before
|
||||
//auto lock = _debuggerLock.AcquireSafe();
|
||||
//_debugger.reset();
|
||||
//GetDebugger();
|
||||
//}
|
||||
auto lock = _debuggerLock.AcquireSafe();
|
||||
_debugger.reset();
|
||||
GetDebugger();
|
||||
_debugger->Step(1);
|
||||
}
|
||||
|
||||
UpdateRegion();
|
||||
_memoryManager->IncrementMasterClockValue<170>();
|
||||
|
@ -483,6 +525,11 @@ shared_ptr<Debugger> Console::GetDebugger(bool autoStart)
|
|||
return debugger;
|
||||
}
|
||||
|
||||
void Console::StopDebugger()
|
||||
{
|
||||
_debugger.reset();
|
||||
}
|
||||
|
||||
thread::id Console::GetEmulationThreadId()
|
||||
{
|
||||
return _emulationThreadId;
|
||||
|
|
|
@ -76,11 +76,14 @@ public:
|
|||
void Run();
|
||||
void Stop(bool sendNotification);
|
||||
|
||||
void Reset();
|
||||
void PowerCycle();
|
||||
|
||||
void Pause();
|
||||
void Resume();
|
||||
bool IsPaused();
|
||||
|
||||
bool LoadRom(VirtualFile romFile, VirtualFile patchFile);
|
||||
bool LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom = true);
|
||||
RomInfo GetRomInfo();
|
||||
uint32_t GetMasterClockRate();
|
||||
ConsoleRegion GetRegion();
|
||||
|
@ -109,7 +112,9 @@ public:
|
|||
shared_ptr<InternalRegisters> GetInternalRegisters();
|
||||
shared_ptr<ControlManager> GetControlManager();
|
||||
shared_ptr<DmaController> GetDmaController();
|
||||
|
||||
shared_ptr<Debugger> GetDebugger(bool autoStart = true);
|
||||
void StopDebugger();
|
||||
|
||||
thread::id GetEmulationThreadId();
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "IKeyManager.h"
|
||||
#include "IInputProvider.h"
|
||||
#include "IInputRecorder.h"
|
||||
#include "SystemActionManager.h"
|
||||
#include "SnesController.h"
|
||||
#include "SnesMouse.h"
|
||||
#include "../Utilities/Serializer.h"
|
||||
|
@ -16,7 +17,7 @@ ControlManager::ControlManager(shared_ptr<Console> console)
|
|||
_console = console;
|
||||
_inputConfigVersion = -1;
|
||||
_pollCounter = 0;
|
||||
|
||||
_systemActionManager.reset(new SystemActionManager(console));
|
||||
UpdateControlDevices();
|
||||
}
|
||||
|
||||
|
@ -66,6 +67,11 @@ vector<ControlDeviceState> ControlManager::GetPortStates()
|
|||
return states;
|
||||
}
|
||||
|
||||
shared_ptr<SystemActionManager> ControlManager::GetSystemActionManager()
|
||||
{
|
||||
return _systemActionManager;
|
||||
}
|
||||
|
||||
shared_ptr<BaseControlDevice> ControlManager::GetControlDevice(uint8_t port)
|
||||
{
|
||||
auto lock = _deviceLock.AcquireSafe();
|
||||
|
@ -116,7 +122,7 @@ void ControlManager::UpdateControlDevices()
|
|||
|
||||
auto lock = _deviceLock.AcquireSafe();
|
||||
_controlDevices.clear();
|
||||
|
||||
RegisterControlDevice(_systemActionManager);
|
||||
for(int i = 0; i < 4; i++) {
|
||||
shared_ptr<BaseControlDevice> device = CreateControllerDevice(GetControllerType(i), i, _console);
|
||||
if(device) {
|
||||
|
@ -124,6 +130,7 @@ void ControlManager::UpdateControlDevices()
|
|||
}
|
||||
}
|
||||
}
|
||||
_systemActionManager->ProcessSystemActions();
|
||||
}
|
||||
|
||||
uint8_t ControlManager::GetOpenBusMask(uint8_t port)
|
||||
|
|
|
@ -9,6 +9,7 @@ class BaseControlDevice;
|
|||
class IInputRecorder;
|
||||
class IInputProvider;
|
||||
class Console;
|
||||
class SystemActionManager;
|
||||
struct ControlDeviceState;
|
||||
enum class ControllerType;
|
||||
enum class ExpansionPortDevice;
|
||||
|
@ -27,7 +28,7 @@ protected:
|
|||
shared_ptr<Console> _console;
|
||||
SimpleLock _deviceLock;
|
||||
vector<shared_ptr<BaseControlDevice>> _controlDevices;
|
||||
shared_ptr<BaseControlDevice> _systemActionManager;
|
||||
shared_ptr<SystemActionManager> _systemActionManager;
|
||||
|
||||
void RegisterControlDevice(shared_ptr<BaseControlDevice> controlDevice);
|
||||
|
||||
|
@ -52,6 +53,7 @@ public:
|
|||
|
||||
vector<ControlDeviceState> GetPortStates();
|
||||
|
||||
shared_ptr<SystemActionManager> GetSystemActionManager();
|
||||
shared_ptr<BaseControlDevice> GetControlDevice(uint8_t port);
|
||||
vector<shared_ptr<BaseControlDevice>> GetControlDevices();
|
||||
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
<ClInclude Include="SPC_DSP.h" />
|
||||
<ClInclude Include="SPC_Filter.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="SystemActionManager.h" />
|
||||
<ClInclude Include="TraceLogger.h" />
|
||||
<ClInclude Include="VideoDecoder.h" />
|
||||
<ClInclude Include="VideoRenderer.h" />
|
||||
|
|
|
@ -251,6 +251,9 @@
|
|||
<ClInclude Include="SnesMouse.h">
|
||||
<Filter>SNES\Input</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SystemActionManager.h">
|
||||
<Filter>SNES\Input</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp" />
|
||||
|
|
|
@ -467,6 +467,7 @@ void Cpu::ProcessInterrupt(uint16_t vector)
|
|||
SetFlags(ProcFlags::IrqDisable);
|
||||
ClearFlags(ProcFlags::Decimal);
|
||||
|
||||
_state.K = 0;
|
||||
_state.PC = ReadDataWord(vector);
|
||||
} else {
|
||||
PushByte(_state.K);
|
||||
|
|
|
@ -30,6 +30,14 @@ Cpu::~Cpu()
|
|||
|
||||
void Cpu::Reset()
|
||||
{
|
||||
_state.EmulationMode = true;
|
||||
_state.NmiFlag = false;
|
||||
_state.PrevNmiFlag = false;
|
||||
_state.IrqSource = (uint8_t)IrqSource::None;
|
||||
_state.PrevIrqSource = (uint8_t)IrqSource::None;
|
||||
_state.StopState = CpuStopState::Running;
|
||||
SetSP(_state.SP);
|
||||
ProcessInterrupt(Cpu::ResetVector);
|
||||
}
|
||||
|
||||
void Cpu::Exec()
|
||||
|
|
|
@ -58,9 +58,18 @@ Debugger::Debugger(shared_ptr<Console> console)
|
|||
}
|
||||
|
||||
Debugger::~Debugger()
|
||||
{
|
||||
Release();
|
||||
}
|
||||
|
||||
void Debugger::Release()
|
||||
{
|
||||
string cdlFile = FolderUtilities::CombinePath(FolderUtilities::GetDebuggerFolder(), FolderUtilities::GetFilename(_console->GetCartridge()->GetRomInfo().RomFile.GetFileName(), false) + ".cdl");
|
||||
_codeDataLogger->SaveCdlFile(cdlFile);
|
||||
|
||||
while(_executionStopped) {
|
||||
Run();
|
||||
}
|
||||
}
|
||||
|
||||
void Debugger::ProcessCpuRead(uint32_t addr, uint8_t value, MemoryOperationType type)
|
||||
|
|
|
@ -56,6 +56,7 @@ private:
|
|||
public:
|
||||
Debugger(shared_ptr<Console> console);
|
||||
~Debugger();
|
||||
void Release();
|
||||
|
||||
void ProcessCpuRead(uint32_t addr, uint8_t value, MemoryOperationType type);
|
||||
void ProcessCpuWrite(uint32_t addr, uint8_t value, MemoryOperationType type);
|
||||
|
|
|
@ -7,6 +7,19 @@
|
|||
DmaController::DmaController(MemoryManager *memoryManager)
|
||||
{
|
||||
_memoryManager = memoryManager;
|
||||
Reset();
|
||||
|
||||
//Power on values
|
||||
for(int j = 0; j < 8; j++) {
|
||||
for(int i = 0; i <= 0x0A; i++) {
|
||||
Write(0x4300 | i | (j << 4), 0xFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DmaController::Reset()
|
||||
{
|
||||
_hdmaChannels = 0;
|
||||
}
|
||||
|
||||
void DmaController::CopyDmaByte(uint32_t addressBusA, uint16_t addressBusB, bool fromBtoA)
|
||||
|
|
|
@ -53,6 +53,8 @@ private:
|
|||
public:
|
||||
DmaController(MemoryManager *memoryManager);
|
||||
|
||||
void Reset();
|
||||
|
||||
void InitHdmaChannels();
|
||||
void ProcessHdmaChannels();
|
||||
|
||||
|
|
|
@ -11,6 +11,23 @@
|
|||
InternalRegisters::InternalRegisters(shared_ptr<Console> console)
|
||||
{
|
||||
_console = console;
|
||||
Reset();
|
||||
|
||||
//Power on values
|
||||
_horizontalTimer = 0x1FF;
|
||||
_verticalTimer = 0x1FF;
|
||||
_multOperand1 = 0xFF;
|
||||
_dividend = 0xFFFF;
|
||||
_ioPortOutput = 0xFF;
|
||||
}
|
||||
|
||||
void InternalRegisters::Reset()
|
||||
{
|
||||
_enableAutoJoypadRead = false;
|
||||
_enableNmi = false;
|
||||
_enableHorizontalIrq = false;
|
||||
_enableVerticalIrq = false;
|
||||
_nmiFlag = false;
|
||||
}
|
||||
|
||||
void InternalRegisters::ProcessAutoJoypadRead()
|
||||
|
|
|
@ -34,6 +34,8 @@ private:
|
|||
public:
|
||||
InternalRegisters(shared_ptr<Console> console);
|
||||
|
||||
void Reset();
|
||||
|
||||
void ProcessAutoJoypadRead();
|
||||
uint8_t GetIoPortOutput();
|
||||
void SetNmiFlag(bool nmiFlag);
|
||||
|
|
|
@ -72,6 +72,11 @@ MemoryManager::~MemoryManager()
|
|||
delete[] _workRam;
|
||||
}
|
||||
|
||||
void MemoryManager::Reset()
|
||||
{
|
||||
_masterClock = 0;
|
||||
}
|
||||
|
||||
void MemoryManager::RegisterHandler(uint32_t startAddr, uint32_t endAddr, IMemoryHandler * handler)
|
||||
{
|
||||
if((startAddr & 0xFFF) != 0 || (endAddr & 0xFFF) != 0xFFF) {
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
void Initialize(shared_ptr<Console> console);
|
||||
~MemoryManager();
|
||||
|
||||
void Reset();
|
||||
|
||||
void RegisterHandler(uint32_t startAddr, uint32_t endAddr, IMemoryHandler* handler);
|
||||
|
||||
void GenerateMasterClockTable();
|
||||
|
|
|
@ -52,6 +52,13 @@ Ppu::~Ppu()
|
|||
delete[] _outputBuffers[1];
|
||||
}
|
||||
|
||||
void Ppu::Reset()
|
||||
{
|
||||
_scanline = 0;
|
||||
_cycle = 0;
|
||||
_forcedVblank = true;
|
||||
}
|
||||
|
||||
uint32_t Ppu::GetFrameCount()
|
||||
{
|
||||
return _frameCount;
|
||||
|
|
|
@ -227,6 +227,8 @@ public:
|
|||
Ppu(shared_ptr<Console> console);
|
||||
~Ppu();
|
||||
|
||||
void Reset();
|
||||
|
||||
uint32_t GetFrameCount();
|
||||
uint16_t GetScanline();
|
||||
uint16_t GetCycle();
|
||||
|
|
|
@ -231,7 +231,7 @@ void SaveStateManager::LoadRecentGame(string filename, bool resetGame)
|
|||
std::getline(romInfoStream, romPath);
|
||||
std::getline(romInfoStream, patchPath);
|
||||
|
||||
_console->Pause();
|
||||
_console->Lock();
|
||||
try {
|
||||
if(_console->LoadRom(romPath, patchPath)) {
|
||||
if(!resetGame) {
|
||||
|
@ -241,5 +241,5 @@ void SaveStateManager::LoadRecentGame(string filename, bool resetGame)
|
|||
} catch(std::exception ex) {
|
||||
_console->Stop(true);
|
||||
}
|
||||
_console->Resume();
|
||||
_console->Unlock();
|
||||
}
|
||||
|
|
|
@ -28,6 +28,13 @@ Spc::~Spc()
|
|||
delete _spc;
|
||||
}
|
||||
|
||||
void Spc::Reset()
|
||||
{
|
||||
_spc->soft_reset();
|
||||
_spc->set_output(_soundBuffer, Spc::SampleBufferSize >> 1);
|
||||
_startFrameMasterClock = _console->GetMemoryManager()->GetMasterClock();
|
||||
}
|
||||
|
||||
int Spc::GetSpcTime()
|
||||
{
|
||||
uint64_t currentClock = _console->GetMemoryManager()->GetMasterClock();
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
Spc(shared_ptr<Console> console, vector<uint8_t> &spcRomData);
|
||||
~Spc();
|
||||
|
||||
void Reset();
|
||||
|
||||
uint8_t Read(uint16_t addr);
|
||||
void Write(uint32_t addr, uint8_t value);
|
||||
|
||||
|
|
78
Core/SystemActionManager.h
Normal file
78
Core/SystemActionManager.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "BaseControlDevice.h"
|
||||
#include "Console.h"
|
||||
|
||||
class SystemActionManager : public BaseControlDevice
|
||||
{
|
||||
private:
|
||||
bool _needReset = false;
|
||||
bool _needPowerCycle = false;
|
||||
|
||||
protected:
|
||||
string GetKeyNames() override
|
||||
{
|
||||
return "RP";
|
||||
}
|
||||
|
||||
public:
|
||||
enum Buttons { ResetButton = 0, PowerButton = 1 };
|
||||
|
||||
SystemActionManager(shared_ptr<Console> console) : BaseControlDevice(console, BaseControlDevice::ConsoleInputPort)
|
||||
{
|
||||
}
|
||||
|
||||
uint8_t ReadRam(uint16_t addr) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteRam(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
}
|
||||
|
||||
void OnAfterSetState() override
|
||||
{
|
||||
if(_needReset) {
|
||||
SetBit(SystemActionManager::Buttons::ResetButton);
|
||||
_needReset = false;
|
||||
}
|
||||
if(_needPowerCycle) {
|
||||
SetBit(SystemActionManager::Buttons::PowerButton);
|
||||
_needPowerCycle = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Reset()
|
||||
{
|
||||
if(!_needReset) {
|
||||
_needReset = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PowerCycle()
|
||||
{
|
||||
if(!_needPowerCycle) {
|
||||
_needPowerCycle = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void ProcessSystemActions()
|
||||
{
|
||||
shared_ptr<Console> console = _console;
|
||||
if(console) {
|
||||
if(IsPressed(SystemActionManager::Buttons::ResetButton)) {
|
||||
console->Reset();
|
||||
console->GetControlManager()->UpdateInputState();
|
||||
}
|
||||
if(IsPressed(SystemActionManager::Buttons::PowerButton)) {
|
||||
console->PowerCycle();
|
||||
//Calling PowerCycle() causes this object to be deleted - no code must be written below this line
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -27,8 +27,7 @@ extern "C"
|
|||
|
||||
DllExport void __stdcall ReleaseDebugger()
|
||||
{
|
||||
//_debugger.reset();
|
||||
//_console->StopDebugger();
|
||||
_console->StopDebugger();
|
||||
}
|
||||
|
||||
DllExport bool __stdcall IsDebuggerRunning()
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "../Core/Console.h"
|
||||
#include "../Core/EmuSettings.h"
|
||||
#include "../Core/VideoDecoder.h"
|
||||
#include "../Core/ControlManager.h"
|
||||
#include "../Core/SystemActionManager.h"
|
||||
#include "../Core/MessageManager.h"
|
||||
#include "../Core/SaveStateManager.h"
|
||||
#include "../Core/INotificationListener.h"
|
||||
|
@ -132,6 +134,16 @@ extern "C" {
|
|||
_console->IsPaused();
|
||||
}
|
||||
|
||||
DllExport void __stdcall Reset()
|
||||
{
|
||||
_console->GetControlManager()->GetSystemActionManager()->Reset();
|
||||
}
|
||||
|
||||
DllExport void __stdcall PowerCycle()
|
||||
{
|
||||
_console->GetControlManager()->GetSystemActionManager()->PowerCycle();
|
||||
}
|
||||
|
||||
DllExport void __stdcall Release()
|
||||
{
|
||||
_console->Stop(true);
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Mesen.GUI.Debugger
|
|||
//TODO
|
||||
//DebugWorkspaceManager.SaveWorkspace();
|
||||
//DebugWorkspaceManager.Clear();
|
||||
//DebugApi.ReleaseDebugger();
|
||||
DebugApi.ReleaseDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ namespace Mesen.GUI.Emulation
|
|||
|
||||
switch(shortcut) {
|
||||
case EmulatorShortcut.Pause: TogglePause(); break;
|
||||
case EmulatorShortcut.Reset: ResetEmu(); break;
|
||||
case EmulatorShortcut.PowerCycle: PowerCycleEmu(); break;
|
||||
case EmulatorShortcut.Reset: EmuApi.Reset(); break;
|
||||
case EmulatorShortcut.PowerCycle: EmuApi.PowerCycle(); break;
|
||||
case EmulatorShortcut.PowerOff: Task.Run(() => EmuApi.Stop()); restoreFullscreen = false; break;
|
||||
case EmulatorShortcut.Exit: Application.OpenForms[0].Close(); restoreFullscreen = false; break;
|
||||
|
||||
|
@ -278,15 +278,5 @@ namespace Mesen.GUI.Emulation
|
|||
EmuApi.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetEmu()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
private void PowerCycleEmu()
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
94
UI/Forms/frmMain.Designer.cs
generated
94
UI/Forms/frmMain.Designer.cs
generated
|
@ -111,6 +111,9 @@
|
|||
this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mnuPreferences = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuSoundRecorder = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuWaveRecord = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuWaveStop = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuVideoRecorder = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuAviRecord = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuAviStop = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -132,9 +135,6 @@
|
|||
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.pnlRenderer = new System.Windows.Forms.Panel();
|
||||
this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames();
|
||||
this.mnuSoundRecorder = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuWaveRecord = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuWaveStop = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuMain.SuspendLayout();
|
||||
this.pnlRenderer.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
@ -245,7 +245,7 @@
|
|||
this.mnuPause.Enabled = false;
|
||||
this.mnuPause.Image = global::Mesen.GUI.Properties.Resources.MediaPause;
|
||||
this.mnuPause.Name = "mnuPause";
|
||||
this.mnuPause.Size = new System.Drawing.Size(139, 22);
|
||||
this.mnuPause.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuPause.Text = "Pause";
|
||||
//
|
||||
// mnuReset
|
||||
|
@ -253,29 +253,27 @@
|
|||
this.mnuReset.Enabled = false;
|
||||
this.mnuReset.Image = global::Mesen.GUI.Properties.Resources.Refresh;
|
||||
this.mnuReset.Name = "mnuReset";
|
||||
this.mnuReset.Size = new System.Drawing.Size(139, 22);
|
||||
this.mnuReset.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuReset.Text = "Reset";
|
||||
this.mnuReset.Visible = false;
|
||||
//
|
||||
// mnuPowerCycle
|
||||
//
|
||||
this.mnuPowerCycle.Enabled = false;
|
||||
this.mnuPowerCycle.Image = global::Mesen.GUI.Properties.Resources.PowerCycle;
|
||||
this.mnuPowerCycle.Name = "mnuPowerCycle";
|
||||
this.mnuPowerCycle.Size = new System.Drawing.Size(139, 22);
|
||||
this.mnuPowerCycle.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuPowerCycle.Text = "Power Cycle";
|
||||
this.mnuPowerCycle.Visible = false;
|
||||
//
|
||||
// toolStripMenuItem24
|
||||
//
|
||||
this.toolStripMenuItem24.Name = "toolStripMenuItem24";
|
||||
this.toolStripMenuItem24.Size = new System.Drawing.Size(136, 6);
|
||||
this.toolStripMenuItem24.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// mnuPowerOff
|
||||
//
|
||||
this.mnuPowerOff.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
|
||||
this.mnuPowerOff.Name = "mnuPowerOff";
|
||||
this.mnuPowerOff.Size = new System.Drawing.Size(139, 22);
|
||||
this.mnuPowerOff.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuPowerOff.Text = "Power Off";
|
||||
//
|
||||
// optionsToolStripMenuItem
|
||||
|
@ -313,7 +311,7 @@
|
|||
this.mnuShowFPS});
|
||||
this.mnuEmulationSpeed.Image = global::Mesen.GUI.Properties.Resources.Speed;
|
||||
this.mnuEmulationSpeed.Name = "mnuEmulationSpeed";
|
||||
this.mnuEmulationSpeed.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuEmulationSpeed.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuEmulationSpeed.Text = "Speed";
|
||||
this.mnuEmulationSpeed.DropDownOpening += new System.EventHandler(this.mnuEmulationSpeed_DropDownOpening);
|
||||
//
|
||||
|
@ -401,7 +399,7 @@
|
|||
this.mnuFullscreen});
|
||||
this.mnuVideoScale.Image = global::Mesen.GUI.Properties.Resources.Fullscreen;
|
||||
this.mnuVideoScale.Name = "mnuVideoScale";
|
||||
this.mnuVideoScale.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuVideoScale.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuVideoScale.Text = "Video Size";
|
||||
this.mnuVideoScale.DropDownOpening += new System.EventHandler(this.mnuVideoScale_DropDownOpening);
|
||||
//
|
||||
|
@ -487,7 +485,7 @@
|
|||
this.mnuBilinearInterpolation});
|
||||
this.mnuVideoFilter.Image = global::Mesen.GUI.Properties.Resources.VideoFilter;
|
||||
this.mnuVideoFilter.Name = "mnuVideoFilter";
|
||||
this.mnuVideoFilter.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuVideoFilter.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuVideoFilter.Text = "Video Filter";
|
||||
this.mnuVideoFilter.DropDownOpening += new System.EventHandler(this.mnuVideoFilter_DropDownOpening);
|
||||
//
|
||||
|
@ -674,7 +672,7 @@
|
|||
this.mnuRegionPal});
|
||||
this.mnuRegion.Image = global::Mesen.GUI.Properties.Resources.WebBrowser;
|
||||
this.mnuRegion.Name = "mnuRegion";
|
||||
this.mnuRegion.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuRegion.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuRegion.Text = "Region";
|
||||
this.mnuRegion.DropDownOpening += new System.EventHandler(this.mnuRegion_DropDownOpening);
|
||||
//
|
||||
|
@ -704,13 +702,13 @@
|
|||
// toolStripMenuItem4
|
||||
//
|
||||
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(132, 6);
|
||||
this.toolStripMenuItem4.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// mnuAudioConfig
|
||||
//
|
||||
this.mnuAudioConfig.Image = global::Mesen.GUI.Properties.Resources.Audio;
|
||||
this.mnuAudioConfig.Name = "mnuAudioConfig";
|
||||
this.mnuAudioConfig.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuAudioConfig.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuAudioConfig.Text = "Audio";
|
||||
this.mnuAudioConfig.Click += new System.EventHandler(this.mnuAudioConfig_Click);
|
||||
//
|
||||
|
@ -718,7 +716,7 @@
|
|||
//
|
||||
this.mnuInputConfig.Image = global::Mesen.GUI.Properties.Resources.Controller;
|
||||
this.mnuInputConfig.Name = "mnuInputConfig";
|
||||
this.mnuInputConfig.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuInputConfig.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuInputConfig.Text = "Input";
|
||||
this.mnuInputConfig.Click += new System.EventHandler(this.mnuInputConfig_Click);
|
||||
//
|
||||
|
@ -726,7 +724,7 @@
|
|||
//
|
||||
this.mnuVideoConfig.Image = global::Mesen.GUI.Properties.Resources.VideoOptions;
|
||||
this.mnuVideoConfig.Name = "mnuVideoConfig";
|
||||
this.mnuVideoConfig.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuVideoConfig.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuVideoConfig.Text = "Video";
|
||||
this.mnuVideoConfig.Click += new System.EventHandler(this.mnuVideoConfig_Click);
|
||||
//
|
||||
|
@ -734,20 +732,20 @@
|
|||
//
|
||||
this.mnuEmulationConfig.Image = global::Mesen.GUI.Properties.Resources.DipSwitches;
|
||||
this.mnuEmulationConfig.Name = "mnuEmulationConfig";
|
||||
this.mnuEmulationConfig.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuEmulationConfig.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuEmulationConfig.Text = "Emulation";
|
||||
this.mnuEmulationConfig.Click += new System.EventHandler(this.mnuEmulationConfig_Click);
|
||||
//
|
||||
// toolStripMenuItem3
|
||||
//
|
||||
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(132, 6);
|
||||
this.toolStripMenuItem3.Size = new System.Drawing.Size(149, 6);
|
||||
//
|
||||
// mnuPreferences
|
||||
//
|
||||
this.mnuPreferences.Image = global::Mesen.GUI.Properties.Resources.Settings;
|
||||
this.mnuPreferences.Name = "mnuPreferences";
|
||||
this.mnuPreferences.Size = new System.Drawing.Size(135, 22);
|
||||
this.mnuPreferences.Size = new System.Drawing.Size(152, 22);
|
||||
this.mnuPreferences.Text = "Preferences";
|
||||
this.mnuPreferences.Click += new System.EventHandler(this.mnuPreferences_Click);
|
||||
//
|
||||
|
@ -765,6 +763,33 @@
|
|||
this.toolsToolStripMenuItem.Text = "Tools";
|
||||
this.toolsToolStripMenuItem.DropDownOpening += new System.EventHandler(this.toolsToolStripMenuItem_DropDownOpening);
|
||||
//
|
||||
// mnuSoundRecorder
|
||||
//
|
||||
this.mnuSoundRecorder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.mnuWaveRecord,
|
||||
this.mnuWaveStop});
|
||||
this.mnuSoundRecorder.Image = global::Mesen.GUI.Properties.Resources.Microphone;
|
||||
this.mnuSoundRecorder.Name = "mnuSoundRecorder";
|
||||
this.mnuSoundRecorder.Size = new System.Drawing.Size(159, 22);
|
||||
this.mnuSoundRecorder.Text = "Sound Recorder";
|
||||
this.mnuSoundRecorder.DropDownOpening += new System.EventHandler(this.mnuSoundRecorder_DropDownOpening);
|
||||
//
|
||||
// mnuWaveRecord
|
||||
//
|
||||
this.mnuWaveRecord.Image = global::Mesen.GUI.Properties.Resources.Record;
|
||||
this.mnuWaveRecord.Name = "mnuWaveRecord";
|
||||
this.mnuWaveRecord.Size = new System.Drawing.Size(155, 22);
|
||||
this.mnuWaveRecord.Text = "Record...";
|
||||
this.mnuWaveRecord.Click += new System.EventHandler(this.mnuWaveRecord_Click);
|
||||
//
|
||||
// mnuWaveStop
|
||||
//
|
||||
this.mnuWaveStop.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
|
||||
this.mnuWaveStop.Name = "mnuWaveStop";
|
||||
this.mnuWaveStop.Size = new System.Drawing.Size(155, 22);
|
||||
this.mnuWaveStop.Text = "Stop Recording";
|
||||
this.mnuWaveStop.Click += new System.EventHandler(this.mnuWaveStop_Click);
|
||||
//
|
||||
// mnuVideoRecorder
|
||||
//
|
||||
this.mnuVideoRecorder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -934,33 +959,6 @@
|
|||
this.ctrlRecentGames.TabIndex = 1;
|
||||
this.ctrlRecentGames.Visible = false;
|
||||
//
|
||||
// mnuSoundRecorder
|
||||
//
|
||||
this.mnuSoundRecorder.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.mnuWaveRecord,
|
||||
this.mnuWaveStop});
|
||||
this.mnuSoundRecorder.Image = global::Mesen.GUI.Properties.Resources.Microphone;
|
||||
this.mnuSoundRecorder.Name = "mnuSoundRecorder";
|
||||
this.mnuSoundRecorder.Size = new System.Drawing.Size(159, 22);
|
||||
this.mnuSoundRecorder.Text = "Sound Recorder";
|
||||
this.mnuSoundRecorder.DropDownOpening += new System.EventHandler(this.mnuSoundRecorder_DropDownOpening);
|
||||
//
|
||||
// mnuWaveRecord
|
||||
//
|
||||
this.mnuWaveRecord.Image = global::Mesen.GUI.Properties.Resources.Record;
|
||||
this.mnuWaveRecord.Name = "mnuWaveRecord";
|
||||
this.mnuWaveRecord.Size = new System.Drawing.Size(155, 22);
|
||||
this.mnuWaveRecord.Text = "Record...";
|
||||
this.mnuWaveRecord.Click += new System.EventHandler(this.mnuWaveRecord_Click);
|
||||
//
|
||||
// mnuWaveStop
|
||||
//
|
||||
this.mnuWaveStop.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
|
||||
this.mnuWaveStop.Name = "mnuWaveStop";
|
||||
this.mnuWaveStop.Size = new System.Drawing.Size(155, 22);
|
||||
this.mnuWaveStop.Text = "Stop Recording";
|
||||
this.mnuWaveStop.Click += new System.EventHandler(this.mnuWaveStop_Click);
|
||||
//
|
||||
// frmMain
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
|
|
|
@ -37,6 +37,9 @@ namespace Mesen.GUI
|
|||
[DllImport(DllPath)] public static extern void Run();
|
||||
[DllImport(DllPath)] public static extern void Stop();
|
||||
|
||||
[DllImport(DllPath)] public static extern void Reset();
|
||||
[DllImport(DllPath)] public static extern void PowerCycle();
|
||||
|
||||
[DllImport(DllPath)] public static extern void Pause();
|
||||
[DllImport(DllPath)] public static extern void Resume();
|
||||
[DllImport(DllPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool IsPaused();
|
||||
|
|
|
@ -373,11 +373,8 @@ void WindowsKeyManager::UpdateDevices()
|
|||
return;
|
||||
}
|
||||
|
||||
//TODO
|
||||
//_console->Pause();
|
||||
_xInput->UpdateDeviceList();
|
||||
_directInput->UpdateDeviceList();
|
||||
//_console->Resume();
|
||||
}
|
||||
|
||||
void WindowsKeyManager::SetKeyState(uint16_t scanCode, bool state)
|
||||
|
|
Loading…
Add table
Reference in a new issue