Ejemplo n.º 1
0
    void Start()
    {
        //PPU texture data
        RenderDumpBlock4BPP block4BPP = new RenderDumpBlock4BPP();

        block4BPP.Build(Rom.smRom);
        chipset = block4BPP.RenderFullBlock(MAP_CHIPSET_BLOCK);

        mat             = new Material(Shader.Find("Unlit/MapRender"));
        mat.mainTexture = chipset;

        //CPU placement/meta data
        RenderDumpLinear8BPP linear8BPP = new RenderDumpLinear8BPP();

        linear8BPP.Build(Rom.smRom);
        mapTileBytes = linear8BPP.GetDataBlockSegment(MAP_LOOKUP_START, MAP_LOOKUP_END);

        ConstructMap();
    }
Ejemplo n.º 2
0
    void Start()
    {
        RenderDumpLinear8BPP rdl = new RenderDumpLinear8BPP();

        rdl.Build(Rom.smRom);

        string[] strRoomOffsets = System.IO.File.ReadAllText(Application.dataPath + dataPath).Split('\n');
        uint[]   roomOffsets    = new uint[strRoomOffsets.Length];
        byte[][] headers        = new byte[roomOffsets.Length][];

        for (int x = 0; x < roomOffsets.Length; x++)
        {
            string temp = strRoomOffsets[x].Substring(0, 8);
            roomOffsets[x] = System.Convert.ToUInt32(temp, 16);
            headers[x]     = rdl.GetDataBlock(roomOffsets[x], 39);
            rooms.Add(new RoomHeader(roomOffsets[x], headers[x]));
        }
        Debug.Log("Complete!");
        BuildRooms();
    }