Remove vba-next (#1969)
* remove vba-next c code * decouple mgba code from vbanext stuff * delete vbanext C# core * rip out gba core picker * remove reference to VBANext from .csproj file * consolidate
This commit is contained in:
parent
48658e2c3d
commit
8c17ac8da9
|
@ -1059,7 +1059,7 @@ namespace BizHawk.Client.Common
|
|||
nextEmulator = cpc;
|
||||
break;
|
||||
case "GBA":
|
||||
core = CoreInventory.Instance["GBA", Global.Config.PreferredCores["GBA"]];
|
||||
core = CoreInventory.Instance["GBA", CoreNames.Mgba];
|
||||
break;
|
||||
case "PSX":
|
||||
nextEmulator = new Octoshock(nextComm, null, null, rom.FileData, GetCoreSettings<Octoshock>(), GetCoreSyncSettings<Octoshock>(), "PSX etc.");
|
||||
|
|
|
@ -320,7 +320,6 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
["NES"] = CoreNames.QuickNes,
|
||||
["SNES"] = CoreNames.Snes9X,
|
||||
["GBA"] = CoreNames.Mgba,
|
||||
["GB"] = CoreNames.Gambatte
|
||||
};
|
||||
|
||||
|
|
|
@ -310,6 +310,6 @@ namespace BizHawk.Client.Common.movie.import
|
|||
}
|
||||
|
||||
private static SimpleController GbaController()
|
||||
=> new SimpleController { Definition = GBA.GBAController };
|
||||
=> new SimpleController { Definition = MGBAHawk.GBAController };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,9 +191,6 @@
|
|||
this.CoreSNESSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.Coresnes9xMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.CorebsnesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GbaCoreSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.VbaNextCoreMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.MgbaCoreMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SGBCoreSubmenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SgbBsnesMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SgbSameBoyMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -292,9 +289,6 @@
|
|||
this.GBGameGenieMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBPrinterViewerMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBASubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBACoreSelectionSubMenu = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBAmGBAMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBAVBANextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.GBAcoresettingsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator33 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.GbaGpuViewerMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -1802,7 +1796,6 @@
|
|||
this.CoresSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.NesCoreSubMenu,
|
||||
this.CoreSNESSubMenu,
|
||||
this.GbaCoreSubMenu,
|
||||
this.SGBCoreSubmenu,
|
||||
this.GBCoreSubmenu,
|
||||
this.GBInSGBMenuItem,
|
||||
|
@ -1885,30 +1878,6 @@
|
|||
this.CorebsnesMenuItem.Text = "BSNES";
|
||||
this.CorebsnesMenuItem.Click += new System.EventHandler(this.CoreSnesToggle_Click);
|
||||
//
|
||||
// GbaCoreSubMenu
|
||||
//
|
||||
this.GbaCoreSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.VbaNextCoreMenuItem,
|
||||
this.MgbaCoreMenuItem});
|
||||
this.GbaCoreSubMenu.Name = "GbaCoreSubMenu";
|
||||
this.GbaCoreSubMenu.Size = new System.Drawing.Size(223, 22);
|
||||
this.GbaCoreSubMenu.Text = "GBA";
|
||||
this.GbaCoreSubMenu.DropDownOpened += new System.EventHandler(this.GbaCoreSubMenu_DropDownOpened);
|
||||
//
|
||||
// VbaNextCoreMenuItem
|
||||
//
|
||||
this.VbaNextCoreMenuItem.Name = "VbaNextCoreMenuItem";
|
||||
this.VbaNextCoreMenuItem.Size = new System.Drawing.Size(120, 22);
|
||||
this.VbaNextCoreMenuItem.Text = "VBA-Next";
|
||||
this.VbaNextCoreMenuItem.Click += new System.EventHandler(this.GbaCorePick_Click);
|
||||
//
|
||||
// MgbaCoreMenuItem
|
||||
//
|
||||
this.MgbaCoreMenuItem.Name = "MgbaCoreMenuItem";
|
||||
this.MgbaCoreMenuItem.Size = new System.Drawing.Size(120, 22);
|
||||
this.MgbaCoreMenuItem.Text = "mGBA";
|
||||
this.MgbaCoreMenuItem.Click += new System.EventHandler(this.GbaCorePick_Click);
|
||||
//
|
||||
// SGBCoreSubmenu
|
||||
//
|
||||
this.SGBCoreSubmenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -2655,7 +2624,6 @@
|
|||
// GBASubMenu
|
||||
//
|
||||
this.GBASubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.GBACoreSelectionSubMenu,
|
||||
this.GBAcoresettingsToolStripMenuItem1,
|
||||
this.toolStripSeparator33,
|
||||
this.GbaGpuViewerMenuItem});
|
||||
|
@ -2664,30 +2632,6 @@
|
|||
this.GBASubMenu.Text = "GBA";
|
||||
this.GBASubMenu.DropDownOpened += new System.EventHandler(this.GBASubMenu_DropDownOpened);
|
||||
//
|
||||
// GBACoreSelectionSubMenu
|
||||
//
|
||||
this.GBACoreSelectionSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.GBAmGBAMenuItem,
|
||||
this.GBAVBANextMenuItem});
|
||||
this.GBACoreSelectionSubMenu.Name = "GBACoreSelectionSubMenu";
|
||||
this.GBACoreSelectionSubMenu.Size = new System.Drawing.Size(129, 22);
|
||||
this.GBACoreSelectionSubMenu.Text = "&Core";
|
||||
this.GBACoreSelectionSubMenu.DropDownOpened += new System.EventHandler(this.GBACoreSelectionSubMenu_DropDownOpened);
|
||||
//
|
||||
// GBAmGBAMenuItem
|
||||
//
|
||||
this.GBAmGBAMenuItem.Name = "GBAmGBAMenuItem";
|
||||
this.GBAmGBAMenuItem.Size = new System.Drawing.Size(120, 22);
|
||||
this.GBAmGBAMenuItem.Text = "mGBA";
|
||||
this.GBAmGBAMenuItem.Click += new System.EventHandler(this.UsemGBAMenuItem_Click);
|
||||
//
|
||||
// GBAVBANextMenuItem
|
||||
//
|
||||
this.GBAVBANextMenuItem.Name = "GBAVBANextMenuItem";
|
||||
this.GBAVBANextMenuItem.Size = new System.Drawing.Size(120, 22);
|
||||
this.GBAVBANextMenuItem.Text = "&VBA-Next";
|
||||
this.GBAVBANextMenuItem.Click += new System.EventHandler(this.UseVbaNextMenuItem_Click);
|
||||
//
|
||||
// GBAcoresettingsToolStripMenuItem1
|
||||
//
|
||||
this.GBAcoresettingsToolStripMenuItem1.Name = "GBAcoresettingsToolStripMenuItem1";
|
||||
|
@ -4398,9 +4342,6 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem subNesHawkMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator34;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator35;
|
||||
private System.Windows.Forms.ToolStripMenuItem GBACoreSelectionSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem GBAmGBAMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem GBAVBANextMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem PSXHashDiscsToolStripMenuItem;
|
||||
private System.Windows.Forms.Timer timerMouseIdle;
|
||||
|
@ -4455,9 +4396,6 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem NesCoreSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem QuicknesCoreMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem NesCoreMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem GbaCoreSubMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem VbaNextCoreMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem MgbaCoreMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem Atari7800HawkCoreMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem SGBCoreSubmenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem SgbBsnesMenuItem;
|
||||
|
|
|
@ -1258,23 +1258,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void GbaCoreSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
VbaNextCoreMenuItem.Checked = Config.PreferredCores["GBA"] == CoreNames.VbaNext;
|
||||
MgbaCoreMenuItem.Checked = Config.PreferredCores["GBA"] == CoreNames.Mgba;
|
||||
}
|
||||
|
||||
private void GbaCorePick_Click(object sender, EventArgs e)
|
||||
{
|
||||
Config.PreferredCores["GBA"] = Config.PreferredCores["GBA"] == CoreNames.VbaNext
|
||||
? CoreNames.Mgba
|
||||
: CoreNames.VbaNext;
|
||||
if (Emulator.SystemId == "GBA")
|
||||
{
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
}
|
||||
|
||||
private void SGBCoreSubmenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
SgbBsnesMenuItem.Checked = Config.SgbUseBsnes;
|
||||
|
@ -2000,29 +1983,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
Tools.Load<GbaGpuView>();
|
||||
}
|
||||
|
||||
private void UsemGBAMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Config.PreferredCores["GBA"] = CoreNames.Mgba;
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
||||
private void UseVbaNextMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Config.PreferredCores["GBA"] = CoreNames.VbaNext;
|
||||
FlagNeedsReboot();
|
||||
}
|
||||
|
||||
private void GBASubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
GbaGpuViewerMenuItem.Enabled = !OSTailoredCode.IsUnixHost;
|
||||
}
|
||||
|
||||
private void GBACoreSelectionSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
{
|
||||
GBAmGBAMenuItem.Checked = Config.PreferredCores["GBA"] == CoreNames.Mgba;
|
||||
GBAVBANextMenuItem.Checked = Config.PreferredCores["GBA"] == CoreNames.VbaNext;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region NDS
|
||||
|
|
|
@ -1663,9 +1663,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
byte[] sram;
|
||||
|
||||
// GBA meteor core might not know how big the saveram ought to be, so just send it the whole file
|
||||
// GBA vba-next core will try to eat anything, regardless of size
|
||||
if (Emulator is VBANext || Emulator is MGBAHawk || Emulator is NeoGeoPort)
|
||||
// some cores might not know how big the saveram ought to be, so just send it the whole file
|
||||
if (Emulator is MGBAHawk || Emulator is NeoGeoPort)
|
||||
{
|
||||
sram = File.ReadAllBytes(saveRamPath);
|
||||
}
|
||||
|
|
|
@ -166,11 +166,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
_current.CoreType = emu.GetType();
|
||||
var controller = new Controller(emu.ControllerDefinition);
|
||||
_current.BoardName = emu.HasBoardInfo() ? emu.AsBoardInfo().BoardName : null;
|
||||
// hack
|
||||
if (emu is VBANext vba)
|
||||
{
|
||||
_current.BoardName = vba.GameCode;
|
||||
}
|
||||
|
||||
_current.Frames = 0;
|
||||
_current.LaggedFrames = 0;
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
<Compile Update="Consoles/Nintendo/Gameboy/Gambatte.*.cs" DependentUpon="Gambatte.cs" />
|
||||
<Compile Update="Consoles/Nintendo/Gameboy/GambatteLink.*.cs" DependentUpon="GambatteLink.cs" />
|
||||
<Compile Update="Consoles/Nintendo/GBA/MGBAHawk.*.cs" DependentUpon="MGBAHawk.cs" />
|
||||
<Compile Update="Consoles/Nintendo/GBA/VBANext.*.cs" DependentUpon="VBANext.cs" />
|
||||
<Compile Update="Consoles/Nintendo/GBHawk/GBHawk.*.cs" DependentUpon="GBHawk.cs" />
|
||||
<Compile Update="Consoles/Nintendo/GBHawk/*_PPU.cs" DependentUpon="PPU.cs" />
|
||||
<Compile Update="Consoles/Nintendo/GBHawkLink/GBHawkLink.*.cs" DependentUpon="GBHawkLink.cs" />
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public static class GBA
|
||||
{
|
||||
private static readonly ControllerDefinition.AxisRange TiltRange = new ControllerDefinition.AxisRange(-32767, 0, 32767);
|
||||
|
||||
public static readonly ControllerDefinition GBAController = new ControllerDefinition
|
||||
{
|
||||
Name = "GBA Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
"Up", "Down", "Left", "Right", "Start", "Select", "B", "A", "L", "R", "Power"
|
||||
},
|
||||
AxisControls =
|
||||
{
|
||||
"Tilt X", "Tilt Y", "Tilt Z",
|
||||
"Light Sensor"
|
||||
},
|
||||
AxisRanges =
|
||||
{
|
||||
TiltRange, TiltRange, TiltRange,
|
||||
new ControllerDefinition.AxisRange(0, 100, 200),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,214 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public class LibVBANext
|
||||
{
|
||||
const string dllname = "libvbanext.dll";
|
||||
const CallingConvention cc = CallingConvention.Cdecl;
|
||||
|
||||
[Flags]
|
||||
public enum Buttons : int
|
||||
{
|
||||
A = 1,
|
||||
B = 2,
|
||||
Select = 4,
|
||||
Start = 8,
|
||||
Right = 16,
|
||||
Left = 32,
|
||||
Up = 64,
|
||||
Down = 128,
|
||||
R = 256,
|
||||
L = 512
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class FrontEndSettings
|
||||
{
|
||||
public enum SaveType : int
|
||||
{
|
||||
auto = 0,
|
||||
eeprom = 1,
|
||||
sram = 2,
|
||||
flash = 3,
|
||||
eeprom_sensor = 4,
|
||||
none = 5
|
||||
}
|
||||
public enum FlashSize : int
|
||||
{
|
||||
small = 0x10000,
|
||||
big = 0x20000
|
||||
}
|
||||
public SaveType saveType;
|
||||
public FlashSize flashSize = FlashSize.big;
|
||||
public bool enableRtc;
|
||||
public bool mirroringEnable;
|
||||
public bool skipBios;
|
||||
|
||||
public bool RTCUseRealTime = true;
|
||||
public int RTCyear; // 00..99
|
||||
public int RTCmonth; // 00..11
|
||||
public int RTCmday; // 01..31
|
||||
public int RTCwday; // 00..06
|
||||
public int RTChour; // 00..23
|
||||
public int RTCmin; // 00..59
|
||||
public int RTCsec; // 00..59
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// create a new context
|
||||
/// </summary>
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern IntPtr Create();
|
||||
|
||||
/// <summary>
|
||||
/// destroy a context
|
||||
/// </summary>
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void Destroy(IntPtr g);
|
||||
|
||||
/// <summary>
|
||||
/// load a rom
|
||||
/// </summary>
|
||||
/// <returns>success</returns>
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool LoadRom(IntPtr g, byte[] romfile, uint romfilelen, byte[] biosfile, uint biosfilelen, [In]FrontEndSettings settings);
|
||||
|
||||
/// <summary>
|
||||
/// hard reset
|
||||
/// </summary>
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void Reset(IntPtr g);
|
||||
|
||||
/// <summary>
|
||||
/// frame advance
|
||||
/// </summary>
|
||||
/// <param name="videobuffer">240x160 packed argb32</param>
|
||||
/// <param name="audiobuffer">buffer to recieve stereo audio</param>
|
||||
/// <param name="numsamp">number of samples created</param>
|
||||
/// <returns>true if lagged</returns>
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool FrameAdvance(IntPtr g, Buttons input, int[] videobuffer, short[] audiobuffer, out int numsamp, int[] videopalette);
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern int BinStateSize(IntPtr g);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool BinStateSave(IntPtr g, byte[] data, int length);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool BinStateLoad(IntPtr g, byte[] data, int length);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void TxtStateSave(IntPtr g, [In]ref TextStateFPtrs ff);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void TxtStateLoad(IntPtr g, [In]ref TextStateFPtrs ff);
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern int SaveRamSize(IntPtr g);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool SaveRamSave(IntPtr g, byte[] data, int length);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern bool SaveRamLoad(IntPtr g, byte[] data, int length);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void GetMemoryAreas(IntPtr g, [Out]MemoryAreas mem);
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SystemBusWrite(IntPtr g, int addr, byte val);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern byte SystemBusRead(IntPtr g, int addr);
|
||||
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void StandardCallback();
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetScanlineCallback(IntPtr g, StandardCallback cb, int scanline);
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern IntPtr GetRegisters(IntPtr g);
|
||||
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void AddressCallback(uint addr);
|
||||
|
||||
/// <param name="addr">if bit 0 is set, thumb mode</param>
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void TraceCallback(uint addr, uint opcode);
|
||||
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetPadCallback(IntPtr g, StandardCallback cb);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetFetchCallback(IntPtr g, AddressCallback cb);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetReadCallback(IntPtr g, AddressCallback cb);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetWriteCallback(IntPtr g, AddressCallback cb);
|
||||
[DllImport(dllname, CallingConvention = cc)]
|
||||
public static extern void SetTraceCallback(IntPtr g, TraceCallback cb);
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class MemoryAreas
|
||||
{
|
||||
public IntPtr bios;
|
||||
public IntPtr iwram;
|
||||
public IntPtr ewram;
|
||||
public IntPtr palram;
|
||||
public IntPtr vram;
|
||||
public IntPtr oam;
|
||||
public IntPtr rom;
|
||||
public IntPtr mmio;
|
||||
public IntPtr sram;
|
||||
public int sram_size;
|
||||
}
|
||||
|
||||
// this isn't used directly at the moment. but it could be used for something eventually...
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class Registers
|
||||
{
|
||||
public int R0;
|
||||
public int R1;
|
||||
public int R2;
|
||||
public int R3;
|
||||
public int R4;
|
||||
public int R5;
|
||||
public int R6;
|
||||
public int R7;
|
||||
public int R8;
|
||||
public int R9;
|
||||
public int R10;
|
||||
public int R11;
|
||||
public int R12;
|
||||
public int R13;
|
||||
public int R14;
|
||||
public int R15;
|
||||
public int CPSR;
|
||||
public int SPSR;
|
||||
public int R13_IRQ;
|
||||
public int R14_IRQ;
|
||||
public int SPSR_IRQ;
|
||||
public int _unk0; // what are these???
|
||||
public int _unk1;
|
||||
public int _unk2;
|
||||
public int _unk3;
|
||||
public int _unk4;
|
||||
public int R13_USR;
|
||||
public int R14_USR;
|
||||
public int R13_SVC;
|
||||
public int R14_SVC;
|
||||
public int SPSR_SVC;
|
||||
public int R13_ABT;
|
||||
public int R14_ABT;
|
||||
public int SPSR_ABT;
|
||||
public int R13_UND;
|
||||
public int R14_UND;
|
||||
public int SPSR_UND;
|
||||
public int R8_FIQ;
|
||||
public int R9_FIQ;
|
||||
public int R10_FIQ;
|
||||
public int R11_FIQ;
|
||||
public int R12_FIQ;
|
||||
public int R13_FIQ;
|
||||
public int R14_FIQ;
|
||||
public int SPSR_FIQ;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,39 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public static class LibmGBA
|
||||
{
|
||||
[Flags]
|
||||
public enum Buttons : int
|
||||
{
|
||||
A = 1,
|
||||
B = 2,
|
||||
Select = 4,
|
||||
Start = 8,
|
||||
Right = 16,
|
||||
Left = 32,
|
||||
Up = 64,
|
||||
Down = 128,
|
||||
R = 256,
|
||||
L = 512
|
||||
}
|
||||
|
||||
public static Buttons GetButtons(IController c)
|
||||
{
|
||||
Buttons ret = 0;
|
||||
foreach (string s in Enum.GetNames(typeof(Buttons)))
|
||||
{
|
||||
if (c.IsPressed(s))
|
||||
{
|
||||
ret |= (Buttons)Enum.Parse(typeof(Buttons), s);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
const string dll = "mgba.dll";
|
||||
const CallingConvention cc = CallingConvention.Cdecl;
|
||||
|
||||
|
@ -95,7 +124,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
public static extern void BizReset(IntPtr ctx);
|
||||
|
||||
[DllImport(dll, CallingConvention = cc)]
|
||||
public static extern bool BizAdvance(IntPtr ctx, LibVBANext.Buttons keys, int[] vbuff, ref int nsamp, short[] sbuff,
|
||||
public static extern bool BizAdvance(IntPtr ctx, Buttons keys, int[] vbuff, ref int nsamp, short[] sbuff,
|
||||
long time, short gyrox, short gyroy, short gyroz, byte luma);
|
||||
|
||||
[DllImport(dll, CallingConvention = cc)]
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
|
||||
public IEmulatorServiceProvider ServiceProvider { get; }
|
||||
|
||||
public ControllerDefinition ControllerDefinition => GBA.GBAController;
|
||||
public ControllerDefinition ControllerDefinition => GBAController;
|
||||
|
||||
private ITraceable Tracer { get; }
|
||||
|
||||
|
@ -117,7 +117,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
|
||||
IsLagFrame = LibmGBA.BizAdvance(
|
||||
Core,
|
||||
VBANext.GetButtons(controller),
|
||||
LibmGBA.GetButtons(controller),
|
||||
render ? _videobuff : _dummyvideobuff,
|
||||
ref _nsamp,
|
||||
renderSound ? _soundbuff : _dummysoundbuff,
|
||||
|
@ -249,5 +249,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
long increment = Frame * 4389L >> 18;
|
||||
return baseTime + increment;
|
||||
}
|
||||
|
||||
private static readonly ControllerDefinition.AxisRange TiltRange = new ControllerDefinition.AxisRange(-32767, 0, 32767);
|
||||
|
||||
public static readonly ControllerDefinition GBAController = new ControllerDefinition
|
||||
{
|
||||
Name = "GBA Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
"Up", "Down", "Left", "Right", "Start", "Select", "B", "A", "L", "R", "Power"
|
||||
},
|
||||
AxisControls =
|
||||
{
|
||||
"Tilt X", "Tilt Y", "Tilt Z",
|
||||
"Light Sensor"
|
||||
},
|
||||
AxisRanges =
|
||||
{
|
||||
TiltRange, TiltRange, TiltRange,
|
||||
new ControllerDefinition.AxisRange(0, 100, 200),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : IDebuggable
|
||||
{
|
||||
public IDictionary<string, RegisterValue> GetCpuFlagsAndRegisters() => regs.GetAllRegisters();
|
||||
|
||||
public void SetCpuRegister(string register, int value) => regs.SetRegister(register, value);
|
||||
|
||||
public bool CanStep(StepType type) => false;
|
||||
|
||||
private readonly MemoryCallbackSystem _memorycallbacks = new MemoryCallbackSystem(new[] { "System Bus" });
|
||||
public IMemoryCallbackSystem MemoryCallbacks => _memorycallbacks;
|
||||
|
||||
[FeatureNotImplemented]
|
||||
public void Step(StepType type) => throw new NotImplementedException();
|
||||
|
||||
[FeatureNotImplemented]
|
||||
public long TotalExecutedCycles => throw new NotImplementedException();
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : IGBAGPUViewable
|
||||
{
|
||||
public GBAGPUMemoryAreas GetMemoryAreas()
|
||||
{
|
||||
var s = new LibVBANext.MemoryAreas();
|
||||
LibVBANext.GetMemoryAreas(Core, s);
|
||||
return new GBAGPUMemoryAreas
|
||||
{
|
||||
mmio = s.mmio,
|
||||
oam = s.oam,
|
||||
palram = s.palram,
|
||||
vram = s.vram
|
||||
};
|
||||
}
|
||||
|
||||
public void SetScanlineCallback(Action callback, int scanline)
|
||||
{
|
||||
if (scanline < 0 || scanline > 227)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(scanline), "Scanline must be in [0, 227]!");
|
||||
}
|
||||
|
||||
if (callback == null)
|
||||
{
|
||||
scanlinecb = null;
|
||||
LibVBANext.SetScanlineCallback(Core, scanlinecb, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
scanlinecb = new LibVBANext.StandardCallback(callback);
|
||||
LibVBANext.SetScanlineCallback(Core, scanlinecb, scanline);
|
||||
}
|
||||
}
|
||||
|
||||
private LibVBANext.StandardCallback scanlinecb;
|
||||
}
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext
|
||||
{
|
||||
private IMemoryDomains _memoryDomains;
|
||||
|
||||
private void InitMemoryDomains()
|
||||
{
|
||||
var mm = new List<MemoryDomain>();
|
||||
var s = new LibVBANext.MemoryAreas();
|
||||
var l = MemoryDomain.Endian.Little;
|
||||
LibVBANext.GetMemoryAreas(Core, s);
|
||||
|
||||
mm.Add(new MemoryDomainIntPtr("IWRAM", l, s.iwram, 32 * 1024, true, 4));
|
||||
mm.Add(new MemoryDomainIntPtr("EWRAM", l, s.ewram, 256 * 1024, true, 4));
|
||||
mm.Add(new MemoryDomainIntPtr("BIOS", l, s.bios, 16 * 1024, false, 4));
|
||||
mm.Add(new MemoryDomainIntPtr("PALRAM", l, s.palram, 1024, false, 4));
|
||||
mm.Add(new MemoryDomainIntPtr("VRAM", l, s.vram, 96 * 1024, true, 4));
|
||||
mm.Add(new MemoryDomainIntPtr("OAM", l, s.oam, 1024, true, 4));
|
||||
|
||||
mm.Add(new MemoryDomainIntPtr("ROM", l, s.rom, 32 * 1024 * 1024, true, 4));
|
||||
|
||||
mm.Add(new MemoryDomainIntPtr("SRAM", l, s.sram, s.sram_size, true, 4));
|
||||
|
||||
mm.Add(new MemoryDomainDelegate("System Bus", 0x10000000, l,
|
||||
delegate(long addr)
|
||||
{
|
||||
if (addr < 0 || addr >= 0x10000000)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
return LibVBANext.SystemBusRead(Core, (int)addr);
|
||||
},
|
||||
delegate(long addr, byte val)
|
||||
{
|
||||
if (addr < 0 || addr >= 0x10000000)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
LibVBANext.SystemBusWrite(Core, (int)addr, val);
|
||||
}, 4));
|
||||
|
||||
// special combined ram memory domain
|
||||
{
|
||||
var ew = mm[1];
|
||||
var iw = mm[0];
|
||||
MemoryDomain cr = new MemoryDomainDelegate("Combined WRAM", (256 + 32) * 1024, MemoryDomain.Endian.Little,
|
||||
delegate(long addr)
|
||||
{
|
||||
if (addr < 0 || addr >= (256 + 32) * 1024)
|
||||
throw new IndexOutOfRangeException();
|
||||
if (addr >= 256 * 1024)
|
||||
return iw.PeekByte(addr & 32767);
|
||||
else
|
||||
return ew.PeekByte(addr);
|
||||
},
|
||||
delegate(long addr, byte val)
|
||||
{
|
||||
if (addr < 0 || addr >= (256 + 32) * 1024)
|
||||
throw new IndexOutOfRangeException();
|
||||
if (addr >= 256 * 1024)
|
||||
iw.PokeByte(addr & 32767, val);
|
||||
else
|
||||
ew.PokeByte(addr, val);
|
||||
}, 4);
|
||||
mm.Add(cr);
|
||||
}
|
||||
|
||||
_memoryDomains = new MemoryDomainList(mm);
|
||||
(ServiceProvider as BasicServiceProvider).Register<IMemoryDomains>(_memoryDomains);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
using System;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : ISaveRam
|
||||
{
|
||||
public bool SaveRamModified => LibVBANext.SaveRamSize(Core) != 0;
|
||||
|
||||
public byte[] CloneSaveRam()
|
||||
{
|
||||
var data = new byte[LibVBANext.SaveRamSize(Core)];
|
||||
if (!LibVBANext.SaveRamSave(Core, data, data.Length))
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(LibVBANext.SaveRamSave)}() failed!");
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public void StoreSaveRam(byte[] data)
|
||||
{
|
||||
// internally, we try to salvage bad-sized saverams
|
||||
if (!LibVBANext.SaveRamLoad(Core, data, data.Length))
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(LibVBANext.SaveRamLoad)}() failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : ISettable<object, VBANext.SyncSettings>
|
||||
{
|
||||
public object GetSettings()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public SyncSettings GetSyncSettings()
|
||||
{
|
||||
return _syncSettings.Clone();
|
||||
}
|
||||
|
||||
public PutSettingsDirtyBits PutSettings(object o)
|
||||
{
|
||||
return PutSettingsDirtyBits.None;
|
||||
}
|
||||
|
||||
public PutSettingsDirtyBits PutSyncSettings(SyncSettings o)
|
||||
{
|
||||
bool ret = SyncSettings.NeedsReboot(o, _syncSettings);
|
||||
_syncSettings = o;
|
||||
return ret ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None;
|
||||
}
|
||||
|
||||
private SyncSettings _syncSettings;
|
||||
|
||||
public class SyncSettings
|
||||
{
|
||||
[DisplayName("Skip BIOS")]
|
||||
[Description("Skips the BIOS intro. A BIOS file is still required.")]
|
||||
[DefaultValue(true)]
|
||||
public bool SkipBios { get; set; }
|
||||
|
||||
[DisplayName("RTC Use Real Time")]
|
||||
[Description("Causes the internal clock to reflect your system clock. Only relevant when a game has an RTC chip. Forced to false for movie recording.")]
|
||||
[DefaultValue(true)]
|
||||
public bool RTCUseRealTime { get; set; }
|
||||
|
||||
[DisplayName("RTC Initial Time")]
|
||||
[Description("The initial time of emulation. Only relevant when a game has an RTC chip and \"RTC Use Real Time\" is false.")]
|
||||
[DefaultValue(typeof(DateTime), "2010-01-01")]
|
||||
public DateTime RTCInitialTime { get; set; }
|
||||
|
||||
public enum DayOfWeek
|
||||
{
|
||||
Sunday = 0,
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday
|
||||
}
|
||||
|
||||
[DisplayName("RTC Initial Day")]
|
||||
[Description("The day of the week to go with \"RTC Initial Time\". Due to peculiarities in the RTC chip, this can be set indepedently of the year, month, and day of month.")]
|
||||
[DefaultValue(DayOfWeek.Friday)]
|
||||
public DayOfWeek RTCInitialDay { get; set; }
|
||||
|
||||
public SyncSettings()
|
||||
{
|
||||
SettingsUtil.SetDefaultValues(this);
|
||||
}
|
||||
|
||||
public static bool NeedsReboot(SyncSettings x, SyncSettings y)
|
||||
{
|
||||
return !DeepEquality.DeepEquals(x, y);
|
||||
}
|
||||
|
||||
public SyncSettings Clone()
|
||||
{
|
||||
return (SyncSettings)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
using System;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : ISoundProvider
|
||||
{
|
||||
private readonly short[] _soundbuff = new short[2048];
|
||||
private int _numsamp;
|
||||
|
||||
public void GetSamplesSync(out short[] samples, out int nsamp)
|
||||
{
|
||||
samples = _soundbuff;
|
||||
nsamp = _numsamp;
|
||||
}
|
||||
|
||||
public void DiscardSamples()
|
||||
{
|
||||
}
|
||||
|
||||
public bool CanProvideAsync => false;
|
||||
|
||||
public void SetSyncMode(SyncSoundMode mode)
|
||||
{
|
||||
if (mode == SyncSoundMode.Async)
|
||||
{
|
||||
throw new NotSupportedException("Async mode is not supported.");
|
||||
}
|
||||
}
|
||||
|
||||
public SyncSoundMode SyncMode => SyncSoundMode.Sync;
|
||||
|
||||
public void GetSamplesAsync(short[] samples)
|
||||
{
|
||||
throw new InvalidOperationException("Async mode is not supported.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : ITextStatable
|
||||
{
|
||||
public void SaveStateText(TextWriter writer)
|
||||
{
|
||||
var s = new TextState<TextStateData>();
|
||||
s.Prepare();
|
||||
var ff = s.GetFunctionPointersSave();
|
||||
LibVBANext.TxtStateSave(Core, ref ff);
|
||||
s.ExtraData.IsLagFrame = IsLagFrame;
|
||||
s.ExtraData.LagCount = LagCount;
|
||||
s.ExtraData.Frame = Frame;
|
||||
|
||||
ser.Serialize(writer, s);
|
||||
}
|
||||
|
||||
public void LoadStateText(TextReader reader)
|
||||
{
|
||||
var s = (TextState<TextStateData>)ser.Deserialize(reader, typeof(TextState<TextStateData>));
|
||||
s.Prepare();
|
||||
var ff = s.GetFunctionPointersLoad();
|
||||
LibVBANext.TxtStateLoad(Core, ref ff);
|
||||
IsLagFrame = s.ExtraData.IsLagFrame;
|
||||
LagCount = s.ExtraData.LagCount;
|
||||
Frame = s.ExtraData.Frame;
|
||||
}
|
||||
|
||||
public void SaveStateBinary(BinaryWriter writer)
|
||||
{
|
||||
if (!LibVBANext.BinStateSave(Core, _savebuff, _savebuff.Length))
|
||||
throw new InvalidOperationException($"Core's {nameof(LibVBANext.BinStateSave)}() returned false!");
|
||||
writer.Write(_savebuff.Length);
|
||||
writer.Write(_savebuff);
|
||||
|
||||
// other variables
|
||||
writer.Write(IsLagFrame);
|
||||
writer.Write(LagCount);
|
||||
writer.Write(Frame);
|
||||
}
|
||||
|
||||
public void LoadStateBinary(BinaryReader reader)
|
||||
{
|
||||
int length = reader.ReadInt32();
|
||||
if (length != _savebuff.Length)
|
||||
throw new InvalidOperationException("Save buffer size mismatch!");
|
||||
reader.Read(_savebuff, 0, length);
|
||||
if (!LibVBANext.BinStateLoad(Core, _savebuff, _savebuff.Length))
|
||||
throw new InvalidOperationException($"Core's {nameof(LibVBANext.BinStateLoad)}() returned false!");
|
||||
|
||||
// other variables
|
||||
IsLagFrame = reader.ReadBoolean();
|
||||
LagCount = reader.ReadInt32();
|
||||
Frame = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public byte[] SaveStateBinary()
|
||||
{
|
||||
var ms = new MemoryStream(_savebuff2, true);
|
||||
var bw = new BinaryWriter(ms);
|
||||
SaveStateBinary(bw);
|
||||
bw.Flush();
|
||||
if (ms.Position != _savebuff2.Length)
|
||||
throw new InvalidOperationException();
|
||||
ms.Close();
|
||||
return _savebuff2;
|
||||
}
|
||||
|
||||
private JsonSerializer ser = new JsonSerializer { Formatting = Formatting.Indented };
|
||||
private readonly byte[] _savebuff;
|
||||
private readonly byte[] _savebuff2;
|
||||
|
||||
private class TextStateData
|
||||
{
|
||||
public int Frame;
|
||||
public int LagCount;
|
||||
public bool IsLagFrame;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
using System;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public partial class VBANext : IVideoProvider
|
||||
{
|
||||
public int VirtualWidth => 240;
|
||||
public int VirtualHeight => 160;
|
||||
public int BufferWidth => 240;
|
||||
public int BufferHeight => 160;
|
||||
|
||||
public int BackgroundColor => unchecked((int)0xff000000);
|
||||
|
||||
public int[] GetVideoBuffer()
|
||||
{
|
||||
return _videobuff;
|
||||
}
|
||||
|
||||
public int VsyncNumerator => 262144;
|
||||
|
||||
public int VsyncDenominator => 4389;
|
||||
|
||||
private readonly int[] _videobuff = new int[240 * 160];
|
||||
private readonly int[] _videopalette = new int[65536];
|
||||
|
||||
private void SetupColors()
|
||||
{
|
||||
int[] tmp = GBColors.GetLut(GBColors.ColorType.vivid);
|
||||
|
||||
// reorder
|
||||
for (int i = 0; i < 32768; i++)
|
||||
{
|
||||
int j = i & 0x3e0 | (i & 0x1f) << 10 | i >> 10 & 0x1f;
|
||||
_videopalette[i] = tmp[j];
|
||||
}
|
||||
|
||||
// duplicate
|
||||
Array.Copy(_videopalette, 0, _videopalette, 32768, 32768);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,237 +0,0 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Components.ARM;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
[Core(CoreNames.VbaNext, "many authors", true, true, "cd508312a29ed8c29dacac1b11c2dce56c338a54", "https://github.com/libretro/vba-next", false)]
|
||||
[ServiceNotApplicable(new[] { typeof(IDriveLight), typeof(IRegionable) })]
|
||||
public partial class VBANext : IEmulator, IVideoProvider, ISoundProvider, IInputPollable,
|
||||
IGBAGPUViewable, ISaveRam, IStatable, IDebuggable, ISettable<object, VBANext.SyncSettings>
|
||||
{
|
||||
[CoreConstructor("GBA")]
|
||||
public VBANext(byte[] file, CoreComm comm, GameInfo game, bool deterministic, object syncsettings)
|
||||
{
|
||||
var ser = new BasicServiceProvider(this);
|
||||
ser.Register<IDisassemblable>(new ArmV4Disassembler());
|
||||
ServiceProvider = ser;
|
||||
|
||||
byte[] biosfile = comm.CoreFileProvider.GetFirmware("GBA", "Bios", true, "GBA bios file is mandatory.");
|
||||
if (file.Length > 32 * 1024 * 1024)
|
||||
throw new ArgumentException("ROM is too big to be a GBA ROM!");
|
||||
if (biosfile.Length != 16 * 1024)
|
||||
throw new ArgumentException("BIOS file is not exactly 16K!");
|
||||
|
||||
var FES = new LibVBANext.FrontEndSettings
|
||||
{
|
||||
saveType = (LibVBANext.FrontEndSettings.SaveType)game.GetInt("saveType", 0),
|
||||
flashSize = (LibVBANext.FrontEndSettings.FlashSize)game.GetInt("flashSize", 0x10000),
|
||||
enableRtc = game.GetInt("rtcEnabled", 0) != 0,
|
||||
mirroringEnable = game.GetInt("mirroringEnabled", 0) != 0
|
||||
};
|
||||
Console.WriteLine("GameDB loaded settings: saveType={0}, flashSize={1}, rtcEnabled={2}, mirroringEnabled={3}",
|
||||
FES.saveType, FES.flashSize, FES.enableRtc, FES.mirroringEnable);
|
||||
|
||||
_syncSettings = (SyncSettings)syncsettings ?? new SyncSettings();
|
||||
DeterministicEmulation = deterministic;
|
||||
|
||||
FES.skipBios = _syncSettings.SkipBios;
|
||||
FES.RTCUseRealTime = _syncSettings.RTCUseRealTime;
|
||||
FES.RTCwday = (int)_syncSettings.RTCInitialDay;
|
||||
FES.RTCyear = _syncSettings.RTCInitialTime.Year % 100;
|
||||
FES.RTCmonth = _syncSettings.RTCInitialTime.Month - 1;
|
||||
FES.RTCmday = _syncSettings.RTCInitialTime.Day;
|
||||
FES.RTChour = _syncSettings.RTCInitialTime.Hour;
|
||||
FES.RTCmin = _syncSettings.RTCInitialTime.Minute;
|
||||
FES.RTCsec = _syncSettings.RTCInitialTime.Second;
|
||||
if (DeterministicEmulation)
|
||||
{
|
||||
// FES.skipBios = false; // this is OK; it is deterministic and probably accurate
|
||||
FES.RTCUseRealTime = false;
|
||||
}
|
||||
|
||||
Core = LibVBANext.Create();
|
||||
if (Core == IntPtr.Zero)
|
||||
throw new InvalidOperationException($"{nameof(LibVBANext.Create)}() returned nullptr!");
|
||||
try
|
||||
{
|
||||
if (!LibVBANext.LoadRom(Core, file, (uint)file.Length, biosfile, (uint)biosfile.Length, FES))
|
||||
throw new InvalidOperationException($"{nameof(LibVBANext.LoadRom)}() returned false!");
|
||||
|
||||
Tracer = new TraceBuffer()
|
||||
{
|
||||
Header = "ARM7: PC, machine code, mnemonic, operands, registers (r0-r16)"
|
||||
};
|
||||
ser.Register<ITraceable>(Tracer);
|
||||
|
||||
GameCode = Encoding.ASCII.GetString(file, 0xac, 4);
|
||||
Console.WriteLine("Game code \"{0}\"", GameCode);
|
||||
|
||||
_savebuff = new byte[LibVBANext.BinStateSize(Core)];
|
||||
_savebuff2 = new byte[_savebuff.Length + 13];
|
||||
InitMemoryDomains();
|
||||
InitRegisters();
|
||||
InitCallbacks();
|
||||
|
||||
// todo: hook me up as a setting
|
||||
SetupColors();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
IntPtr Core;
|
||||
|
||||
public IEmulatorServiceProvider ServiceProvider { get; }
|
||||
|
||||
public bool FrameAdvance(IController controller, bool render, bool rendersound = true)
|
||||
{
|
||||
Frame++;
|
||||
|
||||
if (controller.IsPressed("Power"))
|
||||
LibVBANext.Reset(Core);
|
||||
|
||||
SyncTraceCallback();
|
||||
|
||||
IsLagFrame = LibVBANext.FrameAdvance(Core, GetButtons(controller), _videobuff, _soundbuff, out _numsamp, _videopalette);
|
||||
|
||||
if (IsLagFrame)
|
||||
LagCount++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int Frame { get; private set; }
|
||||
public int LagCount { get; set; }
|
||||
public bool IsLagFrame { get; set; }
|
||||
|
||||
private ITraceable Tracer { get; set; }
|
||||
|
||||
public string SystemId => "GBA";
|
||||
|
||||
public bool DeterministicEmulation { get; }
|
||||
|
||||
public void ResetCounters()
|
||||
{
|
||||
Frame = 0;
|
||||
LagCount = 0;
|
||||
IsLagFrame = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set in the ROM internal header
|
||||
/// </summary>
|
||||
public string GameCode { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Core != IntPtr.Zero)
|
||||
{
|
||||
LibVBANext.Destroy(Core);
|
||||
Core = IntPtr.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
#region Debugging
|
||||
|
||||
LibVBANext.StandardCallback padcb;
|
||||
LibVBANext.AddressCallback fetchcb;
|
||||
LibVBANext.AddressCallback readcb;
|
||||
LibVBANext.AddressCallback writecb;
|
||||
LibVBANext.TraceCallback tracecb;
|
||||
|
||||
private readonly InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
|
||||
public IInputCallbackSystem InputCallbacks => _inputCallbacks;
|
||||
|
||||
TraceInfo Trace(uint addr, uint opcode)
|
||||
{
|
||||
return new TraceInfo
|
||||
{
|
||||
Disassembly = $"{addr:X8}: {opcode:X8} {Darm.DisassembleStuff(addr, opcode)}".PadRight(54),
|
||||
RegisterInfo = regs.TraceString()
|
||||
};
|
||||
}
|
||||
|
||||
void InitCallbacks()
|
||||
{
|
||||
padcb = new LibVBANext.StandardCallback(() => InputCallbacks.Call());
|
||||
fetchcb = new LibVBANext.AddressCallback((addr) => {
|
||||
if (MemoryCallbacks.HasExecutes)
|
||||
{
|
||||
uint flags = (uint)MemoryCallbackFlags.AccessExecute;
|
||||
MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus");
|
||||
}
|
||||
});
|
||||
readcb = new LibVBANext.AddressCallback((addr) =>
|
||||
{
|
||||
if (MemoryCallbacks.HasReads)
|
||||
{
|
||||
uint flags = (uint)MemoryCallbackFlags.AccessRead;
|
||||
MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus");
|
||||
}
|
||||
});
|
||||
writecb = new LibVBANext.AddressCallback((addr) =>
|
||||
{
|
||||
if (MemoryCallbacks.HasWrites)
|
||||
{
|
||||
uint flags = (uint)MemoryCallbackFlags.AccessWrite;
|
||||
MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus");
|
||||
}
|
||||
});
|
||||
tracecb = new LibVBANext.TraceCallback((addr, opcode) => Tracer.Put(Trace(addr, opcode)));
|
||||
_inputCallbacks.ActiveChanged += SyncPadCallback;
|
||||
_memorycallbacks.ActiveChanged += SyncMemoryCallbacks;
|
||||
}
|
||||
|
||||
void SyncPadCallback()
|
||||
{
|
||||
LibVBANext.SetPadCallback(Core, InputCallbacks.Any() ? padcb : null);
|
||||
}
|
||||
|
||||
void SyncMemoryCallbacks()
|
||||
{
|
||||
LibVBANext.SetFetchCallback(Core, MemoryCallbacks.HasExecutes ? fetchcb : null);
|
||||
LibVBANext.SetReadCallback(Core, MemoryCallbacks.HasReads ? readcb : null);
|
||||
LibVBANext.SetWriteCallback(Core, MemoryCallbacks.HasWrites ? writecb : null);
|
||||
}
|
||||
|
||||
void SyncTraceCallback()
|
||||
{
|
||||
LibVBANext.SetTraceCallback(Core, Tracer.Enabled ? tracecb : null);
|
||||
}
|
||||
|
||||
VBARegisterHelper regs;
|
||||
|
||||
void InitRegisters()
|
||||
{
|
||||
regs = new VBARegisterHelper(Core);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Controller
|
||||
|
||||
public ControllerDefinition ControllerDefinition => GBA.GBAController;
|
||||
|
||||
public static LibVBANext.Buttons GetButtons(IController c)
|
||||
{
|
||||
LibVBANext.Buttons ret = 0;
|
||||
foreach (string s in Enum.GetNames(typeof(LibVBANext.Buttons)))
|
||||
{
|
||||
if (c.IsPressed(s))
|
||||
{
|
||||
ret |= (LibVBANext.Buttons)Enum.Parse(typeof(LibVBANext.Buttons), s);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||
{
|
||||
public unsafe class VBARegisterHelper
|
||||
{
|
||||
private readonly IntPtr _origin;
|
||||
private readonly Dictionary<string, IntPtr> _locs = new Dictionary<string, IntPtr>();
|
||||
|
||||
public VBARegisterHelper(IntPtr Core)
|
||||
{
|
||||
_origin = LibVBANext.GetRegisters(Core);
|
||||
foreach (var field in typeof(LibVBANext.Registers).GetFields())
|
||||
{
|
||||
var ofs = Marshal.OffsetOf(typeof(LibVBANext.Registers), field.Name);
|
||||
_locs[field.Name] = IntPtr.Add(_origin, (int)ofs);
|
||||
}
|
||||
}
|
||||
|
||||
public int GetRegister(string name)
|
||||
{
|
||||
int* p = (int*)_locs[name];
|
||||
return *p;
|
||||
}
|
||||
|
||||
public void SetRegister(string name, int val)
|
||||
{
|
||||
int* p = (int*)_locs[name];
|
||||
*p = val;
|
||||
}
|
||||
|
||||
public Dictionary<string, RegisterValue> GetAllRegisters()
|
||||
{
|
||||
var ret = new Dictionary<string, RegisterValue>();
|
||||
foreach (var kvp in _locs)
|
||||
{
|
||||
ret[kvp.Key] = GetRegister(kvp.Key);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public string TraceString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
int* p = (int*)_origin;
|
||||
for (int i = 0; i < 17; i++)
|
||||
{
|
||||
sb.Append($"r{i}:{p[i]:X8}");
|
||||
if (i != 16)
|
||||
{
|
||||
sb.Append(' ');
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,7 +15,6 @@ namespace BizHawk.Emulation.Cores
|
|||
public const string Snes9X = "Snes9x";
|
||||
public const string Bsnes = "BSNES";
|
||||
public const string Mgba = "mGBA";
|
||||
public const string VbaNext = "VBA-Next";
|
||||
public const string GbHawk = "GBHawk";
|
||||
public const string Gambatte = "Gambatte";
|
||||
public const string SubGbHawk = "SubGBHawk";
|
||||
|
|
Binary file not shown.
|
@ -1,55 +0,0 @@
|
|||
#ifndef CONSTARRAYS_H
|
||||
#define CONSTARRAYS_H
|
||||
|
||||
static float const apu_vols [4] = { -0.25f, -0.5f, -1.0f, -0.25f };
|
||||
|
||||
static const int daysinmonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static const int table [0x40] =
|
||||
{
|
||||
0xFF10, 0,0xFF11,0xFF12,0xFF13,0xFF14, 0, 0,
|
||||
0xFF16,0xFF17, 0, 0,0xFF18,0xFF19, 0, 0,
|
||||
0xFF1A, 0,0xFF1B,0xFF1C,0xFF1D,0xFF1E, 0, 0,
|
||||
0xFF20,0xFF21, 0, 0,0xFF22,0xFF23, 0, 0,
|
||||
0xFF24,0xFF25, 0, 0,0xFF26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,
|
||||
0xFF38,0xFF39,0xFF3A,0xFF3B,0xFF3C,0xFF3D,0xFF3E,0xFF3F,
|
||||
};
|
||||
|
||||
static const uint32_t TIMER_TICKS[4] = {0, 6, 8, 10};
|
||||
|
||||
static const uint8_t gamepakRamWaitState[4] = { 4, 3, 2, 8 };
|
||||
|
||||
static const uint32_t objTilesAddress [3] = {0x010000, 0x014000, 0x014000};
|
||||
|
||||
static const u32 AlphaClampLUT[64] =
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
|
||||
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
|
||||
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F
|
||||
};
|
||||
|
||||
static const u32 map_sizes_rot[] = { 128, 256, 512, 1024 };
|
||||
|
||||
static const u32 map_widths[] = { 256, 512, 256, 512 };
|
||||
static const u32 map_heights[] = { 256, 256, 512, 512 };
|
||||
|
||||
|
||||
static const int coeff[32] = {0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 16,
|
||||
16, 16, 16};
|
||||
|
||||
|
||||
static const uint8_t memoryWait_init[16] =
|
||||
{ 0, 0, 2, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 0 };
|
||||
static const uint8_t memoryWaitSeq_init[16] =
|
||||
{ 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 4, 4, 8, 8, 4, 0 };
|
||||
static const uint8_t memoryWait32_init[16] =
|
||||
{ 0, 0, 5, 0, 0, 1, 1, 0, 7, 7, 9, 9, 13, 13, 4, 0 };
|
||||
static const uint8_t memoryWaitSeq32_init[16] =
|
||||
{ 0, 0, 5, 0, 0, 1, 1, 0, 5, 5, 9, 9, 17, 17, 4, 0 };
|
||||
|
||||
#endif
|
13699
vbanext/instance.cpp
13699
vbanext/instance.cpp
File diff suppressed because it is too large
Load Diff
|
@ -1,227 +0,0 @@
|
|||
#ifndef INSTANCE_H
|
||||
#define INSTANCE_H
|
||||
|
||||
struct FrontEndSettings
|
||||
{
|
||||
int cpuSaveType; // [0auto] 1eeprom 2sram 3flash 4eeprom+sensor 5none
|
||||
int flashSize; // [0x10000] 0x20000
|
||||
int enableRtc; // [false] true
|
||||
int mirroringEnable; // [false] true
|
||||
int skipBios; // [false] true
|
||||
|
||||
int RTCuseRealTime;
|
||||
int RTCyear; // 00..99
|
||||
int RTCmonth; // 00..11
|
||||
int RTCmday; // 01..31
|
||||
int RTCwday; // 00..06
|
||||
int RTChour; // 00..23
|
||||
int RTCmin; // 00..59
|
||||
int RTCsec; // 00..59
|
||||
|
||||
};
|
||||
|
||||
struct MemoryAreas
|
||||
{
|
||||
void *bios;
|
||||
void *iwram;
|
||||
void *ewram;
|
||||
void *palram;
|
||||
void *vram;
|
||||
void *oam;
|
||||
void *rom;
|
||||
void *mmio;
|
||||
void *sram;
|
||||
uint32_t sram_size;
|
||||
};
|
||||
|
||||
#define FLASH_128K_SZ 0x20000
|
||||
|
||||
#define EEPROM_IDLE 0
|
||||
#define EEPROM_READADDRESS 1
|
||||
#define EEPROM_READDATA 2
|
||||
#define EEPROM_READDATA2 3
|
||||
#define EEPROM_WRITEDATA 4
|
||||
|
||||
enum {
|
||||
IMAGE_UNKNOWN,
|
||||
IMAGE_GBA
|
||||
};
|
||||
|
||||
#define SGCNT0_H 0x82
|
||||
#define FIFOA_L 0xa0
|
||||
#define FIFOA_H 0xa2
|
||||
#define FIFOB_L 0xa4
|
||||
#define FIFOB_H 0xa6
|
||||
|
||||
#define BLIP_BUFFER_ACCURACY 16
|
||||
#define BLIP_PHASE_BITS 8
|
||||
#define BLIP_WIDEST_IMPULSE_ 16
|
||||
#define BLIP_BUFFER_EXTRA_ 18
|
||||
#define BLIP_RES 256
|
||||
#define BLIP_RES_MIN_ONE 255
|
||||
#define BLIP_SAMPLE_BITS 30
|
||||
#define BLIP_READER_DEFAULT_BASS 9
|
||||
#define BLIP_DEFAULT_LENGTH 250 /* 1/4th of a second */
|
||||
|
||||
#define BUFS_SIZE 3
|
||||
#define STEREO 2
|
||||
|
||||
#define CLK_MUL GB_APU_OVERCLOCK
|
||||
#define CLK_MUL_MUL_2 8
|
||||
#define CLK_MUL_MUL_4 16
|
||||
#define CLK_MUL_MUL_6 24
|
||||
#define CLK_MUL_MUL_8 32
|
||||
#define CLK_MUL_MUL_15 60
|
||||
#define CLK_MUL_MUL_32 128
|
||||
#define DAC_BIAS 7
|
||||
|
||||
#define PERIOD_MASK 0x70
|
||||
#define SHIFT_MASK 0x07
|
||||
|
||||
#define PERIOD2_MASK 0x1FFFF
|
||||
|
||||
#define BANK40_MASK 0x40
|
||||
#define BANK_SIZE 32
|
||||
#define BANK_SIZE_MIN_ONE 31
|
||||
#define BANK_SIZE_DIV_TWO 16
|
||||
|
||||
/* 11-bit frequency in NRx3 and NRx4*/
|
||||
#define GB_OSC_FREQUENCY() (((regs[4] & 7) << 8) + regs[3])
|
||||
|
||||
#define WAVE_TYPE 0x100
|
||||
#define NOISE_TYPE 0x200
|
||||
#define MIXED_TYPE WAVE_TYPE | NOISE_TYPE
|
||||
#define TYPE_INDEX_MASK 0xFF
|
||||
|
||||
#define BITS_16 0
|
||||
#define BITS_32 1
|
||||
|
||||
#define R13_IRQ 18
|
||||
#define R14_IRQ 19
|
||||
#define SPSR_IRQ 20
|
||||
#define R13_USR 26
|
||||
#define R14_USR 27
|
||||
#define R13_SVC 28
|
||||
#define R14_SVC 29
|
||||
#define SPSR_SVC 30
|
||||
#define R13_ABT 31
|
||||
#define R14_ABT 32
|
||||
#define SPSR_ABT 33
|
||||
#define R13_UND 34
|
||||
#define R14_UND 35
|
||||
#define SPSR_UND 36
|
||||
#define R8_FIQ 37
|
||||
#define R9_FIQ 38
|
||||
#define R10_FIQ 39
|
||||
#define R11_FIQ 40
|
||||
#define R12_FIQ 41
|
||||
#define R13_FIQ 42
|
||||
#define R14_FIQ 43
|
||||
#define SPSR_FIQ 44
|
||||
|
||||
typedef struct {
|
||||
uint8_t *address;
|
||||
uint32_t mask;
|
||||
} memoryMap;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
#ifdef LSB_FIRST
|
||||
uint8_t B0;
|
||||
uint8_t B1;
|
||||
uint8_t B2;
|
||||
uint8_t B3;
|
||||
#else
|
||||
uint8_t B3;
|
||||
uint8_t B2;
|
||||
uint8_t B1;
|
||||
uint8_t B0;
|
||||
#endif
|
||||
} B;
|
||||
struct {
|
||||
#ifdef LSB_FIRST
|
||||
uint16_t W0;
|
||||
uint16_t W1;
|
||||
#else
|
||||
uint16_t W1;
|
||||
uint16_t W0;
|
||||
#endif
|
||||
} W;
|
||||
#ifdef LSB_FIRST
|
||||
uint32_t I;
|
||||
#else
|
||||
volatile uint32_t I;
|
||||
#endif
|
||||
} reg_pair;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
reg_pair reg[45];
|
||||
bool busPrefetch;
|
||||
bool busPrefetchEnable;
|
||||
uint32_t busPrefetchCount;
|
||||
uint32_t armNextPC;
|
||||
} bus_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t paletteRAM[0x400];
|
||||
int layerEnable;
|
||||
int layerEnableDelay;
|
||||
int lcdTicks;
|
||||
} graphics_t;
|
||||
|
||||
/* Begins reading from buffer. Name should be unique to the current block.*/
|
||||
#define BLIP_READER_BEGIN( name, blip_buffer ) \
|
||||
const int32_t * name##_reader_buf = (blip_buffer).buffer_;\
|
||||
int32_t name##_reader_accum = (blip_buffer).reader_accum_
|
||||
|
||||
/* Advances to next sample*/
|
||||
#define BLIP_READER_NEXT( name, bass ) \
|
||||
(void) (name##_reader_accum += *name##_reader_buf++ - (name##_reader_accum >> (bass)))
|
||||
|
||||
/* Ends reading samples from buffer. The number of samples read must now be removed
|
||||
using Blip_Buffer::remove_samples(). */
|
||||
#define BLIP_READER_END( name, blip_buffer ) \
|
||||
(void) ((blip_buffer).reader_accum_ = name##_reader_accum)
|
||||
|
||||
#define BLIP_READER_ADJ_( name, offset ) (name##_reader_buf += offset)
|
||||
|
||||
#define BLIP_READER_NEXT_IDX_( name, idx ) {\
|
||||
name##_reader_accum -= name##_reader_accum >> BLIP_READER_DEFAULT_BASS;\
|
||||
name##_reader_accum += name##_reader_buf [(idx)];\
|
||||
}
|
||||
|
||||
#define BLIP_READER_NEXT_RAW_IDX_( name, idx ) {\
|
||||
name##_reader_accum -= name##_reader_accum >> BLIP_READER_DEFAULT_BASS; \
|
||||
name##_reader_accum += *(int32_t const*) ((char const*) name##_reader_buf + (idx)); \
|
||||
}
|
||||
|
||||
#if defined (_M_IX86) || defined (_M_IA64) || defined (__i486__) || \
|
||||
defined (__x86_64__) || defined (__ia64__) || defined (__i386__)
|
||||
#define BLIP_CLAMP_( in ) in < -0x8000 || 0x7FFF < in
|
||||
#else
|
||||
#define BLIP_CLAMP_( in ) (int16_t) in != in
|
||||
#endif
|
||||
|
||||
/* Clamp sample to int16_t range */
|
||||
#define BLIP_CLAMP( sample, out ) { if ( BLIP_CLAMP_( (sample) ) ) (out) = ((sample) >> 24) ^ 0x7FFF; }
|
||||
#define GB_ENV_DAC_ENABLED() (regs[2] & 0xF8) /* Non-zero if DAC is enabled*/
|
||||
#define GB_NOISE_PERIOD2_INDEX() (regs[3] >> 4)
|
||||
#define GB_NOISE_PERIOD2(base) (base << GB_NOISE_PERIOD2_INDEX())
|
||||
#define GB_NOISE_LFSR_MASK() ((regs[3] & 0x08) ? ~0x4040 : ~0x4000)
|
||||
#define GB_WAVE_DAC_ENABLED() (regs[0] & 0x80) /* Non-zero if DAC is enabled*/
|
||||
|
||||
#define reload_sweep_timer() \
|
||||
sweep_delay = (regs [0] & PERIOD_MASK) >> 4; \
|
||||
if ( !sweep_delay ) \
|
||||
sweep_delay = 8;
|
||||
|
||||
|
||||
#ifdef __LIBRETRO__
|
||||
#define PIX_BUFFER_SCREEN_WIDTH 256
|
||||
#else
|
||||
#define PIX_BUFFER_SCREEN_WIDTH 240
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,44 +0,0 @@
|
|||
CXX = g++
|
||||
CXXFLAGS = -Wall -O3 -fpermissive -Wno-unused-but-set-variable \
|
||||
-Wno-strict-aliasing -Wzero-as-null-pointer-constant -Wno-unused-variable \
|
||||
-Wno-parentheses -Wno-sign-compare -std=gnu++11 -fomit-frame-pointer -fno-exceptions -fPIC
|
||||
|
||||
MACHINE = $(shell $(CXX) -dumpmachine)
|
||||
ifneq (,$(findstring i686,$(MACHINE)))
|
||||
$(error 32 bit build no longer supported)
|
||||
else ifneq (,$(findstring x86_64,$(MACHINE)))
|
||||
ARCH = 64
|
||||
else
|
||||
$(error Unknown arch)
|
||||
endif
|
||||
|
||||
LDFLAGS_32 = -static-libgcc -static-libstdc++
|
||||
LDFLAGS_64 =
|
||||
LDFLAGS = -shared $(LDFLAGS_$(ARCH)) $(CXXFLAGS)
|
||||
|
||||
TARGET = libvbanext.dll
|
||||
RM = rm
|
||||
CP = cp
|
||||
|
||||
SRCS = \
|
||||
../instance.cpp \
|
||||
../newstate.cpp
|
||||
|
||||
OBJS = $(SRCS:.cpp=.o)
|
||||
DEST_32 = ../../output/dll
|
||||
DEST_64 = ../../output/dll
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $< $(CXXFLAGS)
|
||||
|
||||
$(TARGET) : $(OBJS)
|
||||
$(CXX) -o $@ $(LDFLAGS) $(OBJS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS)
|
||||
$(RM) $(TARGET)
|
||||
|
||||
install:
|
||||
$(CP) $(TARGET) $(DEST_$(ARCH))
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvbanext", "libvbanext.vcxproj", "{DE666222-17A4-4B1E-8A5A-0A69838AE23F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DE666222-17A4-4B1E-8A5A-0A69838AE23F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DE666222-17A4-4B1E-8A5A-0A69838AE23F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DE666222-17A4-4B1E-8A5A-0A69838AE23F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DE666222-17A4-4B1E-8A5A-0A69838AE23F}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,90 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DE666222-17A4-4B1E-8A5A-0A69838AE23F}</ProjectGuid>
|
||||
<RootNamespace>libvbanext</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DisableSpecificWarnings>4146;4800</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /y $(TargetDir)$(TargetFileName) $(ProjectDir)..\..\..\output\dll\$(TargetFileName)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Full</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<DisableSpecificWarnings>4146;4800</DisableSpecificWarnings>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy /y $(TargetDir)$(TargetFileName) $(ProjectDir)..\..\..\output\dll\$(TargetFileName)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\instance.cpp" />
|
||||
<ClCompile Include="..\..\newstate.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\constarrays.h" />
|
||||
<ClInclude Include="..\..\instance.h" />
|
||||
<ClInclude Include="..\..\newstate.h" />
|
||||
<ClInclude Include="..\..\port.h" />
|
||||
<ClInclude Include="..\..\sound_blargg.h" />
|
||||
<ClInclude Include="..\..\types.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\optable.inc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Unused">
|
||||
<UniqueIdentifier>{25bb448a-4359-4425-bc82-a36c2dcddcb8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\instance.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\newstate.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\port.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\types.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\instance.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\sound_blargg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\constarrays.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\newstate.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\optable.inc">
|
||||
<Filter>Header Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,64 +0,0 @@
|
|||
#include "newstate.h"
|
||||
#include <cstring>
|
||||
|
||||
NewStateDummy::NewStateDummy()
|
||||
:length(0)
|
||||
{
|
||||
}
|
||||
void NewStateDummy::Save(const void *ptr, size_t size, const char *name)
|
||||
{
|
||||
length += size;
|
||||
}
|
||||
void NewStateDummy::Load(void *ptr, size_t size, const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
NewStateExternalBuffer::NewStateExternalBuffer(char *buffer, long maxlength)
|
||||
:buffer(buffer), length(0), maxlength(maxlength)
|
||||
{
|
||||
}
|
||||
|
||||
void NewStateExternalBuffer::Save(const void *ptr, size_t size, const char *name)
|
||||
{
|
||||
if (maxlength - length >= (long)size)
|
||||
{
|
||||
std::memcpy(buffer + length, ptr, size);
|
||||
}
|
||||
length += size;
|
||||
}
|
||||
|
||||
void NewStateExternalBuffer::Load(void *ptr, size_t size, const char *name)
|
||||
{
|
||||
char *dst = static_cast<char *>(ptr);
|
||||
if (maxlength - length >= (long)size)
|
||||
{
|
||||
std::memcpy(dst, buffer + length, size);
|
||||
}
|
||||
length += size;
|
||||
}
|
||||
|
||||
NewStateExternalFunctions::NewStateExternalFunctions(const FPtrs *ff)
|
||||
:Save_(ff->Save_),
|
||||
Load_(ff->Load_),
|
||||
EnterSection_(ff->EnterSection_),
|
||||
ExitSection_(ff->ExitSection_)
|
||||
{
|
||||
}
|
||||
|
||||
void NewStateExternalFunctions::Save(const void *ptr, size_t size, const char *name)
|
||||
{
|
||||
Save_(ptr, size, name);
|
||||
}
|
||||
void NewStateExternalFunctions::Load(void *ptr, size_t size, const char *name)
|
||||
{
|
||||
Load_(ptr, size, name);
|
||||
}
|
||||
void NewStateExternalFunctions::EnterSection(const char *name)
|
||||
{
|
||||
EnterSection_(name);
|
||||
}
|
||||
void NewStateExternalFunctions::ExitSection(const char *name)
|
||||
{
|
||||
ExitSection_(name);
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
#ifndef NEWSTATE_H
|
||||
#define NEWSTATE_H
|
||||
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
|
||||
class NewState
|
||||
{
|
||||
public:
|
||||
virtual void Save(const void *ptr, size_t size, const char *name) = 0;
|
||||
virtual void Load(void *ptr, size_t size, const char *name) = 0;
|
||||
virtual void EnterSection(const char *name) { }
|
||||
virtual void ExitSection(const char *name) { }
|
||||
};
|
||||
|
||||
class NewStateDummy : public NewState
|
||||
{
|
||||
private:
|
||||
long length;
|
||||
public:
|
||||
NewStateDummy();
|
||||
long GetLength() { return length; }
|
||||
void Rewind() { length = 0; }
|
||||
virtual void Save(const void *ptr, size_t size, const char *name);
|
||||
virtual void Load(void *ptr, size_t size, const char *name);
|
||||
};
|
||||
|
||||
class NewStateExternalBuffer : public NewState
|
||||
{
|
||||
private:
|
||||
char *const buffer;
|
||||
long length;
|
||||
const long maxlength;
|
||||
public:
|
||||
NewStateExternalBuffer(char *buffer, long maxlength);
|
||||
long GetLength() { return length; }
|
||||
void Rewind() { length = 0; }
|
||||
bool Overflow() { return length > maxlength; }
|
||||
virtual void Save(const void *ptr, size_t size, const char *name);
|
||||
virtual void Load(void *ptr, size_t size, const char *name);
|
||||
};
|
||||
|
||||
struct FPtrs
|
||||
{
|
||||
void (*Save_)(const void *ptr, size_t size, const char *name);
|
||||
void (*Load_)(void *ptr, size_t size, const char *name);
|
||||
void (*EnterSection_)(const char *name);
|
||||
void (*ExitSection_)(const char *name);
|
||||
};
|
||||
|
||||
class NewStateExternalFunctions : public NewState
|
||||
{
|
||||
private:
|
||||
void (*Save_)(const void *ptr, size_t size, const char *name);
|
||||
void (*Load_)(void *ptr, size_t size, const char *name);
|
||||
void (*EnterSection_)(const char *name);
|
||||
void (*ExitSection_)(const char *name);
|
||||
public:
|
||||
NewStateExternalFunctions(const FPtrs *ff);
|
||||
virtual void Save(const void *ptr, size_t size, const char *name);
|
||||
virtual void Load(void *ptr, size_t size, const char *name);
|
||||
virtual void EnterSection(const char *name);
|
||||
virtual void ExitSection(const char *name);
|
||||
};
|
||||
|
||||
// defines and explicitly instantiates
|
||||
#define SYNCFUNC(x)\
|
||||
template void x::SyncState<false>(NewState *ns);\
|
||||
template void x::SyncState<true>(NewState *ns);\
|
||||
template<bool isReader>void x::SyncState(NewState *ns)
|
||||
|
||||
// N = normal variable
|
||||
// P = pointer to fixed size data
|
||||
// S = "sub object"
|
||||
// T = "ptr to sub object"
|
||||
// R = pointer, store its offset from some other pointer
|
||||
// E = general purpose cased value "enum"
|
||||
|
||||
|
||||
// first line is default value in converted enum; last line is default value in argument x
|
||||
#define EBS(x,d) do { int _ttmp = (d); if (isReader) ns->Load(&_ttmp, sizeof(_ttmp), #x); if (0)
|
||||
#define EVS(x,v,n) else if (!isReader && (x) == (v)) _ttmp = (n); else if (isReader && _ttmp == (n)) (x) = (v)
|
||||
#define EES(x,d) else if (isReader) (x) = (d); if (!isReader) ns->Save(&_ttmp, sizeof(_ttmp), #x); } while (0)
|
||||
|
||||
#define RSS(x,b) do { if (isReader)\
|
||||
{ ptrdiff_t _ttmp; ns->Load(&_ttmp, sizeof(_ttmp), #x); (x) = (_ttmp == (ptrdiff_t)0xdeadbeef ? 0 : (b) + _ttmp); }\
|
||||
else\
|
||||
{ ptrdiff_t _ttmp = (x) == 0 ? 0xdeadbeef : (x) - (b); ns->Save(&_ttmp, sizeof(_ttmp), #x); } } while (0)
|
||||
|
||||
#define PSS(x,s) do { if (isReader) ns->Load((x), (s), #x); else ns->Save((x), (s), #x); } while (0)
|
||||
|
||||
#define NSS(x) do { if (isReader) ns->Load(&(x), sizeof(x), #x); else ns->Save(&(x), sizeof(x), #x); } while (0)
|
||||
|
||||
#define SSS(x) do { ns->EnterSection(#x); (x).SyncState<isReader>(ns); ns->ExitSection(#x); } while (0)
|
||||
#define SSS_HACKY(x,extra) do { ns->EnterSection(#x); (x).SyncState<isReader>(ns, extra); ns->ExitSection(#x); } while (0)
|
||||
|
||||
#define TSS(x) do { ns->EnterSection(#x); (x)->SyncState<isReader>(ns); ns->ExitSection(#x); } while (0)
|
||||
|
||||
#endif
|
|
@ -1,327 +0,0 @@
|
|||
#define F(fcn) &Gigazoid::fcn
|
||||
|
||||
#define REP16(insn) \
|
||||
F(insn),F(insn),F(insn),F(insn),F(insn),F(insn),F(insn),F(insn),\
|
||||
F(insn),F(insn),F(insn),F(insn),F(insn),F(insn),F(insn),F(insn)
|
||||
#define REP256(insn) \
|
||||
REP16(insn),REP16(insn),REP16(insn),REP16(insn),\
|
||||
REP16(insn),REP16(insn),REP16(insn),REP16(insn),\
|
||||
REP16(insn),REP16(insn),REP16(insn),REP16(insn),\
|
||||
REP16(insn),REP16(insn),REP16(insn),REP16(insn)
|
||||
|
||||
#define arm_UI armUnknownInsn
|
||||
#define arm_BP armUnknownInsn
|
||||
|
||||
#define thumbUI thumbUnknownInsn
|
||||
#define thumbBP thumbUnknownInsn
|
||||
|
||||
void (Gigazoid::*const Gigazoid::armInsnTable[4096])(u32 opcode) = {
|
||||
F(arm000),F(arm001),F(arm002),F(arm003),F(arm004),F(arm005),F(arm006),F(arm007), // F(000)
|
||||
F(arm000),F(arm009),F(arm002),F(arm00B),F(arm004),F(arm_UI),F(arm006),F(arm_UI), // F(008)
|
||||
F(arm010),F(arm011),F(arm012),F(arm013),F(arm014),F(arm015),F(arm016),F(arm017), // F(010)
|
||||
F(arm010),F(arm019),F(arm012),F(arm01B),F(arm014),F(arm01D),F(arm016),F(arm01F), // F(018)
|
||||
F(arm020),F(arm021),F(arm022),F(arm023),F(arm024),F(arm025),F(arm026),F(arm027), // F(020)
|
||||
F(arm020),F(arm029),F(arm022),F(arm_UI),F(arm024),F(arm_UI),F(arm026),F(arm_UI), // F(028)
|
||||
F(arm030),F(arm031),F(arm032),F(arm033),F(arm034),F(arm035),F(arm036),F(arm037), // F(030)
|
||||
F(arm030),F(arm039),F(arm032),F(arm_UI),F(arm034),F(arm01D),F(arm036),F(arm01F), // F(038)
|
||||
F(arm040),F(arm041),F(arm042),F(arm043),F(arm044),F(arm045),F(arm046),F(arm047), // F(040)
|
||||
F(arm040),F(arm_UI),F(arm042),F(arm04B),F(arm044),F(arm_UI),F(arm046),F(arm_UI), // F(048)
|
||||
F(arm050),F(arm051),F(arm052),F(arm053),F(arm054),F(arm055),F(arm056),F(arm057), // F(050)
|
||||
F(arm050),F(arm_UI),F(arm052),F(arm05B),F(arm054),F(arm05D),F(arm056),F(arm05F), // F(058)
|
||||
F(arm060),F(arm061),F(arm062),F(arm063),F(arm064),F(arm065),F(arm066),F(arm067), // F(060)
|
||||
F(arm060),F(arm_UI),F(arm062),F(arm_UI),F(arm064),F(arm_UI),F(arm066),F(arm_UI), // F(068)
|
||||
F(arm070),F(arm071),F(arm072),F(arm073),F(arm074),F(arm075),F(arm076),F(arm077), // F(070)
|
||||
F(arm070),F(arm_UI),F(arm072),F(arm_UI),F(arm074),F(arm05D),F(arm076),F(arm05F), // F(078)
|
||||
F(arm080),F(arm081),F(arm082),F(arm083),F(arm084),F(arm085),F(arm086),F(arm087), // F(080)
|
||||
F(arm080),F(arm089),F(arm082),F(arm08B),F(arm084),F(arm_UI),F(arm086),F(arm_UI), // F(088)
|
||||
F(arm090),F(arm091),F(arm092),F(arm093),F(arm094),F(arm095),F(arm096),F(arm097), // F(090)
|
||||
F(arm090),F(arm099),F(arm092),F(arm09B),F(arm094),F(arm09D),F(arm096),F(arm09F), // F(098)
|
||||
F(arm0A0),F(arm0A1),F(arm0A2),F(arm0A3),F(arm0A4),F(arm0A5),F(arm0A6),F(arm0A7), // F(0A0)
|
||||
F(arm0A0),F(arm0A9),F(arm0A2),F(arm_UI),F(arm0A4),F(arm_UI),F(arm0A6),F(arm_UI), // F(0A8)
|
||||
F(arm0B0),F(arm0B1),F(arm0B2),F(arm0B3),F(arm0B4),F(arm0B5),F(arm0B6),F(arm0B7), // F(0B0)
|
||||
F(arm0B0),F(arm0B9),F(arm0B2),F(arm_UI),F(arm0B4),F(arm09D),F(arm0B6),F(arm09F), // F(0B8)
|
||||
F(arm0C0),F(arm0C1),F(arm0C2),F(arm0C3),F(arm0C4),F(arm0C5),F(arm0C6),F(arm0C7), // F(0C0)
|
||||
F(arm0C0),F(arm0C9),F(arm0C2),F(arm0CB),F(arm0C4),F(arm_UI),F(arm0C6),F(arm_UI), // F(0C8)
|
||||
F(arm0D0),F(arm0D1),F(arm0D2),F(arm0D3),F(arm0D4),F(arm0D5),F(arm0D6),F(arm0D7), // F(0D0)
|
||||
F(arm0D0),F(arm0D9),F(arm0D2),F(arm0DB),F(arm0D4),F(arm0DD),F(arm0D6),F(arm0DF), // F(0D8)
|
||||
F(arm0E0),F(arm0E1),F(arm0E2),F(arm0E3),F(arm0E4),F(arm0E5),F(arm0E6),F(arm0E7), // F(0E0)
|
||||
F(arm0E0),F(arm0E9),F(arm0E2),F(arm_UI),F(arm0E4),F(arm_UI),F(arm0E6),F(arm_UI), // F(0E8)
|
||||
F(arm0F0),F(arm0F1),F(arm0F2),F(arm0F3),F(arm0F4),F(arm0F5),F(arm0F6),F(arm0F7), // F(0F0)
|
||||
F(arm0F0),F(arm0F9),F(arm0F2),F(arm_UI),F(arm0F4),F(arm0DD),F(arm0F6),F(arm0DF), // F(0F8)
|
||||
|
||||
F(arm100),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(100)
|
||||
F(arm_UI),F(arm109),F(arm_UI),F(arm10B),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(108)
|
||||
F(arm110),F(arm111),F(arm112),F(arm113),F(arm114),F(arm115),F(arm116),F(arm117), // F(110)
|
||||
F(arm110),F(arm_UI),F(arm112),F(arm11B),F(arm114),F(arm11D),F(arm116),F(arm11F), // F(118)
|
||||
F(arm120),F(arm121),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_BP), // F(120)
|
||||
F(arm_UI),F(arm_UI),F(arm_UI),F(arm12B),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(128)
|
||||
F(arm130),F(arm131),F(arm132),F(arm133),F(arm134),F(arm135),F(arm136),F(arm137), // F(130)
|
||||
F(arm130),F(arm_UI),F(arm132),F(arm13B),F(arm134),F(arm13D),F(arm136),F(arm13F), // F(138)
|
||||
F(arm140),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(140)
|
||||
F(arm_UI),F(arm149),F(arm_UI),F(arm14B),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(148)
|
||||
F(arm150),F(arm151),F(arm152),F(arm153),F(arm154),F(arm155),F(arm156),F(arm157), // F(150)
|
||||
F(arm150),F(arm_UI),F(arm152),F(arm15B),F(arm154),F(arm15D),F(arm156),F(arm15F), // F(158)
|
||||
F(arm160),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(160)
|
||||
F(arm_UI),F(arm_UI),F(arm_UI),F(arm16B),F(arm_UI),F(arm_UI),F(arm_UI),F(arm_UI), // F(168)
|
||||
F(arm170),F(arm171),F(arm172),F(arm173),F(arm174),F(arm175),F(arm176),F(arm177), // F(170)
|
||||
F(arm170),F(arm_UI),F(arm172),F(arm17B),F(arm174),F(arm17D),F(arm176),F(arm17F), // F(178)
|
||||
F(arm180),F(arm181),F(arm182),F(arm183),F(arm184),F(arm185),F(arm186),F(arm187), // F(180)
|
||||
F(arm180),F(arm_UI),F(arm182),F(arm18B),F(arm184),F(arm_UI),F(arm186),F(arm_UI), // F(188)
|
||||
F(arm190),F(arm191),F(arm192),F(arm193),F(arm194),F(arm195),F(arm196),F(arm197), // F(190)
|
||||
F(arm190),F(arm_UI),F(arm192),F(arm19B),F(arm194),F(arm19D),F(arm196),F(arm19F), // F(198)
|
||||
F(arm1A0),F(arm1A1),F(arm1A2),F(arm1A3),F(arm1A4),F(arm1A5),F(arm1A6),F(arm1A7), // F(1A0)
|
||||
F(arm1A0),F(arm_UI),F(arm1A2),F(arm1AB),F(arm1A4),F(arm_UI),F(arm1A6),F(arm_UI), // F(1A8)
|
||||
F(arm1B0),F(arm1B1),F(arm1B2),F(arm1B3),F(arm1B4),F(arm1B5),F(arm1B6),F(arm1B7), // F(1B0)
|
||||
F(arm1B0),F(arm_UI),F(arm1B2),F(arm1BB),F(arm1B4),F(arm1BD),F(arm1B6),F(arm1BF), // F(1B8)
|
||||
F(arm1C0),F(arm1C1),F(arm1C2),F(arm1C3),F(arm1C4),F(arm1C5),F(arm1C6),F(arm1C7), // F(1C0)
|
||||
F(arm1C0),F(arm_UI),F(arm1C2),F(arm1CB),F(arm1C4),F(arm_UI),F(arm1C6),F(arm_UI), // F(1C8)
|
||||
F(arm1D0),F(arm1D1),F(arm1D2),F(arm1D3),F(arm1D4),F(arm1D5),F(arm1D6),F(arm1D7), // F(1D0)
|
||||
F(arm1D0),F(arm_UI),F(arm1D2),F(arm1DB),F(arm1D4),F(arm1DD),F(arm1D6),F(arm1DF), // F(1D8)
|
||||
F(arm1E0),F(arm1E1),F(arm1E2),F(arm1E3),F(arm1E4),F(arm1E5),F(arm1E6),F(arm1E7), // F(1E0)
|
||||
F(arm1E0),F(arm_UI),F(arm1E2),F(arm1EB),F(arm1E4),F(arm_UI),F(arm1E6),F(arm_UI), // F(1E8)
|
||||
F(arm1F0),F(arm1F1),F(arm1F2),F(arm1F3),F(arm1F4),F(arm1F5),F(arm1F6),F(arm1F7), // F(1F0)
|
||||
F(arm1F0),F(arm_UI),F(arm1F2),F(arm1FB),F(arm1F4),F(arm1FD),F(arm1F6),F(arm1FF), // F(1F8)
|
||||
|
||||
REP16(arm200),REP16(arm210),REP16(arm220),REP16(arm230), // 200
|
||||
REP16(arm240),REP16(arm250),REP16(arm260),REP16(arm270), // 240
|
||||
REP16(arm280),REP16(arm290),REP16(arm2A0),REP16(arm2B0), // 280
|
||||
REP16(arm2C0),REP16(arm2D0),REP16(arm2E0),REP16(arm2F0), // 2C0
|
||||
REP16(arm_UI),REP16(arm310),REP16(arm320),REP16(arm330), // 300
|
||||
REP16(arm_UI),REP16(arm350),REP16(arm360),REP16(arm370), // 340
|
||||
REP16(arm380),REP16(arm390),REP16(arm3A0),REP16(arm3B0), // 380
|
||||
REP16(arm3C0),REP16(arm3D0),REP16(arm3E0),REP16(arm3F0), // 3C0
|
||||
|
||||
REP16(arm400),REP16(arm410),REP16(arm400),REP16(arm410), // 400
|
||||
REP16(arm440),REP16(arm450),REP16(arm440),REP16(arm450), // 440
|
||||
REP16(arm480),REP16(arm490),REP16(arm480),REP16(arm490), // 480
|
||||
REP16(arm4C0),REP16(arm4D0),REP16(arm4C0),REP16(arm4D0), // 4C0
|
||||
REP16(arm500),REP16(arm510),REP16(arm520),REP16(arm530), // 500
|
||||
REP16(arm540),REP16(arm550),REP16(arm560),REP16(arm570), // 540
|
||||
REP16(arm580),REP16(arm590),REP16(arm5A0),REP16(arm5B0), // 580
|
||||
REP16(arm5C0),REP16(arm5D0),REP16(arm5E0),REP16(arm5F0), // 5C0
|
||||
|
||||
F(arm600),F(arm_UI),F(arm602),F(arm_UI),F(arm604),F(arm_UI),F(arm606),F(arm_UI), // F(600)
|
||||
F(arm600),F(arm_UI),F(arm602),F(arm_UI),F(arm604),F(arm_UI),F(arm606),F(arm_UI), // F(608)
|
||||
F(arm610),F(arm_UI),F(arm612),F(arm_UI),F(arm614),F(arm_UI),F(arm616),F(arm_UI), // F(610)
|
||||
F(arm610),F(arm_UI),F(arm612),F(arm_UI),F(arm614),F(arm_UI),F(arm616),F(arm_UI), // F(618)
|
||||
F(arm600),F(arm_UI),F(arm602),F(arm_UI),F(arm604),F(arm_UI),F(arm606),F(arm_UI), // F(620)
|
||||
F(arm600),F(arm_UI),F(arm602),F(arm_UI),F(arm604),F(arm_UI),F(arm606),F(arm_UI), // F(628)
|
||||
F(arm610),F(arm_UI),F(arm612),F(arm_UI),F(arm614),F(arm_UI),F(arm616),F(arm_UI), // F(630)
|
||||
F(arm610),F(arm_UI),F(arm612),F(arm_UI),F(arm614),F(arm_UI),F(arm616),F(arm_UI), // F(638)
|
||||
F(arm640),F(arm_UI),F(arm642),F(arm_UI),F(arm644),F(arm_UI),F(arm646),F(arm_UI), // F(640)
|
||||
F(arm640),F(arm_UI),F(arm642),F(arm_UI),F(arm644),F(arm_UI),F(arm646),F(arm_UI), // F(648)
|
||||
F(arm650),F(arm_UI),F(arm652),F(arm_UI),F(arm654),F(arm_UI),F(arm656),F(arm_UI), // F(650)
|
||||
F(arm650),F(arm_UI),F(arm652),F(arm_UI),F(arm654),F(arm_UI),F(arm656),F(arm_UI), // F(658)
|
||||
F(arm640),F(arm_UI),F(arm642),F(arm_UI),F(arm644),F(arm_UI),F(arm646),F(arm_UI), // F(660)
|
||||
F(arm640),F(arm_UI),F(arm642),F(arm_UI),F(arm644),F(arm_UI),F(arm646),F(arm_UI), // F(668)
|
||||
F(arm650),F(arm_UI),F(arm652),F(arm_UI),F(arm654),F(arm_UI),F(arm656),F(arm_UI), // F(670)
|
||||
F(arm650),F(arm_UI),F(arm652),F(arm_UI),F(arm654),F(arm_UI),F(arm656),F(arm_UI), // F(678)
|
||||
F(arm680),F(arm_UI),F(arm682),F(arm_UI),F(arm684),F(arm_UI),F(arm686),F(arm_UI), // F(680)
|
||||
F(arm680),F(arm_UI),F(arm682),F(arm_UI),F(arm684),F(arm_UI),F(arm686),F(arm_UI), // F(688)
|
||||
F(arm690),F(arm_UI),F(arm692),F(arm_UI),F(arm694),F(arm_UI),F(arm696),F(arm_UI), // F(690)
|
||||
F(arm690),F(arm_UI),F(arm692),F(arm_UI),F(arm694),F(arm_UI),F(arm696),F(arm_UI), // F(698)
|
||||
F(arm680),F(arm_UI),F(arm682),F(arm_UI),F(arm684),F(arm_UI),F(arm686),F(arm_UI), // F(6A0)
|
||||
F(arm680),F(arm_UI),F(arm682),F(arm_UI),F(arm684),F(arm_UI),F(arm686),F(arm_UI), // F(6A8)
|
||||
F(arm690),F(arm_UI),F(arm692),F(arm_UI),F(arm694),F(arm_UI),F(arm696),F(arm_UI), // F(6B0)
|
||||
F(arm690),F(arm_UI),F(arm692),F(arm_UI),F(arm694),F(arm_UI),F(arm696),F(arm_UI), // F(6B8)
|
||||
F(arm6C0),F(arm_UI),F(arm6C2),F(arm_UI),F(arm6C4),F(arm_UI),F(arm6C6),F(arm_UI), // F(6C0)
|
||||
F(arm6C0),F(arm_UI),F(arm6C2),F(arm_UI),F(arm6C4),F(arm_UI),F(arm6C6),F(arm_UI), // F(6C8)
|
||||
F(arm6D0),F(arm_UI),F(arm6D2),F(arm_UI),F(arm6D4),F(arm_UI),F(arm6D6),F(arm_UI), // F(6D0)
|
||||
F(arm6D0),F(arm_UI),F(arm6D2),F(arm_UI),F(arm6D4),F(arm_UI),F(arm6D6),F(arm_UI), // F(6D8)
|
||||
F(arm6C0),F(arm_UI),F(arm6C2),F(arm_UI),F(arm6C4),F(arm_UI),F(arm6C6),F(arm_UI), // F(6E0)
|
||||
F(arm6C0),F(arm_UI),F(arm6C2),F(arm_UI),F(arm6C4),F(arm_UI),F(arm6C6),F(arm_UI), // F(6E8)
|
||||
F(arm6D0),F(arm_UI),F(arm6D2),F(arm_UI),F(arm6D4),F(arm_UI),F(arm6D6),F(arm_UI), // F(6F0)
|
||||
F(arm6D0),F(arm_UI),F(arm6D2),F(arm_UI),F(arm6D4),F(arm_UI),F(arm6D6),F(arm_UI), // F(6F8)
|
||||
|
||||
F(arm700),F(arm_UI),F(arm702),F(arm_UI),F(arm704),F(arm_UI),F(arm706),F(arm_UI), // F(700)
|
||||
F(arm700),F(arm_UI),F(arm702),F(arm_UI),F(arm704),F(arm_UI),F(arm706),F(arm_UI), // F(708)
|
||||
F(arm710),F(arm_UI),F(arm712),F(arm_UI),F(arm714),F(arm_UI),F(arm716),F(arm_UI), // F(710)
|
||||
F(arm710),F(arm_UI),F(arm712),F(arm_UI),F(arm714),F(arm_UI),F(arm716),F(arm_UI), // F(718)
|
||||
F(arm720),F(arm_UI),F(arm722),F(arm_UI),F(arm724),F(arm_UI),F(arm726),F(arm_UI), // F(720)
|
||||
F(arm720),F(arm_UI),F(arm722),F(arm_UI),F(arm724),F(arm_UI),F(arm726),F(arm_UI), // F(728)
|
||||
F(arm730),F(arm_UI),F(arm732),F(arm_UI),F(arm734),F(arm_UI),F(arm736),F(arm_UI), // F(730)
|
||||
F(arm730),F(arm_UI),F(arm732),F(arm_UI),F(arm734),F(arm_UI),F(arm736),F(arm_UI), // F(738)
|
||||
F(arm740),F(arm_UI),F(arm742),F(arm_UI),F(arm744),F(arm_UI),F(arm746),F(arm_UI), // F(740)
|
||||
F(arm740),F(arm_UI),F(arm742),F(arm_UI),F(arm744),F(arm_UI),F(arm746),F(arm_UI), // F(748)
|
||||
F(arm750),F(arm_UI),F(arm752),F(arm_UI),F(arm754),F(arm_UI),F(arm756),F(arm_UI), // F(750)
|
||||
F(arm750),F(arm_UI),F(arm752),F(arm_UI),F(arm754),F(arm_UI),F(arm756),F(arm_UI), // F(758)
|
||||
F(arm760),F(arm_UI),F(arm762),F(arm_UI),F(arm764),F(arm_UI),F(arm766),F(arm_UI), // F(760)
|
||||
F(arm760),F(arm_UI),F(arm762),F(arm_UI),F(arm764),F(arm_UI),F(arm766),F(arm_UI), // F(768)
|
||||
F(arm770),F(arm_UI),F(arm772),F(arm_UI),F(arm774),F(arm_UI),F(arm776),F(arm_UI), // F(770)
|
||||
F(arm770),F(arm_UI),F(arm772),F(arm_UI),F(arm774),F(arm_UI),F(arm776),F(arm_UI), // F(778)
|
||||
F(arm780),F(arm_UI),F(arm782),F(arm_UI),F(arm784),F(arm_UI),F(arm786),F(arm_UI), // F(780)
|
||||
F(arm780),F(arm_UI),F(arm782),F(arm_UI),F(arm784),F(arm_UI),F(arm786),F(arm_UI), // F(788)
|
||||
F(arm790),F(arm_UI),F(arm792),F(arm_UI),F(arm794),F(arm_UI),F(arm796),F(arm_UI), // F(790)
|
||||
F(arm790),F(arm_UI),F(arm792),F(arm_UI),F(arm794),F(arm_UI),F(arm796),F(arm_UI), // F(798)
|
||||
F(arm7A0),F(arm_UI),F(arm7A2),F(arm_UI),F(arm7A4),F(arm_UI),F(arm7A6),F(arm_UI), // F(7A0)
|
||||
F(arm7A0),F(arm_UI),F(arm7A2),F(arm_UI),F(arm7A4),F(arm_UI),F(arm7A6),F(arm_UI), // F(7A8)
|
||||
F(arm7B0),F(arm_UI),F(arm7B2),F(arm_UI),F(arm7B4),F(arm_UI),F(arm7B6),F(arm_UI), // F(7B0)
|
||||
F(arm7B0),F(arm_UI),F(arm7B2),F(arm_UI),F(arm7B4),F(arm_UI),F(arm7B6),F(arm_UI), // F(7B8)
|
||||
F(arm7C0),F(arm_UI),F(arm7C2),F(arm_UI),F(arm7C4),F(arm_UI),F(arm7C6),F(arm_UI), // F(7C0)
|
||||
F(arm7C0),F(arm_UI),F(arm7C2),F(arm_UI),F(arm7C4),F(arm_UI),F(arm7C6),F(arm_UI), // F(7C8)
|
||||
F(arm7D0),F(arm_UI),F(arm7D2),F(arm_UI),F(arm7D4),F(arm_UI),F(arm7D6),F(arm_UI), // F(7D0)
|
||||
F(arm7D0),F(arm_UI),F(arm7D2),F(arm_UI),F(arm7D4),F(arm_UI),F(arm7D6),F(arm_UI), // F(7D8)
|
||||
F(arm7E0),F(arm_UI),F(arm7E2),F(arm_UI),F(arm7E4),F(arm_UI),F(arm7E6),F(arm_UI), // F(7E0)
|
||||
F(arm7E0),F(arm_UI),F(arm7E2),F(arm_UI),F(arm7E4),F(arm_UI),F(arm7E6),F(arm_UI), // F(7E8)
|
||||
F(arm7F0),F(arm_UI),F(arm7F2),F(arm_UI),F(arm7F4),F(arm_UI),F(arm7F6),F(arm_UI), // F(7F0)
|
||||
F(arm7F0),F(arm_UI),F(arm7F2),F(arm_UI),F(arm7F4),F(arm_UI),F(arm7F6),F(arm_BP), // F(7F8)
|
||||
|
||||
REP16(arm800),REP16(arm810),REP16(arm820),REP16(arm830), // 800
|
||||
REP16(arm840),REP16(arm850),REP16(arm860),REP16(arm870), // 840
|
||||
REP16(arm880),REP16(arm890),REP16(arm8A0),REP16(arm8B0), // 880
|
||||
REP16(arm8C0),REP16(arm8D0),REP16(arm8E0),REP16(arm8F0), // 8C0
|
||||
REP16(arm900),REP16(arm910),REP16(arm920),REP16(arm930), // 900
|
||||
REP16(arm940),REP16(arm950),REP16(arm960),REP16(arm970), // 940
|
||||
REP16(arm980),REP16(arm990),REP16(arm9A0),REP16(arm9B0), // 980
|
||||
REP16(arm9C0),REP16(arm9D0),REP16(arm9E0),REP16(arm9F0), // 9C0
|
||||
|
||||
REP256(armA00), // A00
|
||||
REP256(armB00), // B00
|
||||
REP256(arm_UI), // C00
|
||||
REP256(arm_UI), // D00
|
||||
|
||||
F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01), // F(E00)
|
||||
F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01), // F(E08)
|
||||
F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01), // F(E10)
|
||||
F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01),F(arm_UI),F(armE01), // F(E18)
|
||||
REP16(arm_UI), // E20
|
||||
REP16(arm_UI), // E30
|
||||
REP16(arm_UI),REP16(arm_UI),REP16(arm_UI),REP16(arm_UI), // E40
|
||||
REP16(arm_UI),REP16(arm_UI),REP16(arm_UI),REP16(arm_UI), // E80
|
||||
REP16(arm_UI),REP16(arm_UI),REP16(arm_UI),REP16(arm_UI), // EC0
|
||||
|
||||
REP256(armF00), // F00
|
||||
};
|
||||
|
||||
void (Gigazoid::*const Gigazoid::thumbInsnTable[1024])(u32 opcode) = {
|
||||
F(thumb00_00),F(thumb00_01),F(thumb00_02),F(thumb00_03),F(thumb00_04),F(thumb00_05),F(thumb00_06),F(thumb00_07), // F(00)
|
||||
F(thumb00_08),F(thumb00_09),F(thumb00_0A),F(thumb00_0B),F(thumb00_0C),F(thumb00_0D),F(thumb00_0E),F(thumb00_0F),
|
||||
F(thumb00_10),F(thumb00_11),F(thumb00_12),F(thumb00_13),F(thumb00_14),F(thumb00_15),F(thumb00_16),F(thumb00_17),
|
||||
F(thumb00_18),F(thumb00_19),F(thumb00_1A),F(thumb00_1B),F(thumb00_1C),F(thumb00_1D),F(thumb00_1E),F(thumb00_1F),
|
||||
F(thumb08_00),F(thumb08_01),F(thumb08_02),F(thumb08_03),F(thumb08_04),F(thumb08_05),F(thumb08_06),F(thumb08_07), // F(08)
|
||||
F(thumb08_08),F(thumb08_09),F(thumb08_0A),F(thumb08_0B),F(thumb08_0C),F(thumb08_0D),F(thumb08_0E),F(thumb08_0F),
|
||||
F(thumb08_10),F(thumb08_11),F(thumb08_12),F(thumb08_13),F(thumb08_14),F(thumb08_15),F(thumb08_16),F(thumb08_17),
|
||||
F(thumb08_18),F(thumb08_19),F(thumb08_1A),F(thumb08_1B),F(thumb08_1C),F(thumb08_1D),F(thumb08_1E),F(thumb08_1F),
|
||||
F(thumb10_00),F(thumb10_01),F(thumb10_02),F(thumb10_03),F(thumb10_04),F(thumb10_05),F(thumb10_06),F(thumb10_07), // F(10)
|
||||
F(thumb10_08),F(thumb10_09),F(thumb10_0A),F(thumb10_0B),F(thumb10_0C),F(thumb10_0D),F(thumb10_0E),F(thumb10_0F),
|
||||
F(thumb10_10),F(thumb10_11),F(thumb10_12),F(thumb10_13),F(thumb10_14),F(thumb10_15),F(thumb10_16),F(thumb10_17),
|
||||
F(thumb10_18),F(thumb10_19),F(thumb10_1A),F(thumb10_1B),F(thumb10_1C),F(thumb10_1D),F(thumb10_1E),F(thumb10_1F),
|
||||
F(thumb18_0),F(thumb18_1),F(thumb18_2),F(thumb18_3),F(thumb18_4),F(thumb18_5),F(thumb18_6),F(thumb18_7), // F(18)
|
||||
F(thumb1A_0),F(thumb1A_1),F(thumb1A_2),F(thumb1A_3),F(thumb1A_4),F(thumb1A_5),F(thumb1A_6),F(thumb1A_7),
|
||||
F(thumb1C_0),F(thumb1C_1),F(thumb1C_2),F(thumb1C_3),F(thumb1C_4),F(thumb1C_5),F(thumb1C_6),F(thumb1C_7),
|
||||
F(thumb1E_0),F(thumb1E_1),F(thumb1E_2),F(thumb1E_3),F(thumb1E_4),F(thumb1E_5),F(thumb1E_6),F(thumb1E_7),
|
||||
F(thumb20),F(thumb20),F(thumb20),F(thumb20),F(thumb21),F(thumb21),F(thumb21),F(thumb21), // F(20)
|
||||
F(thumb22),F(thumb22),F(thumb22),F(thumb22),F(thumb23),F(thumb23),F(thumb23),F(thumb23),
|
||||
F(thumb24),F(thumb24),F(thumb24),F(thumb24),F(thumb25),F(thumb25),F(thumb25),F(thumb25),
|
||||
F(thumb26),F(thumb26),F(thumb26),F(thumb26),F(thumb27),F(thumb27),F(thumb27),F(thumb27),
|
||||
F(thumb28),F(thumb28),F(thumb28),F(thumb28),F(thumb29),F(thumb29),F(thumb29),F(thumb29), // F(28)
|
||||
F(thumb2A),F(thumb2A),F(thumb2A),F(thumb2A),F(thumb2B),F(thumb2B),F(thumb2B),F(thumb2B),
|
||||
F(thumb2C),F(thumb2C),F(thumb2C),F(thumb2C),F(thumb2D),F(thumb2D),F(thumb2D),F(thumb2D),
|
||||
F(thumb2E),F(thumb2E),F(thumb2E),F(thumb2E),F(thumb2F),F(thumb2F),F(thumb2F),F(thumb2F),
|
||||
F(thumb30),F(thumb30),F(thumb30),F(thumb30),F(thumb31),F(thumb31),F(thumb31),F(thumb31), // F(30)
|
||||
F(thumb32),F(thumb32),F(thumb32),F(thumb32),F(thumb33),F(thumb33),F(thumb33),F(thumb33),
|
||||
F(thumb34),F(thumb34),F(thumb34),F(thumb34),F(thumb35),F(thumb35),F(thumb35),F(thumb35),
|
||||
F(thumb36),F(thumb36),F(thumb36),F(thumb36),F(thumb37),F(thumb37),F(thumb37),F(thumb37),
|
||||
F(thumb38),F(thumb38),F(thumb38),F(thumb38),F(thumb39),F(thumb39),F(thumb39),F(thumb39), // F(38)
|
||||
F(thumb3A),F(thumb3A),F(thumb3A),F(thumb3A),F(thumb3B),F(thumb3B),F(thumb3B),F(thumb3B),
|
||||
F(thumb3C),F(thumb3C),F(thumb3C),F(thumb3C),F(thumb3D),F(thumb3D),F(thumb3D),F(thumb3D),
|
||||
F(thumb3E),F(thumb3E),F(thumb3E),F(thumb3E),F(thumb3F),F(thumb3F),F(thumb3F),F(thumb3F),
|
||||
F(thumb40_0),F(thumb40_1),F(thumb40_2),F(thumb40_3),F(thumb41_0),F(thumb41_1),F(thumb41_2),F(thumb41_3), // F(40)
|
||||
F(thumb42_0),F(thumb42_1),F(thumb42_2),F(thumb42_3),F(thumb43_0),F(thumb43_1),F(thumb43_2),F(thumb43_3),
|
||||
F(thumbUI),F(thumb44_1),F(thumb44_2),F(thumb44_3),F(thumbUI),F(thumb45_1),F(thumb45_2),F(thumb45_3),
|
||||
F(thumbUI),F(thumb46_1),F(thumb46_2),F(thumb46_3),F(thumb47),F(thumb47),F(thumbUI),F(thumbUI),
|
||||
F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48), // F(48)
|
||||
F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),
|
||||
F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),
|
||||
F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),F(thumb48),
|
||||
F(thumb50),F(thumb50),F(thumb50),F(thumb50),F(thumb50),F(thumb50),F(thumb50),F(thumb50), // F(50)
|
||||
F(thumb52),F(thumb52),F(thumb52),F(thumb52),F(thumb52),F(thumb52),F(thumb52),F(thumb52),
|
||||
F(thumb54),F(thumb54),F(thumb54),F(thumb54),F(thumb54),F(thumb54),F(thumb54),F(thumb54),
|
||||
F(thumb56),F(thumb56),F(thumb56),F(thumb56),F(thumb56),F(thumb56),F(thumb56),F(thumb56),
|
||||
F(thumb58),F(thumb58),F(thumb58),F(thumb58),F(thumb58),F(thumb58),F(thumb58),F(thumb58), // F(58)
|
||||
F(thumb5A),F(thumb5A),F(thumb5A),F(thumb5A),F(thumb5A),F(thumb5A),F(thumb5A),F(thumb5A),
|
||||
F(thumb5C),F(thumb5C),F(thumb5C),F(thumb5C),F(thumb5C),F(thumb5C),F(thumb5C),F(thumb5C),
|
||||
F(thumb5E),F(thumb5E),F(thumb5E),F(thumb5E),F(thumb5E),F(thumb5E),F(thumb5E),F(thumb5E),
|
||||
F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60), // F(60)
|
||||
F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),
|
||||
F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),
|
||||
F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),F(thumb60),
|
||||
F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68), // F(68)
|
||||
F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),
|
||||
F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),
|
||||
F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),F(thumb68),
|
||||
F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70), // F(70)
|
||||
F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),
|
||||
F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),
|
||||
F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),F(thumb70),
|
||||
F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78), // F(78)
|
||||
F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),
|
||||
F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),
|
||||
F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),F(thumb78),
|
||||
F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80), // F(80)
|
||||
F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),
|
||||
F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),
|
||||
F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),F(thumb80),
|
||||
F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88), // F(88)
|
||||
F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),
|
||||
F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),
|
||||
F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),F(thumb88),
|
||||
F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90), // F(90)
|
||||
F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),
|
||||
F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),
|
||||
F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),F(thumb90),
|
||||
F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98), // F(98)
|
||||
F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),
|
||||
F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),
|
||||
F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),F(thumb98),
|
||||
F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0), // F(A0)
|
||||
F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),
|
||||
F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),
|
||||
F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),F(thumbA0),
|
||||
F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8), // F(A8)
|
||||
F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),
|
||||
F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),
|
||||
F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),F(thumbA8),
|
||||
F(thumbB0),F(thumbB0),F(thumbB0),F(thumbB0),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI), // F(B0)
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbB4),F(thumbB4),F(thumbB4),F(thumbB4),F(thumbB5),F(thumbB5),F(thumbB5),F(thumbB5),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI), // F(B8)
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbBC),F(thumbBC),F(thumbBC),F(thumbBC),F(thumbBD),F(thumbBD),F(thumbBD),F(thumbBD),
|
||||
F(thumbBP),F(thumbBP),F(thumbBP),F(thumbBP),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0), // F(C0)
|
||||
F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),
|
||||
F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),
|
||||
F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),F(thumbC0),
|
||||
F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8), // F(C8)
|
||||
F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),
|
||||
F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),
|
||||
F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),F(thumbC8),
|
||||
F(thumbD0),F(thumbD0),F(thumbD0),F(thumbD0),F(thumbD1),F(thumbD1),F(thumbD1),F(thumbD1), // F(D0)
|
||||
F(thumbD2),F(thumbD2),F(thumbD2),F(thumbD2),F(thumbD3),F(thumbD3),F(thumbD3),F(thumbD3),
|
||||
F(thumbD4),F(thumbD4),F(thumbD4),F(thumbD4),F(thumbD5),F(thumbD5),F(thumbD5),F(thumbD5),
|
||||
F(thumbD6),F(thumbD6),F(thumbD6),F(thumbD6),F(thumbD7),F(thumbD7),F(thumbD7),F(thumbD7),
|
||||
F(thumbD8),F(thumbD8),F(thumbD8),F(thumbD8),F(thumbD9),F(thumbD9),F(thumbD9),F(thumbD9), // F(D8)
|
||||
F(thumbDA),F(thumbDA),F(thumbDA),F(thumbDA),F(thumbDB),F(thumbDB),F(thumbDB),F(thumbDB),
|
||||
F(thumbDC),F(thumbDC),F(thumbDC),F(thumbDC),F(thumbDD),F(thumbDD),F(thumbDD),F(thumbDD),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbDF),F(thumbDF),F(thumbDF),F(thumbDF),
|
||||
F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0), // F(E0)
|
||||
F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),
|
||||
F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),
|
||||
F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),F(thumbE0),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI), // F(E8)
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),F(thumbUI),
|
||||
F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0), // F(F0)
|
||||
F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),F(thumbF0),
|
||||
F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),
|
||||
F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),F(thumbF4),
|
||||
F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8), // F(F8)
|
||||
F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),
|
||||
F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),
|
||||
F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),F(thumbF8),
|
||||
};
|
||||
|
||||
#undef F
|
|
@ -1,57 +0,0 @@
|
|||
#ifndef PORT_H
|
||||
#define PORT_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
/* if a >= 0 return x else y*/
|
||||
#define isel(a, x, y) ((x & (~(a >> 31))) + (y & (a >> 31)))
|
||||
|
||||
#ifdef FRONTEND_SUPPORTS_RGB565
|
||||
/* 16bit color - RGB565 */
|
||||
#define RED_MASK 0xf800
|
||||
#define GREEN_MASK 0x7e0
|
||||
#define BLUE_MASK 0x1f
|
||||
#define RED_EXPAND 3
|
||||
#define GREEN_EXPAND 2
|
||||
#define BLUE_EXPAND 3
|
||||
#define RED_SHIFT 11
|
||||
#define GREEN_SHIFT 5
|
||||
#define BLUE_SHIFT 0
|
||||
#define CONVERT_COLOR(color) (((color & 0x001f) << 11) | ((color & 0x03e0) << 1) | ((color & 0x0200) >> 4) | ((color & 0x7c00) >> 10))
|
||||
#else
|
||||
/* 16bit color - RGB555 */
|
||||
#define RED_MASK 0x7c00
|
||||
#define GREEN_MASK 0x3e0
|
||||
#define BLUE_MASK 0x1f
|
||||
#define RED_EXPAND 3
|
||||
#define GREEN_EXPAND 3
|
||||
#define BLUE_EXPAND 3
|
||||
#define RED_SHIFT 10
|
||||
#define GREEN_SHIFT 5
|
||||
#define BLUE_SHIFT 0
|
||||
#define CONVERT_COLOR(color) ((((color & 0x1f) << 10) | (((color & 0x3e0) >> 5) << 5) | (((color & 0x7c00) >> 10))) & 0x7fff)
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <stdlib.h>
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#ifdef USE_CACHE_PREFETCH
|
||||
#if defined(__ANDROID__)
|
||||
#define CACHE_PREFETCH(prefetch) prefetch(&prefetch);
|
||||
#elif defined(_XBOX)
|
||||
#define CACHE_PREFETCH(prefetch) __dcbt(0, &prefetch);
|
||||
#else
|
||||
#define CACHE_PREFETCH(prefetch) __dcbt(&prefetch);
|
||||
#endif
|
||||
#else
|
||||
#define CACHE_PREFETCH(prefetch)
|
||||
#endif
|
||||
|
||||
#define READ16LE(x) *((u16 *)x)
|
||||
#define READ32LE(x) *((u32 *)x)
|
||||
#define WRITE16LE(x,v) *((u16 *)x) = (v)
|
||||
#define WRITE32LE(x,v) *((u32 *)x) = (v)
|
||||
|
||||
#endif
|
|
@ -1,57 +0,0 @@
|
|||
#ifndef SOUND_BLARGG_H
|
||||
#define SOUND_BLARGG_H
|
||||
|
||||
/* Uncomment to have Gb_Apu run at 4x normal clock rate (16777216 Hz), useful in
|
||||
a Game Boy Advance emulator. */
|
||||
#define GB_APU_OVERCLOCK 4
|
||||
|
||||
#ifndef STATIC_CAST
|
||||
#if __GNUC__ >= 4
|
||||
#define STATIC_CAST(T,expr) static_cast<T> (expr)
|
||||
#define CONST_CAST( T,expr) const_cast<T> (expr)
|
||||
#else
|
||||
#define STATIC_CAST(T,expr) ((T) (expr))
|
||||
#define CONST_CAST( T,expr) ((T) (expr))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// BLARGG_COMPILER_HAS_BOOL: If 0, provides bool support for old compiler. If 1,
|
||||
// compiler is assumed to support bool. If undefined, availability is determined.
|
||||
#ifndef BLARGG_COMPILER_HAS_BOOL
|
||||
#if defined (__MWERKS__)
|
||||
#if !__option(bool)
|
||||
#define BLARGG_COMPILER_HAS_BOOL 0
|
||||
#endif
|
||||
#elif defined (_MSC_VER)
|
||||
#if _MSC_VER < 1100
|
||||
#define BLARGG_COMPILER_HAS_BOOL 0
|
||||
#endif
|
||||
#elif defined (__GNUC__)
|
||||
// supports bool
|
||||
#elif __cplusplus < 199711
|
||||
#define BLARGG_COMPILER_HAS_BOOL 0
|
||||
#endif
|
||||
#endif
|
||||
#if defined (BLARGG_COMPILER_HAS_BOOL) && !BLARGG_COMPILER_HAS_BOOL
|
||||
typedef int bool;
|
||||
const bool true = 1;
|
||||
const bool false = 0;
|
||||
#endif
|
||||
|
||||
/* HAVE_STDINT_H: If defined, use <stdint.h> for int8_t etc.*/
|
||||
#if defined (HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
/* HAVE_INTTYPES_H: If defined, use <stdint.h> for int8_t etc.*/
|
||||
#elif defined (HAVE_INTTYPES_H)
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
// If expr yields non-NULL error string, returns it from current function,
|
||||
// otherwise continues normally.
|
||||
#undef RETURN_ERR
|
||||
#define RETURN_ERR( expr ) do { \
|
||||
const char * blargg_return_err_ = (expr); \
|
||||
if ( blargg_return_err_ ) return blargg_return_err_; \
|
||||
} while ( 0 )
|
||||
|
||||
#endif // #ifndef SOUND_BLARGG_H
|
|
@ -1,33 +0,0 @@
|
|||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 2008 VBA-M development team
|
||||
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2, or(at your option)
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software Foundation,
|
||||
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifndef __VBA_TYPES_H__
|
||||
#define __VBA_TYPES_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
|
||||
typedef int8_t s8;
|
||||
typedef int16_t s16;
|
||||
typedef int32_t s32;
|
||||
typedef int64_t s64;
|
||||
|
||||
#endif // __VBA_TYPES_H__
|
Loading…
Reference in New Issue