release r2, update credits
[fceu.git] / fce.c
diff --git a/fce.c b/fce.c
index 282a264..8483a7b 100644 (file)
--- a/fce.c
+++ b/fce.c
@@ -115,32 +115,6 @@ static int RWWrap=0;
 #ifdef ASM_6502
 #ifdef DEBUG_ASM_6502
 extern uint8  nes_internal_ram[0x800];
-#else
-static void asmcpu_update(int32 cycles)
-{
- // some code from x6502.c
- fhcnt-=cycles;
- if(fhcnt<=0)
- {
-  FrameSoundUpdate();
-  fhcnt+=fhinc;
- }
-
- if(PCMIRQCount>0)
- {
-  PCMIRQCount-=cycles;
-  if(PCMIRQCount<=0)
-  {
-   vdis=1;
-   if((PSG[0x10]&0x80) && !(PSG[0x10]&0x40))
-   {
-    extern uint8 SIRQStat;
-    SIRQStat|=0x80;
-    X6502_IRQBegin(FCEU_IQDPCM);
-   }
-  }
- }
-}
 #endif
 
 void asmcpu_unpack(void)
@@ -1263,6 +1237,8 @@ int FCEUI_Initialize(void)
        FCEUI_Initialize098();
        FCEUI_SetEmuMode(0);
 
+       X6502_Init();
+
         return 1;
 }
 
@@ -1401,10 +1377,10 @@ static void EmLoop(void)
   {
    if(ScreenON || SpriteON)
    {
-    if(GameHBIRQHook)
+    if(GameHBIRQHook && (PPU[0]&0x38)!=0x18)
      GameHBIRQHook();
-     if(PPU_hook)
-      for(x=0;x<42;x++) {PPU_hook(0x2000); PPU_hook(0);} // ugh
+    if(PPU_hook)
+     for(x=0;x<42;x++) {PPU_hook(0x2000); PPU_hook(0);} // ugh
     if(GameHBIRQHook2)
      GameHBIRQHook2();
    }
@@ -1514,7 +1490,7 @@ void ResetNES081(void)
 {
         if(!GameLoaded) return;
         GameInterface(GI_RESETM2, 0);
-        ResetSound();
+        FCEUSND_Reset();
         ResetPPU();
         X6502_Reset();
 }
@@ -1548,7 +1524,7 @@ void PowerNES(void)
        memset(nes_internal_ram,0x00,0x800);
 #endif
         ResetMapping();
-        PowerSound();
+        FCEUSND_Power();
        PowerPPU();
 
        if (use098code)