Esempio n. 1
0
        //public static Logger log = Modules.getLogger("sceMeCore");

        private string logParameters(CpuState cpu, int firstParameter, int numberParameters)
        {
            StringBuilder s = new StringBuilder();

            for (int i = 0; i < numberParameters; i++)
            {
                int reg = firstParameter + i;
                if (s.Length > 0)
                {
                    s.Append(", ");
                }
                s.Append(string.Format("{0}=0x{1:X8}", Common.gprNames[reg], cpu.getRegister(reg)));
            }

            return(s.ToString());
        }
Esempio n. 2
0
        public virtual string hleKernelSprintf(CpuState cpu, string format, int firstRegister)
        {
            // For now, use only the 7 register parameters: $a1-$a3, $t0-$t3
            // Further parameters are retrieved from the stack (assume max. 10 stack parameters).
            int registerParameters = _t3 - firstRegister + 1;

            object[] formatParameters = new object[registerParameters + 10];
            for (int i = 0; i < registerParameters; i++)
            {
                formatParameters[i] = cpu.getRegister(firstRegister + i);
            }
            Memory mem = Memory.Instance;

            for (int i = registerParameters; i < formatParameters.Length; i++)
            {
                formatParameters[i] = mem.read32(cpu._sp + ((i - registerParameters) << 2));
            }

            return(hleKernelSprintf(cpu, format, formatParameters));
        }