public void LoadFromGBA(ReadAndWrite rw) { preImport = false; int num = index << 3; frontdata = GetData(rw, front_offset + num); backdata = GetData(rw, back_offset + num); normalpallete = GetData(rw, normal_pal_off + num); shinypallete = GetData(rw, shiny_pal_off + num); byte height = 64; if (frontdata.Length == 2048 * 2) { height = 128; isTwoframe = true; } else { isTwoframe = false; } Color[] normalpal = ImgFunction.ConvertGBAPalTo24Bit(normalpallete); Color[] shinypal = ImgFunction.ConvertGBAPalTo24Bit(shinypallete); front.Image = ImgFunction.ConvertGBAImageToBitmap(frontdata, normalpal, 64, height); shinyfront.Image = ImgFunction.ConvertGBAImageToBitmap(frontdata, shinypal, 64, height); back.Image = ImgFunction.ConvertGBAImageToBitmap(backdata, normalpal, 64, 64); shinyback.Image = ImgFunction.ConvertGBAImageToBitmap(backdata, shinypal, 64, 64); }
public void LoadMapData(int map_no, int map_bank) { int offset = ReadPointer(MAP_BANK_PONTER); offset = ReadPointer(offset + 4 * map_no); offset = ReadPointer(offset + 4 * map_bank); header = GetStruct <mapheader>(offset, 0); offset = ReadPointer(MAP_FOOTER_POINTER); offset = ReadPointer(offset + 4 * header.footer_id); footer = GetStruct <footer>(offset, 0); tileset1 = GetStruct <blockset>(footer.primary_blockset, 0); tileset2 = GetStruct <blockset>(footer.secondary_blockset, 0); map_pals = ImgFunction.ConvertGBAPalTo24Bit(ReadBytes(tileset1.pals, 0, 12 * 0x20)); }
public void LoadPalletes(ReadAndWrite rw) { byte[] data = new byte[0x20]; Stream s = rw.Br.BaseStream; for (int x = 0; x < PAL_NUM - 1; x++) { int off = rw.ReadPointer(PAL_SPRITE + (x << 3)); int num = s.ReadByte(); rw.Seek(off); s.Read(data, 0, 0x20); palletes[num] = ImgFunction.ConvertGBAPalTo24Bit(data); } }
public void InIt(ReadAndWrite rw, INI_init ini) { front_offset = rw.ReadPointer(ini.frontspritetable); back_offset = rw.ReadPointer(ini.backspritetable); normal_pal_off = rw.ReadPointer(ini.frontpalettetable); shiny_pal_off = rw.ReadPointer(ini.shinypalettetable); icoinTable = rw.ReadPointer(ini.icointable); icoinPalleteIndexTable = rw.ReadPointer(ini.icoinindextable); icoinPalltes = new Color[3][]; rw.Seek(ini.icoinpallete); for (byte x = 0; x < 3; x++) { byte[] pal = rw.Br.ReadBytes(32); icoinPalltes[x] = ImgFunction.ConvertGBAPalTo24Bit(pal); } }