//-----------------------------------------------------------------------------
//* ProcessDList
//! This function is called when there is a Dlist to be processed. (High level GFX list)
//-----------------------------------------------------------------------------
EXPORT void CALL ProcessDList()
{
    Logger::getSingleton().printMsg("ProcessDList\n");

    try
    {
        g_graphicsPlugin.viStatusChanged();
        g_graphicsPlugin.processDisplayList();
    }
    catch (...)
    {
        Logger::getSingleton().printMsg("Unknown Error processing DisplayList", M64MSG_WARNING); 
        //MessageBox(0, "Unknown Error processing DisplayList", "Arachnoid Graphics Plugin", MB_OK|MB_SETFOREGROUND); 

        g_graphicsPlugin.dispose();
        g_graphicsPlugin.initialize(&g_graphicsInfo);

        //Trigger Interupts
        *(g_graphicsInfo.MI_INTR_REG) |= MI_INTR_DP;
        g_graphicsInfo.CheckInterrupts();
        *(g_graphicsInfo.MI_INTR_REG) |= MI_INTR_SP;
        g_graphicsInfo.CheckInterrupts();    
    }
}
//-----------------------------------------------------------------------------
//* Rom Open
//! This function is called when a rom is open. (from the emulation thread)
//-----------------------------------------------------------------------------
EXPORT int CALL RomOpen()
{
    Logger::getSingleton().printMsg("RomOpen\n");
    return g_graphicsPlugin.initialize(&g_graphicsInfo);
}