Example #1
0
        public static void LoadTile16(Rom rom)
        {
            int tpos = RomConstants.map16Tiles;

            //TODO: Change that magic number
            for (int i = 0; i < 4096; i += 1)
            {
                var t0 = GetTile8(rom.readShort(tpos));
                var t1 = GetTile8(rom.readShort(tpos + 2));
                var t2 = GetTile8(rom.readShort(tpos + 4));
                var t3 = GetTile8(rom.readShort(tpos + 6));
                tpos += 8;
                tiles16.Add(new Tile16(new Tile8Data[4] {
                    t0, t1, t2, t3
                }));
            }
        }
Example #2
0
        public static Tile16[] LoadTile16(Rom rom)
        {
            int           tpos    = RomConstants.map16Tiles;
            List <Tile16> tiles16 = new List <Tile16>();

            for (int i = 0; i < 4096; i += 1)
            {
                var t0 = GetTile8(rom.readShort(tpos));
                var t1 = GetTile8(rom.readShort(tpos + 2));
                var t2 = GetTile8(rom.readShort(tpos + 4));
                var t3 = GetTile8(rom.readShort(tpos + 6));
                tpos += 8;
                tiles16.Add(new Tile16(new Tile8Data[4] {
                    t0, t1, t2, t3
                }));
            }
            return(tiles16.ToArray());
        }