Esempio n. 1
0
 public Cache(PPU self)
 {
     tiledata[0] = new byte[262144];
     tiledata[1] = new byte[131072];
     tiledata[2] = new byte[65536];
     tilevalid[0] = new byte[4096];
     tilevalid[1] = new byte[2048];
     tilevalid[2] = new byte[1024];
 }
Esempio n. 2
0
            public Sprite(PPU self_)
            {
                self = self_;

                for (int i = 0; i < list.Length; i++)
                {
                    list[i] = new SpriteItem();
                }
            }
Esempio n. 3
0
            public Sprite(PPU self)
            {
                this.self = self;
                priority0_enable = true;
                priority1_enable = true;
                priority2_enable = true;
                priority3_enable = true;

                Utility.InstantiateArrayElements(list);
                Utility.InstantiateArrayElements(tilelist);
            }
Esempio n. 4
0
            public Background(PPU self, uint id)
            {
                this.self = self;
                this.id = id;

                priority0_enable = true;
                priority1_enable = true;

                opt_valid_bit = (uint)(id == (uint)ID.BG1 ? 0x2000 : id == (uint)ID.BG2 ? 0x4000 : 0x0000);

                mosaic_table = new ushort[16][];
                for (uint m = 0; m < 16; m++)
                {
                    mosaic_table[m] = new ushort[4096];
                    for (uint x = 0; x < 4096; x++)
                    {
                        mosaic_table[m][x] = (ushort)((x / (m + 1)) * (m + 1));
                    }
                }
            }
Esempio n. 5
0
 public Screen(PPU self_)
 {
     self = self_;
     for (uint l = 0; l < 16; l++)
     {
         for (uint r = 0; r < 32; r++)
         {
             for (uint g = 0; g < 32; g++)
             {
                 for (uint b = 0; b < 32; b++)
                 {
                     double luma = (double)l / 15.0;
                     uint ar = (uint)(luma * r + 0.5);
                     uint ag = (uint)(luma * g + 0.5);
                     uint ab = (uint)(luma * b + 0.5);
                     light_table[l, (r << 10) + (g << 5) + b] = (ushort)((ab << 10) + (ag << 5) + ar);
                 }
             }
         }
     }
 }
Esempio n. 6
0
            public Screen(PPU self)
            {
                this.self = self;

                light_table = new ushort[16][];
                for (uint l = 0; l < 16; l++)
                {
                    light_table[l] = new ushort[32768];
                    for (uint r = 0; r < 32; r++)
                    {
                        for (uint g = 0; g < 32; g++)
                        {
                            for (uint b = 0; b < 32; b++)
                            {
                                double luma = (double)l / 15.0;
                                uint ar = (uint)(luma * r + 0.5);
                                uint ag = (uint)(luma * g + 0.5);
                                uint ab = (uint)(luma * b + 0.5);
                                light_table[l][(r << 10) + (g << 5) + (b << 0)] = (ushort)((ab << 10) + (ag << 5) + (ar << 0));
                            }
                        }
                    }
                }
            }
Esempio n. 7
0
 public Background(PPU self_, uint id_)
 {
     self = self_;
     id = id_;
 }
Esempio n. 8
0
 public Window(PPU self_)
 {
     self = self_;
 }