public static Bitmap DrawFont(uint image)
        {
            if (!ROM.isPointer(image))
            {
                return(ImageUtil.Blank(4 * 8, 4 * 8));
            }
            uint palette = Program.ROM.p32(Program.ROM.RomInfo.op_class_font_palette_pointer());

            byte[] imageUZ = LZ77.decompress(Program.ROM.Data, ROM.toOffset(image));

            return(ImageUtil.ByteToImage16Tile(4 * 8, 4 * 8
                                               , imageUZ, 0
                                               , Program.ROM.Data, (int)ROM.toOffset(palette)
                                               ));
        }
Beispiel #2
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.p32(Program.ROM.RomInfo.bigcg_pointer)
                             , 12
                             , (int i, uint addr) =>
     {
         return ROM.isPointer(Program.ROM.u32(addr));
     }
                             , (int i, uint addr) =>
     {
         return U.ToHexString(i);
     }
                             ));
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.p32(Program.ROM.RomInfo.op_class_font_pointer())
                             , 4
                             , (int i, uint addr) =>
     {
         return ROM.isPointer(Program.ROM.u32(addr))
         ;
     }
                             , (int i, uint addr) =>
     {
         return U.ToHexString(i);
     }
                             ));
 }
Beispiel #4
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.p32(Program.ROM.RomInfo.op_class_demo_pointer())
                             , 28
                             , (int i, uint addr) =>
     {
         return ROM.isPointer(Program.ROM.u32(addr))
         ;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u8(addr + 14);
         return U.ToHexString(i) + " " + ClassForm.GetClassName(id);
     }
                             ));
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.p32(Program.ROM.RomInfo.worldmap_road_pointer())
                             , 12
                             , (int i, uint addr) =>
     {
         return ROM.isPointer(Program.ROM.u32(addr))
         ;
     }
                             , (int i, uint addr) =>
     {
         uint basepoint1 = Program.ROM.u8(addr + 4);
         uint basepoint2 = Program.ROM.u8(addr + 4 + 1);
         string basepointstring1 = WorldMapPointForm.GetWorldMapPointName(basepoint1);
         string basepointstring2 = WorldMapPointForm.GetWorldMapPointName(basepoint2);
         return U.ToHexString(i) + " " + basepointstring1 + " -> " + basepointstring2;
     }
                             ));
 }
Beispiel #6
0
        public static Bitmap DrawImage(uint table, uint tsa, uint palette)
        {
            if (!ROM.isPointer(table))
            {
                return(ImageUtil.Blank(8, 8));
            }
            if (!ROM.isPointer(tsa))
            {
                return(ImageUtil.Blank(8, 8));
            }
            if (!ROM.isPointer(palette))
            {
                return(ImageUtil.Blank(8, 8));
            }

            table = ROM.toOffset(table);

            List <byte> imageUZList = new List <byte>();

            for (int i = 0; i < 10; i++)
            {
                uint image = Program.ROM.u32((uint)(table + (i * 4)));
                if (!ROM.isPointer(image))
                {
                    return(ImageUtil.Blank(8, 8));
                }
                byte[] imageUZ = LZ77.decompress(Program.ROM.Data, ROM.toOffset(image));
                imageUZList.AddRange(imageUZ);
            }
            return(ImageUtil.ByteToImage16TileHeaderTSA(32 * 8, 20 * 8
                                                        , imageUZList.ToArray(), 0
                                                        , Program.ROM.Data, (int)ROM.toOffset(palette)
                                                        , Program.ROM.Data, (int)ROM.toOffset(tsa)
                                                        , 0x8000 //TSAに謎の係数を足しながら、最下層のラインから格納するらしい
                                                        , -0x80  //パレット番号が0x80シフトされるらしい
                                                        ));
        }