core替换为7.7版本

This commit is contained in:
ALIENJACK\alien 2024-07-03 18:15:28 +08:00
parent 7b2b0f3d20
commit ed4af60268
212 changed files with 29835 additions and 29813 deletions

View File

@ -1,8 +1,6 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal abstract class Bandai : Board
{
@ -140,4 +138,3 @@ namespace MyNes.Core
eprom.LoadState(stream);
}
}
}

View File

@ -1,6 +1,4 @@
namespace MyNes.Core
{
namespace MyNes.Core;
internal struct BankInfo
{
@ -26,4 +24,3 @@ namespace MyNes.Core
this.IsBattery = IsBattery;
}
}
}

View File

@ -1,7 +1,7 @@
using System.Collections.Generic;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class BankInfoSorter : IComparer<BankInfo>
{
public int Compare(BankInfo x, BankInfo y)
@ -13,4 +13,3 @@ namespace MyNes.Core
return result2 - result;
}
}
}

View File

@ -1,9 +1,8 @@
namespace MyNes.Core
{
namespace MyNes.Core;
internal class BlankJoypad : IJoypadConnecter
{
public override void Update()
{
}
}
}

View File

@ -1,5 +1,4 @@
namespace MyNes.Core
{
namespace MyNes.Core;
internal class BlankShortuctsHandler : IShortcutsHandler
{
@ -7,4 +6,3 @@ namespace MyNes.Core
{
}
}
}

