抽象Input|bios加载修正|接口规范

This commit is contained in:
sin365 2024-07-30 17:36:13 +08:00
parent 3816e73e5e
commit c1e030026f
8 changed files with 36 additions and 22 deletions

View File

@ -67,14 +67,26 @@ namespace MAME.Core.Common
private void LoadROMXML()
{
XElement xe = XElement.Parse(resource.Get_mame_xml());
XElement xe = XElement.Parse(resource.mame);
IEnumerable<XElement> elements = from ele in xe.Elements("game") select ele;
showInfoByElements(elements);
}
public Dictionary<string, RomInfo> GetGameList()
{
return RomInfo.dictName2Rom;
}
public void GetGameScreenSize(out int _width, out int _height)
{
_width = Video.fullwidth;
_height = Video.fullheight;
}
private void showInfoByElements(IEnumerable<XElement> elements)
{
RomInfo.romList = new List<RomInfo>();
RomInfo.dictName2Rom = new Dictionary<string, RomInfo>();
foreach (var ele in elements)
{
RomInfo rom = new RomInfo();
@ -86,6 +98,7 @@ namespace MAME.Core.Common
rom.Year = ele.Element("year").Value;
rom.Manufacturer = ele.Element("manufacturer").Value;
RomInfo.romList.Add(rom);
RomInfo.dictName2Rom[rom.Name] = rom;
//loadform.listView1.Items.Add(new ListViewItem(new string[] { rom.Description, rom.Year, rom.Name, rom.Parent, rom.Direction, rom.Manufacturer, rom.Board }));
}
}

View File

@ -42,7 +42,7 @@ namespace mame
{
m_KeyStates[(int)key].IsPressed = true;
}
for (int i = 0; i < 256; i++)
for (int i = 0; i < finalIndex; i++)
{
if (m_KeyStates[i].IsPressed)
{

View File

@ -5,6 +5,7 @@ namespace mame
public class RomInfo
{
public static List<RomInfo> romList;
public static Dictionary<string,RomInfo> dictName2Rom;
public static RomInfo Rom;
public string Name, Board;
public string Parent;

View File

@ -36,7 +36,7 @@ namespace mame
gfx2rom = Machine.GetRom("gfx2.rom");
gfx3rom = ByteTo2byte(Machine.GetRom("gfx3.rom"));
user1rom = Machine.GetRom("user1.rom");
mcurom = mainMotion.resource.Get_mcu();
mcurom = mainMotion.resource.mcu;
voicerom = new byte[0xc0000];
byte[] bb1 = Machine.GetRom("voice.rom");
Array.Copy(bb1, voicerom, bb1.Length);

View File

@ -41,10 +41,10 @@ namespace mame
Memory.audioram = new byte[0x800];
Machine.bRom = true;
dsw = 0xff;
fixedbiosrom = mainMotion.resource.Get_sfix();
zoomyrom = mainMotion.resource.Get__000_lo();
audiobiosrom = mainMotion.resource.Get_sm1();
mainbiosrom = mainMotion.resource.Get_mainbios();
fixedbiosrom = mainMotion.resource.sfix;
zoomyrom = mainMotion.resource._000_lo;
audiobiosrom = mainMotion.resource.sm1;
mainbiosrom = mainMotion.resource.mainbios;
Memory.mainrom = Machine.GetRom("maincpu.rom");
Memory.audiorom = Machine.GetRom("audiocpu.rom");
fixedrom = Machine.GetRom("fixed.rom");

View File

@ -1,7 +1,6 @@
using cpu.m68000;
using MAME.Core.Common;
using System;
using System.IO;
namespace mame
{
@ -16,9 +15,9 @@ namespace mame
public static void PGMInit()
{
Machine.bRom = true;
mainbiosrom = mainMotion.resource.Get_pgmmainbios();
videobios = mainMotion.resource.Get_pgmvideobios();
audiobios = mainMotion.resource.Get_pgmaudiobios();
mainbiosrom = mainMotion.resource.pgmmainbios;
videobios = mainMotion.resource.pgmvideobios;
audiobios = mainMotion.resource.pgmaudiobios;
ICS2115.icsrom = audiobios;
byte[] bb1, bb2;
int i3, n1, n2, n3;

View File

@ -2,14 +2,16 @@
{
public interface IResources
{
byte[] Get_sfix();
byte[] Get__000_lo();
byte[] Get_sm1();
byte[] Get_mainbios();
byte[] Get_pgmmainbios();
byte[] Get_pgmvideobios();
byte[] Get_pgmaudiobios();
byte[] Get_mcu();
string Get_mame_xml();
byte[] mcu { get; }
byte[] sfix { get; }
byte[] _000_lo { get; }
byte[] sm1 { get; }
byte[] mainbios { get; }
byte[] pgmmainbios { get; }
byte[] pgmvideobios { get; }
byte[] pgmaudiobios { get; }
byte[] _1 { get; }
byte[] readme { get; }
string mame { get; }
}
}

View File

@ -2,7 +2,6 @@
{
public interface IVideoPlayer
{
void SubmitVideo(int[] data);
}
}