Beispiel #1
0
        public static byte[] readLinearBigBlockData(int hierLevel, int bigTileIndex, int tileSize)
        {
            //if tileSize == -1, try read it from config
            if (tileSize == -1)
            {
                tileSize = ConfigScript.isBlockSize4x4() ? 16 : 4;
            }

            int wordSize = ConfigScript.isUseSegaGraphics() ? 2 : 1;
            int size     = ConfigScript.getBigBlocksCount(hierLevel) * tileSize * wordSize;

            byte[] bigBlockIndexes = new byte[size];
            var    bigBlocksAddr   = ConfigScript.getBigTilesAddr(hierLevel, bigTileIndex);

            for (int i = 0; i < size; i++)
            {
                bigBlockIndexes[i] = Globals.romdata[bigBlocksAddr + i];
            }
            return(bigBlockIndexes);
        }
Beispiel #2
0
        public static byte[] getPalleteLinear(int palIndex)
        {
            int pal_size = ConfigScript.isUseSegaGraphics() ? Globals.SEGA_PAL_LEN : Globals.PAL_LEN;
            var palette  = new byte[pal_size];
            int addr     = ConfigScript.palOffset.beginAddr + palIndex * ConfigScript.palOffset.recSize;

            if (!ConfigScript.isUseSegaGraphics())
            {
                for (int i = 0; i < pal_size; i++)
                {
                    palette[i] = (byte)(Globals.romdata[addr + i] & 0x3F);
                }
            }
            else
            {
                for (int i = 0; i < pal_size; i++)
                {
                    palette[i] = (byte)(Globals.romdata[addr + i]);
                }
            }
            return(palette);
        }