View File

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal abstract class Board
{
protected byte[][] PRG_RAM;
@ -1114,4 +1114,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class BoardInfoAttribute : Attribute
{
public string Name { get; private set; }
@ -54,4 +54,3 @@ namespace MyNes.Core
this.PPUA12TogglesOnRaisingEdge = PPUA12TogglesOnRaisingEdge;
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public class BoardInfoObject
{
public string Name { get; internal set; }
@ -12,4 +12,3 @@ namespace MyNes.Core
public bool HasIssues { get; internal set; }
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
internal enum CHRArea : byte
{
Area0000,
@ -11,4 +11,3 @@ namespace MyNes.Core
Area1800,
Area1C00
}
}

View File

@ -1,5 +1,5 @@
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class Adler32
{
private const int BASE = 65521;
@ -69,4 +69,3 @@ namespace ComponentAce.Compression.Libs.zlib
return (num2 << 16) | num;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public sealed class Deflate
{
internal class Config
@ -333,7 +333,15 @@ namespace ComponentAce.Compression.Libs.zlib
internal static bool smaller(short[] tree, int n, int m, byte[] depth)
{
return tree[n * 2] < tree[m * 2] || (tree[n * 2] == tree[m * 2] && depth[n] <= depth[m]);
if (tree[n * 2] >= tree[m * 2])
{
if (tree[n * 2] == tree[m * 2])
{
return depth[n] <= depth[m];
}
return false;
}
return true;
}
internal void scan_tree(short[] tree, int max_code)
@ -738,9 +746,17 @@ namespace ComponentAce.Compression.Libs.zlib
flush_block_only(flush == 4);
if (strm.avail_out == 0)
{
return (flush == 4) ? 2 : 0;
if (flush != 4)
{
return 0;
}
return (flush != 4) ? 1 : 3;
return 2;
}
if (flush != 4)
{
return 1;
}
return 3;
}
internal void _tr_stored_block(int buf, int stored_len, bool eof)
@ -928,7 +944,11 @@ namespace ComponentAce.Compression.Libs.zlib
}
return 0;
}
return (flush != 4) ? 1 : 3;
if (flush != 4)
{
return 1;
}
return 3;
}
internal int deflate_slow(int flush)
@ -1032,7 +1052,11 @@ namespace ComponentAce.Compression.Libs.zlib
}
return 0;
}
return (flush != 4) ? 1 : 3;
if (flush != 4)
{
return 1;
}
return 3;
}
internal int longest_match(int cur_match)
@ -1167,7 +1191,11 @@ namespace ComponentAce.Compression.Libs.zlib
head = null;
prev = null;
window = null;
return (status == 113) ? (-3) : 0;
if (status != 113)
{
return 0;
}
return -3;
}
internal int deflateParams(ZStream strm, int _level, int _strategy)
@ -1181,7 +1209,7 @@ namespace ComponentAce.Compression.Libs.zlib
{
return -2;
}
if (config_table[level].func != config_table[_level].func && strm.total_in != 0)
if (config_table[level].func != config_table[_level].func && strm.total_in != 0L)
{
result = strm.deflate(1);
}
@ -1309,16 +1337,16 @@ namespace ComponentAce.Compression.Libs.zlib
{
status = 666;
}
if (num4 == 0 || num4 == 2)
switch (num4)
{
case 0:
case 2:
if (strm.avail_out == 0)
{
last_flush = -1;
}
return 0;
}
if (num4 == 1)
{
case 1:
if (flush == 1)
{
_tr_align();
@ -1340,6 +1368,7 @@ namespace ComponentAce.Compression.Libs.zlib
last_flush = -1;
return 0;
}
break;
}
}
if (flush != 4)
@ -1354,7 +1383,11 @@ namespace ComponentAce.Compression.Libs.zlib
putShortMSB((int)(strm.adler & 0xFFFF));
strm.flush_pending();
noheader = -1;
return (pending == 0) ? 1 : 0;
if (pending == 0)
{
return 1;
}
return 0;
}
static Deflate()
@ -1376,4 +1409,3 @@ namespace ComponentAce.Compression.Libs.zlib
config_table[9] = new Config(32, 258, 258, 4096, 2);
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class InfBlocks
{
private const int MANY = 1440;
@ -420,9 +420,8 @@ namespace ComponentAce.Compression.Libs.zlib
write = num4;
return inflate_flush(z, r);
}
if (tb[0] == -1)
{
}
_ = tb[0];
_ = -1;
num6 = hufts[(tb[0] + (num3 & inflate_mask[num6])) * 3 + 1];
int num7 = hufts[(tb[0] + (num3 & inflate_mask[num6])) * 3 + 2];
if (num7 < 16)
@ -599,7 +598,11 @@ namespace ComponentAce.Compression.Libs.zlib
internal int sync_point()
{
return (mode == 1) ? 1 : 0;
if (mode != 1)
{
return 0;
}
return 1;
}
internal int inflate_flush(ZStream z, int r)
@ -655,4 +658,3 @@ namespace ComponentAce.Compression.Libs.zlib
return r;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class InfCodes
{
private static readonly int[] inflate_mask = new int[17]
@ -54,7 +54,7 @@ namespace ComponentAce.Compression.Libs.zlib
internal int[] tree;
internal int tree_index = 0;
internal int tree_index;
internal int need;
@ -509,7 +509,6 @@ namespace ComponentAce.Compression.Libs.zlib
num8 += array[(num9 + num8) * 3 + 2];
num8 += num2 & inflate_mask[num10];
num10 = array[(num9 + num8) * 3];
bool flag = true;
continue;
}
z.msg = "invalid distance code";
@ -611,7 +610,6 @@ namespace ComponentAce.Compression.Libs.zlib
num5--;
break;
}
bool flag2 = true;
continue;
}
if (((uint)num10 & 0x20u) != 0)
@ -663,4 +661,3 @@ namespace ComponentAce.Compression.Libs.zlib
return 0;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class InfTree
{
private const int MANY = 1440;
@ -398,7 +398,11 @@ namespace ComponentAce.Compression.Libs.zlib
}
}
}
return (num5 != 0 && num4 != 1) ? (-5) : 0;
if (num5 == 0 || num4 == 1)
{
return 0;
}
return -5;
}
internal static int inflate_trees_bits(int[] c, int[] bb, int[] tb, int[] hp, ZStream z)
@ -472,4 +476,3 @@ namespace ComponentAce.Compression.Libs.zlib
return 0;
}
}
}

View File

@ -1,5 +1,5 @@
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class Inflate
{
private const int MAX_WBITS = 15;
@ -250,7 +250,7 @@ namespace ComponentAce.Compression.Libs.zlib
case -3:
z.istate.mode = 13;
z.istate.marker = 0;
goto end_IL_004b;
goto end_IL_0031;
case 0:
num = f;
break;
@ -327,7 +327,7 @@ namespace ComponentAce.Compression.Libs.zlib
{
return -2;
}
end_IL_004b:
end_IL_0031:
break;
}
}
@ -406,4 +406,3 @@ namespace ComponentAce.Compression.Libs.zlib
return z.istate.blocks.sync_point();
}
}
}

View File

@ -1,5 +1,5 @@
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class StaticTree
{
private const int MAX_BITS = 15;
@ -123,4 +123,3 @@ namespace ComponentAce.Compression.Libs.zlib
static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, 19, 7);
}
}
}

View File

