7800: implemented hard reset to simulate pushing the power button on the console. HSC ram is preserved, ROM is preserved, just about everything else is flushed. added "Power" button to connect to this. changed recording mnemonics
This commit is contained in:
parent
c9c3821632
commit
f8c9bd98f9
|
@ -23,6 +23,13 @@ namespace BizHawk.Emulation
|
|||
{
|
||||
_frame++;
|
||||
|
||||
if (Controller["Power"])
|
||||
{
|
||||
// it seems that theMachine.Reset() doesn't clear ram, etc
|
||||
// this should leave hsram intact but clear most other things
|
||||
HardReset();
|
||||
}
|
||||
|
||||
ControlAdapter.Convert(Controller, theMachine.InputState);
|
||||
theMachine.ComputeNextFrame(avProvider.framebuffer);
|
||||
|
||||
|
@ -183,10 +190,8 @@ namespace BizHawk.Emulation
|
|||
HardReset();
|
||||
}
|
||||
|
||||
public void HardReset()
|
||||
void HardReset()
|
||||
{
|
||||
_lagcount = 0;
|
||||
|
||||
cart = Cart.Create(rom, GameInfo.CartType);
|
||||
ILogger logger = new ConsoleLogger();
|
||||
HSC7800 hsc7800 = new HSC7800(hsbios, hsram);
|
||||
|
@ -207,8 +212,6 @@ namespace BizHawk.Emulation
|
|||
throw new Exception("For now, only Atari 7800 ProLine Joystick games are supported.");
|
||||
ControllerDefinition = ControlAdapter.ControlType;
|
||||
|
||||
if (avProvider != null)
|
||||
avProvider.Dispose();
|
||||
avProvider.ConnectToMachine(theMachine);
|
||||
// to sync exactly with audio as this emulator creates and times it, the frame rate should be exactly 60:1 or 50:1
|
||||
CoreComm.VsyncNum = theMachine.FrameHZ;
|
||||
|
@ -238,11 +241,6 @@ namespace BizHawk.Emulation
|
|||
}
|
||||
}
|
||||
|
||||
private void SoftReset() //TOOD: hook this up
|
||||
{
|
||||
theMachine.Reset();
|
||||
}
|
||||
|
||||
MyAVProvider avProvider = new MyAVProvider();
|
||||
|
||||
class MyAVProvider : IVideoProvider, ISyncSoundProvider, IDisposable
|
||||
|
@ -258,7 +256,7 @@ namespace BizHawk.Emulation
|
|||
uint newsamplerate = (uint)m.SoundSampleFrequency;
|
||||
if (newsamplerate != samplerate)
|
||||
{
|
||||
// really shouldn't happen, but if it does, we're ready
|
||||
// really shouldn't happen (after init), but if it does, we're ready
|
||||
if (resampler != null)
|
||||
resampler.Dispose();
|
||||
resampler = new Emulation.Sound.Utilities.SpeexResampler(3, newsamplerate, 44100, newsamplerate, 44100, null, null);
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Joystick Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -29,6 +31,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Paddle Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -54,6 +58,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Keypad Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -84,6 +90,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Driving Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -105,6 +113,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Booster Grip Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -122,6 +132,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 ProLine Joystick Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
@ -136,6 +148,8 @@ namespace BizHawk.Emulation
|
|||
Name = "Atari 7800 Light Gun Controller",
|
||||
BoolButtons =
|
||||
{
|
||||
// hard reset, not passed to EMU7800
|
||||
"Power",
|
||||
// on the console
|
||||
"Reset",
|
||||
"Select",
|
||||
|
|
|
@ -341,7 +341,7 @@ namespace BizHawk.MultiClient
|
|||
case "A26":
|
||||
return "|..|.....|.....|";
|
||||
case "A78":
|
||||
return "|...|......|......|";
|
||||
return "|....|......|......|";
|
||||
case "TI83":
|
||||
return "|..................................................|.|";
|
||||
case "NES":
|
||||
|
@ -453,6 +453,7 @@ namespace BizHawk.MultiClient
|
|||
private string GetA78ControllersAsMnemonic()
|
||||
{
|
||||
StringBuilder input = new StringBuilder("|");
|
||||
input.Append(IsBasePressed("Power") ? 'P' : '.');
|
||||
input.Append(IsBasePressed("Reset") ? 'r' : '.');
|
||||
input.Append(IsBasePressed("Select") ? 's' : '.');
|
||||
input.Append(IsBasePressed("Pause") ? 'p' : '.');
|
||||
|
@ -811,19 +812,23 @@ namespace BizHawk.MultiClient
|
|||
MnemonicChecker c = new MnemonicChecker(mnemonic);
|
||||
MyBoolButtons.Clear();
|
||||
|
||||
if (mnemonic.Length < 4)
|
||||
if (mnemonic.Length < 5)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (mnemonic[1] == 'r')
|
||||
if (mnemonic[1] == 'P')
|
||||
{
|
||||
Force("Power", true);
|
||||
}
|
||||
if (mnemonic[2] == 'r')
|
||||
{
|
||||
Force("Reset", true);
|
||||
}
|
||||
if (mnemonic[2] == 's')
|
||||
if (mnemonic[3] == 's')
|
||||
{
|
||||
Force("Select", true);
|
||||
}
|
||||
if (mnemonic[3] == 'p')
|
||||
if (mnemonic[4] == 'p')
|
||||
{
|
||||
Force("Pause", true);
|
||||
}
|
||||
|
@ -831,7 +836,7 @@ namespace BizHawk.MultiClient
|
|||
for (int player = 1; player <= Global.PLAYERS[ControlType]; player++)
|
||||
{
|
||||
int srcindex = (player - 1) * (Global.BUTTONS[ControlType].Count + 1);
|
||||
int start = 5;
|
||||
int start = 6;
|
||||
if (mnemonic.Length < srcindex + start + Global.BUTTONS[ControlType].Count)
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue