applied Chrono GB-Multiple-LCDC-interrupt-fix

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@746 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
squall-leonhart 2008-09-23 23:56:02 +00:00
parent 0c7c6c1de0
commit c6f509e10e
1 changed files with 3 additions and 13 deletions

View File

@ -1091,20 +1091,10 @@ void gbWriteMemory(register u16 address, register u8 value)
// (value & 0x7c);
gbMemory[0xff41] = register_STAT = (value & 0xf8) | (register_STAT & 0x07); // fix ?
// GB bug from Devrs FAQ
// Corrected : it happens if Lcd Mode<2, but also if LY == LYC whatever
// Lcd Mode is, and if !gbInt48Signal in all cases. The screen being off
// doesn't matter (the bug will still happen).
// That fixes 'Satoru Nakajima - F-1 Hero' crash bug.
// proper fix
gbInt48Signal &= ((register_STAT>>3) & 0xF);
if((gbHardware & 5) && (((!gbInt48Signal) && (gbLcdMode<2) && (register_LCDC & 0x80)) ||
(register_LY == register_LYC)))
{
gbMemory[0xff0f] = register_IF |=2;
}
gbInt48Signal &= ((register_STAT>>3) & 0xF);
if((register_LCDC & 0x80)) {
if((register_LCDC & 0x80)) {
if ((register_STAT & 0x08) && (gbLcdMode == 0))
{
if (!gbInt48Signal)