A7800Hawk: Updates and Bug Fixes

-Fix save states
-Fix sync settings
-Controller Support / improvements
This commit is contained in:
alyosha-tas 2017-07-21 19:32:50 -04:00 committed by GitHub
parent d8b13d21b8
commit 2ae9de98ef
5 changed files with 81 additions and 3 deletions

View File

@ -51,6 +51,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
tia.SyncState(ser);
maria.SyncState(ser);
m6532.SyncState(ser);
mapper.SyncState(ser);
ser.BeginSection("Atari7800");
ser.Sync("core", ref core, false);

View File

@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
public M6532 m6532;
public TIA tia;
public A7800Hawk(CoreComm comm, GameInfo game, byte[] rom, string gameDbFn)
public A7800Hawk(CoreComm comm, GameInfo game, byte[] rom, string gameDbFn, object settings, object syncSettings)
{
var ser = new BasicServiceProvider(this);
@ -72,6 +72,9 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
CoreComm = comm;
_settings = (A7800Settings)settings ?? new A7800Settings();
_syncSettings = (A7800SyncSettings)syncSettings ?? new A7800SyncSettings();
_controllerDeck = new A7800HawkControllerDeck(_syncSettings.Port1, _syncSettings.Port2);
byte[] highscoreBios = comm.CoreFileProvider.GetFirmware("A78", "Bios_HSC", false, "Some functions may not work without the high score BIOS.");

View File

@ -108,6 +108,73 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return result;
}
public byte ReadFire2x(IController c)
{
return 0; // only applicable for 2 button mode
}
public ControllerDefinition Definition { get; }
public void SyncState(Serializer ser)
{
// Nothing todo, I think
}
private static readonly string[] BaseDefinition =
{
"U", "D", "L", "R", "Fire"
};
private static byte[] HandControllerButtons =
{
0x0, // UP
0x0, // Down
0x0, // Left
0x0, // Right
};
}
[DisplayName("ProLine Controller")]
public class ProLineController : IPort
{
public ProLineController(int portNum)
{
PortNum = portNum;
Definition = new ControllerDefinition
{
BoolButtons = BaseDefinition
.Select(b => "P" + PortNum + " " + b)
.ToList()
};
}
public int PortNum { get; }
public byte Read(IController c)
{
byte result = 0xF;
for (int i = 0; i < 4; i++)
{
if (c.IsPressed(Definition.BoolButtons[i]))
{
result -= (byte)(1 << i);
}
}
if (PortNum == 1)
{
result = (byte)(result << 4);
}
return result;
}
public byte ReadFire(IController c)
{
return 0x80;
}
public byte ReadFire2x(IController c)
{
byte result = 0;

View File

@ -218,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
if (cycle == 453 && !sl_DMA_complete && do_dma && (DMA_phase == DMA_GRAPHICS || DMA_phase == DMA_HEADER))
{
overrun_dma = true;
//Console.WriteLine(scanline);
Console.WriteLine(scanline);
if (current_DLL_offset == 0)
{
DMA_phase = DMA_SHUTDOWN_LAST;

View File

@ -124,7 +124,14 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
if (temp == 4) // WSYNC
cpu.RDY = false;
/*
for (int i = 0; i < 0x20; i++)
{
Console.Write(Maria_regs[i]);
Console.Write(" ");
}
Console.WriteLine(maria.scanline);
*/
}
else
{