O2Hawk: Expose Core and start running code
This commit is contained in:
parent
8b9968da60
commit
61038a13ae
|
@ -12,6 +12,7 @@
|
||||||
#include gamedb_msx2.txt
|
#include gamedb_msx2.txt
|
||||||
#include gamedb_n64.txt
|
#include gamedb_n64.txt
|
||||||
#include gamedb_nes.txt
|
#include gamedb_nes.txt
|
||||||
|
#include gamedb_Odyssey2.txt
|
||||||
#include gamedb_pce_cd.txt
|
#include gamedb_pce_cd.txt
|
||||||
#include gamedb_pce_hucards.txt
|
#include gamedb_pce_hucards.txt
|
||||||
#include gamedb_psx.txt
|
#include gamedb_psx.txt
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
SHA1:26A044C68FF08F574F6649B731B82CACA8C0E797 Death Race O2
|
||||||
|
|
||||||
|
|
|
@ -115,15 +115,17 @@ namespace BizHawk.Client.ApiHawk
|
||||||
return CoreSystem.GB3x;
|
return CoreSystem.GB3x;
|
||||||
|
|
||||||
case "GB4x":
|
case "GB4x":
|
||||||
return CoreSystem.GB3x;
|
return CoreSystem.GB4x;
|
||||||
|
|
||||||
case "MAME":
|
case "MAME":
|
||||||
return CoreSystem.MAME;
|
return CoreSystem.MAME;
|
||||||
|
|
||||||
|
case "O2":
|
||||||
|
return CoreSystem.Odyssey2;
|
||||||
|
|
||||||
case "VB":
|
case "VB":
|
||||||
case "NGP":
|
case "NGP":
|
||||||
case "DNGP":
|
case "DNGP":
|
||||||
case "O2":
|
|
||||||
case "SGB":
|
case "SGB":
|
||||||
case "UZE":
|
case "UZE":
|
||||||
case "PCFX":
|
case "PCFX":
|
||||||
|
@ -235,6 +237,9 @@ namespace BizHawk.Client.ApiHawk
|
||||||
case CoreSystem.AmstradCPC:
|
case CoreSystem.AmstradCPC:
|
||||||
return "AmstradCPC";
|
return "AmstradCPC";
|
||||||
|
|
||||||
|
case CoreSystem.Odyssey2:
|
||||||
|
return "O2";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new IndexOutOfRangeException($"{value} is missing in convert list");
|
throw new IndexOutOfRangeException($"{value} is missing in convert list");
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
GB3x,
|
GB3x,
|
||||||
GB4x,
|
GB4x,
|
||||||
ChannelF,
|
ChannelF,
|
||||||
|
Odyssey2,
|
||||||
MAME
|
MAME
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,6 +162,8 @@ namespace BizHawk.Client.Common
|
||||||
return SystemInfo.AmstradCPC;
|
return SystemInfo.AmstradCPC;
|
||||||
case "ChannelF":
|
case "ChannelF":
|
||||||
return SystemInfo.ChannelF;
|
return SystemInfo.ChannelF;
|
||||||
|
case "O2":
|
||||||
|
return SystemInfo.O2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
private bool HandleArchiveBinding(HawkFile file)
|
private bool HandleArchiveBinding(HawkFile file)
|
||||||
{
|
{
|
||||||
var romExtensions = new[] { "SMS", "SMC", "SFC", "PCE", "SGX", "GG", "SG", "BIN", "GEN", "MD", "SMD", "GB", "NES", "FDS", "ROM", "INT", "GBC", "UNF", "A78", "CRT", "COL", "XML", "Z64", "V64", "N64", "WS", "WSC", "GBA", "32X", "VEC" };
|
var romExtensions = new[] { "SMS", "SMC", "SFC", "PCE", "SGX", "GG", "SG", "BIN", "GEN", "MD", "SMD", "GB", "NES", "FDS", "ROM", "INT", "GBC", "UNF", "A78", "CRT", "COL", "XML", "Z64", "V64", "N64", "WS", "WSC", "GBA", "32X", "VEC", "O2" };
|
||||||
|
|
||||||
// try binding normal rom extensions first
|
// try binding normal rom extensions first
|
||||||
if (!file.IsBound)
|
if (!file.IsBound)
|
||||||
|
@ -1178,6 +1178,9 @@ namespace BizHawk.Client.Common
|
||||||
case "VEC":
|
case "VEC":
|
||||||
core = CoreInventory.Instance["VEC", "VectrexHawk"];
|
core = CoreInventory.Instance["VEC", "VectrexHawk"];
|
||||||
break;
|
break;
|
||||||
|
case "O2":
|
||||||
|
core = CoreInventory.Instance["O2", "O2Hawk"];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core != null)
|
if (core != null)
|
||||||
|
|
|
@ -221,8 +221,13 @@ namespace BizHawk.Client.Common
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="SystemInfo"/> instance for ChannelF
|
/// Gets the <see cref="SystemInfo"/> instance for ChannelF
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
///
|
||||||
public static SystemInfo ChannelF { get; } = new SystemInfo("Channel F", CoreSystem.ChannelF, 2);
|
public static SystemInfo ChannelF { get; } = new SystemInfo("Channel F", CoreSystem.ChannelF, 2);
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="SystemInfo"/> instance for ChannelF
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
public static SystemInfo O2 { get; } = new SystemInfo("Odyssey2", CoreSystem.Odyssey2, 2);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="SystemInfo"/> instance for MAME
|
/// Gets the <see cref="SystemInfo"/> instance for MAME
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -409,6 +409,13 @@ namespace BizHawk.Client.Common
|
||||||
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
|
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
|
||||||
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
|
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
|
||||||
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
|
new PathEntry { System = "VEC", SystemDisplayName = "VEC", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
|
||||||
|
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "VEC", Type = "Base", Path = Path.Combine(".", "O2"), Ordinal = 0 },
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "O2", Type = "ROM", Path = ".", Ordinal = 1 },
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "O2", Type = "Savestates", Path = Path.Combine(".", "State"), Ordinal = 2 },
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "O2", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "O2", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
|
||||||
|
new PathEntry { System = "O2", SystemDisplayName = "O2", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,6 +218,7 @@ namespace BizHawk.Client.DBMan
|
||||||
ChannelF,
|
ChannelF,
|
||||||
VEC,
|
VEC,
|
||||||
GB3x,
|
GB3x,
|
||||||
GB4x
|
GB4x,
|
||||||
|
O2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1224,6 +1224,7 @@
|
||||||
<Compile Include="tools\VirtualPads\schema\AppleIISchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\AppleIISchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\C64Schema.cs" />
|
<Compile Include="tools\VirtualPads\schema\C64Schema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\ColecoSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\ColecoSchema.cs" />
|
||||||
|
<Compile Include="tools\VirtualPads\schema\O2Schema .cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\VECSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\VECSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\GGLSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\GGLSchema.cs" />
|
||||||
<Compile Include="tools\VirtualPads\schema\DualGBSchema.cs" />
|
<Compile Include="tools\VirtualPads\schema\DualGBSchema.cs" />
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
using BizHawk.Emulation.Common;
|
||||||
|
using BizHawk.Emulation.Cores.Consoles.O2Hawk;
|
||||||
|
|
||||||
|
namespace BizHawk.Client.EmuHawk
|
||||||
|
{
|
||||||
|
[Schema("O2")]
|
||||||
|
public class O2Schema : IVirtualPadSchema
|
||||||
|
{
|
||||||
|
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||||
|
{
|
||||||
|
var O2SyncSettings = ((O2Hawk)core).GetSyncSettings().Clone();
|
||||||
|
// var port1 = O2SyncSettings.Port1;
|
||||||
|
// var port2 = O2SyncSettings.Port2;
|
||||||
|
|
||||||
|
// if (port1 == "O2 Controller")
|
||||||
|
// {
|
||||||
|
yield return StandardController(1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (port2 == "O2 Controller")
|
||||||
|
// {
|
||||||
|
yield return StandardController(2);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PadSchema StandardController(int controller)
|
||||||
|
{
|
||||||
|
return new PadSchema
|
||||||
|
{
|
||||||
|
IsConsole = false,
|
||||||
|
DefaultSize = new Size(200, 100),
|
||||||
|
Buttons = new[]
|
||||||
|
{
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Up",
|
||||||
|
Icon = Properties.Resources.BlueUp,
|
||||||
|
Location = new Point(14, 12),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Down",
|
||||||
|
Icon = Properties.Resources.BlueDown,
|
||||||
|
Location = new Point(14, 56),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Left",
|
||||||
|
Icon = Properties.Resources.Back,
|
||||||
|
Location = new Point(2, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Right",
|
||||||
|
Icon = Properties.Resources.Forward,
|
||||||
|
Location = new Point(24, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Button 1",
|
||||||
|
DisplayName = "1",
|
||||||
|
Location = new Point(74, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Button 2",
|
||||||
|
DisplayName = "2",
|
||||||
|
Location = new Point(98, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Button 3",
|
||||||
|
DisplayName = "3",
|
||||||
|
Location = new Point(122, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
},
|
||||||
|
new PadSchema.ButtonSchema
|
||||||
|
{
|
||||||
|
Name = $"P{controller} Button 4",
|
||||||
|
DisplayName = "4",
|
||||||
|
Location = new Point(146, 34),
|
||||||
|
Type = PadSchema.PadInputType.Boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,8 @@ namespace BizHawk.Emulation.Common
|
||||||
new SystemInfo { SystemId = "ZXSpectrum", FullName = "Sinclair ZX Spectrum" },
|
new SystemInfo { SystemId = "ZXSpectrum", FullName = "Sinclair ZX Spectrum" },
|
||||||
new SystemInfo { SystemId = "AmstradCPC", FullName = "Amstrad CPC" },
|
new SystemInfo { SystemId = "AmstradCPC", FullName = "Amstrad CPC" },
|
||||||
new SystemInfo { SystemId = "ChannelF", FullName = "Fairchild Channel F"},
|
new SystemInfo { SystemId = "ChannelF", FullName = "Fairchild Channel F"},
|
||||||
|
new SystemInfo { SystemId = "O2", FullName = "Odyssey2"},
|
||||||
|
new SystemInfo { SystemId = "VEC", FullName = "Vectrex"}
|
||||||
};
|
};
|
||||||
|
|
||||||
public SystemInfo this[string systemId]
|
public SystemInfo this[string systemId]
|
||||||
|
|
|
@ -79,6 +79,9 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
public const ushort ST_T = 69;
|
public const ushort ST_T = 69;
|
||||||
public const ushort SET_ADDR_8 = 70;
|
public const ushort SET_ADDR_8 = 70;
|
||||||
public const ushort MEM_ALU = 71;
|
public const ushort MEM_ALU = 71;
|
||||||
|
public const ushort PUSH = 72;
|
||||||
|
public const ushort PULL = 73;
|
||||||
|
public const ushort PULL_PC = 74;
|
||||||
|
|
||||||
public I8048()
|
public I8048()
|
||||||
{
|
{
|
||||||
|
@ -90,13 +93,13 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
ResetRegisters();
|
ResetRegisters();
|
||||||
ResetInterrupts();
|
ResetInterrupts();
|
||||||
TotalExecutedCycles = 0;
|
TotalExecutedCycles = 0;
|
||||||
Regs[PC] = 0xFFFE;
|
Regs[PC] = 0x0;
|
||||||
PopulateCURINSTR(IDLE,
|
PopulateCURINSTR(IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
RD_INC, ALU, PC,
|
IDLE,
|
||||||
RD_INC, ALU2, PC,
|
IDLE,
|
||||||
SET_ADDR, PC, ALU, ALU2);
|
IDLE);
|
||||||
|
|
||||||
IRQS = 6;
|
IRQS = 6;
|
||||||
instr_pntr = irq_pntr = 0;
|
instr_pntr = irq_pntr = 0;
|
||||||
|
@ -186,7 +189,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
reg_l_ad = cur_instr[instr_pntr++];
|
reg_l_ad = cur_instr[instr_pntr++];
|
||||||
reg_h_ad = cur_instr[instr_pntr++]; // direct value
|
reg_h_ad = cur_instr[instr_pntr++]; // direct value
|
||||||
|
|
||||||
Regs[reg_d_ad] = (ushort)(MB | reg_h_ad | Regs[reg_l_ad]);
|
Regs[reg_d_ad] = (ushort)(MB | (reg_h_ad << 8) | Regs[reg_l_ad]);
|
||||||
break;
|
break;
|
||||||
case TST:
|
case TST:
|
||||||
TST_Func(cur_instr[instr_pntr++]);
|
TST_Func(cur_instr[instr_pntr++]);
|
||||||
|
@ -337,20 +340,28 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case ST_CNT:
|
case ST_CNT:
|
||||||
|
counter_en = true;
|
||||||
break;
|
break;
|
||||||
case STP_CNT:
|
case STP_CNT:
|
||||||
|
counter_en = timer_en = false;
|
||||||
break;
|
break;
|
||||||
case ST_T:
|
case ST_T:
|
||||||
|
timer_en = true;
|
||||||
|
timer_prescale = 0;
|
||||||
break;
|
break;
|
||||||
case EI:
|
case EI:
|
||||||
IntEn = true;
|
IntEn = true;
|
||||||
break;
|
break;
|
||||||
|
case EN:
|
||||||
|
TimIntEn = true;
|
||||||
|
break;
|
||||||
case DI:
|
case DI:
|
||||||
IntEn = false;
|
IntEn = false;
|
||||||
break;
|
break;
|
||||||
|
case DN:
|
||||||
|
TimIntEn = false;
|
||||||
|
TIRQPending = false;
|
||||||
|
break;
|
||||||
case INCA:
|
case INCA:
|
||||||
INC8_Func(A);
|
INC8_Func(A);
|
||||||
break;
|
break;
|
||||||
|
@ -365,12 +376,37 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
case MEM_ALU:
|
case MEM_ALU:
|
||||||
Regs[ALU] = Regs[(ushort)(Regs[cur_instr[instr_pntr++]] & 0x3F)];
|
Regs[ALU] = Regs[(ushort)(Regs[cur_instr[instr_pntr++]] & 0x3F)];
|
||||||
break;
|
break;
|
||||||
|
case PUSH:
|
||||||
|
Regs[(Regs[PSW] & 0x7) * 2 + 8] = (ushort)(Regs[PC] & 0xFF);
|
||||||
|
Regs[(Regs[PSW] & 0x7) * 2 + 8 + 1] = (ushort)(((Regs[PC] >> 8) & 0xF) | (Regs[PSW] & 0xF0));
|
||||||
|
Regs[PSW] = (ushort)((((Regs[PSW] & 0x7) + 1) & 0x7) | (Regs[PSW] & 0xF8));
|
||||||
|
break;
|
||||||
|
case PULL:
|
||||||
|
Regs[PSW] = (ushort)((((Regs[PSW] & 0x7) - 1) & 0x7) | (Regs[PSW] & 0xF8));
|
||||||
|
Regs[PC] = (ushort)(Regs[(Regs[PSW] & 0x7) * 2 + 8] & 0xFF);
|
||||||
|
Regs[PC] |= (ushort)((Regs[(Regs[PSW] & 0x7) * 2 + 8 + 1] & 0xF) << 8);
|
||||||
|
Regs[PSW] &= 0xF;
|
||||||
|
Regs[PSW] |= (ushort)(Regs[(Regs[PSW] & 0x7) * 2 + 8 + 1] & 0xF0);
|
||||||
|
break;
|
||||||
|
case PULL_PC:
|
||||||
|
Regs[PSW] = (ushort)((((Regs[PSW] & 0x7) - 1) & 0x7) | (Regs[PSW] & 0xF8));
|
||||||
|
Regs[PC] = (ushort)(Regs[(Regs[PSW] & 0x7) * 2 + 8] & 0xFF);
|
||||||
|
Regs[PC] |= (ushort)((Regs[(Regs[PSW] & 0x7) * 2 + 8 + 1] & 0xF) << 8);
|
||||||
|
break;
|
||||||
|
case MSK:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case SWP:
|
||||||
|
reg_d_ad = Regs[A];
|
||||||
|
Regs[A] = (ushort)(Regs[A] >> 4);
|
||||||
|
Regs[A] |= (ushort)((reg_d_ad << 4) & 0xF0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++irq_pntr == IRQS)
|
if (++irq_pntr == IRQS)
|
||||||
{
|
{
|
||||||
// then regular IRQ
|
// then regular IRQ
|
||||||
if (IRQPending && IntEn)
|
if ((IRQPending && IntEn) | (TIRQPending && TimIntEn))
|
||||||
{
|
{
|
||||||
IRQPending = false;
|
IRQPending = false;
|
||||||
|
|
||||||
|
@ -390,6 +426,42 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
}
|
}
|
||||||
|
|
||||||
TotalExecutedCycles++;
|
TotalExecutedCycles++;
|
||||||
|
|
||||||
|
if (timer_en)
|
||||||
|
{
|
||||||
|
timer_prescale++;
|
||||||
|
if (timer_prescale == 32)
|
||||||
|
{
|
||||||
|
timer_prescale = 0;
|
||||||
|
if (Regs[TIM] == 255)
|
||||||
|
{
|
||||||
|
TF = true;
|
||||||
|
if (TimIntEn)
|
||||||
|
{
|
||||||
|
TIRQPending = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Regs[TIM] = (ushort)((Regs[TIM] + 1) & 0xFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (counter_en)
|
||||||
|
{
|
||||||
|
if (!T1 && T1_old)
|
||||||
|
{
|
||||||
|
if (Regs[TIM] == 255)
|
||||||
|
{
|
||||||
|
TF = true;
|
||||||
|
if (TimIntEn)
|
||||||
|
{
|
||||||
|
TIRQPending = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Regs[TIM] = (ushort)((Regs[TIM] + 1) & 0xFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
T1_old = T1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tracer stuff
|
// tracer stuff
|
||||||
|
@ -463,7 +535,9 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
ser.BeginSection("MC6809");
|
ser.BeginSection("MC6809");
|
||||||
|
|
||||||
ser.Sync(nameof(IntEn), ref IntEn);
|
ser.Sync(nameof(IntEn), ref IntEn);
|
||||||
|
ser.Sync(nameof(TimIntEn), ref TimIntEn);
|
||||||
ser.Sync(nameof(IRQPending), ref IRQPending);
|
ser.Sync(nameof(IRQPending), ref IRQPending);
|
||||||
|
ser.Sync(nameof(TIRQPending), ref TIRQPending);
|
||||||
|
|
||||||
ser.Sync(nameof(instr_pntr), ref instr_pntr);
|
ser.Sync(nameof(instr_pntr), ref instr_pntr);
|
||||||
ser.Sync(nameof(cur_instr), ref cur_instr, false);
|
ser.Sync(nameof(cur_instr), ref cur_instr, false);
|
||||||
|
@ -473,6 +547,8 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
|
|
||||||
ser.Sync(nameof(TF), ref TF);
|
ser.Sync(nameof(TF), ref TF);
|
||||||
ser.Sync(nameof(timer_en), ref timer_en);
|
ser.Sync(nameof(timer_en), ref timer_en);
|
||||||
|
ser.Sync(nameof(counter_en), ref counter_en);
|
||||||
|
ser.Sync(nameof(timer_prescale), ref timer_prescale);
|
||||||
|
|
||||||
ser.Sync(nameof(RB), ref RB);
|
ser.Sync(nameof(RB), ref RB);
|
||||||
ser.Sync(nameof(RAM_ptr), ref RAM_ptr);
|
ser.Sync(nameof(RAM_ptr), ref RAM_ptr);
|
||||||
|
@ -482,6 +558,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
ser.Sync(nameof(F1), ref F1);
|
ser.Sync(nameof(F1), ref F1);
|
||||||
ser.Sync(nameof(T0), ref T0);
|
ser.Sync(nameof(T0), ref T0);
|
||||||
ser.Sync(nameof(T1), ref T1);
|
ser.Sync(nameof(T1), ref T1);
|
||||||
|
ser.Sync(nameof(T1_old), ref T1_old);
|
||||||
|
|
||||||
ser.Sync(nameof(TotalExecutedCycles), ref TotalExecutedCycles);
|
ser.Sync(nameof(TotalExecutedCycles), ref TotalExecutedCycles);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,9 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IRQPending;
|
public bool IRQPending;
|
||||||
|
public bool TIRQPending;
|
||||||
public bool IntEn;
|
public bool IntEn;
|
||||||
|
public bool TimIntEn;
|
||||||
|
|
||||||
public Action IRQCallback = delegate () { };
|
public Action IRQCallback = delegate () { };
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
PULL_PC,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
|
@ -139,7 +139,7 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
PULL,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
|
@ -305,12 +305,12 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
PopulateCURINSTR(IDLE,
|
PopulateCURINSTR(IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
IDLE,
|
IDLE,
|
||||||
TR, ALU, A,
|
RD, ALU, PC,
|
||||||
|
INC11, PC,
|
||||||
IDLE,
|
IDLE,
|
||||||
|
PUSH,
|
||||||
IDLE,
|
IDLE,
|
||||||
MSK, ALU,
|
SET_ADDR, PC, ALU, dest_h);
|
||||||
IDLE,
|
|
||||||
ALU);
|
|
||||||
|
|
||||||
IRQS = 9;
|
IRQS = 9;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,11 @@ namespace BizHawk.Emulation.Common.Components.I8048
|
||||||
// The timer flag is set if the timer overflows, testing it resets it to zero
|
// The timer flag is set if the timer overflows, testing it resets it to zero
|
||||||
public bool TF;
|
public bool TF;
|
||||||
public bool timer_en;
|
public bool timer_en;
|
||||||
|
public bool counter_en;
|
||||||
|
public int timer_prescale;
|
||||||
|
|
||||||
// The 8048 has 2 test lines which can be used for conditionals, T0 can be used as an output
|
// The 8048 has 2 test lines which can be used for conditionals, T0 can be used as an output
|
||||||
public bool T0, T1;
|
public bool T0, T1, T1_old;
|
||||||
|
|
||||||
// 8 'registers' but really they point to locations in RAM
|
// 8 'registers' but really they point to locations in RAM
|
||||||
public const ushort R0 = 0;
|
public const ushort R0 = 0;
|
||||||
|
|
|
@ -5,7 +5,7 @@ using BizHawk.Common.BufferExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
using BizHawk.Common.NumberExtensions;
|
using BizHawk.Common.NumberExtensions;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
// Audio Emulation (a 24 bit shift register plus a control register)
|
// Audio Emulation (a 24 bit shift register plus a control register)
|
||||||
public class Audio : ISoundProvider
|
public class Audio : ISoundProvider
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common.Components.I8048;
|
using BizHawk.Emulation.Common.Components.I8048;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public class MapperBase
|
public class MapperBase
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common.Components.I8048;
|
using BizHawk.Emulation.Common.Components.I8048;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
// Default mapper with no bank switching
|
// Default mapper with no bank switching
|
||||||
public class MapperDefault : MapperBase
|
public class MapperDefault : MapperBase
|
||||||
|
|
|
@ -8,7 +8,7 @@ using BizHawk.Emulation.Common;
|
||||||
$0000-$03FF BIOS
|
$0000-$03FF BIOS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk
|
public partial class O2Hawk
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return mapper.ReadMemory(addr);
|
return mapper.ReadMemory((ushort)(addr - 0x400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return mapper.PeekMemory(addr);
|
return mapper.PeekMemory((ushort)(addr - 0x400));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
using BizHawk.Emulation.Common.Components.I8048;
|
using BizHawk.Emulation.Common.Components.I8048;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : ICodeDataLogger
|
public partial class O2Hawk : ICodeDataLogger
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : IDebuggable
|
public partial class O2Hawk : IDebuggable
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
using BizHawk.Common.NumberExtensions;
|
using BizHawk.Common.NumberExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : IEmulator, IVideoProvider
|
public partial class O2Hawk : IEmulator, IVideoProvider
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
||||||
|
|
||||||
public void do_frame(IController controller)
|
public void do_frame(IController controller)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 70224; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
audio.tick();
|
audio.tick();
|
||||||
ppu.tick();
|
ppu.tick();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : IInputPollable
|
public partial class O2Hawk : IInputPollable
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
|
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk
|
public partial class O2Hawk
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : ISaveRam
|
public partial class O2Hawk : ISaveRam
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ using Newtonsoft.Json;
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : IEmulator, IStatable, ISettable<O2Hawk.O2Settings, O2Hawk.O2SyncSettings>
|
public partial class O2Hawk : IEmulator, IStatable, ISettable<O2Hawk.O2Settings, O2Hawk.O2SyncSettings>
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public partial class O2Hawk : IStatable
|
public partial class O2Hawk : IStatable
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Emulation.Common.Components.I8048;
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
[Core(
|
[Core(
|
||||||
"O2Hawk",
|
"O2Hawk",
|
||||||
|
@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
||||||
|
|
||||||
byte[] Bios = null;
|
byte[] Bios = null;
|
||||||
|
|
||||||
Bios = comm.CoreFileProvider.GetFirmware("O2", "World", true, "BIOS Not Found, Cannot Load");
|
Bios = comm.CoreFileProvider.GetFirmware("O2", "BIOS", true, "BIOS Not Found, Cannot Load");
|
||||||
ppu = new PPU();
|
ppu = new PPU();
|
||||||
|
|
||||||
if (Bios == null)
|
if (Bios == null)
|
||||||
|
@ -139,7 +139,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
||||||
|
|
||||||
private void Setup_Mapper()
|
private void Setup_Mapper()
|
||||||
{
|
{
|
||||||
|
mapper = new MapperDefault();
|
||||||
|
mapper.Core = this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ using BizHawk.Common;
|
||||||
using BizHawk.Common.ReflectionExtensions;
|
using BizHawk.Common.ReflectionExtensions;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public class O2HawkControllerDeck
|
public class O2HawkControllerDeck
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Linq;
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
using BizHawk.Emulation.Common;
|
using BizHawk.Emulation.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a O2 add on
|
/// Represents a O2 add on
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public class PPU
|
public class PPU
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@ using BizHawk.Emulation.Common;
|
||||||
using BizHawk.Common.NumberExtensions;
|
using BizHawk.Common.NumberExtensions;
|
||||||
using BizHawk.Common;
|
using BizHawk.Common;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Cores.Nintendo.O2Hawk
|
namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
|
||||||
{
|
{
|
||||||
public class SerialPort
|
public class SerialPort
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue