Intellivision implement BackTab calls

Correct timing for background drawing, not sure if any game uses it though
This commit is contained in:
alyosha-tas 2016-12-23 20:07:12 -05:00 committed by GitHub
parent 35d86388a4
commit 585f35b29e
3 changed files with 77 additions and 69 deletions

View File

@ -25,11 +25,12 @@ namespace BizHawk.Emulation.Cores.Intellivision
_psg.sample_count = 0; _psg.sample_count = 0;
_frame++; _frame++;
stic_row = -1;
// read the controller state here for now // read the controller state here for now
get_controller_state(); get_controller_state();
// this timer tracks cycles stolen by the STIC during the visible part of the frame, quite a large number of them actually // this timer tracks cycles stolen by the STIC during the visible part of the frame, quite a large number of them actually
int delay_cycles = 0; int delay_cycles = 600;
int delay_timer = -1; int delay_timer = -1;
_cpu.PendingCycles = (14934 - 3791 + _cpu.GetPendingCycles()); _cpu.PendingCycles = (14934 - 3791 + _cpu.GetPendingCycles());
@ -53,13 +54,19 @@ namespace BizHawk.Emulation.Cores.Intellivision
} }
} }
if (delay_cycles>= 800 && _stic.active_display) if (delay_cycles>= 750 && _stic.active_display)
{ {
delay_cycles = -1; delay_cycles = -1;
delay_timer = 110; delay_timer = 110;
_stic.ToggleSr2(); _stic.ToggleSr2();
if (stic_row >= 0)
{
_stic.in_vb_2 = true;
_stic.Background(stic_row);
_stic.in_vb_2 = false;
}
stic_row++;
} }
Connect(); Connect();
} }
@ -69,7 +76,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
if (_stic.active_display) if (_stic.active_display)
{ {
_stic.Background();
_stic.Mobs(); _stic.Mobs();
} }
@ -100,6 +106,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
} }
private int _frame; private int _frame;
private int stic_row;
public int Frame { get { return _frame; } } public int Frame { get { return _frame; } }
public string SystemId public string SystemId

View File

@ -50,6 +50,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
ser.BeginSection("Intellivision"); ser.BeginSection("Intellivision");
ser.Sync("version", ref version); ser.Sync("version", ref version);
ser.Sync("Frame", ref _frame); ser.Sync("Frame", ref _frame);
ser.Sync("stic_row", ref stic_row);
ser.Sync("ScratchpadRam", ref ScratchpadRam, false); ser.Sync("ScratchpadRam", ref ScratchpadRam, false);
ser.Sync("SystemRam", ref SystemRam, false); ser.Sync("SystemRam", ref SystemRam, false);

View File

@ -319,7 +319,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
throw new ArgumentException("Specified color does not exist."); throw new ArgumentException("Specified color does not exist.");
} }
public void Background() public void Background(int input_row)
{ {
// here we will also need to apply the 'delay' register values. // here we will also need to apply the 'delay' register values.
// this shifts the background portion of the screen relative to the mobs // this shifts the background portion of the screen relative to the mobs
@ -328,7 +328,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
ColorSP = 0x0028; ColorSP = 0x0028;
// The background is a 20x12 grid of "cards". // The background is a 20x12 grid of "cards".
for (int card_row = 0; card_row < 12; card_row++) for (int card_row = input_row; card_row < (input_row+1); card_row++)
{ {
for (int card_col = 0; card_col < 20; card_col++) for (int card_col = 0; card_col < 20; card_col++)
{ {