Merge pull request #45 from mkwong98/master

Various updates
This commit is contained in:
NovaSquirrel 2021-08-15 11:58:49 -04:00 committed by GitHub
commit df1e9c9c27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 5830 additions and 4426 deletions

View file

@ -146,6 +146,12 @@ CdlRatios CodeDataLogger::GetRatios()
return ratios;
}
bool CodeDataLogger::IsNone(uint32_t absoluteAddr)
{
return _cdlData[absoluteAddr] == (uint8_t)CdlPrgFlags::None;
}
bool CodeDataLogger::IsCode(uint32_t absoluteAddr)
{
return (_cdlData[absoluteAddr] & (uint8_t)CdlPrgFlags::Code) == (uint8_t)CdlPrgFlags::Code;

View file

@ -80,6 +80,7 @@ public:
CdlRatios GetRatios();
bool IsNone(uint32_t absoluteAddr);
bool IsCode(uint32_t absoluteAddr);
bool IsJumpTarget(uint32_t absoluteAddr);
bool IsSubEntryPoint(uint32_t absoluteAddr);

View file

@ -767,6 +767,7 @@ bool Debugger::ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uin
AddressTypeInfo addressInfo;
GetAbsoluteAddressAndType(addr, &addressInfo);
int32_t absoluteAddr = addressInfo.Type == AddressType::PrgRom ? addressInfo.Address : -1;
bool isUnlogged = absoluteAddr >= 0 ? _codeDataLogger->IsNone(absoluteAddr) : false;
if(addressInfo.Type == AddressType::PrgRom && addressInfo.Address >= 0 && type != MemoryOperationType::DummyRead && type != MemoryOperationType::DummyWrite && _runToCycle == -1) {
if(type == MemoryOperationType::ExecOperand) {
_codeDataLogger->SetFlag(absoluteAddr, CdlPrgFlags::Code);
@ -820,6 +821,9 @@ bool Debugger::ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uin
} else if(CheckFlag(DebuggerFlags::BreakOnUnofficialOpCode) && _disassembler->IsUnofficialOpCode(value)) {
Step(1);
breakSource = BreakSource::BreakOnUnofficialOpCode;
} else if(CheckFlag(DebuggerFlags::BreakOnUnlogged) && isUnlogged && type == MemoryOperationType::ExecOpCode && absoluteAddr >= 0) {
Step(1);
breakSource = BreakSource::BreakOnUnlogged;
}
if(_runToCycle != -1) {

View file

@ -43,6 +43,7 @@ enum class DebuggerFlags
BreakOnPpu2006ScrollGlitch = 0x20000,
BreakOnBusConflict = 0x40000,
BreakOnUnlogged = 0x80000,
};
enum class BreakSource
@ -61,7 +62,8 @@ enum class BreakSource
Pause = 10,
BreakAfterSuspend = 11,
BreakOnPpu2006ScrollGlitch = 12,
BreakOnBusConflict = 13
BreakOnBusConflict = 13,
BreakOnUnlogged = 14
};
enum class AddressType

View file

@ -733,6 +733,7 @@ private:
bool _spritesEnabled = true;
uint32_t _screenRotation = 0;
uint32_t _exclusiveRefreshRate = 60;
uint32_t _exclusiveRefreshRate2 = 50;
ConsoleType _consoleType = ConsoleType::Nes;
ExpansionPortDevice _expansionDevice = ExpansionPortDevice::None;
@ -1316,6 +1317,30 @@ public:
return _exclusiveRefreshRate;
}
void SetExclusiveRefreshRate2(uint32_t refreshRate)
{
_exclusiveRefreshRate2 = refreshRate;
}
uint32_t GetExclusiveRefreshRate2()
{
return _exclusiveRefreshRate2;
}
uint32_t GetExclusiveRefreshRateByModel(NesModel m)
{
switch (m) {
case NesModel::NTSC:
return _exclusiveRefreshRate;
break;
case NesModel::PAL:
case NesModel::Dendy:
return _exclusiveRefreshRate2;
break;
}
return _exclusiveRefreshRate;
}
void SetExpansionDevice(ExpansionPortDevice expansionDevice)
{
_expansionDevice = expansionDevice;

View file

@ -90,6 +90,7 @@ struct HdPpuTileInfo : public HdTileKey
uint8_t BgColor;
uint8_t SpriteColor;
uint8_t PpuBackgroundColor;
uint32_t PaletteOffset;
uint8_t OAMIndex;
};

