Ejemplo n.º 1
0
 public TileRow(Rom206 rom, int index) : base(rom, Rom206.PLAYFIELD_ROW_TABLE + (index - 1) * 16)
 {
     for (int n = 0; n < Tile.Length; n++)
     {
         int offset = (sbyte)rom[Address + n];
         Tile[n] = rom.GetTileAt(offset);
     }
 }
Ejemplo n.º 2
0
 public Chunk(Rom206 rom, int address) : base(rom, address)
 {
     System.Diagnostics.Debug.Assert(Rom.Word(address) != 0x0080);
     do
     {
         int index = Rom[address++];
         List.Add(Rom.GetRowAt(index));
     } while (Rom.Word(address) != 0x0080);
 }
Ejemplo n.º 3
0
        public ChunkList(Rom206 rom, int address) : base(rom, address)
        {
            System.Diagnostics.Debug.Assert(Rom.Word(address) != 0x0080);

            int pChunk = 0;

            System.Diagnostics.Debug.Assert(this.Word(pChunk) != 0);
            do
            {
                Chunks.Add(Rom.GetChunkAt(this.Word(pChunk)));
                pChunk += 2;
            } while (this.Word(pChunk) != 0);
        }
Ejemplo n.º 4
0
        public Level(string name, int level_num, Rom206 rom, int address, int?force_playfield_info = null) : base(rom, address)
        {
            Name                 = name;
            LevelNum             = level_num;
            PlayfieldInfo        = new Playfield.Info(this, force_playfield_info ?? Rom206.PLAYFIELD_INFO_ADDRESS + this[0]);
            DefaultBonusTimerSec = this[1];
            LevelFlags           = this[4];
            DefaultBestTimeSec   = this[14];

            // read the BonusPyramidInfo pointer from the table in ROM
            int pyramid_addr = Rom.Word(Rom206.BONUS_PYRAMID_TABLE_ADDRESS + (level_num - 1) * 2);

            BonusPyramid = (pyramid_addr > 0) ? new BonusPyramid.Info(this, pyramid_addr) : null;
        }
Ejemplo n.º 5
0
        public LevelCollection()
        {
            Rom206.TryLoad(out Rom);
            if (Rom == null)
            {
                return;
            }

            for (int n = 0; n < DEFAULT_NUMBER_OF_LEVELS; n++)
            {
                // read the LevelInfo pointer from the table in ROM
                int address = Rom.Word(Rom206.LEVEL_TABLE_ADDRESS + n * 2);

                // create a level at this address
                Level level = new Level($"Level {n + 1} @ 0x{address.ToString("X4")}", n + 1, Rom, address);

                // and add to our collection
                List.Add(level);
            }

            // add the unused levels from the rom
            List.Add(new Level($"Unused playfield @ 0x5323", -1, Rom, 0x56C2, 0x5323));
            List.Add(new Level($"Unused playfield @ 0x5378", -1, Rom, 0x56C2, 0x5378));
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new playfield tile from data in 136029-206
 /// </summary>
 /// <param name="rom">instance of ROM 136029-206</param>
 /// <param name="table_offset">offset into ROM tile table, must be a multiple of two</param>
 public Tile(Rom206 rom, int table_offset) : base(rom, Rom206.PLAYFIELD_TILE_TABLE + table_offset)
 {
 }