Esempio n. 1
0
        public virtual void sceIoOpen(int result, int filename_addr, string filename, int flags, int permissions, string mode)
        {
            // File handle list
            if (result >= 0)
            {
                FileHandleInfo info = new FileHandleInfo(result, filename);
                fileHandleIdMap[result] = info;
                sortRequired            = true;
            }

            string filelog = string.Format("path=0x{0:X8}('{1}')", filename_addr, filename);

            if (filename.StartsWith("disc0:/sce_lbn", StringComparison.Ordinal))
            {
                // try to resolve LBA addressing if possible
                UmdIsoReader iso = Modules.IoFileMgrForUserModule.IsoReader;
                if (iso != null)
                {
                    string filePath = filename;
                    filePath = filePath.Substring(14);                     // Length of "disc0:/sce_lba"
                    int    sep       = filePath.IndexOf("_size", StringComparison.Ordinal);
                    int    fileStart = Integer.decode(filePath.Substring(0, sep));
                    string resolved  = iso.getFileName(fileStart);
                    if (!string.ReferenceEquals(resolved, null))
                    {
                        filelog = string.Format("path=0x{0:X8}('{1}', '{2}')", filename_addr, filename, resolved);
                    }
                }
            }
            filelog += string.Format(" flags=0x{0:X4}, permissions=0x{1:X4}({2})", flags, permissions, mode);

            // File Command list
            logFileCommand(new FileCommandInfo(this, "open", result, filelog));
        }
Esempio n. 2
0
        public virtual void sceIoRead(int result, int uid, int data_addr, int size, int bytesRead, long position, SeekableDataInput dataInput, IVirtualFile vFile)
        {
            FileHandleInfo info = fileHandleIdMap[uid];

            if (result >= 0 && info != null)
            {
                info.bytesRead += bytesRead;
            }

            logFileCommand(new FileCommandInfo(this, uid, "read", result, string.Format("data=0x{0:X8} size=0x{1:X8}", data_addr, size)));
        }
Esempio n. 3
0
        public virtual void sceIoWrite(int result, int uid, int data_addr, int size, int bytesWritten)
        {
            FileHandleInfo info = fileHandleIdMap[uid];

            if (result >= 0 && info != null)
            {
                info.bytesWritten += bytesWritten;
            }

            logFileCommand(new FileCommandInfo(this, uid, "write", result, string.Format("data=0x{0:X8} size=0x{1:X8}", data_addr, size)));
        }
Esempio n. 4
0
        public virtual void sceIoClose(int result, int uid)
        {
            // File handle list
            if (result >= 0)
            {
                FileHandleInfo info = fileHandleIdMap[uid];
                if (info != null)
                {
                    info.isOpen(false);
                }
            }

            // File Command list
            logFileCommand(new FileCommandInfo(this, uid, "close", result, ""));
        }
Esempio n. 5
0
            public override Component getTableCellRendererComponent(JTable table, object value, bool isSelected, bool hasFocus, int row, int column)
            {
                Component c = base.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);

                c.ForegRound = Color.black;

                if (outerInstance.fileHandleList != null)
                {
                    FileHandleInfo info = outerInstance.fileHandleList[row];
                    if (!info.Open)
                    {
                        c.ForegRound = Color.gray;
                    }
                }

                return(c);
            }
Esempio n. 6
0
            public override object getValueAt(int row, int col)
            {
                FileHandleInfo info = outerInstance.fileHandleList[row];

                if (info != null)
                {
                    switch (col)
                    {
                    case 0:
                        return(string.Format("0x{0:X4}", info.fd));

                    case 1:
                        return(info.filename);

                    case 2:
                        return(info.bytesRead);

                    case 3:
                        return(info.bytesWritten);
                    }
                }
                return(null);
            }