GBCHawk: Halt test rom work, ppu still needs re-work
This commit is contained in:
parent
d4eb3da512
commit
e29b741bd4
|
@ -301,7 +301,15 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
IDLE,
|
||||
GBC_INTERRUPT };
|
||||
*/
|
||||
INTERRUPT_GBC_NOP();
|
||||
if (!Halt_bug_3)
|
||||
{
|
||||
INTERRUPT_GBC_NOP();
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERRUPT_();
|
||||
Halt_bug_3 = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -324,16 +332,26 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
if (OnExecFetch != null) OnExecFetch(RegPC);
|
||||
if (TraceCallback != null && !CB_prefix) TraceCallback(State());
|
||||
|
||||
|
||||
if (is_GBC)
|
||||
{
|
||||
// extra 4 cycles for GBC
|
||||
cur_instr = new ushort[]
|
||||
if (Halt_bug_3)
|
||||
{
|
||||
RegPC++;
|
||||
FetchInstruction(ReadMemory(RegPC));
|
||||
Halt_bug_3 = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
cur_instr = new ushort[]
|
||||
{IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
OP };
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (Halt_bug_3)
|
||||
{
|
||||
|
@ -363,11 +381,9 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
else
|
||||
{
|
||||
cur_instr = new ushort[]
|
||||
{
|
||||
IDLE,
|
||||
{IDLE,
|
||||
HALT_CHK,
|
||||
IDLE,
|
||||
|
||||
IDLE,
|
||||
HALT, 0 };
|
||||
}
|
||||
|
||||
|
@ -492,12 +508,11 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
instr_pntr = 0;
|
||||
break;
|
||||
case HALT_CHK:
|
||||
// only used when exiting HALT from GBC, an extra NOP is added to avoid HALT bug
|
||||
I_use = FlagI;
|
||||
if (Halt_bug_2 && I_use)
|
||||
{
|
||||
RegPC--;
|
||||
if (!interrupts_enabled) { Halt_bug_3 = true; }
|
||||
Halt_bug_3 = true;
|
||||
}
|
||||
|
||||
Halt_bug_2 = false;
|
||||
|
|
|
@ -86,11 +86,7 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
{IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
IDLE,
|
||||
OP};
|
||||
OP_G};
|
||||
}
|
||||
else
|
||||
{ // if interrupts are disabled,
|
||||
|
@ -112,7 +108,8 @@ namespace BizHawk.Emulation.Common.Components.LR35902
|
|||
HALT_CHK,
|
||||
IDLE,
|
||||
HALT, 0 };
|
||||
skip_once = true;
|
||||
|
||||
if (!is_GBC) { skip_once = true; }
|
||||
// If the interrupt flag is not currently set, but it does get set in the first check
|
||||
// then a bug is triggered
|
||||
// With interrupts enabled, this runs the halt command twice
|
||||
|
|
|
@ -402,7 +402,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
|
||||
// also, the LCD does not enter mode 2 on scanline 0 when first turned on
|
||||
no_scan = true;
|
||||
cycle = 8;
|
||||
cycle = 4;
|
||||
}
|
||||
|
||||
// the VBL stat is continuously asserted
|
||||
|
@ -420,7 +420,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
}
|
||||
}
|
||||
|
||||
if ((cycle == 4) && (LY == 144)) {
|
||||
if ((cycle == 0) && (LY == 144)) {
|
||||
|
||||
HBL_INT = false;
|
||||
|
||||
|
@ -454,7 +454,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
|||
// there is no mode 2 (presumably it missed the trigger)
|
||||
// mode 3 is very short, probably in some self test mode before turning on?
|
||||
|
||||
if (cycle == 12)
|
||||
if (cycle == 8)
|
||||
{
|
||||
LYC_INT = false;
|
||||
STAT &= 0xFB;
|
||||
|
|
Loading…
Reference in New Issue