View file

@ -273,22 +273,24 @@ void HdPackBuilder::ProcessTile(uint32_t x, uint32_t y, uint16_t tileAddr, HdPpu
}
}
if ((x == 0 || ((tile.OffsetX & 0x07) == 0)) && (y == 0 || ((tile.OffsetY & 0x07) == 0))) {
if ((x == 0 || ((tile.OffsetX & 0x07) == 0)) && (y == 0 || (((tile.OffsetY & 0x07) == 0) && !tile.VerticalMirroring) || (((tile.OffsetY & 0x07) == 0x07) && tile.VerticalMirroring))) {
HdScreenTileInfo t;
t.IsChrRamTile = tile.IsChrRamTile;
t.PaletteColors = tile.PaletteColors;
t.ScreenX = x - tile.OffsetX;
t.ScreenY = y - tile.OffsetY - (tile.IsSpriteTile() ? 1 : 0);
memcpy(t.TileData, tile.TileData, 16);
t.TileIndex = tile.TileIndex;
t.IsNew = isNew;
if (tile.IsSpriteTile()) {
t.ScreenX = x;
t.ScreenY = y;
t.BackgroundPriority = tile.BackgroundPriority;
t.HorizontalMirroring = tile.HorizontalMirroring;
t.VerticalMirroring = tile.VerticalMirroring;
spritesOnScreen.push_back(t);
}
else {
t.ScreenX = x - tile.OffsetX;
t.ScreenY = y - tile.OffsetY;
bgTilesOnScreen.push_back(t);
}
}

View file

@ -135,6 +135,55 @@ struct HdPackBgPriorityCondition : public HdPackCondition
}
};
struct HdPackSpPalette0Condition : public HdPackCondition
{
string GetConditionName() override { return "sppalette0"; }
string ToString() override { return ""; }
bool IsExcludedFromFile() override { return true; }
bool InternalCheckCondition(HdScreenInfo* screenInfo, int x, int y, HdPpuTileInfo* tile) override
{
return tile && ((0x03 & (tile->PaletteOffset >> 2)) == 0x00);
}
};
struct HdPackSpPalette1Condition : public HdPackCondition
{
string GetConditionName() override { return "sppalette1"; }
string ToString() override { return ""; }
bool IsExcludedFromFile() override { return true; }
bool InternalCheckCondition(HdScreenInfo* screenInfo, int x, int y, HdPpuTileInfo* tile) override
{
return tile && ((0x03 & (tile->PaletteOffset >> 2)) == 0x01);
}
};
struct HdPackSpPalette2Condition : public HdPackCondition
{
string GetConditionName() override { return "sppalette2"; }
string ToString() override { return ""; }
bool IsExcludedFromFile() override { return true; }
bool InternalCheckCondition(HdScreenInfo* screenInfo, int x, int y, HdPpuTileInfo* tile) override
{
return tile && ((0x03 & (tile->PaletteOffset >> 2)) == 0x02);
}
};
struct HdPackSpPalette3Condition : public HdPackCondition
{
string GetConditionName() override { return "sppalette3"; }
string ToString() override { return ""; }
bool IsExcludedFromFile() override { return true; }
bool InternalCheckCondition(HdScreenInfo* screenInfo, int x, int y, HdPpuTileInfo* tile) override
{
return tile && ((0x03 & (tile->PaletteOffset >> 2)) == 0x03);
}
};
struct HdPackMemoryCheckCondition : public HdPackBaseMemoryCondition
{
HdPackMemoryCheckCondition() { _useCache = true; }

View file

@ -13,6 +13,15 @@
#define checkConstraint(x, y) if(!(x)) { MessageManager::Log(y); return; }
static const char windowsSlash = '\\';
static const char unixSlash = '/';
#if defined(_WIN32)
#define convertPathToNative(filepath) std::replace(filepath.begin(), filepath.end(), unixSlash, windowsSlash)
#else
#define convertPathToNative(filepath) std::replace(filepath.begin(), filepath.end(), windowsSlash, unixSlash)
#endif
#define convertPathToNativeVector(vector, idx) if (vector.size() > idx) { convertPathToNative(vector[idx]); }
HdPackLoader::HdPackLoader()
{
}
@ -165,14 +174,17 @@ bool HdPackLoader::LoadPack()
ProcessOverscanTag(tokens);
} else if(lineContent.substr(0, 5) == "<img>") {
lineContent = lineContent.substr(5);
convertPathToNative(lineContent);
if(!ProcessImgTag(lineContent)) {
return false;
}
} else if(lineContent.substr(0, 7) == "<patch>") {
tokens = StringUtilities::Split(lineContent.substr(7), ',');
convertPathToNativeVector(tokens, 0);
ProcessPatchTag(tokens);
} else if(lineContent.substr(0, 12) == "<background>") {
tokens = StringUtilities::Split(lineContent.substr(12), ',');
convertPathToNativeVector(tokens, 0);
ProcessBackgroundTag(tokens, conditions);
} else if(lineContent.substr(0, 11) == "<condition>") {
tokens = StringUtilities::Split(lineContent.substr(11), ',');
@ -186,9 +198,11 @@ bool HdPackLoader::LoadPack()
ProcessOptionTag(tokens);
} else if(lineContent.substr(0, 5) == "<bgm>") {
tokens = StringUtilities::Split(lineContent.substr(5), ',');
convertPathToNativeVector(tokens, 2);
ProcessBgmTag(tokens);
} else if(lineContent.substr(0, 5) == "<sfx>") {
tokens = StringUtilities::Split(lineContent.substr(5), ',');
convertPathToNativeVector(tokens, 2);
ProcessSfxTag(tokens);
}
}
@ -259,6 +273,38 @@ void HdPackLoader::InitializeGlobalConditions()
HdPackCondition* invBgpriority = new HdPackBgPriorityCondition();
invBgpriority->Name = "!bgpriority";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(invBgpriority));
HdPackCondition* sppalette0 = new HdPackSpPalette0Condition();
sppalette0->Name = "sppalette0";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(sppalette0));
HdPackCondition* invSppalette0 = new HdPackSpPalette0Condition();
invSppalette0->Name = "!sppalette0";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(invSppalette0));
HdPackCondition* sppalette1 = new HdPackSpPalette1Condition();
sppalette1->Name = "sppalette1";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(sppalette1));
HdPackCondition* invSppalette1 = new HdPackSpPalette1Condition();
invSppalette1->Name = "!sppalette1";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(invSppalette1));
HdPackCondition* sppalette2 = new HdPackSpPalette2Condition();
sppalette2->Name = "sppalette2";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(sppalette2));
HdPackCondition* invSppalette2 = new HdPackSpPalette2Condition();
invSppalette2->Name = "!sppalette2";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(invSppalette2));
HdPackCondition* sppalette3 = new HdPackSpPalette3Condition();
sppalette3->Name = "sppalette3";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(sppalette3));
HdPackCondition* invSppalette3 = new HdPackSpPalette3Condition();
invSppalette3->Name = "!sppalette3";
_data->Conditions.push_back(unique_ptr<HdPackCondition>(invSppalette3));
}
void HdPackLoader::ProcessOverscanTag(vector<string> &tokens)

