예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public static CaptureFrameBufDetails read(java.io.InputStream in) throws java.io.IOException
        public static CaptureFrameBufDetails read(System.IO.Stream @in)
        {
            CaptureFrameBufDetails details = new CaptureFrameBufDetails();

            DataInputStream data          = new DataInputStream(@in);
            int             sizeRemaining = data.readInt();

            if (sizeRemaining >= packetSize)
            {
                details.topaddrFb     = data.readInt();
                sizeRemaining        -= 4;
                details.bufferwidthFb = data.readInt();
                sizeRemaining        -= 4;
                details.pixelformatFb = data.readInt();
                sizeRemaining        -= 4;
                details.sync          = data.readInt();
                sizeRemaining        -= 4;

                data.skipBytes(sizeRemaining);
            }
            else
            {
                throw new IOException("Not enough bytes remaining in stream");
            }

            return(details);
        }
예제 #2
0
        public static void endReplay()
        {
            // replay sealed override sceDisplaySetFrameBuf
            replayFrameBufDetails.commit();
            replayFrameBufDetails = null;

            VideoEngine.log_Renamed.info("Replay completed");
            Emulator.PauseEmu();
        }
예제 #3
0
        public static void startReplay(string filename)
        {
            if (captureInProgress)
            {
                VideoEngine.log_Renamed.error("Ignoring startReplay, capture is in progress");
                return;
            }

            VideoEngine.log_Renamed.info("Starting replay: " + filename);

            try
            {
                System.IO.Stream @in = new BufferedInputStream(new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read));

                while (@in.available() > 0)
                {
                    CaptureHeader header     = CaptureHeader.read(@in);
                    int           packetType = header.PacketType;

                    switch (packetType)
                    {
                    case CaptureHeader.PACKET_TYPE_LIST:
                        CaptureList list = CaptureList.read(@in);
                        list.commit();
                        break;

                    case CaptureHeader.PACKET_TYPE_RAM:
                        CaptureRAM ramFragment = CaptureRAM.read(@in);
                        ramFragment.commit();
                        break;

                    // deprecated
                    case CaptureHeader.PACKET_TYPE_DISPLAY_DETAILS:
                        CaptureDisplayDetails displayDetails = CaptureDisplayDetails.read(@in);
                        displayDetails.commit();
                        break;

                    case CaptureHeader.PACKET_TYPE_FRAMEBUF_DETAILS:
                        // don't replay this one immediately, wait until after the list has finished executing
                        replayFrameBufDetails = CaptureFrameBufDetails.read(@in);
                        break;

                    default:
                        throw new Exception("Unknown packet type " + packetType);
                    }
                }

                @in.Close();
            }
            catch (Exception e)
            {
                VideoEngine.log_Renamed.error("Failed to start replay: " + e.Message);
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
            }
        }
예제 #4
0
        public static void captureFrameBufDetails()
        {
            if (!captureInProgress)
            {
                VideoEngine.log_Renamed.warn("Ignoring captureRAM, capture hasn't been started");
                return;
            }

            try
            {
                CaptureHeader header = new CaptureHeader(CaptureHeader.PACKET_TYPE_FRAMEBUF_DETAILS);
                header.write(@out);

                CaptureFrameBufDetails details = new CaptureFrameBufDetails();
                details.write(@out);
            }
            catch (Exception e)
            {
                VideoEngine.log_Renamed.error("Failed to capture frame buf details: " + e.Message);
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
                Emulator.PauseEmu();
            }
        }