summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-01 20:12:56 +1100
committerskidau <skidau@gmail.com>2013-03-01 20:12:56 +1100
commit73da6f4f3f721458072c2ff4b70823f37270ca2f (patch)
tree9b9d2fd409df2c7eff0c6af66ad44b010a28daf4 /Source/Core/VideoCommon
parent7a04ec6f9220dd66147c86baaebc2f9e05d65ead (diff)
parent99cf57eb393e61bc0a9072a6e4f4f21c57daea9d (diff)
Merge branch 'master' into FIFO-BP
# By Jordan Woyak (46) and others # Via Jordan Woyak (2) and others * master: (70 commits) Fixes two memory leaks, one is pretty bad for OSX. Yell at pauldachz if this doesn't work. Or... say thanks. Added a BluetoothEnumerateInstalledServices call so that the wiimote remembers the pairing. Make ARMJit core default CPU core on ARM architecture Fix a StringUtil regression from the arm-noglsl merge Small improvement to cmpli/cmpi in ARMJit. Merge latest ArmEmitter changes from ppsspp while we're at it. Ah. I blame vim on this typo entirely. Add disabled code for authenticating wiimotes on Windows. Add the missing FPR cache Buildfix. Yell at the user if they change window size while dumping frames, and some other avi dumping stuff. Not sure if this is the right way to handle this, but it makes the save states perfectly stable. That's all that really matters, right? Abort loading states from incompatible graphics backends. ARM Support without GLSL Improve VideoSoftware save states. They are fairly stable, but not perfect. OpcodeDecoder::DoState() needs to be fixed. Begin implementing save states to video software. Kind of works, sometimes. Make error message for loading save state with wrong dsp engine shorter. Abort load state if it uses a different dsp engine, instead of crashing. Update the gameini of F-zero. Efb to Ram is no longer the default choice. fix last commit by neobrain ... Conflicts: Source/Core/VideoCommon/Src/Fifo.cpp
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/CMakeLists.txt10
-rw-r--r--Source/Core/VideoCommon/Src/AVIDump.cpp20
-rw-r--r--Source/Core/VideoCommon/Src/AVIDump.h6
-rw-r--r--Source/Core/VideoCommon/Src/EmuWindow.cpp4
-rw-r--r--Source/Core/VideoCommon/Src/Fifo.cpp10
-rw-r--r--Source/Core/VideoCommon/Src/GenericDLCache.cpp52
-rw-r--r--Source/Core/VideoCommon/Src/GenericTextureDecoder.cpp2182
-rw-r--r--Source/Core/VideoCommon/Src/MainBase.cpp5
-rw-r--r--Source/Core/VideoCommon/Src/RenderBase.cpp5
-rw-r--r--Source/Core/VideoCommon/Src/RenderBase.h2
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp21
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.cpp18
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.h7
-rw-r--r--Source/Core/VideoCommon/Src/x64DLCache.cpp (renamed from Source/Core/VideoCommon/Src/DLCache.cpp)2
-rw-r--r--Source/Core/VideoCommon/Src/x64TextureDecoder.cpp (renamed from Source/Core/VideoCommon/Src/TextureDecoder.cpp)93
-rw-r--r--Source/Core/VideoCommon/VideoCommon.vcxproj10
-rw-r--r--Source/Core/VideoCommon/VideoCommon.vcxproj.filters12
17 files changed, 2323 insertions, 136 deletions
diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt
index 6ed8e29c6b..cba3666399 100644
--- a/Source/Core/VideoCommon/CMakeLists.txt
+++ b/Source/Core/VideoCommon/CMakeLists.txt
@@ -3,7 +3,6 @@ set(SRCS Src/BPFunctions.cpp
Src/BPStructs.cpp
Src/CPMemory.cpp
Src/CommandProcessor.cpp
- Src/DLCache.cpp
Src/Debugger.cpp
Src/Fifo.cpp
Src/FPSCounter.cpp
@@ -24,7 +23,6 @@ set(SRCS Src/BPFunctions.cpp
Src/Statistics.cpp
Src/TextureCacheBase.cpp
Src/TextureConversionShader.cpp
- Src/TextureDecoder.cpp
Src/VertexLoader.cpp
Src/VertexLoaderManager.cpp
Src/VertexLoader_Color.cpp
@@ -41,6 +39,14 @@ set(SRCS Src/BPFunctions.cpp
Src/memcpy_amd.cpp)
set(LIBS core)
+
+if(NOT _M_GENERIC)
+ set(SRCS ${SRCS} Src/x64TextureDecoder.cpp
+ Src/x64DLCache.cpp)
+else()
+ set(SRCS ${SRCS} Src/GenericTextureDecoder.cpp
+ Src/GenericDLCache.cpp)
+endif()
if(NOT ${CL} STREQUAL CL-NOTFOUND)
list(APPEND LIBS ${CL})
endif()
diff --git a/Source/Core/VideoCommon/Src/AVIDump.cpp b/Source/Core/VideoCommon/Src/AVIDump.cpp
index c172903b5d..fefb09fecb 100644
--- a/Source/Core/VideoCommon/Src/AVIDump.cpp
+++ b/Source/Core/VideoCommon/Src/AVIDump.cpp
@@ -157,9 +157,21 @@ void AVIDump::Stop()
NOTICE_LOG(VIDEO, "Stop");
}
-void AVIDump::AddFrame(char *data)
+void AVIDump::AddFrame(const u8* data, int w, int h)
{
- AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, (LPVOID) data, m_bitmap.biSizeImage, AVIIF_KEYFRAME, NULL, &m_byteBuffer);
+ static bool shown_error = false;
+ if ((w != m_bitmap.biWidth || h != m_bitmap.biHeight) && !shown_error)
+ {
+ PanicAlert("You have resized the window while dumping frames.\n"
+ "Nothing sane can be done to handle this.\n"
+ "Your video will likely be broken.");
+ shown_error = true;
+
+ m_bitmap.biWidth = w;
+ m_bitmap.biHeight = h;
+ }
+
+ AVIStreamWrite(m_streamCompressed, ++m_frameCount, 1, const_cast<u8*>(data), m_bitmap.biSizeImage, AVIIF_KEYFRAME, NULL, &m_byteBuffer);
m_totalBytes += m_byteBuffer;
// Close the recording if the file is more than 2gb
// VfW can't properly save files over 2gb in size, but can keep writing to them up to 4gb.
@@ -298,9 +310,9 @@ bool AVIDump::CreateFile()
return true;
}
-void AVIDump::AddFrame(uint8_t *data, int width, int height)
+void AVIDump::AddFrame(const u8* data, int width, int height)
{
- avpicture_fill((AVPicture *)s_BGRFrame, data, PIX_FMT_BGR24, width, height);
+ avpicture_fill((AVPicture *)s_BGRFrame, const_cast<u8*>(data), PIX_FMT_BGR24, width, height);
// Convert image from BGR24 to desired pixel format, and scale to initial
// width and height
diff --git a/Source/Core/VideoCommon/Src/AVIDump.h b/Source/Core/VideoCommon/Src/AVIDump.h
index e74df05db4..08ab6be254 100644
--- a/Source/Core/VideoCommon/Src/AVIDump.h
+++ b/Source/Core/VideoCommon/Src/AVIDump.h
@@ -24,6 +24,8 @@
#include <stdint.h>
#endif
+#include "CommonTypes.h"
+
class AVIDump
{
private:
@@ -36,11 +38,11 @@ class AVIDump
public:
#ifdef _WIN32
static bool Start(HWND hWnd, int w, int h);
- static void AddFrame(char *data);
#else
static bool Start(int w, int h);
- static void AddFrame(uint8_t *data, int width, int height);
#endif
+ static void AddFrame(const u8* data, int width, int height);
+
static void Stop();
};
diff --git a/Source/Core/VideoCommon/Src/EmuWindow.cpp b/Source/Core/VideoCommon/Src/EmuWindow.cpp
index cbb0bc31ac..81227ba0ca 100644
--- a/Source/Core/VideoCommon/Src/EmuWindow.cpp
+++ b/Source/Core/VideoCommon/Src/EmuWindow.cpp
@@ -205,10 +205,6 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
OnKeyDown(lParam);
FreeLookInput((u32)wParam, lParam);
}
- else if (wParam == WIIMOTE_DISCONNECT)
- {
- PostMessage(m_hParent, WM_USER, wParam, lParam);
- }
break;
// Called when a screensaver wants to show up while this window is active
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp
index 1c4ddb9d5e..93decf7ce3 100644
--- a/Source/Core/VideoCommon/Src/Fifo.cpp
+++ b/Source/Core/VideoCommon/Src/Fifo.cpp
@@ -235,11 +235,11 @@ void RunGpu()
{
u8 *uData = Memory::GetPointer(fifo.CPReadPointer);
- SaveSSEState();
- LoadDefaultSSEState();
- ReadDataFromFifo(uData, 32);
- u32 count = OpcodeDecoder_Run(g_bSkipCurrentFrame);
- LoadSSEState();
+ FPURoundMode::SaveSIMDState();
+ FPURoundMode::LoadDefaultSIMDState();
+ ReadDataFromFifo(uData, 32);
+ u32 count = OpcodeDecoder_Run(g_bSkipCurrentFrame);
+ FPURoundMode::LoadSIMDState();
//DEBUG_LOG(COMMANDPROCESSOR, "Fifo wraps to base");
diff --git a/Source/Core/VideoCommon/Src/GenericDLCache.cpp b/Source/Core/VideoCommon/Src/GenericDLCache.cpp
new file mode 100644
index 0000000000..5e27deb469
--- /dev/null
+++ b/Source/Core/VideoCommon/Src/GenericDLCache.cpp
@@ -0,0 +1,52 @@
+// Copyright (C) 2003-2009 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+// TODO: Handle cache-is-full condition :p
+
+
+#include "Common.h"
+#include "DLCache.h"
+
+namespace DLCache
+{
+
+void Init()
+{
+}
+
+void Shutdown()
+{
+}
+
+void Clear()
+{
+}
+
+void ProgressiveCleanup()
+{
+}
+} // namespace
+
+// NOTE - outside the namespace on purpose.
+bool HandleDisplayList(u32 address, u32 size)
+{
+ return false;
+}
+
+void IncrementCheckContextId()
+{
+}
diff --git a/Source/Core/VideoCommon/Src/GenericTextureDecoder.cpp b/Source/Core/VideoCommon/Src/GenericTextureDecoder.cpp
new file mode 100644
index 0000000000..ad7cfeebf9
--- /dev/null
+++ b/Source/Core/VideoCommon/Src/GenericTextureDecoder.cpp
@@ -0,0 +1,2182 @@
+// Copyright (C) 2003 Dolphin Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official SVN repository and contact information can be found at
+// http://code.google.com/p/dolphin-emu/
+
+#include "Common.h"
+//#include "VideoCommon.h" // to get debug logs
+
+#include "CPUDetect.h"
+#include "TextureDecoder.h"
+#include "OpenCL.h"
+#include "OpenCL/OCLTextureDecoder.h"
+#include "VideoConfig.h"
+
+#include "LookUpTables.h"
+
+#include <cmath>
+
+
+
+bool TexFmt_Overlay_Enable=false;
+bool TexFmt_Overlay_Center=false;
+
+extern const char* texfmt[];
+extern const unsigned char sfont_map[];
+extern const unsigned char sfont_raw[][9*10];
+
+// TRAM
+// STATE_TO_SAVE
+ GC_ALIGNED16(u8 texMem[TMEM_SIZE]);
+
+
+// Gamecube/Wii texture decoder
+
+// Decodes all known Gamecube/Wii texture formats.
+// by ector
+
+int TexDecoder_GetTexelSizeInNibbles(int format)
+{
+ switch (format & 0x3f) {
+ case GX_TF_I4: return 1;
+ case GX_TF_I8: return 2;
+ case GX_TF_IA4: return 2;
+ case GX_TF_IA8: return 4;
+ case GX_TF_RGB565: return 4;
+ case GX_TF_RGB5A3: return 4;
+ case GX_TF_RGBA8: return 8;
+ case GX_TF_C4: return 1;
+ case GX_TF_C8: return 2;
+ case GX_TF_C14X2: return 4;
+ case GX_TF_CMPR: return 1;
+ case GX_CTF_R4: return 1;
+ case GX_CTF_RA4: return 2;
+ case GX_CTF_RA8: return 4;
+ case GX_CTF_YUVA8: return 8;
+ case GX_CTF_A8: return 2;
+ case GX_CTF_R8: return 2;
+ case GX_CTF_G8: return 2;
+ case GX_CTF_B8: return 2;
+ case GX_CTF_RG8: return 4;
+ case GX_CTF_GB8: return 4;
+
+ case GX_TF_Z8: return 2;
+ case GX_TF_Z16: return 4;
+ case GX_TF_Z24X8: return 8;
+
+ case GX_CTF_Z4: return 1;
+ case GX_CTF_Z8M: return 2;
+ case GX_CTF_Z8L: return 2;
+ case GX_CTF_Z16L: return 4;
+ default: return 1;
+ }
+}
+
+int TexDecoder_GetTextureSizeInBytes(int width, int height, int format)
+{
+ return (width * height * TexDecoder_GetTexelSizeInNibbles(format)) / 2;
+}
+
+int TexDecoder_GetBlockWidthInTexels(u32 format)
+{
+ switch (format)
+ {
+ case GX_TF_I4: return 8;
+ case GX_TF_I8: return 8;
+ case GX_TF_IA4: return 8;
+ case GX_TF_IA8: return 4;
+ case GX_TF_RGB565: return 4;
+ case GX_TF_RGB5A3: return 4;
+ case GX_TF_RGBA8: return 4;
+ case GX_TF_C4: return 8;
+ case GX_TF_C8: return 8;
+ case GX_TF_C14X2: return 4;
+ case GX_TF_CMPR: return 8;
+ case GX_CTF_R4: return 8;
+ case GX_CTF_RA4: return 8;
+ case GX_CTF_RA8: return 4;
+ case GX_CTF_A8: return 8;
+ case GX_CTF_R8: return 8;
+ case GX_CTF_G8: return 8;
+ case GX_CTF_B8: return 8;
+ case GX_CTF_RG8: return 4;
+ case GX_CTF_GB8: return 4;
+ case GX_TF_Z8: return 8;
+ case GX_TF_Z16: return 4;
+ case GX_TF_Z24X8: return 4;
+ case GX_CTF_Z4: return 8;
+ case GX_CTF_Z8M: return 8;
+ case GX_CTF_Z8L: return 8;
+ case GX_CTF_Z16L: return 4;
+ default:
+ ERROR_LOG(VIDEO, "Unsupported Texture Format (%08x)! (GetBlockWidthInTexels)", format);
+ return 8;
+ }
+}
+
+int TexDecoder_GetBlockHeightInTexels(u32 format)
+{
+ switch (format)
+ {
+ case GX_TF_I4: return 8;
+ case GX_TF_I8: return 4;
+ case GX_TF_IA4: return 4;
+ case GX_TF_IA8: return 4;
+ case GX_TF_RGB565: return 4;
+ case GX_TF_RGB5A3: return 4;
+ case GX_TF_RGBA8: return 4;
+ case GX_TF_C4: return 8;
+ case GX_TF_C8: return 4;
+ case GX_TF_C14X2: return 4;
+ case GX_TF_CMPR: return 8;
+ case GX_CTF_R4: return 8;
+ case GX_CTF_RA4: return 4;
+ case GX_CTF_RA8: return 4;
+ case GX_CTF_A8: return 4;
+ case GX_CTF_R8: return 4;
+ case GX_CTF_G8: return 4;
+ case GX_CTF_B8: return 4;
+ case GX_CTF_RG8: return 4;
+ case GX_CTF_GB8: return 4;
+ case GX_TF_Z8: return 4;
+ case GX_TF_Z16: return 4;
+ case GX_TF_Z24X8: return 4;
+ case GX_CTF_Z4: return 8;
+ case GX_CTF_Z8M: return 4;
+ case GX_CTF_Z8L: return 4;
+ case GX_CTF_Z16L: return 4;
+ default:
+ ERROR_LOG(VIDEO, "Unsupported Texture Format (%08x)! (GetBlockHeightInTexels)", format);
+ return 4;
+ }
+}
+
+//returns bytes
+int TexDecoder_GetPaletteSize(int format)
+{
+ switch (format)
+ {
+ case GX_TF_C4: return 16 * 2;
+ case GX_TF_C8: return 256 * 2;
+ case GX_TF_C14X2: return 16384 * 2;
+ default:
+ return 0;
+ }
+}
+
+static inline u32 decodeIA8(u16 val)
+{
+ int a = val >> 8;
+ int i = val & 0xFF;
+ return (a << 24) | (i << 16) | (i << 8) | i;
+}
+
+static inline u32 decode5A3(u16 val)
+{
+ int r,g,b,a;
+ if ((val & 0x8000))
+ {
+ a = 0xFF;
+ r = Convert5To8((val >> 10) & 0x1F);
+ g = Convert5To8((val >> 5) & 0x1F);
+ b = Convert5To8(val & 0x1F);
+ }
+ else
+ {
+ a = Convert3To8((val >> 12) & 0x7);
+ r = Convert4To8((val >> 8) & 0xF);
+ g = Convert4To8((val >> 4) & 0xF);
+ b = Convert4To8(val & 0xF);
+ }
+ return (a << 24) | (r << 16) | (g << 8) | b;
+}
+
+static inline u32 decode5A3RGBA(u16 val)
+{
+ int r,g,b,a;
+ if ((val&0x8000))
+ {
+ r=Convert5To8((val>>10) & 0x1f);
+ g=Convert5To8((val>>5 ) & 0x1f);
+ b=Convert5To8((val ) & 0x1f);
+ a=0xFF;
+ }
+ else
+ {
+ a=Convert3To8((val>>12) & 0x7);
+ r=Convert4To8((val>>8 ) & 0xf);
+ g=Convert4To8((val>>4 ) & 0xf);
+ b=Convert4To8((val ) & 0xf);
+ }
+ return r | (g<<8) | (b << 16) | (a << 24);
+}
+
+static inline u32 decode565RGBA(u16 val)
+{
+ int r,g,b,a;
+ r=Convert5To8((val>>11) & 0x1f);
+ g=Convert6To8((val>>5 ) & 0x3f);
+ b=Convert5To8((val ) & 0x1f);
+ a=0xFF;
+ return r | (g<<8) | (b << 16) | (a << 24);
+}
+
+static inline u32 decodeIA8Swapped(u16 val)
+{
+ int a = val & 0xFF;
+ int i = val >> 8;
+ return i | (i<<8) | (i<<16) | (a<<24);
+}
+
+
+
+struct DXTBlock
+{
+ u16 color1;
+ u16 color2;
+ u8 lines[4];
+};
+
+//inline void decodebytesC4(u32 *dst, const u8 *src, int numbytes, int tlutaddr, int tlutfmt)
+inline void decodebytesC4_5A3_To_BGRA32(u32 *dst, const u8 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decode5A3(Common::swap16(tlut[val >> 4]));
+ *dst++ = decode5A3(Common::swap16(tlut[val & 0xF]));
+ }
+}
+
+inline void decodebytesC4_5A3_To_rgba32(u32 *dst, const u8 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decode5A3RGBA(Common::swap16(tlut[val >> 4]));
+ *dst++ = decode5A3RGBA(Common::swap16(tlut[val & 0xF]));
+ }
+}
+
+inline void decodebytesC4_To_Raw16(u16* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem+tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u8 val = src[x];
+ *dst++ = Common::swap16(tlut[val >> 4]);
+ *dst++ = Common::swap16(tlut[val & 0xF]);
+ }
+}
+
+inline void decodebytesC4IA8_To_RGBA(u32* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem+tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decodeIA8Swapped(tlut[val >> 4]);
+ *dst++ = decodeIA8Swapped(tlut[val & 0xF]);
+ }
+}
+
+inline void decodebytesC4RGB565_To_RGBA(u32* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem+tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decode565RGBA(Common::swap16(tlut[val >> 4]));
+ *dst++ = decode565RGBA(Common::swap16(tlut[val & 0xF]));
+ }
+}
+
+//inline void decodebytesC8(u32 *dst, const u8 *src, int numbytes, int tlutaddr, int tlutfmt)
+inline void decodebytesC8_5A3_To_BGRA32(u32 *dst, const u8 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 8; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decode5A3(Common::swap16(tlut[val]));
+ }
+}
+
+inline void decodebytesC8_5A3_To_RGBA32(u32 *dst, const u8 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 8; x++)
+ {
+ u8 val = src[x];
+ *dst++ = decode5A3RGBA(Common::swap16(tlut[val]));
+ }
+}
+
+inline void decodebytesC8_To_Raw16(u16* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 8; x++)
+ {
+ u8 val = src[x];
+ *dst++ = Common::swap16(tlut[val]);
+ }
+}
+
+inline void decodebytesC8IA8_To_RGBA(u32* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 8; x++)
+ {
+ *dst++ = decodeIA8Swapped(tlut[src[x]]);
+ }
+}
+
+inline void decodebytesC8RGB565_To_RGBA(u32* dst, const u8* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 8; x++)
+ {
+ *dst++ = decode565RGBA(Common::swap16(tlut[src[x]]));
+ }
+}
+
+inline void decodebytesC14X2_5A3_To_BGRA32(u32 *dst, const u16 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u16 val = Common::swap16(src[x]);
+ *dst++ = decode5A3(Common::swap16(tlut[(val & 0x3FFF)]));
+ }
+}
+
+inline void decodebytesC14X2_5A3_To_RGBA(u32 *dst, const u16 *src, int tlutaddr)
+{
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u16 val = Common::swap16(src[x]);
+ *dst++ = decode5A3RGBA(Common::swap16(tlut[(val & 0x3FFF)]));
+ }
+}
+
+inline void decodebytesC14X2_To_Raw16(u16* dst, const u16* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u16 val = Common::swap16(src[x]);
+ *dst++ = Common::swap16(tlut[(val & 0x3FFF)]);
+ }
+}
+
+inline void decodebytesC14X2IA8_To_RGBA(u32* dst, const u16* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u16 val = Common::swap16(src[x]);
+ *dst++ = decodeIA8Swapped(tlut[(val & 0x3FFF)]);
+ }
+}
+
+inline void decodebytesC14X2rgb565_To_RGBA(u32* dst, const u16* src, int tlutaddr)
+{
+ u16* tlut = (u16*)(texMem + tlutaddr);
+ for (int x = 0; x < 4; x++)
+ {
+ u16 val = Common::swap16(src[x]);
+ *dst++ = decode565RGBA(Common::swap16(tlut[(val & 0x3FFF)]));
+ }
+}
+
+// Needs more speed.
+inline void decodebytesIA4(u16 *dst, const u8 *src)
+{
+ for (int x = 0; x < 8; x++)
+ {
+ const u8 val = src[x];
+ u8 a = Convert4To8(val >> 4);
+ u8 l = Convert4To8(val & 0xF);
+ dst[x] = (a << 8) | l;
+ }
+}
+
+inline void decodebytesIA4RGBA(u32 *dst, const u8 *src)
+{
+ for (int x = 0; x < 8; x++)
+ {
+ const u8 val = src[x];
+ u8 a = Convert4To8(val >> 4);
+ u8 l = Convert4To8(val & 0xF);
+ dst[x] = (a << 24) | l << 16 | l << 8 | l;
+ }
+}
+
+inline void decodebytesRGB5A3(u32 *dst, const u16 *src)
+{
+#if 0
+ for (int x = 0; x < 4; x++)
+ dst[x] = decode5A3(Common::swap16(src[x]));
+#else
+ dst[0] = decode5A3(Common::swap16(src[0]));
+ dst[1] = decode5A3(Common::swap16(src[1]));
+ dst[2] = decode5A3(Common::swap16(src[2]));
+ dst[3] = decode5A3(Common::swap16(src[3]));
+#endif
+}
+
+inline void decodebytesRGB5A3rgba(u32 *dst, const u16 *src)
+{
+#if 0
+ for (int x = 0; x < 4; x++)
+ dst[x] = decode5A3RGBA(Common::swap16(src[x]));
+#else
+ dst[0] = decode5A3RGBA(Common::swap16(src[0]));
+ dst[1] = decode5A3RGBA(Common::swap16(src[1]));
+ dst[2] = decode5A3RGBA(Common::swap16(src[2]));
+ dst[3] = decode5A3RGBA(Common::swap16(src[3]));
+#endif
+}
+
+// This one is used by many video formats. It'd therefore be good if it was fast.
+// Needs more speed.
+inline void decodebytesARGB8_4(u32 *dst, const u16 *src, const u16 *src2)
+{
+#if 0
+ for (int x = 0; x < 4; x++)
+ dst[x] = Common::swap32((src2[x] << 16) | src[x]);
+#else
+ dst[0] = Common::swap32((src2[0] << 16) | src[0]);
+ dst[1] = Common::swap32((src2[1] << 16) | src[1]);
+ dst[2] = Common::swap32((src2[2] << 16) | src[2]);
+ dst[3] = Common::swap32((src2[3] << 16) | src[3]);
+#endif
+
+ // This can probably be done in a few SSE pack/unpack instructions + pshufb
+ // some unpack instruction x2:
+ // ABABABABABABABAB 1212121212121212 ->
+ // AB12AB12AB12AB12 AB12AB12AB12AB12
+ // 2x pshufb->
+ // 21BA21BA21BA21BA 21BA21BA21BA21BA
+ // and we are done.
+}
+
+inline void decodebytesARGB8_4ToRgba(u32 *dst, const u16 *src, const u16 * src2)
+{
+#if 0
+ for (int x = 0; x < 4; x++) {
+ dst[x] = ((src[x] & 0xFF) << 24) | ((src[x] & 0xFF00)>>8) | (src2[x] << 8);
+ }
+#else
+ dst[0] = ((src[0] & 0xFF) << 24) | ((src[0] & 0xFF00)>>8) | (src2[0] << 8);
+ dst[1] = ((src[1] & 0xFF) << 24) | ((src[1] & 0xFF00)>>8) | (src2[1] << 8);
+ dst[2] = ((src[2] & 0xFF) << 24) | ((src[2] & 0xFF00)>>8) | (src2[2] << 8);
+ dst[3] = ((src[3] & 0xFF) << 24) | ((src[3] & 0xFF00)>>8) | (src2[3] << 8);
+#endif
+}
+
+inline u32 makecol(int r, int g, int b, int a)
+{
+ return (a << 24)|(r << 16)|(g << 8)|b;
+}
+
+inline u32 makeRGBA(int r, int g, int b, int a)
+{
+ return (a<<24)|(b<<16)|(g<<8)|r;
+}
+
+void decodeDXTBlock(u32 *dst, const DXTBlock *src, int pitch)
+{
+ // S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support)
+ // Needs more speed.
+ u16 c1 = Common::swap16(src->color1);
+ u16 c2 = Common::swap16(src->color2);
+ int blue1 = Convert5To8(c1 & 0x1F);
+ int blue2 = Convert5To8(c2 & 0x1F);
+ int green1 = Convert6To8((c1 >> 5) & 0x3F);
+ int green2 = Convert6To8((c2 >> 5) & 0x3F);
+ int red1 = Convert5To8((c1 >> 11) & 0x1F);
+ int red2 = Convert5To8((c2 >> 11) & 0x1F);
+ int colors[4];
+ colors[0] = makecol(red1, green1, blue1, 255);
+ colors[1] = makecol(red2, green2, blue2, 255);
+ if (c1 > c2)
+ {
+ int blue3 = ((blue2 - blue1) >> 1) - ((blue2 - blue1) >> 3);
+ int green3 = ((green2 - green1) >> 1) - ((green2 - green1) >> 3);
+ int red3 = ((red2 - red1) >> 1) - ((red2 - red1) >> 3);
+ colors[2] = makecol(red1 + red3, green1 + green3, blue1 + blue3, 255);
+ colors[3] = makecol(red2 - red3, green2 - green3, blue2 - blue3, 255);
+ }
+ else
+ {
+ colors[2] = makecol((red1 + red2 + 1) / 2, // Average
+ (green1 + green2 + 1) / 2,
+ (blue1 + blue2 + 1) / 2, 255);
+ colors[3] = makecol(red2, green2, blue2, 0); // Color2 but transparent
+ }
+
+ for (int y = 0; y < 4; y++)
+ {
+ int val = src->lines[y];
+ for (int x = 0; x < 4; x++)
+ {
+ dst[x] = colors[(val >> 6) & 3];
+ val <<= 2;
+ }
+ dst += pitch;
+ }
+}
+
+void decodeDXTBlockRGBA(u32 *dst, const DXTBlock *src, int pitch)
+{
+ // S3TC Decoder (Note: GCN decodes differently from PC so we can't use native support)
+ // Needs more speed.
+ u16 c1 = Common::swap16(src->color1);
+ u16 c2 = Common::swap16(src->color2);
+ int blue1 = Convert5To8(c1 & 0x1F);
+ int blue2 = Convert5To8(c2 & 0x1F);
+ int green1 = Convert6To8((c1 >> 5) & 0x3F);
+ int green2 = Convert6To8((c2 >> 5) & 0x3F);
+ int red1 = Convert5To8((c1 >> 11) & 0x1F);
+ int red2 = Convert5To8((c2 >> 11) & 0x1F);
+ int colors[4];
+ colors[0] = makeRGBA(red1, green1, blue1, 255);
+ colors[1] = makeRGBA(red2, green2, blue2, 255);
+ if (c1 > c2)
+ {
+ int blue3 = ((blue2 - blue1) >> 1) - ((blue2 - blue1) >> 3);
+ int green3 = ((green2 - green1) >> 1) - ((green2 - green1) >> 3);
+ int red3 = ((red2 - red1) >> 1) - ((red2 - red1) >> 3);
+ colors[2] = makeRGBA(red1 + red3, green1 + green3, blue1 + blue3, 255);
+ colors[3] = makeRGBA(red2 - red3, green2 - green3, blue2 - blue3, 255);
+ }
+ else
+ {
+ colors[2] = makeRGBA((red1 + red2 + 1) / 2, // Average
+ (green1 + green2 + 1) / 2,
+ (blue1 + blue2 + 1) / 2, 255);
+ colors[3] = makeRGBA(red2, green2, blue2, 0); // Color2 but transparent
+ }
+
+ for (int y = 0; y < 4; y++)
+ {
+ int val = src->lines[y];
+ for (int x = 0; x < 4; x++)
+ {
+ dst[x] = colors[(val >> 6) & 3];
+ val <<= 2;
+ }
+ dst += pitch;
+ }
+}
+
+#if 0 // TODO - currently does not handle transparency correctly and causes problems when texture dimensions are not multiples of 8
+static void copyDXTBlock(u8* dst, const u8* src)
+{
+ ((u16*)dst)[0] = Common::swap16(((u16*)src)[0]);
+ ((u16*)dst)[1] = Common::swap16(((u16*)src)[1]);
+ u32 pixels = ((u32*)src)[1];
+ // A bit of trickiness here: the row are in the same order
+ // between the two formats, but the ordering within the rows
+ // is reversed.
+ pixels = ((pixels >> 4) & 0x0F0F0F0F) | ((pixels << 4) & 0xF0F0F0F0);
+ pixels = ((pixels >> 2) & 0x33333333) | ((pixels << 2) & 0xCCCCCCCC);
+ ((u32*)dst)[1] = pixels;
+}
+#endif
+
+static PC_TexFormat GetPCFormatFromTLUTFormat(int tlutfmt)
+{
+ switch (tlutfmt)
+ {
+ case 0: return PC_TEX_FMT_IA8; // IA8
+ case 1: return PC_TEX_FMT_RGB565; // RGB565
+ case 2: return PC_TEX_FMT_BGRA32; // RGB5A3: This TLUT format requires
+ // extra work to decode.
+ }
+ return PC_TEX_FMT_NONE; // Error
+}
+
+PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt)
+{
+ switch (texformat)
+ {
+ case GX_TF_C4:
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_I4:
+ return PC_TEX_FMT_IA8;
+ case GX_TF_I8: // speed critical
+ return PC_TEX_FMT_IA8;
+ case GX_TF_C8:
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_IA4:
+ return PC_TEX_FMT_IA4_AS_IA8;
+ case GX_TF_IA8:
+ return PC_TEX_FMT_IA8;
+ case GX_TF_C14X2:
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_RGB565:
+ return PC_TEX_FMT_RGB565;
+ case GX_TF_RGB5A3:
+ return PC_TEX_FMT_BGRA32;
+ case GX_TF_RGBA8: // speed critical
+ return PC_TEX_FMT_BGRA32;
+ case GX_TF_CMPR: // speed critical
+ // The metroid games use this format almost exclusively.
+ {
+ return PC_TEX_FMT_BGRA32;
+ }
+ }
+
+ // The "copy" texture formats, too?
+ return PC_TEX_FMT_NONE;
+}
+
+
+//switch endianness, unswizzle
+//TODO: to save memory, don't blindly convert everything to argb8888
+//also ARGB order needs to be swapped later, to accommodate modern hardware better
+//need to add DXT support too
+PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
+{
+ const int Wsteps4 = (width + 3) / 4;
+ const int Wsteps8 = (width + 7) / 8;
+
+ switch (texformat)
+ {
+ case GX_TF_C4:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = yStep * 8; iy < 8; iy++, xStep++)
+ decodebytesC4_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
+ }
+ else
+ {
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = yStep * 8; iy < 8; iy++, xStep++)
+ decodebytesC4_To_Raw16((u16*)dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
+ }
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_I4:
+ {
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = yStep * 8 ; iy < 8; iy++,xStep++)
+ for (int ix = 0; ix < 4; ix++)
+ {
+ int val = src[4 * xStep + ix];
+ dst[(y + iy) * width + x + ix * 2] = Convert4To8(val >> 4);
+ dst[(y + iy) * width + x + ix * 2 + 1] = Convert4To8(val & 0xF);
+ }
+ }
+ return PC_TEX_FMT_I4_AS_I8;
+ case GX_TF_I8: // speed critical
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ {
+ ((u64*)(dst + (y + iy) * width + x))[0] = ((u64*)(src + 8 * xStep))[0];
+ }
+ }
+ return PC_TEX_FMT_I8;
+ case GX_TF_C8:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC8_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
+ }
+ else
+ {
+
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC8_To_Raw16((u16*)dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
+ }
+ }
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_IA4:
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesIA4((u16*)dst + (y + iy) * width + x, src + 8 * xStep);
+ }
+ return PC_TEX_FMT_IA4_AS_IA8;
+ case GX_TF_IA8:
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = yStep * 4; iy < 4; iy++, xStep++)
+ {
+ u16 *ptr = (u16 *)dst + (y + iy) * width + x;
+ u16 *s = (u16 *)(src + 8 * xStep);
+ for(int j = 0; j < 4; j++)
+ *ptr++ = Common::swap16(*s++);
+ }
+
+ }
+ return PC_TEX_FMT_IA8;
+ case GX_TF_C14X2:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC14X2_5A3_To_BGRA32((u32*)dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
+ }
+ else
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC14X2_To_Raw16((u16*)dst + (y + iy) * width + x,(u16*)(src + 8 * xStep), tlutaddr);
+ }
+ return GetPCFormatFromTLUTFormat(tlutfmt);
+ case GX_TF_RGB565:
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ {
+ u16 *ptr = (u16 *)dst + (y + iy) * width + x;
+ u16 *s = (u16 *)(src + 8 * xStep);
+ for(int j = 0; j < 4; j++)
+ *ptr++ = Common::swap16(*s++);
+ }
+ }
+ return PC_TEX_FMT_RGB565;
+ case GX_TF_RGB5A3:
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ //decodebytesRGB5A3((u32*)dst+(y+iy)*width+x, (u16*)src, 4);
+ decodebytesRGB5A3((u32*)dst+(y+iy)*width+x, (u16*)(src + 8 * xStep));
+ }
+ return PC_TEX_FMT_BGRA32;
+ case GX_TF_RGBA8: // speed critical
+ {
+
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ {
+ const u8* src2 = src + 64 * yStep;
+ for (int iy = 0; iy < 4; iy++)
+ decodebytesARGB8_4((u32*)dst + (y+iy)*width + x, (u16*)src2 + 4 * iy, (u16*)src2 + 4 * iy + 16);
+ }
+ }
+ }
+ return PC_TEX_FMT_BGRA32;
+ case GX_TF_CMPR: // speed critical
+ // The metroid games use this format almost exclusively.
+ {
+#if 0 // TODO - currently does not handle transparency correctly and causes problems when texture dimensions are not multiples of 8
+ // 11111111 22222222 55555555 66666666
+ // 33333333 44444444 77777777 88888888
+ for (int y = 0; y < height; y += 8)
+ {
+ for (int x = 0; x < width; x += 8)
+ {
+ copyDXTBlock(dst+(y/2)*width+x*2, src);
+ src += 8;
+ copyDXTBlock(dst+(y/2)*width+x*2+8, src);
+ src += 8;
+ copyDXTBlock(dst+(y/2+2)*width+x*2, src);
+ src += 8;
+ copyDXTBlock(dst+(y/2+2)*width+x*2+8, src);
+ src += 8;
+ }
+ }
+ return PC_TEX_FMT_DXT1;
+#else
+ for (int y = 0; y < height; y += 8)
+ {
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8, yStep++)
+ {
+ const u8* src2 = src + 4 * sizeof(DXTBlock) * yStep;
+ decodeDXTBlock((u32*)dst + y * width + x, (DXTBlock*)src2, width);
+ src2 += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst + y * width + x + 4, (DXTBlock*)src2, width);
+ src2 += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst + (y + 4) * width + x, (DXTBlock*)src2, width);
+ src2 += sizeof(DXTBlock);
+ decodeDXTBlock((u32*)dst + (y + 4) * width + x + 4, (DXTBlock*)src2, width);
+ }
+ }
+#endif
+ return PC_TEX_FMT_BGRA32;
+ }
+ }
+
+ // The "copy" texture formats, too?
+ return PC_TEX_FMT_NONE;
+}
+
+
+
+// JSD 01/06/11:
+// TODO: we really should ensure BOTH the source and destination addresses are aligned to 16-byte boundaries to
+// squeeze out a little more performance. _mm_loadu_si128/_mm_storeu_si128 is slower than _mm_load_si128/_mm_store_si128
+// because they work on unaligned addresses. The processor is free to make the assumption that addresses are multiples
+// of 16 in the aligned case.
+// TODO: complete SSE2 optimization of less often used texture formats.
+// TODO: refactor algorithms using _mm_loadl_epi64 unaligned loads to prefer 128-bit aligned loads.
+
+PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt)
+{
+
+ const int Wsteps4 = (width + 3) / 4;
+ const int Wsteps8 = (width + 7) / 8;
+
+ switch (texformat)
+ {
+ case GX_TF_C4:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++)
+ for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
+ decodebytesC4_5A3_To_rgba32(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
+ }
+ else if(tlutfmt == 0)
+ {
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++)
+ for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
+ decodebytesC4IA8_To_RGBA(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
+
+ }
+ else
+ {
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++)
+ for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
+ decodebytesC4RGB565_To_RGBA(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
+ }
+ break;
+ case GX_TF_I4:
+ {
+ // Reference C implementation:
+ for (int y = 0; y < height; y += 8)
+ for (int x = 0; x < width; x += 8)
+ for (int iy = 0; iy < 8; iy++, src += 4)
+ for (int ix = 0; ix < 4; ix++)
+ {
+ int val = src[ix];
+ u8 i1 = Convert4To8(val >> 4);
+ u8 i2 = Convert4To8(val & 0xF);
+ memset(dst+(y + iy) * width + x + ix * 2 , i1,4);
+ memset(dst+(y + iy) * width + x + ix * 2 + 1 , i2,4);
+ }
+ }
+ break;
+ case GX_TF_I8: // speed critical
+ {
+ // Reference C implementation
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0; x < width; x += 8)
+ for (int iy = 0; iy < 4; ++iy, src += 8)
+ {
+ u32 * newdst = dst + (y + iy)*width+x;
+ const u8 * newsrc = src;
+ u8 srcval;
+
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ srcval = newsrc[0]; newdst[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
+ }
+ }
+ break;
+ case GX_TF_C8:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC8_5A3_To_RGBA32((u32*)dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
+ }
+ else if(tlutfmt == 0)
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC8IA8_To_RGBA(dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
+
+ }
+ else
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC8RGB565_To_RGBA(dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
+
+ }
+ break;
+ case GX_TF_IA4:
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesIA4RGBA(dst + (y + iy) * width + x, src + 8 * xStep);
+ }
+ break;
+ case GX_TF_IA8:
+ {
+ // Reference C implementation:
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0; x < width; x += 4)
+ for (int iy = 0; iy < 4; iy++, src += 8)
+ {
+ u32 *ptr = dst + (y + iy) * width + x;
+ u16 *s = (u16 *)src;
+ ptr[0] = decodeIA8Swapped(s[0]);
+ ptr[1] = decodeIA8Swapped(s[1]);
+ ptr[2] = decodeIA8Swapped(s[2]);
+ ptr[3] = decodeIA8Swapped(s[3]);
+ }
+ }
+ break;
+ case GX_TF_C14X2:
+ if (tlutfmt == 2)
+ {
+ // Special decoding is required for TLUT format 5A3
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC14X2_5A3_To_BGRA32(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
+ }
+ else if (tlutfmt == 0)
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC14X2IA8_To_RGBA(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
+ }
+ else
+ {
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
+ for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
+ decodebytesC14X2rgb565_To_RGBA(dst + (y + iy) * width + x, (u16*)(src + 8 * xStep), tlutaddr);
+ }
+ break;
+ case GX_TF_RGB565:
+ {
+ // Reference C implementation.
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0; x < width; x += 4)
+ for (int iy = 0; iy < 4; iy++, src += 8)
+ {
+ u32 *ptr = dst + (y + iy) * width + x;
+ u16 *s = (u16 *)src;
+ for(int j = 0; j < 4; j++)
+ *ptr++ = decode565RGBA(Common::swap16(*s++));
+ }
+ }
+ break;
+ case GX_TF_RGB5A3:
+ {
+ // Reference C implementation:
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0; x < width; x += 4)
+ for (int iy = 0; iy < 4; iy++, src += 8)
+ decodebytesRGB5A3rgba(dst+(y+iy)*width+x, (u16*)src);
+ }
+ break;
+ case GX_TF_RGBA8: // speed critical
+ {
+ // Reference C implementation.
+ for (int y = 0; y < height; y += 4)
+ for (int x = 0; x < width; x += 4)
+ {
+ for (int iy = 0; iy < 4; iy++)
+ decodebytesARGB8_4ToRgba(dst + (y+iy)*width + x, (u16*)src + 4 * iy, (u16*)src + 4 * iy + 16);
+ src += 64;
+ }
+ }
+ break;
+ case GX_TF_CMPR: // speed critical
+ // The metroid games use this format almost exclusively.
+ {
+ for (int y = 0; y < height; y += 8)
+ {
+ for (int x = 0; x < width; x += 8)
+ {
+ decodeDXTBlockRGBA((u32*)dst + y * width + x, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlockRGBA((u32*)dst + y * width + x + 4, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlockRGBA((u32*)dst + (y + 4) * width + x, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ decodeDXTBlockRGBA((u32*)dst + (y + 4) * width + x + 4, (DXTBlock*)src, width);
+ src += sizeof(DXTBlock);
+ }
+ }
+ break;
+ }
+ }
+
+ // The "copy" texture formats, too?
+ return PC_TEX_FMT_RGBA32;
+}
+
+
+
+
+void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center)
+{
+ TexFmt_Overlay_Enable = enable;
+ TexFmt_Overlay_Center = center;
+}
+
+PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt,bool rgbaOnly)
+{
+ PC_TexFormat retval = TexDecoder_Decode_OpenCL(dst, src,
+ width, height, texformat, tlutaddr, tlutfmt, rgbaOnly);
+ if (retval == PC_TEX_FMT_NONE)
+ retval = rgbaOnly ? TexDecoder_Decode_RGBA((u32*)dst, src,
+ width, height, texformat, tlutaddr, tlutfmt)
+ : TexDecoder_Decode_real(dst, src,
+ width, height, texformat, tlutaddr, tlutfmt);
+
+ if ((!TexFmt_Overlay_Enable)|| (retval == PC_TEX_FMT_NONE))
+ return retval;
+
+ int w = min(width, 40);
+ int h = min(height, 10);
+
+ int xoff = (width - w) >> 1;
+ int yoff = (height - h) >> 1;
+
+ if (!TexFmt_Overlay_Center)
+ {
+ xoff=0;
+ yoff=0;
+ }
+
+ const char* fmt = texfmt[texformat&15];
+ while (*fmt)
+ {
+ int xcnt = 0;
+ int nchar = sfont_map[(int)*fmt];
+
+ const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10
+
+ for (int x = 0; x < 9;x++)
+ {
+ if (ptr[x] == 0x78)
+ break;
+ xcnt++;
+ }
+
+ for (int y=0; y < 10; y++)
+ {
+ for (int x=0; x < xcnt; x++)
+ {
+ switch(retval)
+ {
+ case PC_TEX_FMT_I8:
+ {
+ // TODO: Is this an acceptable way to draw in I8?
+ u8 *dtp = (u8*)dst;
+ dtp[(y + yoff) * width + x + xoff] = ptr[x] ? 0xFF : 0x88;
+ break;
+ }
+ case PC_TEX_FMT_IA8:
+ case PC_TEX_FMT_IA4_AS_IA8:
+ {
+ u16 *dtp = (u16*)dst;
+ dtp[(y + yoff) * width + x + xoff] = ptr[x] ? 0xFFFF : 0xFF00;
+ break;
+ }
+ case PC_TEX_FMT_RGB565:
+ {
+ u16 *dtp = (u16*)dst;
+ dtp[(y + yoff)*width + x + xoff] = ptr[x] ? 0xFFFF : 0x0000;
+ break;
+ }
+ default:
+ case PC_TEX_FMT_BGRA32:
+ {
+ int *dtp = (int*)dst;
+ dtp[(y + yoff) * width + x + xoff] = ptr[x] ? 0xFFFFFFFF : 0xFF000000;
+ break;
+ }
+ }
+ }
+ ptr += 9;
+ }
+ xoff += xcnt;
+ fmt++;
+ }
+
+ return retval;
+}
+
+
+
+void TexDecoder_DecodeTexel(u8 *dst, const u8 *src, int s, int t, int imageWidth, int texformat, int tlutaddr, int tlutfmt)
+{
+ /* General formula for computing texture offset
+ //
+ u16 sBlk = s / blockWidth;
+ u16 tBlk = t / blockHeight;
+ u16 widthBlks = (width / blockWidth) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) * blockWidth * blockHeight;
+ u16 blkS = s & (blockWidth - 1);
+ u16 blkT = t & (blockHeight - 1);
+ u32 blkOff = blkT * blockWidth + blkS;
+ */
+
+ switch (texformat)
+ {
+ case GX_TF_C4:
+ {
+ u16 sBlk = s >> 3;
+ u16 tBlk = t >> 3;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5;
+ u16 blkS = s & 7;
+ u16 blkT = t & 7;
+ u32 blkOff = (blkT << 3) + blkS;
+
+ int rs = (blkOff & 1)?0:4;
+ u32 offset = base + (blkOff >> 1);
+
+ u8 val = (*(src + offset) >> rs) & 0xF;
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+
+ switch (tlutfmt)
+ {
+ case 0:
+ *((u32*)dst) = decodeIA8Swapped(tlut[val]);
+ break;
+ case 1:
+ *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val]));
+ break;
+ case 2:
+ *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val]));
+ break;
+ }
+ }
+ break;
+ case GX_TF_I4:
+ {
+ u16 sBlk = s >> 3;
+ u16 tBlk = t >> 3;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5;
+ u16 blkS = s & 7;
+ u16 blkT = t & 7;
+ u32 blkOff = (blkT << 3) + blkS;
+
+ int rs = (blkOff & 1)?0:4;
+ u32 offset = base + (blkOff >> 1);
+
+ u8 val = (*(src + offset) >> rs) & 0xF;
+ val = Convert4To8(val);
+ dst[0] = val;
+ dst[1] = val;
+ dst[2] = val;
+ dst[3] = val;
+ }
+ break;
+ case GX_TF_I8:
+ {
+ u16 sBlk = s >> 3;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5;
+ u16 blkS = s & 7;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 3) + blkS;
+
+ u8 val = *(src + base + blkOff);
+ dst[0] = val;
+ dst[1] = val;
+ dst[2] = val;
+ dst[3] = val;
+ }
+ break;
+ case GX_TF_C8:
+ {
+ u16 sBlk = s >> 3;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5;
+ u16 blkS = s & 7;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 3) + blkS;
+
+ u8 val = *(src + base + blkOff);
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+
+ switch (tlutfmt)
+ {
+ case 0:
+ *((u32*)dst) = decodeIA8Swapped(tlut[val]);
+ break;
+ case 1:
+ *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val]));
+ break;
+ case 2:
+ *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val]));
+ break;
+ }
+ }
+ break;
+ case GX_TF_IA4:
+ {
+ u16 sBlk = s >> 3;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5;
+ u16 blkS = s & 7;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 3) + blkS;
+
+ u8 val = *(src + base + blkOff);
+ const u8 a = Convert4To8(val>>4);
+ const u8 l = Convert4To8(val&0xF);
+ dst[0] = l;
+ dst[1] = l;
+ dst[2] = l;
+ dst[3] = a;
+ }
+ break;
+ case GX_TF_IA8:
+ {
+ u16 sBlk = s >> 2;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 2) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 4;
+ u16 blkS = s & 3;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 2) + blkS;
+
+ u32 offset = (base + blkOff) << 1;
+ const u16* valAddr = (u16*)(src + offset);
+
+ *((u32*)dst) = decodeIA8Swapped(*valAddr);
+ }
+ break;
+ case GX_TF_C14X2:
+ {
+ u16 sBlk = s >> 2;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 2) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 4;
+ u16 blkS = s & 3;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 2) + blkS;
+
+ u32 offset = (base + blkOff) << 1;
+ const u16* valAddr = (u16*)(src + offset);
+
+ u16 val = Common::swap16(*valAddr) & 0x3FFF;
+ u16 *tlut = (u16*)(texMem + tlutaddr);
+
+ switch (tlutfmt)
+ {
+ case 0:
+ *((u32*)dst) = decodeIA8Swapped(tlut[val]);
+ break;
+ case 1:
+ *((u32*)dst) = decode565RGBA(Common::swap16(tlut[val]));
+ break;
+ case 2:
+ *((u32*)dst) = decode5A3RGBA(Common::swap16(tlut[val]));
+ break;
+ }
+ }
+ break;
+ case GX_TF_RGB565:
+ {
+ u16 sBlk = s >> 2;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 2) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 4;
+ u16 blkS = s & 3;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 2) + blkS;
+
+ u32 offset = (base + blkOff) << 1;
+ const u16* valAddr = (u16*)(src + offset);
+
+ *((u32*)dst) = decode565RGBA(Common::swap16(*valAddr));
+ }
+ break;
+ case GX_TF_RGB5A3:
+ {
+ u16 sBlk = s >> 2;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 2) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 4;
+ u16 blkS = s & 3;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 2) + blkS;
+
+ u32 offset = (base + blkOff) << 1;
+ const u16* valAddr = (u16*)(src + offset);
+
+ *((u32*)dst) = decode5A3RGBA(Common::swap16(*valAddr));
+ }
+ break;
+ case GX_TF_RGBA8:
+ {
+ u16 sBlk = s >> 2;
+ u16 tBlk = t >> 2;
+ u16 widthBlks = (imageWidth >> 2) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 5; // shift by 5 is correct
+ u16 blkS = s & 3;
+ u16 blkT = t & 3;
+ u32 blkOff = (blkT << 2) + blkS;
+
+ u32 offset = (base + blkOff) << 1 ;
+ const u8* valAddr = src + offset;
+
+ dst[3] = valAddr[0];
+ dst[0] = valAddr[1];
+ dst[1] = valAddr[32];
+ dst[2] = valAddr[33];
+ }
+ break;
+ case GX_TF_CMPR:
+ {
+ u16 sDxt = s >> 2;
+ u16 tDxt = t >> 2;
+
+ u16 sBlk = sDxt >> 1;
+ u16 tBlk = tDxt >> 1;
+ u16 widthBlks = (imageWidth >> 3) + 1;
+ u32 base = (tBlk * widthBlks + sBlk) << 2;
+ u16 blkS = sDxt & 1;
+ u16 blkT = tDxt & 1;
+ u32 blkOff = (blkT << 1) + blkS;
+
+ u32 offset = (base + blkOff) << 3;
+
+ const DXTBlock* dxtBlock = (const DXTBlock*)(src + offset);
+
+ u16 c1 = Common::swap16(dxtBlock->color1);
+ u16 c2 = Common::swap16(dxtBlock->color2);
+ int blue1 = Convert5To8(c1 & 0x1F);
+ int blue2 = Convert5To8(c2 & 0x1F);
+ int green1 = Convert6To8((c1 >> 5) & 0x3F);
+ int green2 = Convert6To8((c2 >> 5) & 0x3F);
+ int red1 = Convert5To8((c1 >> 11) & 0x1F);
+ int red2 = Convert5To8((c2 >> 11) & 0x1F);
+
+ u16 ss = s & 3;
+ u16 tt = t & 3;
+
+ int colorSel = dxtBlock->lines[tt];
+ int rs = 6 - (ss << 1);
+ colorSel = (colorSel >> rs) & 3;
+ colorSel |= c1 > c2?0:4;
+
+ u32 color = 0;
+
+ switch (colorSel)
+ {
+ case 0:
+ case 4:
+ color = makeRGBA(red1, green1, blue1, 255);
+ break;
+ case 1:
+ case 5:
+ color = makeRGBA(red2, green2, blue2, 255);
+ break;
+ case 2:
+ color = makeRGBA(red1+(red2-red1)/3, green1+(green2-green1)/3, blue1+(blue2-blue1)/3, 255);
+ break;
+ case 3:
+ color = makeRGBA(red2+(red1-red2)/3, green2+(green1-green2)/3, blue2+(blue1-blue2)/3, 255);
+ break;
+ case 6:
+ color = makeRGBA((int)ceil((float)(red1+red2)/2), (int)ceil((float)(green1+green2)/2), (int)ceil((float)(blue1+blue2)/2), 255);
+ break;
+ case 7:
+ color = makeRGBA(red2, green2, blue2, 0);
+ break;
+ }
+
+ *((u32*)dst) = color;
+ }
+ break;
+ }
+}
+
+
+const char* texfmt[] = {
+ // pixel
+ "I4", "I8", "IA4", "IA8",
+ "RGB565", "RGB5A3", "RGBA8", "0x07",
+ "C4", "C8", "C14X2", "0x0B",
+ "0x0C", "0x0D", "CMPR", "0x0F",
+ // Z-buffer
+ "0x10", "Z8", "0x12", "Z16",
+ "0x14", "0x15", "Z24X8", "0x17",
+ "0x18", "0x19", "0x1A", "0x1B",
+ "0x1C", "0x1D", "0x1E", "0x1F",
+ // pixel + copy
+ "CR4", "0x21", "CRA4", "CRA8",
+ "0x24", "0x25", "CYUVA8", "CA8",
+ "CR8", "CG8", "CB8", "CRG8",
+ "CGB8", "0x2D", "0x2E", "0x2F",
+ // Z + copy
+ "CZ4", "0x31", "0x32", "0x33",
+ "0x34", "0x35", "0x36", "0x37",
+ "0x38", "CZ8M", "CZ8L", "0x3B",
+ "CZ16L", "0x3D", "0x3E", "0x3F",
+};
+
+const unsigned char sfont_map[] = {
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,10,10,10,10,10,
+ 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,
+ 26,27,28,29,30,31,32,33,34,35,36,10,10,10,10,10,
+ 10,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,
+ 52,53,54,55,56,57,58,59,60,61,62,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+};
+
+const unsigned char sfont_raw[][9*10] = {
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },{
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x78, 0x78, 0x78, 0x78,
+ },
+};
diff --git a/Source/Core/VideoCommon/Src/MainBase.cpp b/Source/Core/VideoCommon/Src/MainBase.cpp
index 726ef71b38..a881bebfb2 100644
--- a/Source/Core/VideoCommon/Src/MainBase.cpp
+++ b/Source/Core/VideoCommon/Src/MainBase.cpp
@@ -186,6 +186,11 @@ void VideoBackendHardware::InitializeShared()
// Run from the CPU thread
void VideoBackendHardware::DoState(PointerWrap& p)
{
+ bool software = false;
+ p.Do(software);
+ if (p.GetMode() == PointerWrap::MODE_READ && software == true)
+ // change mode to abort load of incompatible save state.
+ p.SetMode(PointerWrap::MODE_VERIFY);
VideoCommon_DoState(p);
p.DoMarker("VideoCommon");
diff --git a/Source/Core/VideoCommon/Src/RenderBase.cpp b/Source/Core/VideoCommon/Src/RenderBase.cpp
index 8e1d012fa2..90a09aec43 100644
--- a/Source/Core/VideoCommon/Src/RenderBase.cpp
+++ b/Source/Core/VideoCommon/Src/RenderBase.cpp
@@ -83,7 +83,9 @@ unsigned int Renderer::efb_scale_denominatorY = 1;
unsigned int Renderer::ssaa_multiplier = 1;
-Renderer::Renderer() : frame_data(NULL), bLastFrameDumped(false)
+Renderer::Renderer()
+ : frame_data()
+ , bLastFrameDumped(false)
{
UpdateActiveConfig();
TextureCache::OnConfigChanged(g_ActiveConfig);
@@ -110,7 +112,6 @@ Renderer::~Renderer()
if (pFrameDump.IsOpen())
pFrameDump.Close();
#endif
- delete[] frame_data;
}
void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
diff --git a/Source/Core/VideoCommon/Src/RenderBase.h b/Source/Core/VideoCommon/Src/RenderBase.h
index 5376577cbd..8b5505e082 100644
--- a/Source/Core/VideoCommon/Src/RenderBase.h
+++ b/Source/Core/VideoCommon/Src/RenderBase.h
@@ -147,7 +147,7 @@ protected:
#else
File::IOFile pFrameDump;
#endif
- char* frame_data;
+ std::vector<u8> frame_data;
bool bLastFrameDumped;
// The framebuffer size
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index fd935de342..6871c411fa 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -129,7 +129,11 @@ void TextureCache::Cleanup()
TexCache::iterator tcend = textures.end();
while (iter != tcend)
{
- if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount) // TODO: Deleting EFB copies might not be a good idea here...
+ if ( frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount
+
+ // EFB copies living on the host GPU are unrecoverable and thus shouldn't be deleted
+ // TODO: encoding the texture back to RAM here might be a good idea
+ && ! (g_ActiveConfig.bCopyEFBToTexture && iter->second->IsEfbCopy()) )
{
delete iter->second;
textures.erase(iter++);
@@ -481,15 +485,20 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
GFX_DEBUGGER_PAUSE_AT(NEXT_NEW_TEXTURE, true);
}
+ else
+ {
+ // load texture (CreateTexture also loads level 0)
+ entry->Load(width, height, expandedWidth, 0);
+ }
entry->SetGeneralParameters(address, texture_size, full_format, entry->num_mipmaps);
entry->SetDimensions(nativeW, nativeH, width, height);
entry->hash = tex_hash;
- if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture) entry->type = TCET_EC_DYNAMIC;
- else entry->type = TCET_NORMAL;
-
- // load texture
- entry->Load(width, height, expandedWidth, 0);
+
+ if (entry->IsEfbCopy() && !g_ActiveConfig.bCopyEFBToTexture)
+ entry->type = TCET_EC_DYNAMIC;
+ else
+ entry->type = TCET_NORMAL;
if (g_ActiveConfig.bDumpTextures && !using_custom_texture)
DumpTexture(entry, 0);
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp
index 5bffab8ee7..526cbe7e49 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp
@@ -23,7 +23,7 @@
#include "MemoryUtil.h"
#include "StringUtil.h"
#include "x64Emitter.h"
-#include "ABI.h"
+#include "x64ABI.h"
#include "PixelEngine.h"
#include "Host.h"
@@ -43,8 +43,9 @@
//BBox
#include "XFMemory.h"
extern float GC_ALIGNED16(g_fProjectionMatrix[16]);
-
+#ifndef _M_GENERIC
#define USE_JIT
+#endif
#define COMPILED_CODE_SIZE 4096
@@ -82,8 +83,9 @@ static const float fractionTable[32] = {
1.0f / (1U << 24), 1.0f / (1U << 25), 1.0f / (1U << 26), 1.0f / (1U << 27),
1.0f / (1U << 28), 1.0f / (1U << 29), 1.0f / (1U << 30), 1.0f / (1U << 31),
};
-
+#ifdef USE_JIT
using namespace Gen;
+#endif
void LOADERDECL PosMtx_ReadDirect_UByte()
{
@@ -182,14 +184,19 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
m_VtxDesc = vtx_desc;
SetVAT(vtx_attr.g0.Hex, vtx_attr.g1.Hex, vtx_attr.g2.Hex);
+ #ifdef USE_JIT
AllocCodeSpace(COMPILED_CODE_SIZE);
CompileVertexTranslator();
WriteProtect();
+ #endif
+
}
VertexLoader::~VertexLoader()
{
+ #ifdef USE_JIT
FreeCodeSpace();
+ #endif
delete m_NativeFmt;
}
@@ -474,7 +481,8 @@ void VertexLoader::WriteCall(TPipelineFunction func)
m_PipelineStages[m_numPipelineStages++] = func;
#endif
}
-
+// ARMTODO: This should be done in a better way
+#ifndef _M_GENERIC
void VertexLoader::WriteGetVariable(int bits, OpArg dest, void *address)
{
#ifdef USE_JIT
@@ -498,7 +506,7 @@ void VertexLoader::WriteSetVariable(int bits, void *address, OpArg value)
#endif
#endif
}
-
+#endif
void VertexLoader::RunVertices(int vtx_attr_group, int primitive, int count)
{
m_numLoadedVertices += count;
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.h b/Source/Core/VideoCommon/Src/VertexLoader.h
index 98a57cb9ff..0f321cd14f 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.h
+++ b/Source/Core/VideoCommon/Src/VertexLoader.h
@@ -76,7 +76,12 @@ private:
}
};
+// ARMTODO: This should be done in a better way
+#ifndef _M_GENERIC
class VertexLoader : public Gen::XCodeBlock, NonCopyable
+#else
+class VertexLoader
+#endif
{
public:
VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr);
@@ -122,8 +127,10 @@ private:
void WriteCall(TPipelineFunction);
+#ifndef _M_GENERIC
void WriteGetVariable(int bits, Gen::OpArg dest, void *address);
void WriteSetVariable(int bits, void *address, Gen::OpArg dest);
+#endif
};
#endif
diff --git a/Source/Core/VideoCommon/Src/DLCache.cpp b/Source/Core/VideoCommon/Src/x64DLCache.cpp
index c828ea3a03..559593a08c 100644
--- a/Source/Core/VideoCommon/Src/DLCache.cpp
+++ b/Source/Core/VideoCommon/Src/x64DLCache.cpp
@@ -35,7 +35,7 @@
#include "VertexLoaderManager.h"
#include "VertexManagerBase.h"
#include "x64Emitter.h"
-#include "ABI.h"
+#include "x64ABI.h"
#include "DLCache.h"
#include "VideoConfig.h"
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/x64TextureDecoder.cpp
index 30df817902..6c474920cd 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp
+++ b/Source/Core/VideoCommon/Src/x64TextureDecoder.cpp
@@ -1119,20 +1119,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
_mm_storeu_si128( (__m128i*)( dst+(y + iy+1) * width + x + 4 ), o4 );
}
}
-#if 0
- // Reference C implementation:
- for (int y = 0; y < height; y += 8)
- for (int x = 0; x < width; x += 8)
- for (int iy = 0; iy < 8; iy++, src += 4)
- for (int ix = 0; ix < 4; ix++)
- {
- int val = src[ix];
- u8 i1 = Convert4To8(val >> 4);
- u8 i2 = Convert4To8(val & 0xF);
- memset(dst+(y + iy) * width + x + ix * 2 , i1,4);
- memset(dst+(y + iy) * width + x + ix * 2 + 1 , i2,4);
- }
-#endif
}
break;
case GX_TF_I8: // speed critical
@@ -1248,26 +1234,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
}
}
-#if 0
- // Reference C implementation
- for (int y = 0; y < height; y += 4)
- for (int x = 0; x < width; x += 8)
- for (int iy = 0; iy < 4; ++iy, src += 8)
- {
- u32 * newdst = dst + (y + iy)*width+x;
- const u8 * newsrc = src;
- u8 srcval;
-
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = (newsrc++)[0]; (newdst++)[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- srcval = newsrc[0]; newdst[0] = srcval | (srcval << 8) | (srcval << 16) | (srcval << 24);
- }
-#endif
}
break;
case GX_TF_C8:
@@ -1380,20 +1346,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
_mm_storeu_si128( (__m128i*)(dst + (y + iy) * width + x), r1 );
}
}
-#if 0
- // Reference C implementation:
- for (int y = 0; y < height; y += 4)
- for (int x = 0; x < width; x += 4)
- for (int iy = 0; iy < 4; iy++, src += 8)
- {
- u32 *ptr = dst + (y + iy) * width + x;
- u16 *s = (u16 *)src;
- ptr[0] = decodeIA8Swapped(s[0]);
- ptr[1] = decodeIA8Swapped(s[1]);
- ptr[2] = decodeIA8Swapped(s[2]);
- ptr[3] = decodeIA8Swapped(s[3]);
- }
-#endif
}
break;
case GX_TF_C14X2:
@@ -1493,18 +1445,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
__m128i *ptr = (__m128i *)(dst + (y + iy) * width + x);
_mm_storeu_si128(ptr, abgr888x4);
}
-#if 0
- // Reference C implementation.
- for (int y = 0; y < height; y += 4)
- for (int x = 0; x < width; x += 4)
- for (int iy = 0; iy < 4; iy++, src += 8)
- {
- u32 *ptr = dst + (y + iy) * width + x;
- u16 *s = (u16 *)src;
- for(int j = 0; j < 4; j++)
- *ptr++ = decode565RGBA(Common::swap16(*s++));
- }
-#endif
}
break;
case GX_TF_RGB5A3:
@@ -1718,13 +1658,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
}
}
}
-#if 0
- // Reference C implementation:
- for (int y = 0; y < height; y += 4)
- for (int x = 0; x < width; x += 4)
- for (int iy = 0; iy < 4; iy++, src += 8)
- decodebytesRGB5A3rgba(dst+(y+iy)*width+x, (u16*)src);
-#endif
}
break;
case GX_TF_RGBA8: // speed critical
@@ -1860,16 +1793,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
_mm_storeu_si128(dst128, rgba11);
}
}
-#if 0
- // Reference C implementation.
- for (int y = 0; y < height; y += 4)
- for (int x = 0; x < width; x += 4)
- {
- for (int iy = 0; iy < 4; iy++)
- decodebytesARGB8_4ToRgba(dst + (y+iy)*width + x, (u16*)src + 4 * iy, (u16*)src + 4 * iy + 16);
- src += 64;
- }
-#endif
}
break;
case GX_TF_CMPR: // speed critical
@@ -2104,22 +2027,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
}
}
}
-#if 0
- for (int y = 0; y < height; y += 8)
- {
- for (int x = 0; x < width; x += 8)
- {
- decodeDXTBlockRGBA((u32*)dst + y * width + x, (DXTBlock*)src, width);
- src += sizeof(DXTBlock);
- decodeDXTBlockRGBA((u32*)dst + y * width + x + 4, (DXTBlock*)src, width);
- src += sizeof(DXTBlock);
- decodeDXTBlockRGBA((u32*)dst + (y + 4) * width + x, (DXTBlock*)src, width);
- src += sizeof(DXTBlock);
- decodeDXTBlockRGBA((u32*)dst + (y + 4) * width + x + 4, (DXTBlock*)src, width);
- src += sizeof(DXTBlock);
- }
- }
-#endif
break;
}
}
diff --git a/Source/Core/VideoCommon/VideoCommon.vcxproj b/Source/Core/VideoCommon/VideoCommon.vcxproj
index bf9122e6b5..0c1b13f301 100644
--- a/Source/Core/VideoCommon/VideoCommon.vcxproj
+++ b/Source/Core/VideoCommon/VideoCommon.vcxproj
@@ -111,8 +111,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <OpenMPSupport>false</OpenMPSupport>
- </ClCompile>
+ <OpenMPSupport>false</OpenMPSupport>
+ </ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
@@ -143,7 +143,7 @@
<ClCompile>
<AdditionalIncludeDirectories>..\Common\Src;..\Core\Src;..\..\..\Externals\SOIL;..\..\..\Externals\CLRun\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OpenMPSupport>false</OpenMPSupport>
- </ClCompile>
+ </ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -182,7 +182,6 @@
<ClCompile Include="Src\CommandProcessor.cpp" />
<ClCompile Include="Src\CPMemory.cpp" />
<ClCompile Include="Src\Debugger.cpp" />
- <ClCompile Include="Src\DLCache.cpp" />
<ClCompile Include="Src\EmuWindow.cpp" />
<ClCompile Include="Src\Fifo.cpp" />
<ClCompile Include="Src\FPSCounter.cpp" />
@@ -204,7 +203,6 @@
<ClCompile Include="Src\Statistics.cpp" />
<ClCompile Include="Src\TextureCacheBase.cpp" />
<ClCompile Include="Src\TextureConversionShader.cpp" />
- <ClCompile Include="Src\TextureDecoder.cpp" />
<ClCompile Include="Src\VertexLoader.cpp" />
<ClCompile Include="Src\VertexLoaderManager.cpp" />
<ClCompile Include="Src\VertexLoader_Color.cpp" />
@@ -216,6 +214,8 @@
<ClCompile Include="Src\VertexShaderManager.cpp" />
<ClCompile Include="Src\VideoConfig.cpp" />
<ClCompile Include="Src\VideoState.cpp" />
+ <ClCompile Include="Src\x64DLCache.cpp" />
+ <ClCompile Include="Src\x64TextureDecoder.cpp" />
<ClCompile Include="Src\XFMemory.cpp" />
<ClCompile Include="Src\XFStructs.cpp" />
</ItemGroup>
diff --git a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters
index e7019f17ed..6038d5e9e2 100644
--- a/Source/Core/VideoCommon/VideoCommon.vcxproj.filters
+++ b/Source/Core/VideoCommon/VideoCommon.vcxproj.filters
@@ -5,9 +5,6 @@
<ClCompile Include="Src\memcpy_amd.cpp" />
<ClCompile Include="Src\PixelEngine.cpp" />
<ClCompile Include="Src\VideoConfig.cpp" />
- <ClCompile Include="Src\DLCache.cpp">
- <Filter>Vertex Loading</Filter>
- </ClCompile>
<ClCompile Include="Src\VertexLoader.cpp">
<Filter>Vertex Loading</Filter>
</ClCompile>
@@ -92,9 +89,6 @@
<ClCompile Include="Src\OpcodeDecoding.cpp">
<Filter>Decoding</Filter>
</ClCompile>
- <ClCompile Include="Src\TextureDecoder.cpp">
- <Filter>Decoding</Filter>
- </ClCompile>
<ClCompile Include="Src\Debugger.cpp">
<Filter>Base</Filter>
</ClCompile>
@@ -122,6 +116,12 @@
<ClCompile Include="Src\FPSCounter.cpp">
<Filter>Util</Filter>
</ClCompile>
+ <ClCompile Include="Src\x64TextureDecoder.cpp">
+ <Filter>Decoding</Filter>
+ </ClCompile>
+ <ClCompile Include="Src\x64DLCache.cpp">
+ <Filter>Vertex Loading</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\CommandProcessor.h" />