Merge branch 'NovaSquirrel:master' into master
This commit is contained in:
commit
a7245cdfd9
26 changed files with 580 additions and 752 deletions
12
.github/workflows/linux-build.yml
vendored
12
.github/workflows/linux-build.yml
vendored
|
@ -2,7 +2,7 @@ name: "Linux build"
|
||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
win-build:
|
linux-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -13,8 +13,8 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
make
|
make
|
||||||
# - name: Upload binary
|
- name: Upload binary
|
||||||
# uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
# with:
|
with:
|
||||||
# name: Mesen-win
|
name: Mesen-Linux
|
||||||
# path: bin/Any CPU/Release/Mesen.exe
|
path: bin/x64/Release/Mesen.exe
|
|
@ -511,10 +511,8 @@ void BaseMapper::StreamState(bool saving)
|
||||||
ArrayInfo<MemoryAccessType> prgMemoryAccess = { _prgMemoryAccess, 0x100 };
|
ArrayInfo<MemoryAccessType> prgMemoryAccess = { _prgMemoryAccess, 0x100 };
|
||||||
ArrayInfo<MemoryAccessType> chrMemoryAccess = { _chrMemoryAccess, 0x40 };
|
ArrayInfo<MemoryAccessType> chrMemoryAccess = { _chrMemoryAccess, 0x40 };
|
||||||
SnapshotInfo epsmaudio{ _epsmaudio.get() };
|
SnapshotInfo epsmaudio{ _epsmaudio.get() };
|
||||||
SnapshotInfo invA13Audio{ _invA13Audio.get() };
|
|
||||||
SnapshotInfo invOE1Audio{ _invOE1Audio.get() };
|
|
||||||
|
|
||||||
Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess, epsmaudio, invA13Audio, invOE1Audio);
|
Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess, epsmaudio);
|
||||||
|
|
||||||
if(!saving) {
|
if(!saving) {
|
||||||
RestorePrgChrState();
|
RestorePrgChrState();
|
||||||
|
@ -642,8 +640,6 @@ void BaseMapper::Initialize(RomData &romData)
|
||||||
InitMapper();
|
InitMapper();
|
||||||
InitMapper(romData);
|
InitMapper(romData);
|
||||||
_epsmaudio.reset(new EPSMAudio(_console));
|
_epsmaudio.reset(new EPSMAudio(_console));
|
||||||
_invA13Audio.reset(new InvA13Audio(_console));
|
|
||||||
_invOE1Audio.reset(new InvOE1Audio(_console));
|
|
||||||
|
|
||||||
//Load battery data if present
|
//Load battery data if present
|
||||||
LoadBattery();
|
LoadBattery();
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "CPU.h"
|
#include "CPU.h"
|
||||||
#include "EPSMAudio.h"
|
#include "EPSMAudio.h"
|
||||||
#include "InvA13Audio.h"
|
|
||||||
#include "InvOE1Audio.h"
|
|
||||||
|
|
||||||
class BaseControlDevice;
|
class BaseControlDevice;
|
||||||
|
|
||||||
|
@ -161,8 +159,6 @@ public:
|
||||||
static constexpr uint32_t NametableCount = 0x10;
|
static constexpr uint32_t NametableCount = 0x10;
|
||||||
static constexpr uint32_t NametableSize = 0x400;
|
static constexpr uint32_t NametableSize = 0x400;
|
||||||
unique_ptr<EPSMAudio> _epsmaudio;
|
unique_ptr<EPSMAudio> _epsmaudio;
|
||||||
unique_ptr<InvA13Audio> _invA13Audio;
|
|
||||||
unique_ptr<InvOE1Audio> _invOE1Audio;
|
|
||||||
void Initialize(RomData &romData);
|
void Initialize(RomData &romData);
|
||||||
|
|
||||||
virtual ~BaseMapper();
|
virtual ~BaseMapper();
|
||||||
|
@ -172,13 +168,7 @@ public:
|
||||||
|
|
||||||
virtual void SetNesModel(NesModel model) { }
|
virtual void SetNesModel(NesModel model) { }
|
||||||
virtual void ProcessCpuClock() { }
|
virtual void ProcessCpuClock() { }
|
||||||
void ProcessMiscClock()
|
virtual void ProcessEPSMClock() { _epsmaudio->Clock(); }
|
||||||
{
|
|
||||||
_epsmaudio->Clock();
|
|
||||||
_invA13Audio->Clock();
|
|
||||||
_invOE1Audio->Clock();
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void NotifyVRAMAddressChange(uint16_t addr);
|
virtual void NotifyVRAMAddressChange(uint16_t addr);
|
||||||
virtual void GetMemoryRanges(MemoryRanges &ranges) override;
|
virtual void GetMemoryRanges(MemoryRanges &ranges) override;
|
||||||
|
|
||||||
|
|
|
@ -465,23 +465,11 @@ bool Console::Initialize(VirtualFile &romFile, VirtualFile &patchFile, bool forP
|
||||||
|
|
||||||
void Console::ProcessCpuClock()
|
void Console::ProcessCpuClock()
|
||||||
{
|
{
|
||||||
ProcessInterferenceAudio();
|
_mapper->ProcessEPSMClock();
|
||||||
_mapper->ProcessCpuClock();
|
_mapper->ProcessCpuClock();
|
||||||
_mapper->ProcessMiscClock();
|
|
||||||
_apu->ProcessCpuClock();
|
_apu->ProcessCpuClock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::ProcessInterferenceAudio()
|
|
||||||
{
|
|
||||||
_InvA13 = _ppu->_A13pinLowSum;
|
|
||||||
_ppu->_A13pinLowSum = 0;
|
|
||||||
|
|
||||||
_InvOE1 = !_controlManager->GetInvOE1(_controlManager->_address); // invert relative to 2A03
|
|
||||||
|
|
||||||
if (_controlManager->_strobed == true)
|
|
||||||
_controlManager->_strobed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPU* Console::GetCpu()
|
CPU* Console::GetCpu()
|
||||||
{
|
{
|
||||||
return _cpu.get();
|
return _cpu.get();
|
||||||
|
|
|
@ -117,9 +117,6 @@ public:
|
||||||
void Init();
|
void Init();
|
||||||
void Release(bool forShutdown);
|
void Release(bool forShutdown);
|
||||||
|
|
||||||
uint8_t _InvA13;
|
|
||||||
uint8_t _InvOE1;
|
|
||||||
|
|
||||||
shared_ptr<BatteryManager> GetBatteryManager();
|
shared_ptr<BatteryManager> GetBatteryManager();
|
||||||
shared_ptr<SaveStateManager> GetSaveStateManager();
|
shared_ptr<SaveStateManager> GetSaveStateManager();
|
||||||
shared_ptr<VideoDecoder> GetVideoDecoder();
|
shared_ptr<VideoDecoder> GetVideoDecoder();
|
||||||
|
@ -134,7 +131,6 @@ public:
|
||||||
bool IsMaster();
|
bool IsMaster();
|
||||||
|
|
||||||
void ProcessCpuClock();
|
void ProcessCpuClock();
|
||||||
void ProcessInterferenceAudio();
|
|
||||||
CPU* GetCpu();
|
CPU* GetCpu();
|
||||||
PPU* GetPpu();
|
PPU* GetPpu();
|
||||||
APU* GetApu();
|
APU* GetApu();
|
||||||
|
|
|
@ -333,12 +333,10 @@ uint8_t ControlManager::ReadRAM(uint16_t addr)
|
||||||
{
|
{
|
||||||
//Used for lag counter - any frame where the input is read does not count as lag
|
//Used for lag counter - any frame where the input is read does not count as lag
|
||||||
_isLagging = false;
|
_isLagging = false;
|
||||||
_address = addr;
|
|
||||||
|
|
||||||
uint8_t value = _console->GetMemoryManager()->GetOpenBus(GetOpenBusMask(addr - 0x4016));
|
uint8_t value = _console->GetMemoryManager()->GetOpenBus(GetOpenBusMask(addr - 0x4016));
|
||||||
for(shared_ptr<BaseControlDevice> &device : _controlDevices) {
|
for(shared_ptr<BaseControlDevice> &device : _controlDevices) {
|
||||||
value |= device->ReadRAM(addr);
|
value |= device->ReadRAM(addr);
|
||||||
_strobed = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
@ -351,14 +349,6 @@ void ControlManager::WriteRAM(uint16_t addr, uint8_t value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ControlManager::GetInvOE1(uint16_t addr)
|
|
||||||
{
|
|
||||||
// pull low for only one clock
|
|
||||||
if (addr == 0x4016)
|
|
||||||
_OE1pinLow = !_strobed;
|
|
||||||
return _OE1pinLow;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ControlManager::Reset(bool softReset)
|
void ControlManager::Reset(bool softReset)
|
||||||
{
|
{
|
||||||
ResetLagCounter();
|
ResetLagCounter();
|
||||||
|
|
|
@ -43,10 +43,6 @@ protected:
|
||||||
virtual uint8_t GetOpenBusMask(uint8_t port);
|
virtual uint8_t GetOpenBusMask(uint8_t port);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _OE1pinLow;
|
|
||||||
uint16_t _address;
|
|
||||||
bool _strobed;
|
|
||||||
|
|
||||||
ControlManager(shared_ptr<Console> console, shared_ptr<BaseControlDevice> systemActionManager, shared_ptr<BaseControlDevice> mapperControlDevice);
|
ControlManager(shared_ptr<Console> console, shared_ptr<BaseControlDevice> systemActionManager, shared_ptr<BaseControlDevice> mapperControlDevice);
|
||||||
virtual ~ControlManager();
|
virtual ~ControlManager();
|
||||||
|
|
||||||
|
@ -84,6 +80,4 @@ public:
|
||||||
|
|
||||||
virtual uint8_t ReadRAM(uint16_t addr) override;
|
virtual uint8_t ReadRAM(uint16_t addr) override;
|
||||||
virtual void WriteRAM(uint16_t addr, uint8_t value) override;
|
virtual void WriteRAM(uint16_t addr, uint8_t value) override;
|
||||||
|
|
||||||
bool GetInvOE1(uint16_t addr);
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -574,8 +574,6 @@
|
||||||
<ClInclude Include="IInputProvider.h" />
|
<ClInclude Include="IInputProvider.h" />
|
||||||
<ClInclude Include="IInputRecorder.h" />
|
<ClInclude Include="IInputRecorder.h" />
|
||||||
<ClInclude Include="InternalRamHandler.h" />
|
<ClInclude Include="InternalRamHandler.h" />
|
||||||
<ClInclude Include="InvA13Audio.h" />
|
|
||||||
<ClInclude Include="InvOE1Audio.h" />
|
|
||||||
<ClInclude Include="Kaiser7017.h" />
|
<ClInclude Include="Kaiser7017.h" />
|
||||||
<ClInclude Include="Kaiser7031.h" />
|
<ClInclude Include="Kaiser7031.h" />
|
||||||
<ClInclude Include="KeyManager.h" />
|
<ClInclude Include="KeyManager.h" />
|
||||||
|
|
|
@ -1523,8 +1523,6 @@
|
||||||
<ClInclude Include="fmopn_2608rom.h">
|
<ClInclude Include="fmopn_2608rom.h">
|
||||||
<Filter>Nes\Mappers\EPSG</Filter>
|
<Filter>Nes\Mappers\EPSG</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="InvA13Audio.h" />
|
|
||||||
<ClInclude Include="InvOE1Audio.h" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
|
|
@ -1003,8 +1003,16 @@ bool Debugger::SleepUntilResume(BreakSource source, uint32_t breakpointId, Break
|
||||||
|
|
||||||
_executionStopped = true;
|
_executionStopped = true;
|
||||||
_pausedForDebugHelper = breakRequested;
|
_pausedForDebugHelper = breakRequested;
|
||||||
|
int whilePausedRunCounter = 0;
|
||||||
while((((stepCount == 0 || _breakRequested) && _suspendCount == 0) || _preventResume > 0) && !_stopFlag) {
|
while((((stepCount == 0 || _breakRequested) && _suspendCount == 0) || _preventResume > 0) && !_stopFlag) {
|
||||||
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(10));
|
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(10));
|
||||||
|
if (preventResume == 0) {
|
||||||
|
whilePausedRunCounter++;
|
||||||
|
if (whilePausedRunCounter > 10) {
|
||||||
|
ProcessEvent(EventType::WhilePaused);
|
||||||
|
whilePausedRunCounter = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(stepCount == 0) {
|
if(stepCount == 0) {
|
||||||
_console->ResetRunTimers();
|
_console->ResetRunTimers();
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,6 +203,7 @@ enum class EventType
|
||||||
SpriteZeroHit = 9,
|
SpriteZeroHit = 9,
|
||||||
ScriptEnded = 10,
|
ScriptEnded = 10,
|
||||||
BusConflict = 11,
|
BusConflict = 11,
|
||||||
|
WhilePaused = 12,
|
||||||
EventTypeSize
|
EventTypeSize
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -119,9 +119,6 @@ enum class AudioChannel
|
||||||
Sunsoft5B = 10,
|
Sunsoft5B = 10,
|
||||||
EPSM_L = 11,
|
EPSM_L = 11,
|
||||||
EPSM_R = 12,
|
EPSM_R = 12,
|
||||||
InvA13 = 13,
|
|
||||||
InvOE1 = 14,
|
|
||||||
MaxChannelCount
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EqualizerFilterType
|
enum class EqualizerFilterType
|
||||||
|
@ -663,40 +660,8 @@ private:
|
||||||
bool _audioSettingsChanged = false;
|
bool _audioSettingsChanged = false;
|
||||||
uint32_t _audioLatency = 50;
|
uint32_t _audioLatency = 50;
|
||||||
uint32_t _EPSMClockFrequency = 3579545;
|
uint32_t _EPSMClockFrequency = 3579545;
|
||||||
double _channelVolume[15] = {
|
double _channelVolume[13] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
|
||||||
1.0,
|
double _channelPanning[13] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0 };
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0
|
|
||||||
};
|
|
||||||
double _channelPanning[15] = {
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
1.0,
|
|
||||||
0.0,
|
|
||||||
2.0,
|
|
||||||
1.0,
|
|
||||||
1.0
|
|
||||||
};
|
|
||||||
EqualizerFilterType _equalizerFilterType = EqualizerFilterType::None;
|
EqualizerFilterType _equalizerFilterType = EqualizerFilterType::None;
|
||||||
vector<double> _bandGains = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
vector<double> _bandGains = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
|
||||||
vector<double> _bands = { { 40,56,80,113,160,225,320,450,600,750,1000,2000,3000,4000,5000,6000,7000,10000,12500,15000 } };
|
vector<double> _bands = { { 40,56,80,113,160,225,320,450,600,750,1000,2000,3000,4000,5000,6000,7000,10000,12500,15000 } };
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "stdafx.h"
|
|
||||||
#include "Snapshotable.h"
|
|
||||||
#include "APU.h"
|
|
||||||
#include "BaseExpansionAudio.h"
|
|
||||||
#include "Console.h"
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
|
|
||||||
class InvA13Audio : public BaseExpansionAudio
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
int8_t _currentOutput;
|
|
||||||
int8_t _lastOutput;
|
|
||||||
|
|
||||||
void UpdateOutputLevel()
|
|
||||||
{
|
|
||||||
if (_currentOutput != _lastOutput) {
|
|
||||||
_console->GetApu()->AddExpansionAudioDelta(AudioChannel::InvA13, _currentOutput - _lastOutput);
|
|
||||||
_lastOutput = _currentOutput;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void StreamState(bool saving) override
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClockAudio() override
|
|
||||||
{
|
|
||||||
_currentOutput = _console->_InvA13;
|
|
||||||
UpdateOutputLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
InvA13Audio(shared_ptr<Console> console) : BaseExpansionAudio(console)
|
|
||||||
{
|
|
||||||
_lastOutput = 0;
|
|
||||||
_currentOutput = 0;
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,41 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "stdafx.h"
|
|
||||||
#include "Snapshotable.h"
|
|
||||||
#include "APU.h"
|
|
||||||
#include "BaseExpansionAudio.h"
|
|
||||||
#include "Console.h"
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
|
|
||||||
class InvOE1Audio : public BaseExpansionAudio
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
int8_t _currentOutput;
|
|
||||||
int8_t _lastOutput;
|
|
||||||
|
|
||||||
void UpdateOutputLevel()
|
|
||||||
{
|
|
||||||
if (_currentOutput != _lastOutput) {
|
|
||||||
_console->GetApu()->AddExpansionAudioDelta(AudioChannel::InvOE1, _currentOutput - _lastOutput);
|
|
||||||
_lastOutput = _currentOutput;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void StreamState(bool saving) override
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ClockAudio() override
|
|
||||||
{
|
|
||||||
_currentOutput = _console->_InvOE1;
|
|
||||||
UpdateOutputLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
InvOE1Audio(shared_ptr<Console> console) : BaseExpansionAudio(console)
|
|
||||||
{
|
|
||||||
_lastOutput = 0;
|
|
||||||
_currentOutput = 0;
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -87,6 +87,8 @@ int LuaApi::GetLibrary(lua_State *lua)
|
||||||
{ "reset", LuaApi::Reset },
|
{ "reset", LuaApi::Reset },
|
||||||
{ "stop", LuaApi::Stop },
|
{ "stop", LuaApi::Stop },
|
||||||
{ "breakExecution", LuaApi::Break },
|
{ "breakExecution", LuaApi::Break },
|
||||||
|
{ "stepOver", LuaApi::StepOver },
|
||||||
|
{ "stepOut", LuaApi::StepOut },
|
||||||
{ "resume", LuaApi::Resume },
|
{ "resume", LuaApi::Resume },
|
||||||
{ "execute", LuaApi::Execute },
|
{ "execute", LuaApi::Execute },
|
||||||
{ "rewind", LuaApi::Rewind },
|
{ "rewind", LuaApi::Rewind },
|
||||||
|
@ -168,6 +170,7 @@ int LuaApi::GetLibrary(lua_State *lua)
|
||||||
lua_pushintvalue(stateSaved, EventType::StateSaved);
|
lua_pushintvalue(stateSaved, EventType::StateSaved);
|
||||||
lua_pushintvalue(inputPolled, EventType::InputPolled);
|
lua_pushintvalue(inputPolled, EventType::InputPolled);
|
||||||
lua_pushintvalue(scriptEnded, EventType::ScriptEnded);
|
lua_pushintvalue(scriptEnded, EventType::ScriptEnded);
|
||||||
|
lua_pushintvalue(whilePaused, EventType::WhilePaused);
|
||||||
lua_settable(lua, -3);
|
lua_settable(lua, -3);
|
||||||
|
|
||||||
lua_pushliteral(lua, "executeCountType");
|
lua_pushliteral(lua, "executeCountType");
|
||||||
|
@ -584,6 +587,24 @@ int LuaApi::Execute(lua_State *lua)
|
||||||
return l.ReturnCount();
|
return l.ReturnCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LuaApi::StepOut(lua_State* lua)
|
||||||
|
{
|
||||||
|
LuaCallHelper l(lua);
|
||||||
|
checkparams();
|
||||||
|
checkinitdone();
|
||||||
|
_debugger->StepOut();
|
||||||
|
return l.ReturnCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
int LuaApi::StepOver(lua_State* lua)
|
||||||
|
{
|
||||||
|
LuaCallHelper l(lua);
|
||||||
|
checkparams();
|
||||||
|
checkinitdone();
|
||||||
|
_debugger->StepOver();
|
||||||
|
return l.ReturnCount();
|
||||||
|
}
|
||||||
|
|
||||||
int LuaApi::Rewind(lua_State *lua)
|
int LuaApi::Rewind(lua_State *lua)
|
||||||
{
|
{
|
||||||
LuaCallHelper l(lua);
|
LuaCallHelper l(lua);
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
static int Break(lua_State *lua);
|
static int Break(lua_State *lua);
|
||||||
static int Resume(lua_State *lua);
|
static int Resume(lua_State *lua);
|
||||||
static int Execute(lua_State *lua);
|
static int Execute(lua_State *lua);
|
||||||
|
static int StepOut(lua_State* lua);
|
||||||
|
static int StepOver(lua_State* lua);
|
||||||
static int Rewind(lua_State *lua);
|
static int Rewind(lua_State *lua);
|
||||||
|
|
||||||
static int TakeScreenshot(lua_State *lua);
|
static int TakeScreenshot(lua_State *lua);
|
||||||
|
|
|
@ -463,12 +463,6 @@ void PPU::WriteRAM(uint16_t addr, uint8_t value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPU::GetInvA13()
|
|
||||||
{
|
|
||||||
// pull level high when PPU/VRAM addr bit 13 is low
|
|
||||||
_A13pinLowSum += (bool)(_ppuBusAddress & 0x2000); // invert relative to 2A03
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t PPU::ReadPaletteRAM(uint16_t addr)
|
uint8_t PPU::ReadPaletteRAM(uint16_t addr)
|
||||||
{
|
{
|
||||||
addr &= 0x1F;
|
addr &= 0x1F;
|
||||||
|
@ -1351,7 +1345,6 @@ void PPU::Exec()
|
||||||
if(_needStateUpdate) {
|
if(_needStateUpdate) {
|
||||||
UpdateState();
|
UpdateState();
|
||||||
}
|
}
|
||||||
GetInvA13();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPU::UpdateState()
|
void PPU::UpdateState()
|
||||||
|
|
|
@ -180,8 +180,6 @@ class PPU : public IMemoryHandler, public Snapshotable
|
||||||
static constexpr int32_t OutputBufferSize = 256*240*2;
|
static constexpr int32_t OutputBufferSize = 256*240*2;
|
||||||
static constexpr int32_t OamDecayCycleCount = 3000;
|
static constexpr int32_t OamDecayCycleCount = 3000;
|
||||||
|
|
||||||
uint8_t _A13pinLowSum;
|
|
||||||
|
|
||||||
PPU(shared_ptr<Console> console);
|
PPU(shared_ptr<Console> console);
|
||||||
virtual ~PPU();
|
virtual ~PPU();
|
||||||
|
|
||||||
|
@ -214,8 +212,6 @@ class PPU : public IMemoryHandler, public Snapshotable
|
||||||
void Exec();
|
void Exec();
|
||||||
__forceinline void Run(uint64_t runTo);
|
__forceinline void Run(uint64_t runTo);
|
||||||
|
|
||||||
void GetInvA13();
|
|
||||||
|
|
||||||
uint32_t GetFrameCount()
|
uint32_t GetFrameCount()
|
||||||
{
|
{
|
||||||
return _frameCount;
|
return _frameCount;
|
||||||
|
|
|
@ -276,9 +276,7 @@ int16_t SoundMixer::GetOutputVolume(bool forRightChannel)
|
||||||
GetChannelOutput(AudioChannel::VRC7, forRightChannel) +
|
GetChannelOutput(AudioChannel::VRC7, forRightChannel) +
|
||||||
#endif
|
#endif
|
||||||
GetChannelOutput(AudioChannel::EPSM_L, forRightChannel) * 4 +
|
GetChannelOutput(AudioChannel::EPSM_L, forRightChannel) * 4 +
|
||||||
GetChannelOutput(AudioChannel::EPSM_R, forRightChannel) * 4 +
|
GetChannelOutput(AudioChannel::EPSM_R, forRightChannel) * 4
|
||||||
(GetChannelOutput(AudioChannel::InvA13, forRightChannel) * 20) / 3.0 + // 3 PPU samples per CPU clock
|
|
||||||
GetChannelOutput(AudioChannel::InvOE1, forRightChannel) * 100
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
private:
|
private:
|
||||||
static constexpr uint32_t MaxSampleRate = 96000;
|
static constexpr uint32_t MaxSampleRate = 96000;
|
||||||
static constexpr uint32_t MaxSamplesPerFrame = MaxSampleRate / 60 * 4 * 2; //x4 to allow CPU overclocking up to 10x, x2 for panning stereo
|
static constexpr uint32_t MaxSamplesPerFrame = MaxSampleRate / 60 * 4 * 2; //x4 to allow CPU overclocking up to 10x, x2 for panning stereo
|
||||||
static constexpr uint32_t MaxChannelCount = (uint32_t)AudioChannel::MaxChannelCount;
|
static constexpr uint32_t MaxChannelCount = 13;
|
||||||
|
|
||||||
IAudioDevice* _audioDevice;
|
IAudioDevice* _audioDevice;
|
||||||
EmulationSettings* _settings;
|
EmulationSettings* _settings;
|
||||||
|
|
|
@ -26,8 +26,6 @@ namespace Mesen.GUI.Config
|
||||||
[MinMax(0, 100)] public UInt32 Sunsoft5bVolume = 100;
|
[MinMax(0, 100)] public UInt32 Sunsoft5bVolume = 100;
|
||||||
[MinMax(0, 100)] public UInt32 EPSMVolume_L = 50;
|
[MinMax(0, 100)] public UInt32 EPSMVolume_L = 50;
|
||||||
[MinMax(0, 100)] public UInt32 EPSMVolume_R = 50;
|
[MinMax(0, 100)] public UInt32 EPSMVolume_R = 50;
|
||||||
[MinMax(0, 100)] public UInt32 InvA13Volume = 0;
|
|
||||||
[MinMax(0, 100)] public UInt32 InvOE1Volume = 0;
|
|
||||||
|
|
||||||
[MinMax(10000, 32000000)] public UInt32 EPSMClockFrequency = 3579545;
|
[MinMax(10000, 32000000)] public UInt32 EPSMClockFrequency = 3579545;
|
||||||
|
|
||||||
|
@ -44,8 +42,6 @@ namespace Mesen.GUI.Config
|
||||||
[MinMax(-100, 100)] public Int32 Sunsoft5bPanning = 0;
|
[MinMax(-100, 100)] public Int32 Sunsoft5bPanning = 0;
|
||||||
[MinMax(-100, 100)] public Int32 EPSMPanning_L = -100;
|
[MinMax(-100, 100)] public Int32 EPSMPanning_L = -100;
|
||||||
[MinMax(-100, 100)] public Int32 EPSMPanning_R = 100;
|
[MinMax(-100, 100)] public Int32 EPSMPanning_R = 100;
|
||||||
[MinMax(-100, 100)] public Int32 InvA13Panning = 0;
|
|
||||||
[MinMax(-100, 100)] public Int32 InvOE1Panning = 0;
|
|
||||||
|
|
||||||
[ValidValues(11025, 22050, 44100, 48000, 96000)] public UInt32 SampleRate = 48000;
|
[ValidValues(11025, 22050, 44100, 48000, 96000)] public UInt32 SampleRate = 48000;
|
||||||
public bool ReduceSoundInBackground = true;
|
public bool ReduceSoundInBackground = true;
|
||||||
|
@ -129,8 +125,6 @@ namespace Mesen.GUI.Config
|
||||||
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, ConvertVolume(audioInfo.EPSMVolume_R));
|
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, ConvertVolume(audioInfo.EPSMVolume_R));
|
||||||
InteropEmu.SetChannelVolume(AudioChannel.EPSM_L, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_L) : 0);
|
InteropEmu.SetChannelVolume(AudioChannel.EPSM_L, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_L) : 0);
|
||||||
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_R) : 0);
|
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_R) : 0);
|
||||||
InteropEmu.SetChannelVolume(AudioChannel.InvA13, ConvertVolume(audioInfo.InvA13Volume));
|
|
||||||
InteropEmu.SetChannelVolume(AudioChannel.InvOE1, ConvertVolume(audioInfo.InvOE1Volume));
|
|
||||||
|
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.Square1, ConvertPanning(audioInfo.Square1Panning));
|
InteropEmu.SetChannelPanning(AudioChannel.Square1, ConvertPanning(audioInfo.Square1Panning));
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.Square2, ConvertPanning(audioInfo.Square2Panning));
|
InteropEmu.SetChannelPanning(AudioChannel.Square2, ConvertPanning(audioInfo.Square2Panning));
|
||||||
|
@ -145,8 +139,6 @@ namespace Mesen.GUI.Config
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.Sunsoft5B, ConvertPanning(audioInfo.Sunsoft5bPanning));
|
InteropEmu.SetChannelPanning(AudioChannel.Sunsoft5B, ConvertPanning(audioInfo.Sunsoft5bPanning));
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.EPSM_L, ConvertPanning(audioInfo.EPSMPanning_L));
|
InteropEmu.SetChannelPanning(AudioChannel.EPSM_L, ConvertPanning(audioInfo.EPSMPanning_L));
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.EPSM_R, ConvertPanning(audioInfo.EPSMPanning_R));
|
InteropEmu.SetChannelPanning(AudioChannel.EPSM_R, ConvertPanning(audioInfo.EPSMPanning_R));
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.InvA13, ConvertPanning(audioInfo.InvA13Panning));
|
|
||||||
InteropEmu.SetChannelPanning(AudioChannel.InvOE1, ConvertPanning(audioInfo.InvOE1Panning));
|
|
||||||
|
|
||||||
InteropEmu.SetEPSMClockFrequency(audioInfo.EPSMClockFrequency);
|
InteropEmu.SetEPSMClockFrequency(audioInfo.EPSMClockFrequency);
|
||||||
|
|
||||||
|
|
|
@ -535,6 +535,8 @@ namespace Mesen.GUI.Debugger
|
||||||
new List<string> {"func","emu.breakExecution","emu.breakExecution()","","","Breaks the execution of the game and displays the debugger window."},
|
new List<string> {"func","emu.breakExecution","emu.breakExecution()","","","Breaks the execution of the game and displays the debugger window."},
|
||||||
new List<string> {"func","emu.stop","emu.stop()","","","Stops execution of the game."},
|
new List<string> {"func","emu.stop","emu.stop()","","","Stops execution of the game."},
|
||||||
new List<string> {"func","emu.execute","emu.execute(count, type)","count - *Integer* The number of cycles or instructions to run before breaking\ntype - *Enum* See executeCountType","","Runs the emulator for the specified number of cycles/instructions and then breaks the execution."},
|
new List<string> {"func","emu.execute","emu.execute(count, type)","count - *Integer* The number of cycles or instructions to run before breaking\ntype - *Enum* See executeCountType","","Runs the emulator for the specified number of cycles/instructions and then breaks the execution."},
|
||||||
|
new List<string> {"func","emu.stepOver", "emu.stepOver()", "","","Step over the next instruction."},
|
||||||
|
new List<string> {"func","emu.stepOut", "emu.stepOut()", "","","Step out of the subroutine."},
|
||||||
new List<string> {"func","emu.reset","emu.reset()","","","Resets the current game."},
|
new List<string> {"func","emu.reset","emu.reset()","","","Resets the current game."},
|
||||||
new List<string> {"func","emu.resume","emu.resume()","","","Resumes execution after breaking."},
|
new List<string> {"func","emu.resume","emu.resume()","","","Resumes execution after breaking."},
|
||||||
new List<string> {"func","emu.rewind","emu.rewind(seconds)","seconds - *Integer* The number of seconds to rewind","","Instantly rewinds the emulation by the number of seconds specified.\n Note: this can only be called from within a 'StartFrame' event callback."},
|
new List<string> {"func","emu.rewind","emu.rewind(seconds)","seconds - *Integer* The number of seconds to rewind","","Instantly rewinds the emulation by the number of seconds specified.\n Note: this can only be called from within a 'StartFrame' event callback."},
|
||||||
|
@ -578,6 +580,7 @@ namespace Mesen.GUI.Debugger
|
||||||
new List<string> {"enum","emu.eventType.inputPolled","Triggered when the emulation core polls the state of the input devices for the next frame","","",""},
|
new List<string> {"enum","emu.eventType.inputPolled","Triggered when the emulation core polls the state of the input devices for the next frame","","",""},
|
||||||
new List<string> {"enum","emu.eventType.spriteZeroHit","Triggered when the PPU sets the sprite zero hit flag","","",""},
|
new List<string> {"enum","emu.eventType.spriteZeroHit","Triggered when the PPU sets the sprite zero hit flag","","",""},
|
||||||
new List<string> {"enum","emu.eventType.scriptEnded","Triggered when the current Lua script ends (script window closed, execution stopped, etc.)","","",""},
|
new List<string> {"enum","emu.eventType.scriptEnded","Triggered when the current Lua script ends (script window closed, execution stopped, etc.)","","",""},
|
||||||
|
new List<string> {"enum","emu.eventType.whilePaused","Triggered repeatedly while execution is paused","","",""},
|
||||||
new List<string> {"enum","emu.executeCountType","emu.executeCountType.[value]","","","Values:\ncpuCycles = 0,\nppuCycles = 1,\ncpuInstructions = 2\n\nUsed by execute calls." },
|
new List<string> {"enum","emu.executeCountType","emu.executeCountType.[value]","","","Values:\ncpuCycles = 0,\nppuCycles = 1,\ncpuInstructions = 2\n\nUsed by execute calls." },
|
||||||
new List<string> {"enum","emu.executeCountType.cpuCycles","Count the number of CPU cycles","","",""},
|
new List<string> {"enum","emu.executeCountType.cpuCycles","Count the number of CPU cycles","","",""},
|
||||||
new List<string> {"enum","emu.executeCountType.ppuCycles","Count the number of PPU cycles","","",""},
|
new List<string> {"enum","emu.executeCountType.ppuCycles","Count the number of PPU cycles","","",""},
|
||||||
|
|
1063
GUI.NET/Forms/Config/frmAudioConfig.Designer.cs
generated
1063
GUI.NET/Forms/Config/frmAudioConfig.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -46,8 +46,6 @@ namespace Mesen.GUI.Forms.Config
|
||||||
AddBinding("Sunsoft5bVolume", trkSunsoft5b);
|
AddBinding("Sunsoft5bVolume", trkSunsoft5b);
|
||||||
AddBinding("EPSMVolume_L", trkEPSMVol_L);
|
AddBinding("EPSMVolume_L", trkEPSMVol_L);
|
||||||
AddBinding("EPSMVolume_R", trkEPSMVol_R);
|
AddBinding("EPSMVolume_R", trkEPSMVol_R);
|
||||||
AddBinding("InvA13Volume", trkInvA13Vol);
|
|
||||||
AddBinding("InvOE1Volume", trkInvOE1Vol);
|
|
||||||
|
|
||||||
AddBinding("Square1Panning", trkSquare1Pan);
|
AddBinding("Square1Panning", trkSquare1Pan);
|
||||||
AddBinding("Square2Panning", trkSquare2Pan);
|
AddBinding("Square2Panning", trkSquare2Pan);
|
||||||
|
@ -62,8 +60,6 @@ namespace Mesen.GUI.Forms.Config
|
||||||
AddBinding("Sunsoft5bPanning", trkSunsoftPan);
|
AddBinding("Sunsoft5bPanning", trkSunsoftPan);
|
||||||
AddBinding("EPSMPanning_L", trkEPSMPan_L);
|
AddBinding("EPSMPanning_L", trkEPSMPan_L);
|
||||||
AddBinding("EPSMPanning_R", trkEPSMPan_R);
|
AddBinding("EPSMPanning_R", trkEPSMPan_R);
|
||||||
AddBinding("InvA13Panning", trkInvA13Pan);
|
|
||||||
AddBinding("InvOE1Panning", trkInvOE1Pan);
|
|
||||||
|
|
||||||
AddBinding("EPSMClockFrequency", nudEPSMClockFrequency);
|
AddBinding("EPSMClockFrequency", nudEPSMClockFrequency);
|
||||||
|
|
||||||
|
|
|
@ -691,7 +691,7 @@ namespace Mesen.GUI.Forms
|
||||||
|
|
||||||
this.StartEmuThread();
|
this.StartEmuThread();
|
||||||
this.BeginInvoke((MethodInvoker)(() => {
|
this.BeginInvoke((MethodInvoker)(() => {
|
||||||
if(DebugWindowManager.HasOpenedWindow) {
|
if(DebugWindowManager.HasOpenedWindow || _luaScriptsToLoad.Count > 0) {
|
||||||
DebugWorkspaceManager.GetWorkspace();
|
DebugWorkspaceManager.GetWorkspace();
|
||||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2303,9 +2303,7 @@ namespace Mesen.GUI
|
||||||
Namco163 = 9,
|
Namco163 = 9,
|
||||||
Sunsoft5B = 10,
|
Sunsoft5B = 10,
|
||||||
EPSM_L = 11,
|
EPSM_L = 11,
|
||||||
EPSM_R = 12,
|
EPSM_R= 12
|
||||||
InvA13 = 13,
|
|
||||||
InvOE1 = 14
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum EqualizerFilterType
|
public enum EqualizerFilterType
|
||||||
|
|
Loading…
Add table
Reference in a new issue