Example #1
0
File: Main.cs Project: mrmikey/nes
 public static void Main(string[] args)
 {
     Engine e = new Engine("Balloon Fight.nes");
     e.Run();
     //Graphics g = new Graphics(256, 240);
     //Console.Read();
     //while (true);
 }
Example #2
0
File: PPU.cs Project: mrmikey/nes
        public PPU(Engine engine)
        {
            this.Engine = engine;
            this.dumpSprite = new SpriteDumpFunc(dumpSpriteSmall);
            // Attribute Lookup Tables
             	for (int i = 0; i != 0x400; ++i)
            {
                AttributeShiftTable[i] = (byte)(((i >> 4) & 0x04) | (i & 0x02));
                AttributeLocationTable[i] = (byte)(((i >> 4) & 0x38) | ((i >> 2))  & 7);
               }

            // Setup nametables
            Nametables.SetupNametables(this.Mirroring);
        }
Example #3
0
        public Graphics(Engine engine, int width, int height)
        {
            Engine = engine;
            Width = width;
            Height = height;
            //Screen = new int[Width * Height];
            BGBuffer =  new int[(Width)*(Height)];
            SprHighBuffer = new int[(Width)*(Height)];
            SprLowBuffer = new int[(Width)*(Height)];
            // Debug
            /*int offset = width * (height/2);
            for (int x = 0; x < width; x++)
                Screen[offset + x] = Color.Blue.ToArgb();*/

            Initialise(1);

            Render();
        }
Example #4
0
File: Stack.cs Project: mrmikey/nes
 public Stack(Engine engine)
 {
     this.Engine = engine;
 }
Example #5
0
 public IORegisters(Engine engine, PPU ppu)
 {
     this.Engine = engine;
     this.PPU = ppu;
     this.PPUFlags = this.PPU.Flags;
 }
Example #6
0
File: APU.cs Project: mrmikey/nes
 public APU(Engine engine)
 {
     Engine = engine;
 }
Example #7
0
 public Cartridge(Engine engine, int prg, int chr, int ram)
 {
     this.Engine = engine;
     PRGROMBanks = new byte[prg][];
     CHRBanks = new byte[chr][];
 }
Example #8
0
File: CPU.cs Project: mrmikey/nes
 public CPU(Engine engine)
 {
     this.Engine = engine;
     this.Stack = new Stack(this.Engine);
 }