View file

@ -96,6 +96,7 @@ void HdPpu::DrawPixel()
} else {
tileInfo.Sprite[j].SpriteColor = ReadPaletteRAM(sprite.PaletteOffset + tileInfo.Sprite[j].SpriteColorIndex);
}
tileInfo.Sprite[j].PaletteOffset = sprite.PaletteOffset;
tileInfo.Sprite[j].PpuBackgroundColor = tileInfo.Tile.PpuBackgroundColor;
tileInfo.Sprite[j].BgColorIndex = tileInfo.Tile.BgColorIndex;

View file

@ -23,7 +23,7 @@ chapter: false
**Fulscreen Resolution**: This option is shown only when exclusive fullsceen mode is enabled. It allows you to select the screen resolution that should be used when in exclusive fullscreen mode. The default resolution is the current Windows screen resolution.
**Requested Refresh Rate**: This option is shown only when exclusive fullsceen mode is enabled. It allows you to select your preferred refresh rate when running in exclusive fullscreen mode.
**Requested Refresh Rate**: This option is shown only when exclusive fullsceen mode is enabled. It allows you to select your preferred refresh rate for NTSC and PAL/Dendy when running in exclusive fullscreen mode.
**Use integer scale values when entering fullscreen mode**: By default, fullscreen mode fills the entire screen. However, this can cause non-integer scaling values to be used -- for example, in 1080p resolution, the scale becomes 4.5x. Since this can cause irregularly shaped pixels, you can use this option to use the nearest integer scale value instead (e.g 4x in this example).

