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]; }
public Sprite(PPU self_) { self = self_; for (int i = 0; i < list.Length; i++) { list[i] = new SpriteItem(); } }
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); }
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)); } } }
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); } } } } }
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)); } } } } }
public Background(PPU self_, uint id_) { self = self_; id = id_; }
public Window(PPU self_) { self = self_; }