public TextEditor(byte[] buf) { InitializeComponent(); gb = new GBHL.GBFile(buf); getTextAddresses(); nAddress.Value = textAddresses[0]; }
public frmWarp(Program.GameTypes g, GBHL.GBFile gbf, byte f) { InitializeComponent(); game = g; if (g == Program.GameTypes.Ages) { foreach (string s in agesGroupNames) { cboArea.Items.Add(s); } } else { foreach (string s in seasonsGroupNames) { cboArea.Items.Add(s); } } cboArea.SelectedIndex = 0; flag2 = f; gb = gbf; warpLoader = new WarpLoader(gb); mapLoader = new MapLoader(gb); }
public InteractionLoader(GBHL.GBFile g, Program.GameTypes game) { gb = g; loadedGame = game; if (game == Program.GameTypes.Ages) { // Check if patch has been applied if (gb.ReadByte(0x54328) == 0xc3) { enableExtraInteractionBank(); } // Many maps point here when they have no data. // But this isn't treated as a special case anymore. //noLocation = 0x49977; } else { if (gb.ReadByte(0x458dc) == 0xcd) { enableExtraInteractionBank(); } //noLocation = 0x4634b; } loadInteractions(0, 0); }
public ChestEditor(GBHL.GBFile g, byte chest) { InitializeComponent(); gb = g; chestData = chest; nItem.Value = chest; }
public frmDungeonPortal(GBHL.GBFile g, Program.GameTypes game) { gb = g; this.game = game; InitializeComponent(); nDungeon_ValueChanged(null, null); }
public RepointCollision(byte[] g, bool overworld, int dungeon, int map, int address, bool spec, bool mag, bool sprite, List <Warps> warps, List <LAObject> objects, int wallvalue, int floorvalue) { InitializeComponent(); gb = new GBHL.GBFile(g); Dungeon = dungeon; overWorld = overworld; Map = map; mapAddress = address; special = spec; magGlass = mag; sprites = sprite; mapWarps = warps; mapObjects = objects; wall = wallvalue; floor = floorvalue; nAddress.Value = address; if (!sprite) { if (overWorld) { if (map < 0x80) { nAddress.Minimum = 0x24200; nAddress.Maximum = //0x2668B; 0x27FFD; } else { nAddress.Minimum = 0x68000; nAddress.Maximum = //0x69E73; 0x6BFFD; } } else { if (dungeon < 6 || dungeon >= 0x1A) { nAddress.Maximum = 0x2BB74; nAddress.Minimum = 0x28200; } else if (dungeon >= 6 || dungeon < 0x1A) { nAddress.Maximum = 0x2FFFD; nAddress.Minimum = 0x2C200; } if (dungeon == 0xFF) { nAddress.Maximum = 0x2BFFD; nAddress.Minimum = 0x28200; } } } else { nAddress.Minimum = 0x58640; nAddress.Maximum = 0x5BFFD; } }
public frmChest(GBHL.GBFile g, int grp, int m, Program.GameTypes game) { gb = g; chest = new ChestLoader(gb, game); group = grp; map = m; InitializeComponent(); }
public frmDungeonRooms(GBHL.GBFile g, byte[] m, Image i) { gb = g; mapOrder = m; Array.Copy(m, baseMapOrder, m.Length); InitializeComponent(); pMinimap.Image = i; }
public NewObject(GBHL.GBFile g, bool overWorld) { InitializeComponent(); gb = g; O.x = 0; O.y = 0; overworld = overWorld; O.id = (byte)nObjectID.Value; }
public frmTilesetEditor(GBHL.GBFile g, Form1 f) { InitializeComponent(); tilesBmp = new Bitmap(128, 128); form = f; gb = g; nTileset.Value = f.nArea.Value; LoadTileset((int)nTileset.Value); }
public frmAreaFlags(GBHL.GBFile g, Program.GameTypes gm, AreaLoader a, int area) { InitializeComponent(); gb = g; game = gm; areaLoader = a; nArea.Value = area; nArea_ValueChanged(null, null); }
public frmInteractions(InteractionLoader i, int grp, int mp, Program.GameTypes game, GBHL.GBFile g) { InitializeComponent(); this.game = game; interactionLoader = i; gb = g; group = grp; map = mp; }
public frmWarpProps(WarpLoader w, int g, int la, Program.GameTypes gm, GBHL.GBFile gbf) { game = gm; warpLoader = w; group = g; lastAddress = la; gb = gbf; InitializeComponent(); }
public static int GetPaletteAddress(GBHL.GBFile gb, Program.GameTypes game, int index) { int baseColorAddress = (game == Program.GameTypes.Ages ? (0x17 * 0x4000) : (0x16 * 0x4000)); gb.BufferLocation = (game == Program.GameTypes.Ages ? 0x632C : 0x6290); gb.BufferLocation += index * 2; gb.BufferLocation = gb.ReadByte() + gb.ReadByte() * 0x100; byte a = gb.ReadByte(); gb.BufferLocation = baseColorAddress + gb.ReadByte() + ((gb.ReadByte() - 0x40) * 0x100); return((gb.BufferLocation % 0x4000) + 0x4000); }
public frmMapScript(GBHL.GBFile g, int map, int group) { gb = g; grp = group; bm = (byte)map; m = new MapScripts(gb); InitializeComponent(); int b = m.loadScript(map, group); if (b == -1) { panel2.Visible = true; return; } panel1.Visible = true; nScript.Value = (byte)b; }
public MinibossEditor(byte[] buff, bool overworld, int map) { InitializeComponent(); gb = new GBHL.GBFile(buff); overWorld = overworld; if (!overworld) { comDungeons.SelectedIndex = 0; } else { comDungeons.Enabled = false; label2.Text = "Map:"; label3.Text = "Warp Map:"; nMap1.Value = map; } }
public frmTransitions(TransitionLoader tl, GBHL.GBFile g, Program.GameTypes ga) { InitializeComponent(); gb = g; game = ga; transitionLoader = tl; nIndex.Maximum = tl.transitions.Count - 1; if (tl.transitions.Count == 0) { groupBox1.Enabled = false; } else { nMap.Value = transitionLoader.transitions[(int)nIndex.Value].map; cboDirection.SelectedIndex = transitionLoader.transitions[(int)nIndex.Value].direction; nFrom.Value = PaletteLoader.GetPaletteIndex(gb, game, transitionLoader.transitions[(int)nIndex.Value].from); nTo.Value = PaletteLoader.GetPaletteIndex(gb, game, transitionLoader.transitions[(int)nIndex.Value].to); } }
public static int GetPaletteIndex(GBHL.GBFile gb, Program.GameTypes game, int dest) { int baseColorAddress = (game == Program.GameTypes.Ages ? (0x17 * 0x4000) : (0x16 * 0x4000)); for (int i = 0; i < 255; i++) { gb.BufferLocation = (game == Program.GameTypes.Ages ? 0x632C : 0x6290); gb.BufferLocation += i * 2; gb.BufferLocation = gb.ReadByte() + gb.ReadByte() * 0x100; byte a = gb.ReadByte(); gb.BufferLocation = baseColorAddress + gb.ReadByte() + ((gb.ReadByte() - 0x40) * 0x100); if ((gb.BufferLocation % 0x4000) + 0x4000 == dest) { return(i); } } return(-1); }
public frmSecondaryScript(GBHL.GBFile g, MapScripts ms, int grp, int mp) { gb = g; m = ms; group = grp; map = mp; InitializeComponent(); int i = m.loadSecondaryScriptRef(group, map); sl = i; if (i == -1) { panel2.Visible = true; } else { panel1.Visible = true; nScript.Value = gb.ReadByte(i + 1); } }
public SpriteEditor(GBHL.GBFile g, bool overworld, byte Map, byte Dungeon) { InitializeComponent(); gb = g; if (overworld) { overWorld = overworld; cOverworld.Checked = true; } map = Map; nMap.Value = map; if (!overworld) { dungeon = Dungeon; nDungeon.Value = dungeon; } loadSpriteBanks(); getSpriteLocation(); drawSprites(); }
public frmTreeTop(GBHL.GBFile g, int grp, int mp, TreeTopLoader trl) { gb = g; map = mp; group = grp; tl = trl; InitializeComponent(); int i = tl.getTreeTopLocation(group, map); if (i == -1) { panel2.Visible = true; } else { panel1.Visible = true; treeLoc = i; gb.BufferLocation = i + 1; nMap.Value = (byte)map; nTop.Value = gb.ReadByte(); nX.Value = gb.ReadByte(); nY.Value = gb.ReadByte(); } }
public static string GetROMHeader(GBHL.GBFile gb) { gb.BufferLocation = 0x134; byte[] bytes = gb.ReadBytes(10); return(System.Text.ASCIIEncoding.ASCII.GetString(bytes)); }
public frmStart(GBHL.GBFile g, Program.GameTypes gm) { gb = g; game = gm; InitializeComponent(); }
public ChestLoader(GBHL.GBFile g, Program.GameTypes gm) { gb = g; game = gm; }
public TilesetBuilder(GBHL.GBFile g) { gb = g; }
public TransitionLoader(GBHL.GBFile g) { gb = g; }
public MapScripts(GBHL.GBFile g) { gb = g; }
public PaletteEditor(TileLoader t, Form1 f, Color[,] pal, byte[] g, int dungeon, int map, bool overworld, bool sideview, bool special, bool crystal, byte off) { InitializeComponent(); tLoader = t; palette = pal; form1 = f; gb = new GBHL.GBFile(g); if (overworld) { nDungeon.Enabled = false; } overWorld = overworld; sideView = sideview; specialMaps = special; crystals = crystal; mapIndex = map; mapIndexOriginal = map; dungeonIndex = dungeon; dungeonIndexOriginal = dungeon; nMap.Value = map; if (!overworld) { nDungeon.Value = dungeon; nIndex.Enabled = false; gb.BufferLocation = 0x8523A; for (int i = 0; i < 0x2D; i++) { if (gb.ReadByte() != dungeonIndex) { gb.BufferLocation += 3; continue; } if (gb.ReadByte() != mapIndex) { gb.BufferLocation += 2; continue; } byte q = gb.ReadByte(); if (q != 4) { gb.BufferLocation++; continue; } nIndex.Enabled = true; nIndex.Maximum = 0x3F; offset = off; nIndex.Value = off & 0x3F; break; } } if (dungeon == 0xFF) { nMap.Maximum = 0x15; } pTileset.Image = form1.pTiles.Image; palette = pal; Bitmap b = new Bitmap(128, 128); Graphics gra = Graphics.FromImage(b); for (int k = 0; k < 8; k++) { for (int i = 0; i < 4; i++) { gra.FillRectangle(new SolidBrush(pal[k, i]), i * 32, k * 16, 32, 16); } } pPalette.Image = b; getPaletteLocation(); getPalettePointer(); if (overworld) { offset = off; nIndex.Value = off; } }
public WarpLoader(GBHL.GBFile g) { gb = g; }
public frmSearch(GBHL.GBFile g) { gb = g; InitializeComponent(); }
private void LoadROM(string file) { try { BinaryReader br = new BinaryReader(File.OpenRead(file)); byte[] buffer = br.ReadBytes((int)br.BaseStream.Length); br.Close(); gb = new GBHL.GBFile(buffer); fname = file; } catch (Exception) { MessageBox.Show("IO Error.", "Error"); setBles(false); } setBles(true); tl = new TextLoader(gb); panel1.Enabled = true; }
public StartEditor(GBHL.GBFile g) { InitializeComponent(); gb = g; getStartData(); }