View file

@ -392,6 +392,7 @@ The `Break Options` submenu contains a number of options to configure under whic
* **Break on unofficial opcodes**: Break the emulation whenever an unofficial opcode is about to execute.
* **Break on BRK**: Break the emulation whenever a BRK instruction is about to execute.
* **Break on CPU crash**: Break the emulation whenever an instruction that will cause the CPU to freeze is about to execute.
* **Break on unlogged code**: Break the emulation whenever an instruction that haven't been logged is about to execute.
<div></div>

View file

@ -113,6 +113,10 @@ A number of built-in conditions can be used to check the value of some flags:
* `hmirror`: True if the current pixel is a sprite pixel, and the sprite is mirrored horizontally.
* `vmirror`: True if the current pixel is a sprite pixel, and the sprite is mirrored vertically.
* `bgpriority`: True if the current pixel is a sprite pixel, and the sprite is marked as a background priority sprite.
* `sppalette0`: True if the current pixel is a sprite pixel, and the sprite is using the palette at address $3F10.
* `sppalette1`: True if the current pixel is a sprite pixel, and the sprite is using the palette at address $3F14.
* `sppalette2`: True if the current pixel is a sprite pixel, and the sprite is using the palette at address $3F18.
* `sppalette3`: True if the current pixel is a sprite pixel, and the sprite is using the palette at address $3F1C.
**Example:** `[hmirror]<tile>...`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -354,6 +354,7 @@ namespace Mesen.GUI.Config
public bool BreakOnInit = true;
public bool BreakOnPlay = false;
public bool BreakOnFirstCycle = true;
public bool BreakOnUnlogged = false;
public bool BringToFrontOnPause = false;
public bool BringToFrontOnBreak = true;

View file

@ -57,6 +57,7 @@ namespace Mesen.GUI.Config
public bool UseExclusiveFullscreen = false;
public string FullscreenResolution = "";
public VideoRefreshRates ExclusiveFullscreenRefreshRate = VideoRefreshRates._60;
public VideoRefreshRates ExclusiveFullscreenRefreshRate2 = VideoRefreshRates._50;
public bool UseCustomVsPalette = false;
public bool ShowColorIndexes = true;
@ -100,6 +101,7 @@ namespace Mesen.GUI.Config
InteropEmu.SetScreenRotation((UInt32)videoInfo.ScreenRotation);
InteropEmu.SetExclusiveRefreshRate((UInt32)videoInfo.ExclusiveFullscreenRefreshRate);
InteropEmu.SetExclusiveRefreshRate2((UInt32)videoInfo.ExclusiveFullscreenRefreshRate2);
InteropEmu.SetVideoFilter(videoInfo.VideoFilter);
InteropEmu.SetVideoResizeFilter(videoInfo.UseBilinearInterpolation ? VideoResizeFilter.Bilinear : VideoResizeFilter.NearestNeighbor);

