示例#1
0
        private static void CMD_27(ref Level lvl, byte[] cmd, ROM rom, byte seg, uint off)
        {
            Warp warp = new Warp(true);

            if (rom.isSegmentMIO0(seg))
            {
                warp.MakeReadOnly();
                warp.Address = "N/A";
            }
            else
            {
                warp.Address = "0x" + rom.decodeSegmentAddress(seg, off).ToString("X");
            }
            warp.WarpFrom_ID    = cmd[2];
            warp.WarpTo_LevelID = cmd[3];
            warp.WarpTo_AreaID  = cmd[4];
            warp.WarpTo_WarpID  = cmd[5];
            lvl.getCurrentArea().PaintingWarps.Add(warp);
        }
示例#2
0
        private static void CMD_27(ref Level lvl, ref string desc, byte[] cmd, byte seg, uint off, byte?areaID)
        {
            ROM  rom  = ROM.Instance;
            Warp warp = new Warp(true);

            if (rom.isSegmentMIO0(seg, areaID))
            {
                warp.MakeReadOnly();
                warp.Address = "N/A";
            }
            else
            {
                warp.Address = "0x" + rom.decodeSegmentAddress(seg, off, areaID).ToString("X");
            }
            warp.WarpFrom_ID    = cmd[2];
            warp.WarpTo_LevelID = cmd[3];
            warp.WarpTo_AreaID  = cmd[4];
            warp.WarpTo_WarpID  = cmd[5];
            lvl.getCurrentArea().PaintingWarps.Add(warp);
            desc = "Define painting warp (0x" + warp.WarpFrom_ID.ToString("X2") + " -> ";
            if (warp.WarpTo_LevelID == lvl.LevelID)
            {
                if (warp.WarpTo_AreaID == lvl.getCurrentArea().AreaID)
                {
                    desc += "0x" + warp.WarpTo_WarpID.ToString("X2") + ")";
                }
                else
                {
                    desc += "0x" + warp.WarpTo_WarpID.ToString("X2") + " in area " + warp.WarpTo_AreaID + ")";
                }
            }
            else
            {
                desc += "0x" + warp.WarpTo_WarpID.ToString("X2") + " at level 0x" + warp.WarpTo_LevelID.ToString("X2") + " in area " + warp.WarpTo_AreaID + ")";
            }
        }