public static Picture PaletteTable() { Picture bitmap = new Picture(TempPaletteTable); if (NES_PPU_Register.PPUCTRL.V) { bitmap.FillRectangle(NES_PPU_Palette.UniversalBackgroundColor(), 0, 0, bitmap.Size.Width, bitmap.Size.Height); int k = 0; for (ushort i = 0; i < 2; i++) { int o = 0; for (ushort j = 0; j < 4; j++) { var color = NES_PPU_Palette.getPalette(k++); for (int h = 0; h < 4; h++) { if (color.color[h] == Color.Transparent) { bitmap.FillRectangle(NES_PPU_Palette.UniversalBackgroundColor(), o * 20, i * 20, ++o * 20, (i + 1) * 20); } else { bitmap.FillRectangle(color.color[h], o * 20, i * 20, ++o * 20, (i + 1) * 20); } } } } for (ushort i = 0; i < 2; i++) { int o = 0; for (ushort j = 0; j < 4; j++) { for (int h = 0; h < 4; h++) { bitmap.DrawInfoRectangle(Color.Black, o * 20, i * 20, ++o * 20, (i + 1) * 20); } } } TempPaletteTable = bitmap; } return(bitmap); }
public static Color getUniversalBackgroundColor() { return(NES_PPU_Palette.UniversalBackgroundColor()); }