Пример #1
0
        public NitroOverlay(NitroROM rom, uint id)
        {
            m_ROM = rom;
            m_ID  = id;

            bool autorw = !m_ROM.CanRW();

            if (autorw)
            {
                m_ROM.BeginRW();
            }

            m_OVTEntryAddr = m_ROM.GetOverlayEntryOffset(m_ID);
            m_FileID       = m_ROM.GetFileIDFromOverlayID(m_ID);

            m_RAMAddr = m_ROM.Read32(m_OVTEntryAddr + 0x04);
            Byte flags = m_ROM.Read8(m_OVTEntryAddr + 0x1F);

            m_Data = m_ROM.ExtractFile(m_FileID);
            if ((flags & 0x01) == 0x01)
            {
                Jap77.Decompress(ref m_Data);
            }

            if (autorw)
            {
                m_ROM.EndRW();
            }
        }
Пример #2
0
        public NitroOverlay(NitroROM rom, uint id)
        {
            m_ROM = rom;
            m_ID  = id;

            if (Program.m_IsROMFolder)
            {
                List <Ndst.Overlay> overlays = JsonConvert.DeserializeObject <List <Ndst.Overlay> >(NitroROM.GetExtractedLines("__ROM__/arm9Overlays.json"));
                Ndst.Overlay        o        = overlays.Where(x => x.Id == id).ElementAt(0);
                m_FileID  = o.FileId;
                m_RAMAddr = o.RAMAddress;
                m_Data    = NitroROM.GetExtractedBytes("__ROM__/Arm9/" + id + ".bin");
                if ((o.Flags & 0x01000000) > 0)
                {
                    Jap77.Decompress(ref m_Data);
                }
                return;
            }

            bool autorw = !m_ROM.CanRW();

            if (autorw)
            {
                m_ROM.BeginRW();
            }

            m_OVTEntryAddr = m_ROM.GetOverlayEntryOffset(m_ID);
            m_FileID       = m_ROM.GetFileIDFromOverlayID(m_ID);

            m_RAMAddr = m_ROM.Read32(m_OVTEntryAddr + 0x04);
            Byte flags = m_ROM.Read8(m_OVTEntryAddr + 0x1F);

            m_Data = m_ROM.ExtractFile(m_FileID);
            if ((flags & 0x01) == 0x01)
            {
                Jap77.Decompress(ref m_Data);
            }

            if (autorw)
            {
                m_ROM.EndRW();
            }
        }
Пример #3
0
        public NitroOverlay(NitroROM rom, uint id)
        {
            m_ROM = rom;
            m_ID = id;

            bool autorw = !m_ROM.CanRW();
            if (autorw) m_ROM.BeginRW();

            m_OVTEntryAddr = m_ROM.GetOverlayEntryOffset(m_ID);
            m_FileID = m_ROM.GetFileIDFromOverlayID(m_ID);

            m_RAMAddr = m_ROM.Read32(m_OVTEntryAddr + 0x04);
            Byte flags = m_ROM.Read8(m_OVTEntryAddr + 0x1F);

            m_Data = m_ROM.ExtractFile(m_FileID);
            if ((flags & 0x01) == 0x01)
                Jap77.Decompress(ref m_Data);

            if (autorw) m_ROM.EndRW();
        }