File diff suppressed because it is too large Load diff

View file

@ -319,7 +319,7 @@ namespace Mesen.GUI.Debugger.Controls
_forceRefresh = false;
_selectedSprite = ramAddr / 4;
int spriteY = _spriteRam[ramAddr];
int spriteY = _spriteRam[ramAddr] + 1;
int tileIndex = _spriteRam[ramAddr + 1];
int attributes = _spriteRam[ramAddr + 2];
int spriteX = _spriteRam[ramAddr + 3];

File diff suppressed because it is too large Load diff

View file

@ -108,6 +108,7 @@ namespace Mesen.GUI.Debugger
this.mnuBreakOnPlay.Checked = ConfigManager.Config.DebugInfo.BreakOnPlay;
this.mnuBreakOnOpen.Checked = ConfigManager.Config.DebugInfo.BreakOnOpen;
this.mnuBreakOnUnofficialOpcodes.Checked = ConfigManager.Config.DebugInfo.BreakOnUnofficialOpcodes;
this.mnuBreakOnUnlogged.Checked = ConfigManager.Config.DebugInfo.BreakOnUnlogged;
this.mnuBreakOnBrk.Checked = ConfigManager.Config.DebugInfo.BreakOnBrk;
this.mnuBreakOnUninitMemoryRead.Checked = ConfigManager.Config.DebugInfo.BreakOnUninitMemoryRead;
this.mnuBreakOnBusConflict.Checked = ConfigManager.Config.DebugInfo.BreakOnBusConflict;
@ -426,6 +427,7 @@ namespace Mesen.GUI.Debugger
SetFlag(DebuggerFlags.ShowVerifiedData, config.ShowVerifiedData);
SetFlag(DebuggerFlags.ShowUnidentifiedData, config.ShowUnidentifiedData);
SetFlag(DebuggerFlags.BreakOnUnofficialOpCode, config.BreakOnUnofficialOpcodes);
SetFlag(DebuggerFlags.BreakOnUnlogged, config.BreakOnUnlogged);
SetFlag(DebuggerFlags.BreakOnBrk, config.BreakOnBrk);
SetFlag(DebuggerFlags.BreakOnUninitMemoryRead, config.BreakOnUninitMemoryRead);
SetFlag(DebuggerFlags.BreakOnDecayedOamRead, config.BreakOnDecayedOamRead);
@ -1178,6 +1180,13 @@ namespace Mesen.GUI.Debugger
UpdateDebuggerFlags();
}
private void mnuBreakOnUnlogged_Click(object sender, EventArgs e)
{
ConfigManager.Config.DebugInfo.BreakOnUnlogged = mnuBreakOnUnlogged.Checked;
ConfigManager.ApplyChanges();
UpdateDebuggerFlags();
}
private void mnuBreakOnBrk_Click(object sender, EventArgs e)
{
ConfigManager.Config.DebugInfo.BreakOnBrk = mnuBreakOnBrk.Checked;

View file

@ -121,12 +121,12 @@
<value>17, 17</value>
</metadata>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
<value>110, 17</value>
</metadata>
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>215, 17</value>
<value>222, 17</value>
</metadata>
<metadata name="tsToolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>324, 17</value>
<value>335, 17</value>
</metadata>
</root>

View file

@ -244,7 +244,8 @@
<Control ID="chkUseHdPacks">Fes servir els paquets d'alta resolució d'HDNes</Control>
<Control ID="chkUseExclusiveFullscreen">Fes servir el mode de pantalla completa exclusiva</Control>
<Control ID="lblFullscreenResolution">Fullscreen Resolution:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate NTSC:</Control>
<Control ID="lblRequestedRefreshRate2">PAL / Dendy:</Control>
<Control ID="tpgOverscan">Sobreescaneig</Control>
<Control ID="tpgOverscanGlobal">Global</Control>
<Control ID="tpgOverscanGameSpecific">Game-Specific</Control>

View file

@ -244,7 +244,8 @@
<Control ID="chkUseHdPacks">Use HDNes HD packs</Control>
<Control ID="chkUseExclusiveFullscreen">Use exclusive fullscreen mode</Control>
<Control ID="lblFullscreenResolution">Fullscreen Resolution:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate:</Control>
<Control ID="lblRequestedRefreshRate">Requested Refresh Rate NTSC:</Control>
<Control ID="lblRequestedRefreshRate2">PAL / Dendy:</Control>
<Control ID="tpgOverscan">Overscan</Control>
<Control ID="tpgOverscanGlobal">Global</Control>
<Control ID="tpgOverscanGameSpecific">Game-Specific</Control>
@ -1361,6 +1362,7 @@
<Value ID="PpuStep">PPU Step</Value>
<Value ID="BreakOnBrk">BRK</Value>
<Value ID="BreakOnUnofficialOpCode">Unofficial OP code</Value>
<Value ID="BreakOnUnlogged">Unlogged code</Value>
<Value ID="BreakOnReset">Reset event</Value>
<Value ID="BreakOnFocus">Debugger focused</Value>
<Value ID="BreakOnUninitMemoryRead">Uninitialized memory read</Value>

File diff suppressed because it is too large Load diff

View file

@ -36,6 +36,7 @@ namespace Mesen.GUI.Forms.Config
AddBinding("FullscreenForceIntegerScale", chkFullscreenForceIntegerScale);
AddBinding("UseExclusiveFullscreen", chkUseExclusiveFullscreen);
AddBinding("ExclusiveFullscreenRefreshRate", cboRefreshRate);
AddBinding("ExclusiveFullscreenRefreshRate2", cboRefreshRate2);
AddBinding("VideoScale", nudScale);
AddBinding("AspectRatio", cboAspectRatio);

View file

@ -121,14 +121,14 @@
<value>17, 17</value>
</metadata>
<metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>537, 17</value>
<value>561, 17</value>
</metadata>
<data name="imageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACs
BQAAAk1TRnQBSQFMAwEBAAFIAQABSAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA
BQAAAk1TRnQBSQFMAwEBAAFYAQABWAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA
ARADAAEBAQABGAYAAQweAAH5AvgB1QHBAbsBqAFyAWEBkAFHATABkAFHATABpgFuAVwB0gG8AbUB+AL2
pQAB1QHAAbkBlgFNATIBqgFaASwBuwFkASsBwAFpASkBwAFpASkBuwFlASwBqwFbAS0BmAFMATAB0wG9
AbWfAAHRAbgBrwGlAVgBMgHAAW0BLgHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHCAW0BLQHA
@ -156,12 +156,12 @@
</value>
</data>
<metadata name="contextPicturePresets.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
<value>229, 17</value>
</metadata>
<metadata name="colorDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
<value>110, 17</value>
</metadata>
<metadata name="contextPaletteList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>389, 17</value>
<value>406, 17</value>
</metadata>
</root>

View file

@ -226,6 +226,7 @@ namespace Mesen.GUI
[DllImport(DLLPath)] public static extern void SetVideoScale(double scale, ConsoleId consoleId = ConsoleId.Master);
[DllImport(DLLPath)] public static extern void SetScreenRotation(UInt32 angle);
[DllImport(DLLPath)] public static extern void SetExclusiveRefreshRate(UInt32 refreshRate);
[DllImport(DLLPath)] public static extern void SetExclusiveRefreshRate2(UInt32 refreshRate);
[DllImport(DLLPath)] public static extern void SetVideoAspectRatio(VideoAspectRatio aspectRatio, double customRatio);
[DllImport(DLLPath)] public static extern void SetVideoFilter(VideoFilterType filter);
[DllImport(DLLPath)] public static extern void SetVideoResizeFilter(VideoResizeFilter filter);
@ -1733,6 +1734,7 @@ namespace Mesen.GUI
BreakOnPpu2006ScrollGlitch = 0x20000,
BreakOnBusConflict = 0x40000,
BreakOnUnlogged = 0x80000,
}
public struct InteropRomInfo

