smb3 and addams family hacks
authornotaz <notasas@gmail.com>
Sat, 26 May 2007 19:20:03 +0000 (19:20 +0000)
committernotaz <notasas@gmail.com>
Sat, 26 May 2007 19:20:03 +0000 (19:20 +0000)
git-svn-id: file:///home/notaz/opt/svn/fceu@137 be3aeb3a-fb24-0410-a615-afba39da0efa

fce.c
ncpu_debug.c
x6502.c

diff --git a/fce.c b/fce.c
index fb28572..5ad965d 100644 (file)
--- a/fce.c
+++ b/fce.c
@@ -977,9 +977,9 @@ static void DoHBlank(void)
  {
   X6502_Run(6);
   Fixit2();
-  X6502_Run(4);
+  X6502_Run(4+3);      // original value was 4, but adding 3 fixes glitch in smb3 (and breaks something?)
   GameHBIRQHook();
-  X6502_Run(85-16-10);
+  X6502_Run(85-10-16-3);
  }
  else
  {
@@ -1221,14 +1221,17 @@ static INLINE void Thingo(void)
 
    if(MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline);
 
-   // check: Battletoads & Double Dragon
+   // check: Battletoads & Double Dragon, Addams Family
+   // sky glitches in SMB1 if done wrong
    if(tosprite>=256)
    {
     X6502_Run(256);
    }
    else
    {
-     // sky glitches in SMB1 if done wrong
+     // a dirty hack for Addams Family and inaccurate sprite hit emulation
+     if(tosprite<8) tosprite-=tosprite*3>>2;
+
      X6502_Run(tosprite);
      PPU[2]|=0x40;
      X6502_Run(256-tosprite);
index 774218a..9736204 100644 (file)
@@ -180,8 +180,6 @@ void X6502_Run_d(int32 c)
                                TriggerIRQ_a();
                        }
                        if (pending_irq & 0xff) {
-                               TriggerIRQ_c();
-                               TriggerIRQ_a();
                                X6502_IRQBegin_c(pending_irq & 0xff);
                                X6502_IRQBegin_a(pending_irq & 0xff);
                        }
diff --git a/x6502.c b/x6502.c
index d81cdab..0d9729d 100644 (file)
--- a/x6502.c
+++ b/x6502.c
@@ -543,7 +543,7 @@ void X6502_Run_c(void/*int32 cycles*/)
           {
            extern uint8 SIRQStat;
            SIRQStat|=0x80;
-           X6502_IRQBegin_c(FCEU_IQDPCM);
+           X6502_IRQBegin(FCEU_IQDPCM);
           }
          }
         }