Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public CaptureList(pspsharp.HLE.kernel.types.PspGeList list) throws Exception
        public CaptureList(PspGeList list)
        {
            this.list = new PspGeList(list.id);
            this.list.init(list.list_addr, list.StallAddr, list.cbid, list.optParams);

            if (list.StallAddr - list.list_addr == 0)
            {
                VideoEngine.log_Renamed.error("Capture: Command list is empty");
            }

            int listSize = 0;

            if (list.StallAddr == 0)
            {
                // Scan list for END command
                Memory mem = Memory.Instance;
                for (int listPc = list.list_addr; Memory.isAddressGood(listPc); listPc += 4)
                {
                    int instruction = mem.read32(listPc);
                    int command     = VideoEngine.command(instruction);
                    if (command == GeCommands.END)
                    {
                        listSize = listPc - list.list_addr + 4;
                        break;
                    }
                    else if (command == GeCommands.JUMP)
                    {
                        VideoEngine.log_Renamed.error("Found a JUMP instruction while scanning the list. Aborting the scan.");
                        listSize = listPc - list.list_addr + 4;
                        break;
                    }
                    else if (command == GeCommands.RET)
                    {
                        VideoEngine.log_Renamed.error("Found a RET instruction while scanning the list. Aborting the scan.");
                        listSize = listPc - list.list_addr + 4;
                        break;
                    }
                    else if (command == GeCommands.CALL)
                    {
                        VideoEngine.log_Renamed.warn("Found a CALL instruction while scanning the list. Ignoring the called list.");
                    }
                }
            }
            else
            {
                listSize = list.StallAddr - list.list_addr;
            }

            listBuffer = new CaptureRAM(list.list_addr & Memory.addressMask, listSize);
        }
Ejemplo n.º 2
0
        private static void sceGeListUpdateStallAddr(int addr)
        {
            // Simplification: we can update the stall address only if the VideoEngine
            // is processing one and only one GE list.
            VideoEngine videoEngine = VideoEngine.Instance;

            if (videoEngine.numberDrawLists() == 0)
            {
                PspGeList geList = videoEngine.CurrentList;
                if (geList != null && geList.StallAddr != 0)
                {
                    addr            &= Memory.addressMask;
                    geList.StallAddr = addr;
                }
            }
        }