示例#1
0
        static bool Do_Exeption(uint lvl, uint expEvn, uint CallVect)
        {
            if (!zleeping)
            {
                if (sh4.sr.BL == 1 || sh4.vbr == 0)
                {
                    return(false);
                }
            }

            if (sh4.sr.IMASK > lvl)
            {
                return(false);
            }

            *mem.EXPEVT = expEvn;

            if (zleeping)
            {
                awake = true;
            }

            sh4.ssr   = sh4.sr.reg;
            sh4.spc   = sh4.pc;
            sh4.sgr   = sh4.r[15];
            sh4.sr.BL = 1;
            sh4.sr.MD = 1;
            sh4.sr.RB = 1;

            CallStackTrace.cstAddCall(sh4.pc, sh4.pc, sh4.vbr + 0x600, CallType.Interupt);

            sh4.pc = sh4.vbr + CallVect;

            return(true);
        }
示例#2
0
        static bool Do_interupt(uint lvl, uint intEvn, uint CallVect)
        {
            if (!zleeping)
            {
                if (sh4.sr.BL == 1 || sh4.vbr == 0)
                {
                    return(false);
                }
            }

            //interupt disabled :)
            if (sh4.sr.IMASK == 0xf || lvl == 0)
            {
                return(false);
            }

            //test interupt level
            if (sh4.sr.IMASK > lvl)
            {
                return(false);
            }

            *mem.INTEVT = intEvn;

            if (zleeping)
            {
                awake = true;
            }

            sh4.ssr   = sh4.sr.reg;
            sh4.spc   = sh4.pc;
            sh4.sgr   = sh4.r[15];
            sh4.sr.BL = 1;
            sh4.sr.MD = 1;
            sh4.sr.RB = 1;

            CallStackTrace.cstAddCall(sh4.pc, sh4.pc, sh4.vbr + 0x600, CallType.Interupt);

            sh4.pc = sh4.vbr + CallVect;

            return(true);
        }