@ -1,8 +1,8 @@
using System.IO;
using System.Text;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public class SupportClass
{
public static long Identity(long literal)
@ -101,4 +101,3 @@ namespace ComponentAce.Compression.Libs.zlib
return Encoding.UTF8.GetChars(byteArray);
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
internal sealed class Tree
{
private const int MAX_BITS = 15;
@ -166,7 +166,11 @@ namespace ComponentAce.Compression.Libs.zlib
internal static int d_code(int dist)
{
return (dist < 256) ? _dist_code[dist] : _dist_code[256 + SupportClass.URShift(dist, 7)];
if (dist >= 256)
{
return _dist_code[256 + SupportClass.URShift(dist, 7)];
}
return _dist_code[dist];
}
internal void gen_bitlen(Deflate s)
@ -334,4 +338,3 @@ namespace ComponentAce.Compression.Libs.zlib
return SupportClass.URShift(num, 1);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public class ZInputStream : BinaryReader
{
protected ZStream z = new ZStream();
@ -16,9 +16,9 @@ namespace ComponentAce.Compression.Libs.zlib
protected bool compress;
internal Stream in_Renamed = null;
internal Stream in_Renamed;
internal bool nomoreinput = false;
internal bool nomoreinput;
public virtual int FlushMode
{
@ -131,4 +131,3 @@ namespace ComponentAce.Compression.Libs.zlib
in_Renamed.Close();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public class ZOutputStream : Stream
{
protected internal ZStream z = new ZStream();
@ -190,4 +190,3 @@ namespace ComponentAce.Compression.Libs.zlib
return 0L;
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public sealed class ZStream
{
private const int MAX_WBITS = 15;
@ -173,8 +173,10 @@ namespace ComponentAce.Compression.Libs.zlib
}
if (pending != 0)
{
if (dstate.pending_buf.Length <= dstate.pending_out || next_out.Length <= next_out_index || dstate.pending_buf.Length < dstate.pending_out + pending || next_out.Length < next_out_index + pending)
if (dstate.pending_buf.Length > dstate.pending_out && next_out.Length > next_out_index && dstate.pending_buf.Length >= dstate.pending_out + pending)
{
_ = next_out.Length;
_ = next_out_index + pending;
}
Array.Copy(dstate.pending_buf, dstate.pending_out, next_out, next_out_index, pending);
next_out_index += pending;
@ -219,4 +221,3 @@ namespace ComponentAce.Compression.Libs.zlib
_adler = null;
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public class ZStreamException : IOException
{
public ZStreamException()
@ -13,4 +13,3 @@ namespace ComponentAce.Compression.Libs.zlib
{
}
}
}

View File

@ -1,5 +1,5 @@
namespace ComponentAce.Compression.Libs.zlib
{
namespace ComponentAce.Compression.Libs.zlib;
public sealed class zlibConst
{
private const string version_Renamed_Field = "1.0.2";
@ -51,4 +51,3 @@ namespace ComponentAce.Compression.Libs.zlib
return "1.0.2";
}
}
}

View File

@ -1,7 +1,7 @@
using System.Security.Cryptography;
namespace MyNes.Core
{
namespace MyNes.Core;
public class Crc32 : HashAlgorithm
{
public const uint DefaultPolynomial = 3988292384u;
@ -106,4 +106,3 @@ namespace MyNes.Core
};
}
}
}

View File

@ -1,9 +1,8 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public enum EmuRegion
{
NTSC,
PALB,
DENDY
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
public class EmuSettings : ISettings
{
public string SnapsFolder = "Snaps";
@ -10,9 +10,9 @@ namespace MyNes.Core
public string SnapsFormat = ".png";
public bool SnapsReplace = false;
public bool SnapsReplace;
public int RegionSetting = 0;
public int RegionSetting;
public string StateFolder = "States";
@ -97,4 +97,3 @@ namespace MyNes.Core
StateHandler.StateFolder = StateFolder;
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class Eprom
{
private enum EpromDevice
@ -25,23 +25,23 @@ namespace MyNes.Core
private byte[] data;
private EpromMode mode = EpromMode.Data;
private EpromMode mode;
private EpromMode nextmode = EpromMode.Data;
private EpromMode nextmode;
private EpromDevice device = EpromDevice.X24C01;
private EpromDevice device;
private bool psda;
private bool pscl;
private int output = 0;
private int output;
private int cbit = 0;
private int cbit;
private int caddress = 0;
private int caddress;
private int cdata = 0;
private int cdata;
private bool isRead;
@ -380,4 +380,3 @@ namespace MyNes.Core
isRead = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal abstract class FFE : Board
{
protected bool irqEnable;
@ -53,4 +53,3 @@ namespace MyNes.Core
irqCounter = bin.ReadInt32();
}
}
}

View File

@ -1,7 +1,7 @@
using System.Collections.Generic;
namespace MyNes.Core
{
namespace MyNes.Core;
public class GameGenie
{
public string[] LettersTable = new string[16]
@ -138,8 +138,7 @@ namespace MyNes.Core
int num5 = 0;
int num6 = 0;
int num7 = 0;
int num8 = 0;
num8 = (code >> 7) & 1;
int num8 = (code >> 7) & 1;
num7 = (code >> 2) & 1;
num6 = (code >> 1) & 1;
num5 = code & 1;
@ -150,4 +149,3 @@ namespace MyNes.Core
return (byte)((num8 << 7) | (num7 << 6) | (num6 << 5) | (num5 << 4) | (num4 << 3) | (num3 << 2) | (num2 << 1) | num);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public struct GameGenieCode
{
public string Name;
@ -16,4 +16,3 @@ namespace MyNes.Core
public bool Enabled;
}
}

View File

@ -1,4 +1,3 @@
namespace MyNes.Core
{
namespace MyNes.Core;
internal delegate void GetIsPlaying(out bool playing);
}

View File

@ -1,8 +1,7 @@
using System;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class HassIssuesAttribute : Attribute
{
}
}

View File

@ -1,8 +1,8 @@
using System.IO;
using System.Security.Cryptography;
namespace MyNes.Core
{
namespace MyNes.Core;
public class HelperTools
{
public static string GetFileSize(string FilePath)
@ -88,8 +88,7 @@ namespace MyNes.Core
{
if (File.Exists(FilePath))
{
FileInfo fileInfo = new FileInfo(FilePath);
return fileInfo.Length;
return new FileInfo(FilePath).Length;
}
return 0L;
}
@ -117,10 +116,8 @@ namespace MyNes.Core
stream.Read(buffer, 0, (int)stream.Length);
stream.Close();
string text = "";
Crc32 crc = new Crc32();
byte[] array = crc.ComputeHash(buffer);
byte[] array2 = array;
foreach (byte b in array2)
byte[] array = new Crc32().ComputeHash(buffer);
foreach (byte b in array)
{
text += b.ToString("x2").ToLower();
}
@ -139,10 +136,8 @@ namespace MyNes.Core
stream.Read(buffer, 0, (int)(stream.Length - bytesToSkip));
stream.Close();
string text = "";
Crc32 crc = new Crc32();
byte[] array = crc.ComputeHash(buffer);
byte[] array2 = array;
foreach (byte b in array2)
byte[] array = new Crc32().ComputeHash(buffer);
foreach (byte b in array)
{
text += b.ToString("x2").ToLower();
}
@ -157,10 +152,8 @@ namespace MyNes.Core
{
byte[] buffer = GetBuffer(filePath);
string text = "";
SHA1Managed sHA1Managed = new SHA1Managed();
byte[] array = sHA1Managed.ComputeHash(buffer);
byte[] array2 = array;
foreach (byte b in array2)
byte[] array = new SHA1Managed().ComputeHash(buffer);
foreach (byte b in array)
{
text += b.ToString("x2").ToLower();
}
@ -178,4 +171,3 @@ namespace MyNes.Core
return array;
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public interface IAudioProvider
{
string Name { get; }
@ -26,4 +26,3 @@ namespace MyNes.Core
void SetVolume(int Vol);
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public abstract class IJoypadConnecter
{
protected byte DATA;
@ -15,4 +15,3 @@ namespace MyNes.Core
return DATA;
}
}
}

View File

@ -1,8 +1,8 @@
using System.IO;
using System.Security.Cryptography;
namespace MyNes.Core
{
namespace MyNes.Core;
public class INes : IRom
{
public bool HasBattery { get; private set; }
@ -25,10 +25,8 @@ namespace MyNes.Core
byte[] buffer = new byte[fileStream.Length - 16];
fileStream.Read(buffer, 0, (int)(fileStream.Length - 16));
base.SHA1 = "";
SHA1Managed sHA1Managed = new SHA1Managed();
byte[] array2 = sHA1Managed.ComputeHash(buffer);
byte[] array3 = array2;
foreach (byte b in array3)
byte[] array2 = new SHA1Managed().ComputeHash(buffer);
foreach (byte b in array2)
{
base.SHA1 += b.ToString("x2").ToLower();
}
@ -94,4 +92,3 @@ namespace MyNes.Core
fileStream.Close();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public abstract class IRom
{
public bool IsValid { get; set; }
@ -26,4 +26,3 @@ namespace MyNes.Core
{
}
}
}

View File

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace MyNes.Core
{
namespace MyNes.Core;
public abstract class ISettings
{
protected string filePath;
@ -115,7 +115,11 @@ namespace MyNes.Core
}
if (field.FieldType == typeof(bool))
{
return ((bool)value) ? "1" : "0";
if (!(bool)value)
{
return "0";
}
return "1";
}
if (field.FieldType == typeof(int))
{
@ -146,4 +150,3 @@ namespace MyNes.Core
return "";
}
}
}

View File

@ -1,7 +1,6 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public interface IShortcutsHandler
{
void Update();
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public abstract class IVSUnisystemDIPConnecter
{
public abstract void Update();
@ -22,4 +22,3 @@ namespace MyNes.Core
{
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public interface IVideoProvider
{
string Name { get; }
@ -38,4 +38,3 @@ namespace MyNes.Core
void ApplyFilter();
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public abstract class IZapperConnecter
{
protected bool Trigger;
@ -13,4 +13,3 @@ namespace MyNes.Core
return (byte)((Trigger ? 16u : 0u) | (State ? 8u : 0u));
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal abstract class MMC2 : Board
{
private byte chr_reg0A;
@ -113,4 +113,3 @@ namespace MyNes.Core
latch_b = stream.ReadByte();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class MMC5Pcm
{
internal byte output;
@ -39,7 +39,7 @@ namespace MyNes.Core
internal byte Read5010()
{
byte result = (byte)((irqTrip & PCMIRQenable) ? 128u : 0u);
byte result = (byte)((irqTrip & PCMIRQenable) ? 128 : 0);
irqTrip = false;
NesEmu.IRQFlags &= -9;
return result;
@ -83,4 +83,3 @@ namespace MyNes.Core
irqTrip = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
internal class MMC5Sqr
{
private byte[][] duty_cycle_sequences = new byte[4][]
@ -211,4 +211,3 @@ namespace MyNes.Core
output = bin.ReadInt32();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
public class MNInterfaceLanguage
{
public static string Message_RomInfoCanBeOnlyShown = "Rom info can be shown only when emulation is on (i.e. game is loaded)";
@ -126,4 +126,3 @@ namespace MyNes.Core
public static string IssueMapper255 = "Mapper 255 is not tested, issues may occur";
}
}

View File

@ -1,7 +1,6 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("NROM", 0)]
internal class Mapper000 : Board
{
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("MMC1", 1, 4, 64)]
internal class Mapper001 : Board
{
@ -10,9 +10,9 @@ namespace MyNes.Core
private byte[] reg = new byte[4];
private byte shift = 0;
private byte shift;
private byte buffer = 0;
private byte buffer;
private bool flag_p;
@ -242,4 +242,3 @@ namespace MyNes.Core
cpuCycles = stream.ReadInt32();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("UxROM", 2)]
internal class Mapper002 : Board
{
@ -14,4 +14,3 @@ namespace MyNes.Core
Switch16KPRG(val, PRGArea.Area8000);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("CNROM", 3)]
internal class Mapper003 : Board
{
@ -12,4 +12,3 @@ namespace MyNes.Core
Switch08KCHR(data_temp);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("MMC3", 4, true, true)]
internal class Mapper004 : Board
{
@ -221,4 +221,3 @@ namespace MyNes.Core
mmc3_alt_behavior = bin.ReadBoolean();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("MMC5", 5, 8, 16)]
[WithExternalSound]
[HassIssues]
@ -82,7 +82,9 @@ namespace MyNes.Core
private MMC5Pcm snd_3;
private double[][][][][] mix_table;
private double[] audio_pulse_table;
private double[] audio_tnd_table;
internal override string Issues => MNInterfaceLanguage.IssueMapper5;
@ -92,46 +94,29 @@ namespace MyNes.Core
snd_1 = new MMC5Sqr();
snd_2 = new MMC5Sqr();
snd_3 = new MMC5Pcm();
mix_table = new double[16][][][][];
for (int i = 0; i < 16; i++)
audio_pulse_table = new double[32];
for (int i = 0; i < 32; i++)
{
mix_table[i] = new double[16][][][];
for (int j = 0; j < 16; j++)
{
mix_table[i][j] = new double[16][][];
for (int k = 0; k < 16; k++)
{
mix_table[i][j][k] = new double[16][];
for (int l = 0; l < 16; l++)
{
mix_table[i][j][k][l] = new double[256];
for (int m = 0; m < 256; m++)
{
double num = 95.88 / (8128.0 / (double)(i + j) + 100.0);
double num2 = 159.79 / (1.0 / ((double)k / 8227.0 + (double)l / 12241.0 + (double)m / 22638.0) + 100.0);
mix_table[i][j][k][l][m] = num + num2;
}
}
}
audio_pulse_table[i] = 95.52 / (8128.0 / (double)i + 100.0);
}
audio_tnd_table = new double[204];
for (int j = 0; j < 204; j++)
{
audio_tnd_table[j] = 163.67 / (24329.0 / (double)j + 100.0);
}
}
internal override void HardReset()
{
base.HardReset();
string text = SHA1.ToUpper();
string text2 = text;
if (!(text2 == "37267833C984F176DB4B0BC9D45DABA0FFF45304"))
{
if (text2 == "800AEFE756E85A0A78CCB4DAE68EBBA5DF24BF41")
switch (SHA1.ToUpper())
{
case "37267833C984F176DB4B0BC9D45DABA0FFF45304":
useSRAMmirroring = true;
}
}
else
{
break;
case "800AEFE756E85A0A78CCB4DAE68EBBA5DF24BF41":
useSRAMmirroring = true;
break;
}
Console.WriteLine("MMC5: using PRG RAM mirroring = " + useSRAMmirroring);
CHROffset_spr = new int[8];
@ -273,8 +258,7 @@ namespace MyNes.Core
case 20758:
{
int num = prg_mode;
int num2 = num;
if ((uint)(num2 - 2) <= 1u)
if ((uint)(num - 2) <= 1u)
{
Toggle08KPRG_RAM((value & 0x80) == 0, PRGArea.AreaC000);
Switch08KPRG(value & 0x7F, PRGArea.AreaC000);
@ -531,9 +515,7 @@ namespace MyNes.Core
{
split_doit = split_watch_tile >= split_tile;
}
if (!split_doit)
{
}
_ = split_doit;
}
if (ExRAM_mode == 1)
{
@ -571,9 +553,7 @@ namespace MyNes.Core
internal override void ReadNMT(ref ushort address, out byte data)
{
if (split_doit)
{
}
_ = split_doit;
if (ExRAM_mode == 1)
{
if ((address & 0x3FF) <= 959)
@ -756,7 +736,7 @@ namespace MyNes.Core
internal override double APUGetSample()
{
return mix_table[snd_1.output][snd_2.output][0][0][snd_3.output];
return audio_pulse_table[snd_1.output + snd_2.output] + audio_tnd_table[snd_3.output];
}
internal override void APUApplyChannelsSettings()
@ -887,4 +867,3 @@ namespace MyNes.Core
snd_3.LoadState(ref stream);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("FFE F4xxx", 6)]
[HassIssues]
internal class Mapper006 : FFE
@ -18,4 +18,3 @@ namespace MyNes.Core
Switch16KPRG((data >> 2) & 0xF, PRGArea.Area8000);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("AxROM", 7)]
internal class Mapper007 : Board
{
@ -9,4 +9,3 @@ namespace MyNes.Core
Switch32KPRG(val & 7, PRGArea.Area8000);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("FFE F3xxx", 8)]
[HassIssues]
internal class Mapper008 : FFE
@ -12,4 +12,3 @@ namespace MyNes.Core
Switch08KCHR(data & 3);
}
}
}

View File

@ -1,7 +1,6 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("MMC2", 9)]
internal class Mapper009 : MMC2
{
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("MMC4", 10)]
internal class Mapper010 : MMC2
{
@ -22,4 +22,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Color Dreams", 11)]
internal class Mapper011 : Board
{
@ -13,4 +13,3 @@ namespace MyNes.Core
Switch08KCHR((writeData >> 4) & 0xF);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("CPROM", 13, 1, 16)]
internal class Mapper013 : Board
{
@ -18,4 +18,3 @@ namespace MyNes.Core
Switch04KCHR(writeData & 3, CHRArea.Area1000);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("100-in-1 Contra Function 16", 15)]
internal class Mapper015 : Board
{
@ -33,4 +33,3 @@ namespace MyNes.Core
Switch01KNMTFromMirroring(((data & 0x40) == 64) ? Mirroring.Horz : Mirroring.Vert);
}
}
}

View File

@ -1,7 +1,6 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Bandai", 16)]
internal class Mapper016 : Bandai
{
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("FFE F8xxx", 17)]
internal class Mapper017 : FFE
{
@ -61,4 +61,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Jaleco SS8806", 18)]
internal class Mapper018 : Board
{
@ -216,4 +216,3 @@ namespace MyNes.Core
irqMask = stream.ReadInt32();
}
}
}

View File

@ -1,7 +1,6 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Namcot 106", 19, 1, 256)]
internal class Mapper019 : Namcot106
{
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC4", 21)]
internal class Mapper021 : Board
{
@ -251,4 +251,3 @@ namespace MyNes.Core
irq_enable_on_ak = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC2", 22)]
internal class Mapper022 : Board
{
@ -135,4 +135,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC2", 23)]
internal class Mapper023 : Board
{
@ -160,4 +160,3 @@ namespace MyNes.Core
security = stream.ReadByte();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC6", 24)]
[WithExternalSound]
internal class Mapper024 : Board
@ -242,4 +242,3 @@ namespace MyNes.Core
snd_3.LoadState(ref stream);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC4", 25)]
internal class Mapper025 : Board
{
@ -251,4 +251,3 @@ namespace MyNes.Core
irq_enable_on_ak = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("VRC6", 26)]
[WithExternalSound]
internal class Mapper026 : Board
@ -242,4 +242,3 @@ namespace MyNes.Core
snd_3.LoadState(ref stream);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Irem G-101", 32)]
internal class Mapper032 : Board
{
@ -106,4 +106,3 @@ namespace MyNes.Core
prg_reg0 = stream.ReadByte();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Taito TC0190/TC0350", 33)]
[HassIssues]
internal class Mapper033 : Board
@ -174,4 +174,3 @@ namespace MyNes.Core
irq_clear = stream.ReadBoolean();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("BxROM/NINA-001", 34)]
internal class Mapper034 : Board
{
@ -47,4 +47,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,13 +1,13 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Caltron 6-in-1", 41)]
internal class Mapper041 : Board
{
private bool enableReg = false;
private bool enableReg;
private int vromReg = 0;
private int vromReg;
internal override void HardReset()
{
@ -55,4 +55,3 @@ namespace MyNes.Core
vromReg = stream.ReadInt32();
}
}
}

View File

@ -1,15 +1,15 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Mario Baby", 42)]
internal class Mapper042 : Board
{
private int SRAM_PRG_Page = 0;
private int SRAM_PRG_Page;
private bool irqEnable = false;
private bool irqEnable;
private int irqCounter = 0;
private int irqCounter;
internal override void HardReset()
{
@ -91,4 +91,3 @@ namespace MyNes.Core
irqCounter = stream.ReadInt32();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("7-in-1 MMC3 Port A001h", 44, true, true)]
[HassIssues]
internal class Mapper044 : Board
@ -232,4 +232,3 @@ namespace MyNes.Core
chr_or = stream.ReadInt32();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("X-in-1 MMC3 Port 6000hx4", 45, true, true)]
internal class Mapper045 : Board
{
@ -291,4 +291,3 @@ namespace MyNes.Core
regCounter = stream.ReadInt32();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("15-in-1 Color Dreams", 46)]
internal class Mapper046 : Board
{
@ -39,4 +39,3 @@ namespace MyNes.Core
chr_reg = stream.ReadInt32();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("2-in-1 MMC3 Port 6000h", 47, true, true)]
internal class Mapper047 : Board
{
@ -255,4 +255,3 @@ namespace MyNes.Core
irq_enabled = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Taito TC0190/TC0350", 48, true, true)]
internal class Mapper048 : Board
{
@ -169,4 +169,3 @@ namespace MyNes.Core
irq_clear = stream.ReadBoolean();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("4-in-1 MMC3 Port 6xxxh", 49, true, true)]
internal class Mapper049 : Board
{
@ -269,4 +269,3 @@ namespace MyNes.Core
prg_32Page = stream.ReadInt32();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("FDS-Port - Alt. Levels", 50)]
internal class Mapper050 : Board
{
@ -68,4 +68,3 @@ namespace MyNes.Core
irq_enabled = stream.ReadBoolean();
}
}
}

View File

@ -1,11 +1,11 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("11-in-1", 51)]
internal class Mapper051 : Board
{
private int bank = 0;
private int bank;
private int mode = 1;
@ -76,4 +76,3 @@ namespace MyNes.Core
offset = stream.ReadInt32();
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("7-in-1 MMC3 Port 6800h with SRAM", 52, true, true)]
internal class Mapper052 : Board
{
@ -270,4 +270,3 @@ namespace MyNes.Core
locked = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Unknown", 53)]
[HassIssues]
internal class Mapper053 : Board
@ -55,4 +55,3 @@ namespace MyNes.Core
epromFirst = stream.ReadBoolean();
}
}
}

View File

@ -1,17 +1,17 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Pirate SMB3", 56)]
internal class Mapper056 : Board
{
private int irqCounter = 0;
private int irqCounter;
private int irqLatch = 0;
private int irqLatch;
private bool irqEnabled = false;
private bool irqEnabled;
private int irqControl = 0;
private int irqControl;
private int switchControl = 0;
private int switchControl;
internal override string Issues => MNInterfaceLanguage.IssueMapper56;
@ -94,4 +94,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("6-in-1 (SuperGK)", 57)]
internal class Mapper057 : Board
{
@ -52,4 +52,3 @@ namespace MyNes.Core
chr_hhh = stream.ReadInt32();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("68-in-1 (Game Star)", 58)]
[HassIssues]
internal class Mapper058 : Board
@ -21,4 +21,3 @@ namespace MyNes.Core
Switch01KNMTFromMirroring(((address & 0x80) == 128) ? Mirroring.Horz : Mirroring.Vert);
}
}
}

View File

@ -1,14 +1,14 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Unknown", 60)]
[HassIssues]
internal class Mapper060 : Board
{
private int latch = 0;
private int latch;
private byte menu = 0;
private byte menu;
internal override string Issues => MNInterfaceLanguage.IssueMapper60;
@ -64,4 +64,3 @@ namespace MyNes.Core
menu = stream.ReadByte();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("20-in-1", 61)]
internal class Mapper061 : Board
{
@ -17,4 +17,3 @@ namespace MyNes.Core
Switch01KNMTFromMirroring(((address & 0x80) == 128) ? Mirroring.Horz : Mirroring.Vert);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Super 700-in-1", 62)]
internal class Mapper062 : Board
{
@ -21,4 +21,3 @@ namespace MyNes.Core
Switch01KNMTFromMirroring(((address & 0x80) == 128) ? Mirroring.Horz : Mirroring.Vert);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Tengen RAMBO-1", 64, true, true)]
internal class Mapper064 : Board
{
@ -255,4 +255,3 @@ namespace MyNes.Core
irq_mode = stream.ReadBoolean();
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Irem H-3001", 65)]
internal class Mapper065 : Board
{
@ -91,4 +91,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("GxROM", 66)]
internal class Mapper066 : Board
{
@ -9,4 +9,3 @@ namespace MyNes.Core
Switch08KCHR(data & 3);
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Sunsoft 3", 67)]
internal class Mapper067 : Board
{
@ -105,4 +105,3 @@ namespace MyNes.Core
odd = stream.ReadBoolean();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Sunsoft 4", 68)]
internal class Mapper068 : Board
{
@ -109,4 +109,3 @@ namespace MyNes.Core
temp = stream.ReadInt32();
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("FME-7/Sunsoft 5B", 69)]
[WithExternalSound]
internal class Mapper069 : Board
@ -256,4 +256,3 @@ namespace MyNes.Core
snd_3.LoadState(ref stream);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Bandai", 70)]
internal class Mapper070 : Board
{
@ -15,4 +15,3 @@ namespace MyNes.Core
Switch08KCHR(data & 0xF);
}
}
}

View File

@ -1,5 +1,5 @@
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Camerica", 71)]
internal class Mapper071 : Board
{
@ -27,4 +27,3 @@ namespace MyNes.Core
}
}
}
}

View File

@ -1,7 +1,7 @@
using System.IO;
namespace MyNes.Core
{
namespace MyNes.Core;
[BoardInfo("Jaleco Early Mapper 0", 72)]
internal class Mapper072 : Board
{
@ -50,4 +50,3 @@ namespace MyNes.Core
prg_reg = stream.ReadInt32();
}
}
}

Some files were not shown because too many files have changed in this diff Show More