1. Nick Massey
  2. Emu-o-Tron

Commits

Nick Massey  committed 6b02c91

Clean up Attribute Table LUT.

  • Participants
  • Parent commits 896ba78
  • Branches default

Comments (0)

Files changed (1)

File DirectXEmu/EmuoTron/PPU.cs

View file
  • Ignore whitespace
                         else if (shiftCount == 2)
                         {
                             int addrTableLookup = AttrTableLookup[tileAddress & 0x3FF];
-                            paletteLatcher = (PPURead(((tileAddress & 0x3C00) + 0x3C0) + (addrTableLookup & 0xFF), AccessType.attrTable) >> (addrTableLookup >> 12)) & 0x3;
+                            paletteLatcher = (PPURead(((tileAddress & 0x3C00) + 0x3C0) + (addrTableLookup & 0x3F), AccessType.attrTable) >> ((addrTableLookup >> 5) & 6)) & 0x3;
                         }
                         else if (shiftCount == 4)
                         {
                         int tileAddr = nameTableOffset + ((line / 8) * 32) + tile;
                         int tileNumber = PPUMemory[tileAddr];
                         int addrTableLookup = AttrTableLookup[tileAddr & 0x3FF];
-                        int palette = (PPUMemory[((tileAddr & 0x3C00) + 0x3C0) + (addrTableLookup & 0xFF)] >> (addrTableLookup >> 12)) & 0x03;
+                        int palette = (PPUMemory[((tileAddr & 0x3C00) + 0x3C0) + (addrTableLookup & 0x3F)] >> ((addrTableLookup >> 5) & 6)) & 0x03;
                         int chrAddress = backgroundTable | (tileNumber << 4) | ((line % 8) & 7);
                         byte lowChr = PPUMemory[chrAddress];
                         byte highChr = PPUMemory[chrAddress | 8];
             for (int i = 0; i < 256; i++)
                 secondaryOAM[i] = reader.ReadByte();
         }