View file

@ -654,6 +654,7 @@ namespace InteropEmu {
DllExport void __stdcall SetVideoScale(double scale, ConsoleId consoleId) { GetConsoleById(consoleId)->GetSettings()->SetVideoScale(scale); }
DllExport void __stdcall SetScreenRotation(uint32_t angle) { _settings->SetScreenRotation(angle); }
DllExport void __stdcall SetExclusiveRefreshRate(uint32_t angle) { _settings->SetExclusiveRefreshRate(angle); }
DllExport void __stdcall SetExclusiveRefreshRate2(uint32_t angle) { _settings->SetExclusiveRefreshRate2(angle); }
DllExport void __stdcall SetVideoAspectRatio(VideoAspectRatio aspectRatio, double customRatio) { _settings->SetVideoAspectRatio(aspectRatio, customRatio); }
DllExport void __stdcall SetVideoFilter(VideoFilterType filter) { _settings->SetVideoFilterType(filter); }
DllExport void __stdcall SetVideoResizeFilter(VideoResizeFilter filter) { _settings->SetVideoResizeFilter(filter); }

View file

@ -242,8 +242,18 @@ extern "C" {
{ 0 },
};
static const struct retro_system_content_info_override content_overrides[] = {
{
"nes|fds|unf|unif", /* extensions */
false, /* need_fullpath */
false /* persistent_data */
},
{ NULL, false, false }
};
retroEnv(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
retroEnv(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
retroEnv(RETRO_ENVIRONMENT_SET_CONTENT_INFO_OVERRIDE, (void*)content_overrides);
}
RETRO_API void retro_set_video_refresh(retro_video_refresh_t sendFrame)
@ -1034,7 +1044,43 @@ extern "C" {
_console->GetSettings()->SetControllerType(2, ControllerType::None);
_console->GetSettings()->SetControllerType(3, ControllerType::None);
VirtualFile romData(game->data, game->size, game->path);
// Attempt to fetch extended game info
const struct retro_game_info_ext *gameExt = NULL;
const void *gameData = NULL;
size_t gameSize = 0;
string gamePath("");
if (retroEnv(RETRO_ENVIRONMENT_GET_GAME_INFO_EXT, &gameExt)) {
gameData = gameExt->data;
gameSize = gameExt->size;
if (gameExt->file_in_archive) {
// We don't have a 'physical' file in this
// case, but the core still needs a filename
// in order to detect associated content
// (i.e. HdPacks). We therefore fake it, using
// the content directory, canonical content
// name, and content file extension
#if defined(_WIN32)
char slash = '\\';
#else
char slash = '/';
#endif
gamePath = string(gameExt->dir) +
string(1, slash) +
string(gameExt->name) +
"." +
string(gameExt->ext);
} else {
gamePath = gameExt->full_path;
}
} else {
// No extended game info; all we have is the
// content fullpath from the retro_game_info
// struct
gamePath = game->path;
}
// Load content
VirtualFile romData(gameData, gameSize, gamePath);
bool result = _console->Initialize(romData);
if(result) {
@ -1084,7 +1130,9 @@ extern "C" {
info->library_name = "Mesen";
info->library_version = _mesenVersion.c_str();
info->need_fullpath = false;
// need_fullpath is required since HdPacks are
// identified via the rom file name
info->need_fullpath = true;
info->valid_extensions = "nes|fds|unf|unif";
info->block_extract = false;
}

File diff suppressed because it is too large Load diff

View file

@ -288,7 +288,7 @@ HRESULT Renderer::InitDevice()
sd.BufferDesc.Width = _realScreenWidth;
sd.BufferDesc.Height = _realScreenHeight;
sd.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator = _console->GetSettings()->GetExclusiveRefreshRate();
sd.BufferDesc.RefreshRate.Numerator = _console->GetSettings()->GetExclusiveRefreshRateByModel(_console->GetModel());
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.Flags = _fullscreen ? DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH : 0;