Exemple #1
0
static void InitCommon(const char *name)
{
        NESIsVSUni = FALSE;
        PPU_hook = 0;
        GameHBIRQHook = 0;

        MapIRQHook = 0;
        MMC5Hack = 0;
        PAL &= 1;

        MDFNGameInfo->GameType = GMT_CART;
        MDFNGameInfo->VideoSystem = VIDSYS_NONE;

        MDFNGameInfo->cspecial = NULL;
        MDFNGameInfo->GameSetMD5Valid = FALSE;


        if(MDFN_GetSettingB("nes.fnscan"))
        {
	 const char *fn = GetFNComponent(name);	// TODO: This seems awfully spaghetti-like/inefficient.  Fixme?

         if(strstr(fn, "(U)") || strstr(fn, "(USA)"))
          MDFNGameInfo->VideoSystem = VIDSYS_NTSC;
         else if(strstr(fn, "(J)") || strstr(fn, "(Japan)"))
          MDFNGameInfo->VideoSystem = VIDSYS_NTSC;
         else if(strstr(fn, "(E)") || strstr(fn, "(G)") || strstr(fn, "(Europe)") || strstr(fn, "(Germany)") )
          MDFNGameInfo->VideoSystem = VIDSYS_PAL;
        }

        GameInterface = (NESGameType *)calloc(1, sizeof(NESGameType));

        SetReadHandler(0x0000, 0xFFFF, ANull);
        SetWriteHandler(0x0000, 0xFFFF, BNull);

        SetReadHandler(0x10000,0x10000 + 0xFF, AOverflow);
        SetWriteHandler(0x10000,0x10000 + 0xFF, BOverflow);

        SetReadHandler(0,0x7FF,ARAML);
        SetWriteHandler(0,0x7FF,BRAML);

        SetReadHandler(0x800,0x1FFF,ARAMH);  /* Part of a little */
        SetWriteHandler(0x800,0x1FFF,BRAMH); /* hack for a small speed boost. */

        MDFNMP_Init(1024, 65536 / 1024);


	#ifdef WANT_DEBUGGER
	NESDBG_Init();

        ASpace_Add(NESDBG_GetAddressSpaceBytes, NESDBG_PutAddressSpaceBytes, "cpu", "CPU", 16);
        ASpace_Add(NESPPU_GetAddressSpaceBytes, NESPPU_PutAddressSpaceBytes, "ppu", "PPU", 14);
        #endif
}
Exemple #2
0
static MDFN_COLD void InitCommon(const std::string& fbase)
{
        NESIsVSUni = false;
        PPU_hook = 0;
        GameHBIRQHook = 0;

        MapIRQHook = 0;
        MMC5Hack = 0;
        PAL &= 1;

        MDFNGameInfo->VideoSystem = VIDSYS_NONE;

        MDFNGameInfo->cspecial = NULL;

        if(MDFN_GetSettingB("nes.fnscan"))
        {
         if(fbase.find("(U)") != std::string::npos || fbase.find("(USA)") != std::string::npos)
          MDFNGameInfo->VideoSystem = VIDSYS_NTSC;
         else if(fbase.find("(J)") != std::string::npos || fbase.find("(Japan)") != std::string::npos)
          MDFNGameInfo->VideoSystem = VIDSYS_NTSC;
         else if(fbase.find("(E)") != std::string::npos || fbase.find("(G)") != std::string::npos || fbase.find("(F)") != std::string::npos ||
	         fbase.find("(Europe)") != std::string::npos || fbase.find("(Germany)") != std::string::npos || fbase.find("(France)") != std::string::npos)
          MDFNGameInfo->VideoSystem = VIDSYS_PAL;
        }

	memset(&GameInterface, 0, sizeof(GameInterface));

        SetReadHandler(0x0000, 0xFFFF, ANull);
        SetWriteHandler(0x0000, 0xFFFF, BNull);

        SetReadHandler(0x10000,0x10000 + 0xFF, AOverflow);
        SetWriteHandler(0x10000,0x10000 + 0xFF, BOverflow);

        SetReadHandler(0,0x7FF,ARAML);
        SetWriteHandler(0,0x7FF,BRAML);

        SetReadHandler(0x800,0x1FFF,ARAMH);  /* Part of a little */
        SetWriteHandler(0x800,0x1FFF,BRAMH); /* hack for a small speed boost. */

        MDFNMP_Init(1024, 65536 / 1024);


	#ifdef WANT_DEBUGGER
	NESDBG_Init();

	ASpace_Add(NESDBG_GetAddressSpaceBytes, NESDBG_PutAddressSpaceBytes, "cpu", "CPU", 16);
	ASpace_Add(NESPPU_GetAddressSpaceBytes, NESPPU_PutAddressSpaceBytes, "ppu", "PPU", 14);
	ASpace_Add(NESPPU_GetAddressSpaceBytes, NESPPU_PutAddressSpaceBytes, "spram", "Sprite RAM", 8);
        #endif
}
Exemple #3
0
bool MDDBG_Init(void)
{
 MDFNDBG_AddRegGroup(&M68K_RegsGroup);

 ASpace_Add(GetAddressSpaceBytes, PutAddressSpaceBytes, "cpu", "CPU Physical", 24);
 ASpace_Add(GetAddressSpaceBytes, PutAddressSpaceBytes, "ram", "Work RAM", 16);

 
 C68k_Init(&Main68K_BP, dbg_int_ack_callback);

 C68k_Set_TAS_Hack(&Main68K_BP, 1);

 C68k_Set_ReadB(&Main68K_BP, MDDBG_ReadMemory8);
 C68k_Set_ReadW(&Main68K_BP, MDDBG_ReadMemory16);

 C68k_Set_WriteB(&Main68K_BP, MDDBG_WriteMemory8);
 C68k_Set_WriteW(&Main68K_BP, MDDBG_WriteMemory16);

 MD_DebugMode = FALSE;

 return(TRUE);
}
Exemple #4
0
void MDDBG_Init(void)
{
 MDFNDBG_AddRegGroup(&M68K_RegsGroup);

 ASpace_Add(GetAddressSpaceBytes, PutAddressSpaceBytes, "cpu", "CPU Physical", 24);
 ASpace_Add(GetAddressSpaceBytes, PutAddressSpaceBytes, "ram", "Work RAM", 16);

 //
 Main68K_BP.BusIntAck = DBG_BusIntAck;
 Main68K_BP.BusReadInstr = DBG_BusRead16;

 Main68K_BP.BusRead8 = DBG_BusRead8;
 Main68K_BP.BusRead16 = DBG_BusRead16;

 Main68K_BP.BusWrite8 = DBG_BusWrite8;
 Main68K_BP.BusWrite16 = DBG_BusWrite16;

 Main68K_BP.BusRMW = DBG_BusRMW;
 //

 MD_DebugMode = false;
}