-        private int[] vertFlipTable = { 7, 5, 3, 1, -1, -3, -5, -7};
-        private ushort[] AttrTableLookup = 
-          { 0x0000, 0x0000, 0x2000, 0x2000, 0x0001, 0x0001, 0x2001, 0x2001, 0x0002, 0x0002, 0x2002, 0x2002, 0x0003, 0x0003, 0x2003, 0x2003, 
-            0x0004, 0x0004, 0x2004, 0x2004, 0x0005, 0x0005, 0x2005, 0x2005, 0x0006, 0x0006, 0x2006, 0x2006, 0x0007, 0x0007, 0x2007, 0x2007, 
-            0x0000, 0x0000, 0x2000, 0x2000, 0x0001, 0x0001, 0x2001, 0x2001, 0x0002, 0x0002, 0x2002, 0x2002, 0x0003, 0x0003, 0x2003, 0x2003, 
-            0x0004, 0x0004, 0x2004, 0x2004, 0x0005, 0x0005, 0x2005, 0x2005, 0x0006, 0x0006, 0x2006, 0x2006, 0x0007, 0x0007, 0x2007, 0x2007, 
-            0x4000, 0x4000, 0x6000, 0x6000, 0x4001, 0x4001, 0x6001, 0x6001, 0x4002, 0x4002, 0x6002, 0x6002, 0x4003, 0x4003, 0x6003, 0x6003, 
-            0x4004, 0x4004, 0x6004, 0x6004, 0x4005, 0x4005, 0x6005, 0x6005, 0x4006, 0x4006, 0x6006, 0x6006, 0x4007, 0x4007, 0x6007, 0x6007, 
-            0x4000, 0x4000, 0x6000, 0x6000, 0x4001, 0x4001, 0x6001, 0x6001, 0x4002, 0x4002, 0x6002, 0x6002, 0x4003, 0x4003, 0x6003, 0x6003, 
-            0x4004, 0x4004, 0x6004, 0x6004, 0x4005, 0x4005, 0x6005, 0x6005, 0x4006, 0x4006, 0x6006, 0x6006, 0x4007, 0x4007, 0x6007, 0x6007, 
-            0x0008, 0x0008, 0x2008, 0x2008, 0x0009, 0x0009, 0x2009, 0x2009, 0x000A, 0x000A, 0x200A, 0x200A, 0x000B, 0x000B, 0x200B, 0x200B, 
-            0x000C, 0x000C, 0x200C, 0x200C, 0x000D, 0x000D, 0x200D, 0x200D, 0x000E, 0x000E, 0x200E, 0x200E, 0x000F, 0x000F, 0x200F, 0x200F, 
-            0x0008, 0x0008, 0x2008, 0x2008, 0x0009, 0x0009, 0x2009, 0x2009, 0x000A, 0x000A, 0x200A, 0x200A, 0x000B, 0x000B, 0x200B, 0x200B, 
-            0x000C, 0x000C, 0x200C, 0x200C, 0x000D, 0x000D, 0x200D, 0x200D, 0x000E, 0x000E, 0x200E, 0x200E, 0x000F, 0x000F, 0x200F, 0x200F, 
-            0x4008, 0x4008, 0x6008, 0x6008, 0x4009, 0x4009, 0x6009, 0x6009, 0x400A, 0x400A, 0x600A, 0x600A, 0x400B, 0x400B, 0x600B, 0x600B, 
-            0x400C, 0x400C, 0x600C, 0x600C, 0x400D, 0x400D, 0x600D, 0x600D, 0x400E, 0x400E, 0x600E, 0x600E, 0x400F, 0x400F, 0x600F, 0x600F, 
-            0x4008, 0x4008, 0x6008, 0x6008, 0x4009, 0x4009, 0x6009, 0x6009, 0x400A, 0x400A, 0x600A, 0x600A, 0x400B, 0x400B, 0x600B, 0x600B, 
-            0x400C, 0x400C, 0x600C, 0x600C, 0x400D, 0x400D, 0x600D, 0x600D, 0x400E, 0x400E, 0x600E, 0x600E, 0x400F, 0x400F, 0x600F, 0x600F, 
-            0x0010, 0x0010, 0x2010, 0x2010, 0x0011, 0x0011, 0x2011, 0x2011, 0x0012, 0x0012, 0x2012, 0x2012, 0x0013, 0x0013, 0x2013, 0x2013, 
-            0x0014, 0x0014, 0x2014, 0x2014, 0x0015, 0x0015, 0x2015, 0x2015, 0x0016, 0x0016, 0x2016, 0x2016, 0x0017, 0x0017, 0x2017, 0x2017, 
-            0x0010, 0x0010, 0x2010, 0x2010, 0x0011, 0x0011, 0x2011, 0x2011, 0x0012, 0x0012, 0x2012, 0x2012, 0x0013, 0x0013, 0x2013, 0x2013, 
-            0x0014, 0x0014, 0x2014, 0x2014, 0x0015, 0x0015, 0x2015, 0x2015, 0x0016, 0x0016, 0x2016, 0x2016, 0x0017, 0x0017, 0x2017, 0x2017, 
-            0x4010, 0x4010, 0x6010, 0x6010, 0x4011, 0x4011, 0x6011, 0x6011, 0x4012, 0x4012, 0x6012, 0x6012, 0x4013, 0x4013, 0x6013, 0x6013, 
-            0x4014, 0x4014, 0x6014, 0x6014, 0x4015, 0x4015, 0x6015, 0x6015, 0x4016, 0x4016, 0x6016, 0x6016, 0x4017, 0x4017, 0x6017, 0x6017, 
-            0x4010, 0x4010, 0x6010, 0x6010, 0x4011, 0x4011, 0x6011, 0x6011, 0x4012, 0x4012, 0x6012, 0x6012, 0x4013, 0x4013, 0x6013, 0x6013, 
-            0x4014, 0x4014, 0x6014, 0x6014, 0x4015, 0x4015, 0x6015, 0x6015, 0x4016, 0x4016, 0x6016, 0x6016, 0x4017, 0x4017, 0x6017, 0x6017, 
-            0x0018, 0x0018, 0x2018, 0x2018, 0x0019, 0x0019, 0x2019, 0x2019, 0x001A, 0x001A, 0x201A, 0x201A, 0x001B, 0x001B, 0x201B, 0x201B, 
-            0x001C, 0x001C, 0x201C, 0x201C, 0x001D, 0x001D, 0x201D, 0x201D, 0x001E, 0x001E, 0x201E, 0x201E, 0x001F, 0x001F, 0x201F, 0x201F, 
-            0x0018, 0x0018, 0x2018, 0x2018, 0x0019, 0x0019, 0x2019, 0x2019, 0x001A, 0x001A, 0x201A, 0x201A, 0x001B, 0x001B, 0x201B, 0x201B, 
-            0x001C, 0x001C, 0x201C, 0x201C, 0x001D, 0x001D, 0x201D, 0x201D, 0x001E, 0x001E, 0x201E, 0x201E, 0x001F, 0x001F, 0x201F, 0x201F, 
-            0x4018, 0x4018, 0x6018, 0x6018, 0x4019, 0x4019, 0x6019, 0x6019, 0x401A, 0x401A, 0x601A, 0x601A, 0x401B, 0x401B, 0x601B, 0x601B, 
-            0x401C, 0x401C, 0x601C, 0x601C, 0x401D, 0x401D, 0x601D, 0x601D, 0x401E, 0x401E, 0x601E, 0x601E, 0x401F, 0x401F, 0x601F, 0x601F, 
-            0x4018, 0x4018, 0x6018, 0x6018, 0x4019, 0x4019, 0x6019, 0x6019, 0x401A, 0x401A, 0x601A, 0x601A, 0x401B, 0x401B, 0x601B, 0x601B, 
-            0x401C, 0x401C, 0x601C, 0x601C, 0x401D, 0x401D, 0x601D, 0x601D, 0x401E, 0x401E, 0x601E, 0x601E, 0x401F, 0x401F, 0x601F, 0x601F, 
-            0x0020, 0x0020, 0x2020, 0x2020, 0x0021, 0x0021, 0x2021, 0x2021, 0x0022, 0x0022, 0x2022, 0x2022, 0x0023, 0x0023, 0x2023, 0x2023, 
-            0x0024, 0x0024, 0x2024, 0x2024, 0x0025, 0x0025, 0x2025, 0x2025, 0x0026, 0x0026, 0x2026, 0x2026, 0x0027, 0x0027, 0x2027, 0x2027, 
-            0x0020, 0x0020, 0x2020, 0x2020, 0x0021, 0x0021, 0x2021, 0x2021, 0x0022, 0x0022, 0x2022, 0x2022, 0x0023, 0x0023, 0x2023, 0x2023, 
-            0x0024, 0x0024, 0x2024, 0x2024, 0x0025, 0x0025, 0x2025, 0x2025, 0x0026, 0x0026, 0x2026, 0x2026, 0x0027, 0x0027, 0x2027, 0x2027, 
-            0x4020, 0x4020, 0x6020, 0x6020, 0x4021, 0x4021, 0x6021, 0x6021, 0x4022, 0x4022, 0x6022, 0x6022, 0x4023, 0x4023, 0x6023, 0x6023, 
-            0x4024, 0x4024, 0x6024, 0x6024, 0x4025, 0x4025, 0x6025, 0x6025, 0x4026, 0x4026, 0x6026, 0x6026, 0x4027, 0x4027, 0x6027, 0x6027, 
-            0x4020, 0x4020, 0x6020, 0x6020, 0x4021, 0x4021, 0x6021, 0x6021, 0x4022, 0x4022, 0x6022, 0x6022, 0x4023, 0x4023, 0x6023, 0x6023, 
-            0x4024, 0x4024, 0x6024, 0x6024, 0x4025, 0x4025, 0x6025, 0x6025, 0x4026, 0x4026, 0x6026, 0x6026, 0x4027, 0x4027, 0x6027, 0x6027, 
-            0x0028, 0x0028, 0x2028, 0x2028, 0x0029, 0x0029, 0x2029, 0x2029, 0x002A, 0x002A, 0x202A, 0x202A, 0x002B, 0x002B, 0x202B, 0x202B, 
-            0x002C, 0x002C, 0x202C, 0x202C, 0x002D, 0x002D, 0x202D, 0x202D, 0x002E, 0x002E, 0x202E, 0x202E, 0x002F, 0x002F, 0x202F, 0x202F, 
-            0x0028, 0x0028, 0x2028, 0x2028, 0x0029, 0x0029, 0x2029, 0x2029, 0x002A, 0x002A, 0x202A, 0x202A, 0x002B, 0x002B, 0x202B, 0x202B, 
-            0x002C, 0x002C, 0x202C, 0x202C, 0x002D, 0x002D, 0x202D, 0x202D, 0x002E, 0x002E, 0x202E, 0x202E, 0x002F, 0x002F, 0x202F, 0x202F, 
-            0x4028, 0x4028, 0x6028, 0x6028, 0x4029, 0x4029, 0x6029, 0x6029, 0x402A, 0x402A, 0x602A, 0x602A, 0x402B, 0x402B, 0x602B, 0x602B, 
-            0x402C, 0x402C, 0x602C, 0x602C, 0x402D, 0x402D, 0x602D, 0x602D, 0x402E, 0x402E, 0x602E, 0x602E, 0x402F, 0x402F, 0x602F, 0x602F, 
-            0x4028, 0x4028, 0x6028, 0x6028, 0x4029, 0x4029, 0x6029, 0x6029, 0x402A, 0x402A, 0x602A, 0x602A, 0x402B, 0x402B, 0x602B, 0x602B, 
-            0x402C, 0x402C, 0x602C, 0x602C, 0x402D, 0x402D, 0x602D, 0x602D, 0x402E, 0x402E, 0x602E, 0x602E, 0x402F, 0x402F, 0x602F, 0x602F, 
-            0x0030, 0x0030, 0x2030, 0x2030, 0x0031, 0x0031, 0x2031, 0x2031, 0x0032, 0x0032, 0x2032, 0x2032, 0x0033, 0x0033, 0x2033, 0x2033, 
-            0x0034, 0x0034, 0x2034, 0x2034, 0x0035, 0x0035, 0x2035, 0x2035, 0x0036, 0x0036, 0x2036, 0x2036, 0x0037, 0x0037, 0x2037, 0x2037, 
-            0x0030, 0x0030, 0x2030, 0x2030, 0x0031, 0x0031, 0x2031, 0x2031, 0x0032, 0x0032, 0x2032, 0x2032, 0x0033, 0x0033, 0x2033, 0x2033, 
-            0x0034, 0x0034, 0x2034, 0x2034, 0x0035, 0x0035, 0x2035, 0x2035, 0x0036, 0x0036, 0x2036, 0x2036, 0x0037, 0x0037, 0x2037, 0x2037, 
-            0x4030, 0x4030, 0x6030, 0x6030, 0x4031, 0x4031, 0x6031, 0x6031, 0x4032, 0x4032, 0x6032, 0x6032, 0x4033, 0x4033, 0x6033, 0x6033, 
-            0x4034, 0x4034, 0x6034, 0x6034, 0x4035, 0x4035, 0x6035, 0x6035, 0x4036, 0x4036, 0x6036, 0x6036, 0x4037, 0x4037, 0x6037, 0x6037, 
-            0x4030, 0x4030, 0x6030, 0x6030, 0x4031, 0x4031, 0x6031, 0x6031, 0x4032, 0x4032, 0x6032, 0x6032, 0x4033, 0x4033, 0x6033, 0x6033, 
-            0x4034, 0x4034, 0x6034, 0x6034, 0x4035, 0x4035, 0x6035, 0x6035, 0x4036, 0x4036, 0x6036, 0x6036, 0x4037, 0x4037, 0x6037, 0x6037, 
-            0x0038, 0x0038, 0x2038, 0x2038, 0x0039, 0x0039, 0x2039, 0x2039, 0x003A, 0x003A, 0x203A, 0x203A, 0x003B, 0x003B, 0x203B, 0x203B, 
-            0x003C, 0x003C, 0x203C, 0x203C, 0x003D, 0x003D, 0x203D, 0x203D, 0x003E, 0x003E, 0x203E, 0x203E, 0x003F, 0x003F, 0x203F, 0x203F, 
-            0x0038, 0x0038, 0x2038, 0x2038, 0x0039, 0x0039, 0x2039, 0x2039, 0x003A, 0x003A, 0x203A, 0x203A, 0x003B, 0x003B, 0x203B, 0x203B, 
-            0x003C, 0x003C, 0x203C, 0x203C, 0x003D, 0x003D, 0x203D, 0x203D, 0x003E, 0x003E, 0x203E, 0x203E, 0x003F, 0x003F, 0x203F, 0x203F, 
-            0x4038, 0x4038, 0x6038, 0x6038, 0x4039, 0x4039, 0x6039, 0x6039, 0x403A, 0x403A, 0x603A, 0x603A, 0x403B, 0x403B, 0x603B, 0x603B, 
-            0x403C, 0x403C, 0x603C, 0x603C, 0x403D, 0x403D, 0x603D, 0x603D, 0x403E, 0x403E, 0x603E, 0x603E, 0x403F, 0x403F, 0x603F, 0x603F, 
-            0x4038, 0x4038, 0x6038, 0x6038, 0x4039, 0x4039, 0x6039, 0x6039, 0x403A, 0x403A, 0x603A, 0x603A, 0x403B, 0x403B, 0x603B, 0x603B, 
-            0x403C, 0x403C, 0x603C, 0x603C, 0x403D, 0x403D, 0x603D, 0x603D, 0x403E, 0x403E, 0x603E, 0x603E, 0x403F, 0x403F, 0x603F, 0x603F };
+        private readonly int[] vertFlipTable = { 7, 5, 3, 1, -1, -3, -5, -7};
+
+        private readonly byte[] AttrTableLookup =
+            {
+                0x00, 0x00, 0x40, 0x40, 0x01, 0x01, 0x41, 0x41, 0x02, 0x02, 0x42, 0x42, 0x03, 0x03, 0x43, 0x43,
+                0x04, 0x04, 0x44, 0x44, 0x05, 0x05, 0x45, 0x45, 0x06, 0x06, 0x46, 0x46, 0x07, 0x07, 0x47, 0x47,
+                0x00, 0x00, 0x40, 0x40, 0x01, 0x01, 0x41, 0x41, 0x02, 0x02, 0x42, 0x42, 0x03, 0x03, 0x43, 0x43,
+                0x04, 0x04, 0x44, 0x44, 0x05, 0x05, 0x45, 0x45, 0x06, 0x06, 0x46, 0x46, 0x07, 0x07, 0x47, 0x47,
+                0x80, 0x80, 0xC0, 0xC0, 0x81, 0x81, 0xC1, 0xC1, 0x82, 0x82, 0xC2, 0xC2, 0x83, 0x83, 0xC3, 0xC3,
+                0x84, 0x84, 0xC4, 0xC4, 0x85, 0x85, 0xC5, 0xC5, 0x86, 0x86, 0xC6, 0xC6, 0x87, 0x87, 0xC7, 0xC7,
+                0x80, 0x80, 0xC0, 0xC0, 0x81, 0x81, 0xC1, 0xC1, 0x82, 0x82, 0xC2, 0xC2, 0x83, 0x83, 0xC3, 0xC3,
+                0x84, 0x84, 0xC4, 0xC4, 0x85, 0x85, 0xC5, 0xC5, 0x86, 0x86, 0xC6, 0xC6, 0x87, 0x87, 0xC7, 0xC7,
+                0x08, 0x08, 0x48, 0x48, 0x09, 0x09, 0x49, 0x49, 0x0A, 0x0A, 0x4A, 0x4A, 0x0B, 0x0B, 0x4B, 0x4B,
+                0x0C, 0x0C, 0x4C, 0x4C, 0x0D, 0x0D, 0x4D, 0x4D, 0x0E, 0x0E, 0x4E, 0x4E, 0x0F, 0x0F, 0x4F, 0x4F,
+                0x08, 0x08, 0x48, 0x48, 0x09, 0x09, 0x49, 0x49, 0x0A, 0x0A, 0x4A, 0x4A, 0x0B, 0x0B, 0x4B, 0x4B,
+                0x0C, 0x0C, 0x4C, 0x4C, 0x0D, 0x0D, 0x4D, 0x4D, 0x0E, 0x0E, 0x4E, 0x4E, 0x0F, 0x0F, 0x4F, 0x4F,
+                0x88, 0x88, 0xC8, 0xC8, 0x89, 0x89, 0xC9, 0xC9, 0x8A, 0x8A, 0xCA, 0xCA, 0x8B, 0x8B, 0xCB, 0xCB,
+                0x8C, 0x8C, 0xCC, 0xCC, 0x8D, 0x8D, 0xCD, 0xCD, 0x8E, 0x8E, 0xCE, 0xCE, 0x8F, 0x8F, 0xCF, 0xCF,
+                0x88, 0x88, 0xC8, 0xC8, 0x89, 0x89, 0xC9, 0xC9, 0x8A, 0x8A, 0xCA, 0xCA, 0x8B, 0x8B, 0xCB, 0xCB,
+                0x8C, 0x8C, 0xCC, 0xCC, 0x8D, 0x8D, 0xCD, 0xCD, 0x8E, 0x8E, 0xCE, 0xCE, 0x8F, 0x8F, 0xCF, 0xCF,
+                0x10, 0x10, 0x50, 0x50, 0x11, 0x11, 0x51, 0x51, 0x12, 0x12, 0x52, 0x52, 0x13, 0x13, 0x53, 0x53,
+                0x14, 0x14, 0x54, 0x54, 0x15, 0x15, 0x55, 0x55, 0x16, 0x16, 0x56, 0x56, 0x17, 0x17, 0x57, 0x57,
+                0x10, 0x10, 0x50, 0x50, 0x11, 0x11, 0x51, 0x51, 0x12, 0x12, 0x52, 0x52, 0x13, 0x13, 0x53, 0x53,
+                0x14, 0x14, 0x54, 0x54, 0x15, 0x15, 0x55, 0x55, 0x16, 0x16, 0x56, 0x56, 0x17, 0x17, 0x57, 0x57,
+                0x90, 0x90, 0xD0, 0xD0, 0x91, 0x91, 0xD1, 0xD1, 0x92, 0x92, 0xD2, 0xD2, 0x93, 0x93, 0xD3, 0xD3,
+                0x94, 0x94, 0xD4, 0xD4, 0x95, 0x95, 0xD5, 0xD5, 0x96, 0x96, 0xD6, 0xD6, 0x97, 0x97, 0xD7, 0xD7,
+                0x90, 0x90, 0xD0, 0xD0, 0x91, 0x91, 0xD1, 0xD1, 0x92, 0x92, 0xD2, 0xD2, 0x93, 0x93, 0xD3, 0xD3,
+                0x94, 0x94, 0xD4, 0xD4, 0x95, 0x95, 0xD5, 0xD5, 0x96, 0x96, 0xD6, 0xD6, 0x97, 0x97, 0xD7, 0xD7,
+                0x18, 0x18, 0x58, 0x58, 0x19, 0x19, 0x59, 0x59, 0x1A, 0x1A, 0x5A, 0x5A, 0x1B, 0x1B, 0x5B, 0x5B,
+                0x1C, 0x1C, 0x5C, 0x5C, 0x1D, 0x1D, 0x5D, 0x5D, 0x1E, 0x1E, 0x5E, 0x5E, 0x1F, 0x1F, 0x5F, 0x5F,
+                0x18, 0x18, 0x58, 0x58, 0x19, 0x19, 0x59, 0x59, 0x1A, 0x1A, 0x5A, 0x5A, 0x1B, 0x1B, 0x5B, 0x5B,
+                0x1C, 0x1C, 0x5C, 0x5C, 0x1D, 0x1D, 0x5D, 0x5D, 0x1E, 0x1E, 0x5E, 0x5E, 0x1F, 0x1F, 0x5F, 0x5F,
+                0x98, 0x98, 0xD8, 0xD8, 0x99, 0x99, 0xD9, 0xD9, 0x9A, 0x9A, 0xDA, 0xDA, 0x9B, 0x9B, 0xDB, 0xDB,
+                0x9C, 0x9C, 0xDC, 0xDC, 0x9D, 0x9D, 0xDD, 0xDD, 0x9E, 0x9E, 0xDE, 0xDE, 0x9F, 0x9F, 0xDF, 0xDF,
+                0x98, 0x98, 0xD8, 0xD8, 0x99, 0x99, 0xD9, 0xD9, 0x9A, 0x9A, 0xDA, 0xDA, 0x9B, 0x9B, 0xDB, 0xDB,
+                0x9C, 0x9C, 0xDC, 0xDC, 0x9D, 0x9D, 0xDD, 0xDD, 0x9E, 0x9E, 0xDE, 0xDE, 0x9F, 0x9F, 0xDF, 0xDF,
+                0x20, 0x20, 0x60, 0x60, 0x21, 0x21, 0x61, 0x61, 0x22, 0x22, 0x62, 0x62, 0x23, 0x23, 0x63, 0x63,
+                0x24, 0x24, 0x64, 0x64, 0x25, 0x25, 0x65, 0x65, 0x26, 0x26, 0x66, 0x66, 0x27, 0x27, 0x67, 0x67,
+                0x20, 0x20, 0x60, 0x60, 0x21, 0x21, 0x61, 0x61, 0x22, 0x22, 0x62, 0x62, 0x23, 0x23, 0x63, 0x63,
+                0x24, 0x24, 0x64, 0x64, 0x25, 0x25, 0x65, 0x65, 0x26, 0x26, 0x66, 0x66, 0x27, 0x27, 0x67, 0x67,
+                0xA0, 0xA0, 0xE0, 0xE0, 0xA1, 0xA1, 0xE1, 0xE1, 0xA2, 0xA2, 0xE2, 0xE2, 0xA3, 0xA3, 0xE3, 0xE3,
+                0xA4, 0xA4, 0xE4, 0xE4, 0xA5, 0xA5, 0xE5, 0xE5, 0xA6, 0xA6, 0xE6, 0xE6, 0xA7, 0xA7, 0xE7, 0xE7,
+                0xA0, 0xA0, 0xE0, 0xE0, 0xA1, 0xA1, 0xE1, 0xE1, 0xA2, 0xA2, 0xE2, 0xE2, 0xA3, 0xA3, 0xE3, 0xE3,
+                0xA4, 0xA4, 0xE4, 0xE4, 0xA5, 0xA5, 0xE5, 0xE5, 0xA6, 0xA6, 0xE6, 0xE6, 0xA7, 0xA7, 0xE7, 0xE7,
+                0x28, 0x28, 0x68, 0x68, 0x29, 0x29, 0x69, 0x69, 0x2A, 0x2A, 0x6A, 0x6A, 0x2B, 0x2B, 0x6B, 0x6B,
+                0x2C, 0x2C, 0x6C, 0x6C, 0x2D, 0x2D, 0x6D, 0x6D, 0x2E, 0x2E, 0x6E, 0x6E, 0x2F, 0x2F, 0x6F, 0x6F,
+                0x28, 0x28, 0x68, 0x68, 0x29, 0x29, 0x69, 0x69, 0x2A, 0x2A, 0x6A, 0x6A, 0x2B, 0x2B, 0x6B, 0x6B,
+                0x2C, 0x2C, 0x6C, 0x6C, 0x2D, 0x2D, 0x6D, 0x6D, 0x2E, 0x2E, 0x6E, 0x6E, 0x2F, 0x2F, 0x6F, 0x6F,
+                0xA8, 0xA8, 0xE8, 0xE8, 0xA9, 0xA9, 0xE9, 0xE9, 0xAA, 0xAA, 0xEA, 0xEA, 0xAB, 0xAB, 0xEB, 0xEB,
+                0xAC, 0xAC, 0xEC, 0xEC, 0xAD, 0xAD, 0xED, 0xED, 0xAE, 0xAE, 0xEE, 0xEE, 0xAF, 0xAF, 0xEF, 0xEF,
+                0xA8, 0xA8, 0xE8, 0xE8, 0xA9, 0xA9, 0xE9, 0xE9, 0xAA, 0xAA, 0xEA, 0xEA, 0xAB, 0xAB, 0xEB, 0xEB,
+                0xAC, 0xAC, 0xEC, 0xEC, 0xAD, 0xAD, 0xED, 0xED, 0xAE, 0xAE, 0xEE, 0xEE, 0xAF, 0xAF, 0xEF, 0xEF,
+                0x30, 0x30, 0x70, 0x70, 0x31, 0x31, 0x71, 0x71, 0x32, 0x32, 0x72, 0x72, 0x33, 0x33, 0x73, 0x73,
+                0x34, 0x34, 0x74, 0x74, 0x35, 0x35, 0x75, 0x75, 0x36, 0x36, 0x76, 0x76, 0x37, 0x37, 0x77, 0x77,
+                0x30, 0x30, 0x70, 0x70, 0x31, 0x31, 0x71, 0x71, 0x32, 0x32, 0x72, 0x72, 0x33, 0x33, 0x73, 0x73,
+                0x34, 0x34, 0x74, 0x74, 0x35, 0x35, 0x75, 0x75, 0x36, 0x36, 0x76, 0x76, 0x37, 0x37, 0x77, 0x77,
+                0xB0, 0xB0, 0xF0, 0xF0, 0xB1, 0xB1, 0xF1, 0xF1, 0xB2, 0xB2, 0xF2, 0xF2, 0xB3, 0xB3, 0xF3, 0xF3,
+                0xB4, 0xB4, 0xF4, 0xF4, 0xB5, 0xB5, 0xF5, 0xF5, 0xB6, 0xB6, 0xF6, 0xF6, 0xB7, 0xB7, 0xF7, 0xF7,
+                0xB0, 0xB0, 0xF0, 0xF0, 0xB1, 0xB1, 0xF1, 0xF1, 0xB2, 0xB2, 0xF2, 0xF2, 0xB3, 0xB3, 0xF3, 0xF3,
+                0xB4, 0xB4, 0xF4, 0xF4, 0xB5, 0xB5, 0xF5, 0xF5, 0xB6, 0xB6, 0xF6, 0xF6, 0xB7, 0xB7, 0xF7, 0xF7,
+                0x38, 0x38, 0x78, 0x78, 0x39, 0x39, 0x79, 0x79, 0x3A, 0x3A, 0x7A, 0x7A, 0x3B, 0x3B, 0x7B, 0x7B,
+                0x3C, 0x3C, 0x7C, 0x7C, 0x3D, 0x3D, 0x7D, 0x7D, 0x3E, 0x3E, 0x7E, 0x7E, 0x3F, 0x3F, 0x7F, 0x7F,
+                0x38, 0x38, 0x78, 0x78, 0x39, 0x39, 0x79, 0x79, 0x3A, 0x3A, 0x7A, 0x7A, 0x3B, 0x3B, 0x7B, 0x7B,
+                0x3C, 0x3C, 0x7C, 0x7C, 0x3D, 0x3D, 0x7D, 0x7D, 0x3E, 0x3E, 0x7E, 0x7E, 0x3F, 0x3F, 0x7F, 0x7F,
+                0xB8, 0xB8, 0xF8, 0xF8, 0xB9, 0xB9, 0xF9, 0xF9, 0xBA, 0xBA, 0xFA, 0xFA, 0xBB, 0xBB, 0xFB, 0xFB,
+                0xBC, 0xBC, 0xFC, 0xFC, 0xBD, 0xBD, 0xFD, 0xFD, 0xBE, 0xBE, 0xFE, 0xFE, 0xBF, 0xBF, 0xFF, 0xFF,
+                0xB8, 0xB8, 0xF8, 0xF8, 0xB9, 0xB9, 0xF9, 0xF9, 0xBA, 0xBA, 0xFA, 0xFA, 0xBB, 0xBB, 0xFB, 0xFB,
+                0xBC, 0xBC, 0xFC, 0xFC, 0xBD, 0xBD, 0xFD, 0xFD, 0xBE, 0xBE, 0xFE, 0xFE, 0xBF, 0xBF, 0xFF, 0xFF
+            };
 
         public uint[] colorChart = {
                             0xFF666666, 0xFF002A88, 0xFF1412A7, 0xFF3B00A4, 0xFF5C007E, 0xFF6E0040, 0xFF6C0700, 0xFF561D00,