Beispiel #1
0
 //-------------------------------------------------
 //  ctor (with tiny_rom_entry)
 //-------------------------------------------------
 public rom_entry(tiny_rom_entry ent)
 {
     m_name     = ent.name != null ? ent.name : "";
     m_hashdata = hashdata_from_tiny_rom_entry(ent);
     m_offset   = ent.offset;
     m_length   = ent.length;
     m_flags    = ent.flags;
 }
Beispiel #2
0
        //-------------------------------------------------
        //  hashdata_from_tiny_rom_entry - calculates the
        //  proper hashdata string from the value in the
        //  tiny_rom_entry
        //-------------------------------------------------
        static string hashdata_from_tiny_rom_entry(tiny_rom_entry ent)
        {
            string result = "";

            switch (ent.flags & romentry_global.ROMENTRY_TYPEMASK)
            {
            case romentry_global.ROMENTRYTYPE_FILL:
            case romentry_global.ROMENTRYTYPE_COPY:
                // for these types, tiny_rom_entry::hashdata is an integer typecasted to a pointer
                result = string.Format("0x{0}", ent.hashdata);      //(unsigned)(uintptr_t)ent.hashdata);  // 0x%x
                break;

            default:
                if (ent.hashdata != null)
                {
                    result = ent.hashdata;
                }
                break;
            }

            return(result);
        }