diff --git a/desmume/src/cocoa/DeSmuME (Latest).xcodeproj/project.pbxproj b/desmume/src/cocoa/DeSmuME (Latest).xcodeproj/project.pbxproj index 8075e3dd5..d6b9ce4ba 100644 --- a/desmume/src/cocoa/DeSmuME (Latest).xcodeproj/project.pbxproj +++ b/desmume/src/cocoa/DeSmuME (Latest).xcodeproj/project.pbxproj @@ -197,6 +197,10 @@ AB4676F314AB12D60002FF94 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0A0D1914AACA9600E83E91 /* libz.dylib */; }; AB47B52E18A3F722009A42AF /* xbrz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB47B52C18A3F722009A42AF /* xbrz.cpp */; }; AB47B52F18A45C35009A42AF /* xbrz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB47B52C18A3F722009A42AF /* xbrz.cpp */; }; + AB4C81E41B21676C00ACECD5 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB4C81E31B21676C00ACECD5 /* hq3x.cpp */; }; + AB4C81E51B21676C00ACECD5 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB4C81E31B21676C00ACECD5 /* hq3x.cpp */; }; + AB4C81E61B21676C00ACECD5 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB4C81E31B21676C00ACECD5 /* hq3x.cpp */; }; + AB4C81E71B21677700ACECD5 /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB4C81E31B21676C00ACECD5 /* hq3x.cpp */; }; AB4FCEBD1692AB82000F498F /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB4FCEBC1692AB82000F498F /* Accelerate.framework */; }; AB4FCEBE1692AB82000F498F /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB4FCEBC1692AB82000F498F /* Accelerate.framework */; }; AB4FCEBF1692AB82000F498F /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB4FCEBC1692AB82000F498F /* Accelerate.framework */; }; @@ -1166,6 +1170,7 @@ AB407F391A620D6E00313213 /* DeSmuME (Latest).profdata */ = {isa = PBXFileReference; lastKnownFileType = file; path = "DeSmuME (Latest).profdata"; sourceTree = ""; }; AB47B52B18A3F722009A42AF /* xbrz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xbrz.h; sourceTree = ""; }; AB47B52C18A3F722009A42AF /* xbrz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xbrz.cpp; sourceTree = ""; }; + AB4C81E31B21676C00ACECD5 /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq3x.cpp; sourceTree = ""; }; AB4FCEBC1692AB82000F498F /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; AB5648FD186E6EA8002740F4 /* cocoa_slot2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa_slot2.h; sourceTree = ""; }; AB5648FE186E6EA8002740F4 /* cocoa_slot2.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = cocoa_slot2.mm; sourceTree = ""; }; @@ -1484,7 +1489,6 @@ ABFE14FE14C92FF5005D6699 /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq2x.cpp; sourceTree = ""; }; ABFE14FF14C92FF5005D6699 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hq2x.h; sourceTree = ""; }; ABFE150014C92FF5005D6699 /* hq4x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq4x.cpp; sourceTree = ""; }; - ABFE150214C92FF5005D6699 /* hq4x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hq4x.h; sourceTree = ""; }; ABFE150314C92FF5005D6699 /* interp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = interp.h; sourceTree = ""; }; ABFE150414C92FF5005D6699 /* lq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lq2x.cpp; sourceTree = ""; }; ABFE150514C92FF5005D6699 /* lq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lq2x.h; sourceTree = ""; }; @@ -2251,6 +2255,7 @@ ABFE14FB14C92FF5005D6699 /* bilinear.cpp */, ABFE14FC14C92FF5005D6699 /* epx.cpp */, ABFE14FE14C92FF5005D6699 /* hq2x.cpp */, + AB4C81E31B21676C00ACECD5 /* hq3x.cpp */, ABFE150014C92FF5005D6699 /* hq4x.cpp */, ABFE150414C92FF5005D6699 /* lq2x.cpp */, ABFE150614C92FF5005D6699 /* scanline.cpp */, @@ -2258,7 +2263,6 @@ AB47B52C18A3F722009A42AF /* xbrz.cpp */, ABFE14FD14C92FF5005D6699 /* filter.h */, ABFE14FF14C92FF5005D6699 /* hq2x.h */, - ABFE150214C92FF5005D6699 /* hq4x.h */, ABFE150314C92FF5005D6699 /* interp.h */, ABFE150514C92FF5005D6699 /* lq2x.h */, AB817A34143EE2DB00A7DFE9 /* videofilter.h */, @@ -2991,6 +2995,7 @@ ABD10AE81715FCDD00B5729D /* audiosamplegenerator.cpp in Sources */, ABD10AEB1715FCDD00B5729D /* mic_ext.cpp in Sources */, ABD42048172319D1006A9B46 /* FileMigrationDelegate.mm in Sources */, + AB4C81E51B21676C00ACECD5 /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3008,6 +3013,7 @@ AB796CF615CDCBA200C59155 /* cheatSystem.cpp in Sources */, AB796CF715CDCBA200C59155 /* common.cpp in Sources */, AB9038B517C5ED2200F410BD /* slot1comp_mc.cpp in Sources */, + AB4C81E41B21676C00ACECD5 /* hq3x.cpp in Sources */, AB796CF815CDCBA200C59155 /* cp15.cpp in Sources */, AB796CF915CDCBA200C59155 /* cpu_detect_x86_gcc.cpp in Sources */, AB796CFA15CDCBA200C59155 /* crc.cpp in Sources */, @@ -3309,6 +3315,7 @@ AB8F3CF51A53AC2600A80BF6 /* buffer.cpp in Sources */, AB8F3CF61A53AC2600A80BF6 /* compiler.cpp in Sources */, AB8F3CF71A53AC2600A80BF6 /* compilercontext.cpp in Sources */, + AB4C81E61B21676C00ACECD5 /* hq3x.cpp in Sources */, AB8F3CF81A53AC2600A80BF6 /* compilerfunc.cpp in Sources */, AB8F3CF91A53AC2600A80BF6 /* compileritem.cpp in Sources */, AB8F3CFA1A53AC2600A80BF6 /* context.cpp in Sources */, @@ -3400,6 +3407,7 @@ ABB3C6971501C04F00E0C22E /* Timestretcher.cpp in Sources */, ABB3C6981501C04F00E0C22E /* crc.cpp in Sources */, AB031B5518472F3100541888 /* cocoa_cheat.mm in Sources */, + AB4C81E71B21677700ACECD5 /* hq3x.cpp in Sources */, ABB3C6991501C04F00E0C22E /* decrypt.cpp in Sources */, ABB3C69A1501C04F00E0C22E /* header.cpp in Sources */, AB1773FF182ECA8A009F29DD /* slot2_passme.cpp in Sources */, diff --git a/desmume/src/cocoa/DeSmuME (XCode 3).xcodeproj/project.pbxproj b/desmume/src/cocoa/DeSmuME (XCode 3).xcodeproj/project.pbxproj index f0d606360..b48ff7f63 100644 --- a/desmume/src/cocoa/DeSmuME (XCode 3).xcodeproj/project.pbxproj +++ b/desmume/src/cocoa/DeSmuME (XCode 3).xcodeproj/project.pbxproj @@ -929,6 +929,11 @@ ABA93EB2178C7D4200CBF50B /* encrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABA93EAF178C7D4200CBF50B /* encrypt.cpp */; }; ABA93EB3178C7D4200CBF50B /* encrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABA93EAF178C7D4200CBF50B /* encrypt.cpp */; }; ABA93EB4178C7D4200CBF50B /* encrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABA93EAF178C7D4200CBF50B /* encrypt.cpp */; }; + ABAAEFFF1B22361800E1269D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABAAEFFE1B22361800E1269D /* hq3x.cpp */; }; + ABAAF0001B22361800E1269D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABAAEFFE1B22361800E1269D /* hq3x.cpp */; }; + ABAAF0011B22361800E1269D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABAAEFFE1B22361800E1269D /* hq3x.cpp */; }; + ABAAF0021B22361800E1269D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABAAEFFE1B22361800E1269D /* hq3x.cpp */; }; + ABAAF0031B22361800E1269D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABAAEFFE1B22361800E1269D /* hq3x.cpp */; }; ABAAFBEA172122B6005DDDBE /* FileMigrationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABAAFBE9172122B6005DDDBE /* FileMigrationDelegate.mm */; }; ABAAFBEB172122B6005DDDBE /* FileMigrationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABAAFBE9172122B6005DDDBE /* FileMigrationDelegate.mm */; }; ABAAFBEC172122B6005DDDBE /* FileMigrationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABAAFBE9172122B6005DDDBE /* FileMigrationDelegate.mm */; }; @@ -1441,6 +1446,7 @@ ABA6574A14511EC90077E5E9 /* cocoa_cheat.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = cocoa_cheat.mm; sourceTree = ""; }; ABA93EAE178C7D4200CBF50B /* encrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encrypt.h; path = ../encrypt.h; sourceTree = SOURCE_ROOT; }; ABA93EAF178C7D4200CBF50B /* encrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = encrypt.cpp; path = ../encrypt.cpp; sourceTree = SOURCE_ROOT; }; + ABAAEFFE1B22361800E1269D /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq3x.cpp; sourceTree = ""; }; ABAAFBE8172122B6005DDDBE /* FileMigrationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMigrationDelegate.h; sourceTree = ""; }; ABAAFBE9172122B6005DDDBE /* FileMigrationDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileMigrationDelegate.mm; sourceTree = ""; }; ABACB7391AAC46B20066F429 /* Icon_MicrophoneDarkGreen_256x256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon_MicrophoneDarkGreen_256x256.png; path = images/Icon_MicrophoneDarkGreen_256x256.png; sourceTree = ""; }; @@ -1754,7 +1760,6 @@ ABFE14FE14C92FF5005D6699 /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq2x.cpp; sourceTree = ""; }; ABFE14FF14C92FF5005D6699 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hq2x.h; sourceTree = ""; }; ABFE150014C92FF5005D6699 /* hq4x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hq4x.cpp; sourceTree = ""; }; - ABFE150214C92FF5005D6699 /* hq4x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hq4x.h; sourceTree = ""; }; ABFE150314C92FF5005D6699 /* interp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = interp.h; sourceTree = ""; }; ABFE150414C92FF5005D6699 /* lq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lq2x.cpp; sourceTree = ""; }; ABFE150514C92FF5005D6699 /* lq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lq2x.h; sourceTree = ""; }; @@ -2513,6 +2518,7 @@ ABFE14FB14C92FF5005D6699 /* bilinear.cpp */, ABFE14FC14C92FF5005D6699 /* epx.cpp */, ABFE14FE14C92FF5005D6699 /* hq2x.cpp */, + ABAAEFFE1B22361800E1269D /* hq3x.cpp */, ABFE150014C92FF5005D6699 /* hq4x.cpp */, ABFE150414C92FF5005D6699 /* lq2x.cpp */, ABFE150614C92FF5005D6699 /* scanline.cpp */, @@ -2520,7 +2526,6 @@ ABECB50818A460710052D52A /* xbrz.cpp */, ABFE14FD14C92FF5005D6699 /* filter.h */, ABFE14FF14C92FF5005D6699 /* hq2x.h */, - ABFE150214C92FF5005D6699 /* hq4x.h */, ABFE150314C92FF5005D6699 /* interp.h */, ABFE150514C92FF5005D6699 /* lq2x.h */, AB817A34143EE2DB00A7DFE9 /* videofilter.h */, @@ -3462,6 +3467,7 @@ ABECB50D18A460710052D52A /* xbrz.cpp in Sources */, ABECB51818A460910052D52A /* OGLDisplayOutput.cpp in Sources */, ABC3DEC11A96EA96009EC345 /* RomInfoPanel.mm in Sources */, + ABAAF0031B22361800E1269D /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3607,6 +3613,7 @@ ABECB50A18A460710052D52A /* xbrz.cpp in Sources */, ABECB51518A460910052D52A /* OGLDisplayOutput.cpp in Sources */, ABC3DEBD1A96EA96009EC345 /* RomInfoPanel.mm in Sources */, + ABAAEFFF1B22361800E1269D /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3782,6 +3789,7 @@ ABECB50918A460710052D52A /* xbrz.cpp in Sources */, ABECB51418A460910052D52A /* OGLDisplayOutput.cpp in Sources */, ABC3DEBE1A96EA96009EC345 /* RomInfoPanel.mm in Sources */, + ABAAF0001B22361800E1269D /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3957,6 +3965,7 @@ ABECB50C18A460710052D52A /* xbrz.cpp in Sources */, ABECB51718A460910052D52A /* OGLDisplayOutput.cpp in Sources */, ABC3DEC01A96EA96009EC345 /* RomInfoPanel.mm in Sources */, + ABAAF0021B22361800E1269D /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4102,6 +4111,7 @@ ABECB50B18A460710052D52A /* xbrz.cpp in Sources */, ABECB51618A460910052D52A /* OGLDisplayOutput.cpp in Sources */, ABC3DEBF1A96EA96009EC345 /* RomInfoPanel.mm in Sources */, + ABAAF0011B22361800E1269D /* hq3x.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings index 1ecef2323..d277a3d51 100644 Binary files a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings differ diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib index 398343f2e..57dc4ae1e 100644 --- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib @@ -2,13 +2,13 @@ 1050 - 14C1510 - 7702 - 1344.72 - 757.30 + 14D136 + 7706 + 1347.57 + 758.70 com.apple.InterfaceBuilder.CocoaPlugin - 7702 + 7706 NSArrayController @@ -1506,6 +1506,24 @@ 4 + + + HQ3x + + 2147483647 + + + 23 + + + + HQ3xS + + 2147483647 + + + 24 + HQ4x @@ -1984,7 +2002,7 @@ 1 - 6 + 70 {505, 10000000} @@ -2123,7 +2141,7 @@ 1 - 6 + 70 {490, 10000000} @@ -2238,7 +2256,7 @@ 1 - 6 + 70 {490, 10000000} @@ -2353,7 +2371,7 @@ 1 - 6 + 70 {490, 10000000} @@ -6395,7 +6413,6 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{13, 10}, {528, 388}} - 1 @@ -14583,7 +14600,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 1 - 6 + 70 {463, 10000000} @@ -19682,7 +19699,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 279 2 - {{1004, 23}, {204, 713}} + {{1004, 23}, {204, 754}} -461896704 Video Settings NSPanel @@ -19695,7 +19712,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{21, 18}, {162, 19}} + {{25, 19}, {162, 19}} YES @@ -19724,11 +19741,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{18, 14}, {132, 358}} + {{18, 14}, {132, 398}} + YES NO - 18 + 20 1 @@ -20014,6 +20032,34 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 75 + 67108864 + 131072 + HQ3x + + + 23 + 1211912448 + 0 + + + 400 + 75 + + + 67108864 + 131072 + HQ3xS + + + 24 + 1211912448 + 0 + + + 400 + 75 + + 67108864 131072 HQ4x @@ -20027,7 +20073,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 - + 67108864 131072 HQ4xS @@ -20041,7 +20087,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 - + 67108864 131072 2xBRZ @@ -20055,7 +20101,7 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 - + 67108864 131072 3xBRZ @@ -20064,34 +20110,6 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 20 1211912448 0 - - - 400 - 75 - - - 67108864 - 131072 - 4xBRZ - - - 21 - 1211912448 - 0 - - - 400 - 75 - - - 67108864 - 131072 - 5xBRZ - - - 22 - 1211912448 - 0 12779520 @@ -20117,27 +20135,24 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 - - {132, 18} - {4, 2} - 1151868928 - NSActionCell - - 67108864 - 131072 - Radio - - 1211912448 - 0 - - 549453824 - {18, 18} - - - - - - TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA + + 67108864 + 131072 + 4xBRZ + + + 21 + 1211912448 + 0 + + 549453824 + {18, 18} + + + + + + TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/ 29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5 @@ -20215,12 +20230,43 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 2vvbgNwF3IrdEN2W3hzeot8p36/gNuC94UThzOJT4tvjY+Pr5HPk/OWE5g3mlucf56noMui86Ubp0Opb 6uXrcOv77IbtEe2c7ijutO9A78zwWPDl8XLx//KM8xnzp/Q09ML1UPXe9m32+/eK+Bn4qPk4+cf6V/rn +3f8B/yY/Sn9uv5L/tz/bf//A + - + - - + + + + 400 + 75 + + 67108864 + 131072 + 5xBRZ + + + 22 + 1211912448 + 0 + + + 400 + 75 + + + {132, 18} + {4, 2} + 1151868928 + NSActionCell + + 67108864 + 131072 + Radio + + 1211912448 + 0 + 400 75 @@ -20231,12 +20277,14 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - {{1, 1}, {168, 382}} + {{1, 1}, {168, 422}} + - {{17, 41}, {170, 398}} + {{17, 42}, {170, 438}} + {0, 0} 67108864 @@ -20255,8 +20303,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{17, 685}, {113, 18}} + {{17, 726}, {113, 18}} + YES 67108864 @@ -20278,8 +20327,9 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 - {{17, 665}, {178, 18}} + {{17, 706}, {178, 18}} + _NS:682 YES @@ -20313,6 +20363,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{15, 12}, {87, 18}} + _NS:682 YES @@ -20336,11 +20387,13 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {168, 38}} + _NS:21 - {{17, 605}, {170, 54}} + {{17, 646}, {170, 54}} + _NS:18 {0, 0} @@ -20370,6 +20423,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 268 {{18, 14}, {132, 118}} + _NS:736 YES NO @@ -20663,11 +20717,13 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 {{1, 1}, {168, 142}} + _NS:21 - {{17, 443}, {170, 158}} + {{17, 484}, {170, 158}} + _NS:18 {0, 0} @@ -20685,7 +20741,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 NO - {204, 713} + {204, 754} + {{0, 0}, {1920, 1177}} {10000000000000, 10000000000000} @@ -26241,7 +26298,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 1 - 6 + 70 {525, 10000000} @@ -26721,7 +26778,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 1 - 6 + 70 {531, 10000000} @@ -26842,7 +26899,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 1 - 6 + 70 {523, 10000000} @@ -27368,7 +27425,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 0 - 6 + 70 {597, 10000000} @@ -28453,6 +28510,22 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 9349 + + + changeVideoPixelScaler: + + + + 10024 + + + + changeVideoPixelScaler: + + + + 10025 + launchWebsite: @@ -39591,12 +39664,12 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 797 - + @@ -41231,6 +41304,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + @@ -48162,6 +48237,8 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + @@ -52634,6 +52711,26 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 + + 10020 + + + + + 10021 + + + + + 10026 + + + + + 10027 + + + @@ -52651,6 +52748,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -53352,6 +53453,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -54999,9 +55101,11 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 com.apple.InterfaceBuilder.CocoaPlugin + {730, 913} com.apple.InterfaceBuilder.CocoaPlugin {{126, 189}, {204, 713}} + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -55876,7 +55980,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 - 10019 + 10027 @@ -56643,6 +56747,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id + id id id id @@ -56709,6 +56814,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 changeFirmwareSettings: id + + changeGpuDimensions: + id + changeHardwareMicGain: id @@ -56994,6 +57103,7 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 id id id + id id id id @@ -57064,6 +57174,10 @@ y7bMNcy1zTXNtc42zrbPN8+40DnQutE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp2 changeFirmwareSettings: id + + changeGpuDimensions: + id + changeHardwareMicGain: id diff --git a/desmume/src/filter/filter.h b/desmume/src/filter/filter.h index 23ba64a6c..d09ff8a27 100644 --- a/desmume/src/filter/filter.h +++ b/desmume/src/filter/filter.h @@ -31,9 +31,11 @@ void RenderNearest2X (SSurface Src, SSurface Dst); void RenderLQ2X (SSurface Src, SSurface Dst); void RenderLQ2XS (SSurface Src, SSurface Dst); void RenderHQ2X (SSurface Src, SSurface Dst); +void RenderHQ2XS (SSurface Src, SSurface Dst); +void RenderHQ3X (SSurface Src, SSurface Dst); +void RenderHQ3XS (SSurface Src, SSurface Dst); void RenderHQ4X (SSurface Src, SSurface Dst); void RenderHQ4XS (SSurface Src, SSurface Dst); -void RenderHQ2XS (SSurface Src, SSurface Dst); void Render2xSaI (SSurface Src, SSurface Dst); void RenderSuper2xSaI (SSurface Src, SSurface Dst); void RenderSuperEagle (SSurface Src, SSurface Dst); diff --git a/desmume/src/filter/hq2x.cpp b/desmume/src/filter/hq2x.cpp index 5bddcf4f7..b42612dfc 100644 --- a/desmume/src/filter/hq2x.cpp +++ b/desmume/src/filter/hq2x.cpp @@ -26,8 +26,8 @@ * this file, you may extend this exception to your version of the * file, but you are not obligated to do so. If you do not wish to * do so, delete this exception statement from your version. - */ - + */ + #include "filter.h" #include "interp.h" @@ -149,58 +149,60 @@ // } //} -static void hq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count) +static void hq2x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, unsigned count) { - unsigned i; - - for(i=0;i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = c[1]; - c[3] = c[4]; - c[6] = c[7]; - } - - if (i 0) + { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } + else + { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i < count - 1) + { + c[2] = src0[1]; + c[5] = src1[1]; + c[8] = src2[1]; + } + else + { + c[2] = c[1]; + c[5] = c[4]; + c[8] = c[7]; + } + + if (interp_32_diff(c[0], c[4])) + mask |= 1 << 0; + if (interp_32_diff(c[1], c[4])) + mask |= 1 << 1; + if (interp_32_diff(c[2], c[4])) + mask |= 1 << 2; + if (interp_32_diff(c[3], c[4])) + mask |= 1 << 3; + if (interp_32_diff(c[5], c[4])) + mask |= 1 << 4; + if (interp_32_diff(c[6], c[4])) + mask |= 1 << 5; + if (interp_32_diff(c[7], c[4])) + mask |= 1 << 6; + if (interp_32_diff(c[8], c[4])) + mask |= 1 << 7; + #define P0 dst0[0] #define P1 dst0[1] #define P2 dst1[0] @@ -223,11 +225,12 @@ static void hq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, #define I97(p0,p1) interp_32_97(c[p0], c[p1]) #define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2]) #define I151(p0,p1) interp_32_151(c[p0], c[p1]) - - switch (mask) { + + switch (mask) + { #include "hq2x.h" - } - + } + #undef P0 #undef P1 #undef P2 @@ -250,13 +253,13 @@ static void hq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, #undef I97 #undef I1411 #undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } + + src0 += 1; + src1 += 1; + src2 += 1; + dst0 += 2; + dst1 += 2; + } } /***************************************************************************/ @@ -404,77 +407,80 @@ static void hq2x_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, // } //} -static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, const u32* src2, unsigned count) +static void hq2xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, const u32 *src0, const u32 *src1, const u32 *src2, unsigned count) { - unsigned i; - - for(i=0;i0) { - c[0] = src0[-1]; - c[3] = src1[-1]; - c[6] = src2[-1]; - } else { - c[0] = src0[0]; - c[3] = src1[0]; - c[6] = src2[0]; - } - - if (i> 8; - const int r = (int)((c[j] & 0xF80000)) >> 16; - const int bright = r+r+r + g+g+g + b+b; - if(bright > maxBright) maxBright = bright; - if(bright < minBright) minBright = bright; - - brightArray[j] = bright; - } - int diffBright = ((maxBright - minBright) * 7) >> 4; - if(diffBright > 7) - { - const int centerBright = brightArray[4]; - if(ABS(brightArray[0] - centerBright) > diffBright) - mask |= 1 << 0; - if(ABS(brightArray[1] - centerBright) > diffBright) - mask |= 1 << 1; - if(ABS(brightArray[2] - centerBright) > diffBright) - mask |= 1 << 2; - if(ABS(brightArray[3] - centerBright) > diffBright) - mask |= 1 << 3; - if(ABS(brightArray[5] - centerBright) > diffBright) - mask |= 1 << 4; - if(ABS(brightArray[6] - centerBright) > diffBright) - mask |= 1 << 5; - if(ABS(brightArray[7] - centerBright) > diffBright) - mask |= 1 << 6; - if(ABS(brightArray[8] - centerBright) > diffBright) - mask |= 1 << 7; - } + u8 mask = 0; + u32 c[9]; + + c[1] = src0[0]; + c[4] = src1[0]; + c[7] = src2[0]; + + if (i > 0) + { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } + else + { + c[0] = src0[0]; + c[3] = src1[0]; + c[6] = src2[0]; + } + + if (i < count - 1) + { + c[2] = src0[1]; + c[5] = src1[1]; + c[8] = src2[1]; + } + else + { + c[2] = src0[0]; + c[5] = src1[0]; + c[8] = src2[0]; + } + + // hq2xS dynamic edge detection: + // simply comparing the center color against its surroundings will give bad results in many cases, + // so, instead, compare the center color relative to the max difference in brightness of this 3x3 block + int brightArray[9]; + int maxBright = 0, minBright = 999999; + for(int j = 0 ; j < 9 ; j++) + { + const int b = (int)((c[j] & 0xF8)); + const int g = (int)((c[j] & 0xF800)) >> 8; + const int r = (int)((c[j] & 0xF80000)) >> 16; + const int bright = r+r+r + g+g+g + b+b; + if(bright > maxBright) maxBright = bright; + if(bright < minBright) minBright = bright; + + brightArray[j] = bright; + } + int diffBright = ((maxBright - minBright) * 7) >> 4; + if(diffBright > 7) + { + const int centerBright = brightArray[4]; + if(ABS(brightArray[0] - centerBright) > diffBright) + mask |= 1 << 0; + if(ABS(brightArray[1] - centerBright) > diffBright) + mask |= 1 << 1; + if(ABS(brightArray[2] - centerBright) > diffBright) + mask |= 1 << 2; + if(ABS(brightArray[3] - centerBright) > diffBright) + mask |= 1 << 3; + if(ABS(brightArray[5] - centerBright) > diffBright) + mask |= 1 << 4; + if(ABS(brightArray[6] - centerBright) > diffBright) + mask |= 1 << 5; + if(ABS(brightArray[7] - centerBright) > diffBright) + mask |= 1 << 6; + if(ABS(brightArray[8] - centerBright) > diffBright) + mask |= 1 << 7; + } #define P0 dst0[0] #define P1 dst0[1] #define P2 dst1[0] @@ -497,11 +503,12 @@ static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, #define I97(p0,p1) interp_32_97(c[p0], c[p1]) #define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2]) #define I151(p0,p1) interp_32_151(c[p0], c[p1]) - - switch (mask) { + + switch (mask) + { #include "hq2x.h" - } - + } + #undef P0 #undef P1 #undef P2 @@ -524,13 +531,13 @@ static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, #undef I97 #undef I1411 #undef I151 - - src0 += 1; - src1 += 1; - src2 += 1; - dst0 += 2; - dst1 += 2; - } + + src0 += 1; + src1 += 1; + src2 += 1; + dst0 += 2; + dst1 += 2; + } } // //void hq2x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, @@ -562,32 +569,32 @@ static void hq2xS_32_def(u32* dst0, u32* dst1, const u32* src0, const u32* src1, // hq2x_16_def(dst0, dst1, src0, src1, src1, width); //} -void hq2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) +void hq2x32(const u8 *srcPtr, const u32 srcPitch, const u8 *dstPtr, const u32 dstPitch, const int width, const int height) { - u32 *dst0 = (u32 *)dstPtr; - u32 *dst1 = dst0 + (dstPitch >> 2); - - u32 *src0 = (u32 *)srcPtr; - u32 *src1 = src0 + (srcPitch >> 2); - u32 *src2 = src1 + (srcPitch >> 2); - hq2x_32_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2x_32_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 2; - --count; - } - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2x_32_def(dst0, dst1, src0, src1, src1, width); + u32 *dst0 = (u32 *)dstPtr; + u32 *dst1 = dst0 + (dstPitch >> 1); + + u32 *src0 = (u32 *)srcPtr; + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; + hq2x_32_def(dst0, dst1, src0, src0, src1, width); + + int count = height; + + count -= 2; + while (count) + { + dst0 += dstPitch; + dst1 += dstPitch; + hq2x_32_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch; + --count; + } + dst0 += dstPitch; + dst1 += dstPitch; + hq2x_32_def(dst0, dst1, src0, src1, src1, width); } // //void hq2xS(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, @@ -619,32 +626,32 @@ void hq2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, // hq2xS_16_def(dst0, dst1, src0, src1, src1, width); //} -void hq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) +void hq2xS32(const u8 *srcPtr, const u32 srcPitch, const u8 *dstPtr, const u32 dstPitch, const int width, const int height) { - u32 *dst0 = (u32 *)dstPtr; - u32 *dst1 = dst0 + (dstPitch >> 2); - - u32 *src0 = (u32 *)srcPtr; - u32 *src1 = src0 + (srcPitch >> 2); - u32 *src2 = src1 + (srcPitch >> 2); - hq2xS_32_def(dst0, dst1, src0, src0, src1, width); - - int count = height; - - count -= 2; - while(count) { - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2xS_32_def(dst0, dst1, src0, src1, src2, width); - src0 = src1; - src1 = src2; - src2 += srcPitch >> 2; - --count; - } - dst0 += dstPitch >> 1; - dst1 += dstPitch >> 1; - hq2xS_32_def(dst0, dst1, src0, src1, src1, width); + u32 *dst0 = (u32 *)dstPtr; + u32 *dst1 = dst0 + (dstPitch >> 1); + + u32 *src0 = (u32 *)srcPtr; + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; + hq2xS_32_def(dst0, dst1, src0, src0, src1, width); + + int count = height; + + count -= 2; + while (count) + { + dst0 += dstPitch; + dst1 += dstPitch; + hq2xS_32_def(dst0, dst1, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch; + --count; + } + dst0 += dstPitch; + dst1 += dstPitch; + hq2xS_32_def(dst0, dst1, src0, src1, src1, width); } //void hq2x_init(unsigned bits_per_pixel) @@ -652,28 +659,12 @@ void hq2xS32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, // interp_set(bits_per_pixel); //} -void RenderHQ2X (SSurface Src, SSurface Dst) +void RenderHQ2X(SSurface Src, SSurface Dst) { - - unsigned char *lpSrc, *lpDst; - - lpSrc = Src.Surface; - lpDst = Dst.Surface; - - hq2x32 (lpSrc, Src.Pitch*2, - lpSrc, - lpDst, Dst.Pitch*2 , Src.Width, Src.Height); + hq2x32(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch, Src.Width, Src.Height); } -void RenderHQ2XS (SSurface Src, SSurface Dst) +void RenderHQ2XS(SSurface Src, SSurface Dst) { - - unsigned char *lpSrc, *lpDst; - - lpSrc = Src.Surface; - lpDst = Dst.Surface; - - hq2xS32 (lpSrc, Src.Pitch*2, - lpSrc, - lpDst, Dst.Pitch*2 , Src.Width, Src.Height); + hq2xS32(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch, Src.Width, Src.Height); } diff --git a/desmume/src/filter/hq3x.cpp b/desmume/src/filter/hq3x.cpp new file mode 100644 index 000000000..07e6db9fc --- /dev/null +++ b/desmume/src/filter/hq3x.cpp @@ -0,0 +1,308 @@ +/* + * This file is part of the Advance project. + * + * Copyright (C) 2003 Andrea Mazzoleni + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * In addition, as a special exception, Andrea Mazzoleni + * gives permission to link the code of this program with + * the MAME library (or with modified versions of MAME that use the + * same license as MAME), and distribute linked combinations including + * the two. You must obey the GNU General Public License in all + * respects for all of the code used other than MAME. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to + * do so, delete this exception statement from your version. + */ + +#include "filter.h" +#include "interp.h" + + +/***************************************************************************/ +/* HQ3x C implementation */ + +/* + * This effect is a rewritten implementation of the hq3x effect made by Maxim Stepin + */ + +void hq3x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, int count) +{ + for (int i = 0; i < count; ++i) + { + u8 mask = 0; + u32 c[9]; + + c[1] = src0[0]; + c[4] = src1[0]; + c[7] = src2[0]; + + if (i > 0) + { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } + else + { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i < count - 1) + { + c[2] = src0[1]; + c[5] = src1[1]; + c[8] = src2[1]; + } + else + { + c[2] = c[1]; + c[5] = c[4]; + c[8] = c[7]; + } + + if (interp_32_diff(c[0], c[4])) + mask |= 1 << 0; + if (interp_32_diff(c[1], c[4])) + mask |= 1 << 1; + if (interp_32_diff(c[2], c[4])) + mask |= 1 << 2; + if (interp_32_diff(c[3], c[4])) + mask |= 1 << 3; + if (interp_32_diff(c[5], c[4])) + mask |= 1 << 4; + if (interp_32_diff(c[6], c[4])) + mask |= 1 << 5; + if (interp_32_diff(c[7], c[4])) + mask |= 1 << 6; + if (interp_32_diff(c[8], c[4])) + mask |= 1 << 7; + +#define P(a, b) dst##b[a] +#define MUR interp_32_diff(c[1], c[5]) +#define MDR interp_32_diff(c[5], c[7]) +#define MDL interp_32_diff(c[7], c[3]) +#define MUL interp_32_diff(c[3], c[1]) +#define I1(p0) c[p0] +#define I2(i0, i1, p0, p1) interp_32_##i0##i1(c[p0], c[p1]) +#define I3(i0, i1, i2, p0, p1, p2) interp_32_##i0##i1##i2(c[p0], c[p1], c[p2]) + + switch (mask) + { +#include "hq3x.dat" + } + +#undef P +#undef MUR +#undef MDR +#undef MDL +#undef MUL +#undef I1 +#undef I2 +#undef I3 + + src0 += 1; + src1 += 1; + src2 += 1; + dst0 += 3; + dst1 += 3; + dst2 += 3; + } +} + +void hq3xS_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, const u32 *src0, const u32 *src1, const u32 *src2, int count) +{ + for (int i = 0; i < count; ++i) + { + u8 mask = 0; + u32 c[9]; + + c[1] = src0[0]; + c[4] = src1[0]; + c[7] = src2[0]; + + if (i > 0) + { + c[0] = src0[-1]; + c[3] = src1[-1]; + c[6] = src2[-1]; + } + else + { + c[0] = c[1]; + c[3] = c[4]; + c[6] = c[7]; + } + + if (i < count - 1) + { + c[2] = src0[1]; + c[5] = src1[1]; + c[8] = src2[1]; + } + else + { + c[2] = c[1]; + c[5] = c[4]; + c[8] = c[7]; + } + + // hq3xS dynamic edge detection: + // simply comparing the center color against its surroundings will give bad results in many cases, + // so, instead, compare the center color relative to the max difference in brightness of this 3x3 block + int brightArray[9]; + int maxBright = 0, minBright = 999999; + for(int j = 0 ; j < 9 ; j++) + { + const int b = (int)((c[j] & 0xF8)); + const int g = (int)((c[j] & 0xF800)) >> 8; + const int r = (int)((c[j] & 0xF80000)) >> 16; + const int bright = r+r+r + g+g+g + b+b; + if(bright > maxBright) maxBright = bright; + if(bright < minBright) minBright = bright; + + brightArray[j] = bright; + } + unsigned int diffBright = ((maxBright - minBright) * 7) >> 4; + if(diffBright > 7) + { + const int centerBright = brightArray[4]; + if(ABS(brightArray[0] - centerBright) > diffBright) + mask |= 1 << 0; + if(ABS(brightArray[1] - centerBright) > diffBright) + mask |= 1 << 1; + if(ABS(brightArray[2] - centerBright) > diffBright) + mask |= 1 << 2; + if(ABS(brightArray[3] - centerBright) > diffBright) + mask |= 1 << 3; + if(ABS(brightArray[5] - centerBright) > diffBright) + mask |= 1 << 4; + if(ABS(brightArray[6] - centerBright) > diffBright) + mask |= 1 << 5; + if(ABS(brightArray[7] - centerBright) > diffBright) + mask |= 1 << 6; + if(ABS(brightArray[8] - centerBright) > diffBright) + mask |= 1 << 7; + } + +#define P(a, b) dst##b[a] +#define MUR false//(ABS(brightArray[1] - brightArray[5]) > diffBright) // top-right +#define MDR false//(ABS(brightArray[5] - brightArray[7]) > diffBright) // bottom-right +#define MDL false//(ABS(brightArray[7] - brightArray[3]) > diffBright) // bottom-left +#define MUL false//(ABS(brightArray[3] - brightArray[1]) > diffBright) // top-left +#define I1(p0) c[p0] +#define I2(i0, i1, p0, p1) interp_32_##i0##i1(c[p0], c[p1]) +#define I3(i0, i1, i2, p0, p1, p2) interp_32_##i0##i1##i2(c[p0], c[p1], c[p2]) + + switch (mask) + { +#include "hq3x.dat" + } + +#undef P +#undef MUR +#undef MDR +#undef MDL +#undef MUL +#undef I1 +#undef I2 +#undef I3 + + src0 += 1; + src1 += 1; + src2 += 1; + dst0 += 3; + dst1 += 3; + dst2 += 3; + } +} + +void hq3x32(const u8 *srcPtr, const u32 srcPitch, const u8 *dstPtr, const u32 dstPitch, const int width, const int height) +{ + u32 *dst0 = (u32 *)dstPtr; + u32 *dst1 = dst0 + (dstPitch / 3); + u32 *dst2 = dst1 + (dstPitch / 3); + + u32 *src0 = (u32 *)srcPtr; + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; + hq3x_32_def(dst0, dst1, dst2, src0, src0, src1, width); + + int count = height; + + count -= 2; + while (count) + { + dst0 += dstPitch; + dst1 += dstPitch; + dst2 += dstPitch; + hq3x_32_def(dst0, dst1, dst2, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch; + --count; + } + + dst0 += dstPitch; + dst1 += dstPitch; + dst2 += dstPitch; + hq3x_32_def(dst0, dst1, dst2, src0, src1, src1, width); +} + +void hq3x32S(const u8 *srcPtr, const u32 srcPitch, const u8 *dstPtr, const u32 dstPitch, const int width, const int height) +{ + u32 *dst0 = (u32 *)dstPtr; + u32 *dst1 = dst0 + (dstPitch / 3); + u32 *dst2 = dst1 + (dstPitch / 3); + + u32 *src0 = (u32 *)srcPtr; + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; + hq3xS_32_def(dst0, dst1, dst2, src0, src0, src1, width); + + int count = height; + + count -= 2; + while (count) + { + dst0 += dstPitch; + dst1 += dstPitch; + dst2 += dstPitch; + hq3xS_32_def(dst0, dst1, dst2, src0, src1, src2, width); + src0 = src1; + src1 = src2; + src2 += srcPitch; + --count; + } + + dst0 += dstPitch; + dst1 += dstPitch; + dst2 += dstPitch; + hq3xS_32_def(dst0, dst1, dst2, src0, src1, src1, width); +} + +void RenderHQ3X(SSurface Src, SSurface Dst) +{ + hq3x32(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch*3/2, Src.Width, Src.Height); +} + +void RenderHQ3XS(SSurface Src, SSurface Dst) +{ + hq3x32S(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch*3/2, Src.Width, Src.Height); +} + diff --git a/desmume/src/filter/hq3x.dat b/desmume/src/filter/hq3x.dat new file mode 100644 index 000000000..04168fbad --- /dev/null +++ b/desmume/src/filter/hq3x.dat @@ -0,0 +1,2913 @@ +/* + * This file is part of the Advance project. + * + * Copyright (C) 2004 Andrea Mazzoleni + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * In addition, as a special exception, Andrea Mazzoleni + * gives permission to link the code of this program with + * the MAME library (or with modified versions of MAME that use the + * same license as MAME), and distribute linked combinations including + * the two. You must obey the GNU General Public License in all + * respects for all of the code used other than MAME. If you modify + * this file, you may extend this exception to your version of the + * file, but you are not obligated to do so. If you do not wish to + * do so, delete this exception statement from your version. + */ + +/* + * This effect is a rewritten implementation of the hq effect made by Maxim Stepin + */ + +case 0 : +case 1 : +case 4 : +case 5 : +case 32 : +case 33 : +case 36 : +case 37 : +case 128 : +case 129 : +case 132 : +case 133 : +case 160 : +case 161 : +case 164 : +case 165 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 2 : +case 34 : +case 130 : +case 162 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 3 : +case 35 : +case 131 : +case 163 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 6 : +case 38 : +case 134 : +case 166 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 7 : +case 39 : +case 135 : +case 167 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 8 : +case 12 : +case 136 : +case 140 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 9 : +case 13 : +case 137 : +case 141 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 10 : +case 138 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 11 : +case 139 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 14 : +case 142 : +{ +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 5); + P(0, 1) = I1(4); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(0, 1) = I2(3, 1, 4, 3); +} +} break; +case 15 : +case 143 : +{ +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 5); + P(0, 1) = I1(4); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(0, 1) = I2(3, 1, 4, 3); +} +} break; +case 16 : +case 17 : +case 48 : +case 49 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 18 : +case 50 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 2); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 19 : +case 51 : +{ +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(0, 0) = I2(3, 1, 4, 3); + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 2); + P(2, 1) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 4, 5); +} +} break; +case 20 : +case 21 : +case 52 : +case 53 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 22 : +case 54 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 23 : +case 55 : +{ +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(0, 0) = I2(3, 1, 4, 3); + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 4, 5); +} +} break; +case 24 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 25 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 26 : +case 31 : +{ +P(1, 0) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 27 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 28 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 29 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 30 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 40 : +case 44 : +case 168 : +case 172 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 41 : +case 45 : +case 169 : +case 173 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} break; +case 42 : +case 170 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); + P(1, 0) = I1(4); + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 7); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 4, 1); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +} break; +case 43 : +case 171 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 7); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 4, 1); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +} break; +case 46 : +case 174 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 47 : +case 175 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I3(2, 1, 1, 4, 5, 7); +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 56 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 57 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 58 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 59 : +{ +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 60 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 61 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 62 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 63 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 64 : +case 65 : +case 68 : +case 69 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 66 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 67 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 70 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 71 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 72 : +case 76 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 6); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 73 : +case 77 : +{ +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 0) = I2(3, 1, 4, 1); + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 6); + P(1, 2) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 4, 7); +} +} break; +case 74 : +case 107 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); +} +} break; +case 75 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 78 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 79 : +{ +P(2, 0) = I2(3, 1, 4, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 80 : +case 81 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 82 : +case 214 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); +} +} break; +case 83 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 84 : +case 85 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 0) = I2(3, 1, 4, 1); + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(1, 2) = I2(3, 1, 4, 7); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 86 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 87 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 88 : +case 248 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); +} +if (MDR) { + P(2, 1) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 89 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 90 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 91 : +{ +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 92 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 93 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 94 : +{ +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 95 : +{ +P(1, 0) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MUL) { + P(0, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 96 : +case 97 : +case 100 : +case 101 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 98 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 99 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 102 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 103 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +} break; +case 104 : +case 108 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 105 : +case 109 : +{ +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 0) = I2(3, 1, 4, 1); + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 4, 7); +} +} break; +case 106 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 110 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 111 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 112 : +case 113 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +if (MDR) { + P(2, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 3); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 1) = I2(3, 1, 4, 5); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 114 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 115 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 116 : +case 117 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 118 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 119 : +{ +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MUR) { + P(0, 0) = I2(3, 1, 4, 3); + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 4, 5); +} +} break; +case 120 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 121 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 122 : +{ +P(1, 0) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MDR) { + P(2, 2) = I2(3, 1, 4, 8); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 123 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); +} +} break; +case 124 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +} break; +case 125 : +{ +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 0) = I2(3, 1, 4, 1); + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 4, 7); +} +} break; +case 126 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 127 : +{ +P(1, 1) = I1(4); +P(2, 2) = I2(3, 1, 4, 8); +if (MDL) { + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 144 : +case 145 : +case 176 : +case 177 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 146 : +case 178 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 2); + P(2, 1) = I1(4); + P(2, 2) = I2(3, 1, 4, 7); +} else { + P(1, 0) = I2(3, 1, 4, 1); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 147 : +case 179 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 148 : +case 149 : +case 180 : +case 181 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 150 : +case 182 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); + P(2, 2) = I2(3, 1, 4, 7); +} else { + P(1, 0) = I2(3, 1, 4, 1); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 151 : +case 183 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I3(2, 1, 1, 4, 3, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 152 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 153 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 154 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 155 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 156 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 157 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 158 : +{ +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 159 : +{ +P(1, 0) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 184 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 185 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 186 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 187 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 7); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 4, 1); + P(0, 1) = I2(3, 1, 3, 4); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +} break; +case 188 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 189 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +} break; +case 190 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); + P(2, 2) = I2(3, 1, 4, 7); +} else { + P(1, 0) = I2(3, 1, 4, 1); + P(2, 0) = I2(1, 1, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 191 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 7); +P(1, 2) = I2(3, 1, 4, 7); +P(2, 2) = I2(3, 1, 4, 7); +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 192 : +case 193 : +case 196 : +case 197 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 194 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 195 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 198 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 199 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 200 : +case 204 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 6); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 5); +} else { + P(0, 1) = I2(3, 1, 4, 3); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 201 : +case 205 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +} break; +case 202 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 203 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 206 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 207 : +{ +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 6); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(2, 0) = I2(3, 1, 4, 5); + P(0, 1) = I1(4); +} else { + P(0, 0) = I2(1, 1, 1, 3); + P(1, 0) = I2(3, 1, 1, 4); + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(0, 1) = I2(3, 1, 4, 3); +} +} break; +case 208 : +case 209 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 210 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 211 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 212 : +case 213 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 0) = I2(3, 1, 4, 1); + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(1, 2) = I2(3, 1, 4, 7); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 215 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 216 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 217 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 218 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 219 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); + P(0, 1) = I2(7, 1, 4, 3); +} +} break; +case 220 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +if (MDL) { + P(0, 2) = I2(3, 1, 4, 6); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 221 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(2, 0) = I2(3, 1, 4, 1); + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(2, 1) = I2(3, 1, 5, 4); + P(1, 2) = I2(3, 1, 4, 7); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 222 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); +} +} break; +case 223 : +{ +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 6); +if (MDR) { + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUL) { + P(0, 0) = I1(4); + P(0, 1) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(0, 1) = I2(7, 1, 4, 3); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); + P(2, 1) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(2, 1, 1, 4, 1, 5); + P(2, 1) = I2(7, 1, 4, 5); +} +} break; +case 224 : +case 225 : +case 228 : +case 229 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 226 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 227 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 230 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 231 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +} break; +case 232 : +case 236 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 5); +} else { + P(0, 1) = I2(3, 1, 4, 3); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 233 : +case 237 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I3(2, 1, 1, 4, 1, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +} break; +case 234 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MUL) { + P(0, 0) = I2(3, 1, 4, 0); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 235 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); +} +} break; +case 238 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I2(3, 1, 4, 5); +} else { + P(0, 1) = I2(3, 1, 4, 3); + P(0, 2) = I2(1, 1, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 239 : +{ +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 5); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I2(3, 1, 4, 5); +P(1, 2) = I1(4); +P(2, 2) = I2(3, 1, 4, 5); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +} break; +case 240 : +case 241 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +if (MDR) { + P(2, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 3); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(3, 1, 4, 5); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 242 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUR) { + P(2, 0) = I2(3, 1, 4, 2); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 243 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +if (MDR) { + P(2, 1) = I1(4); + P(0, 2) = I2(3, 1, 4, 3); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(3, 1, 4, 5); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); + P(1, 2) = I2(3, 1, 7, 4); + P(2, 2) = I2(1, 1, 5, 7); +} +} break; +case 244 : +case 245 : +{ +P(0, 0) = I3(2, 1, 1, 4, 1, 3); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 246 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); +} +} break; +case 247 : +{ +P(0, 0) = I2(3, 1, 4, 3); +P(1, 0) = I1(4); +P(0, 1) = I2(3, 1, 4, 3); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(0, 2) = I2(3, 1, 4, 3); +P(1, 2) = I1(4); +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; +case 249 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 2); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 1) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 250 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I1(4); +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); +} +if (MDR) { + P(2, 1) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +} break; +case 251 : +{ +P(2, 0) = I2(3, 1, 4, 2); +P(1, 1) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); + P(1, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(2, 1, 1, 4, 3, 7); + P(1, 2) = I2(7, 1, 4, 7); +} +if (MDR) { + P(2, 1) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(2, 2) = I3(7, 7, 2, 5, 7, 4); +} +if (MUL) { + P(0, 0) = I1(4); + P(1, 0) = I1(4); +} else { + P(0, 0) = I3(7, 7, 2, 1, 3, 4); + P(1, 0) = I2(7, 1, 4, 1); +} +} break; +case 252 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); +} +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 253 : +{ +P(0, 0) = I2(3, 1, 4, 1); +P(1, 0) = I2(3, 1, 4, 1); +P(2, 0) = I2(3, 1, 4, 1); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +} break; +case 254 : +{ +P(0, 0) = I2(3, 1, 4, 0); +P(1, 1) = I1(4); +if (MDL) { + P(0, 1) = I1(4); + P(0, 2) = I1(4); +} else { + P(0, 1) = I2(7, 1, 4, 3); + P(0, 2) = I3(7, 7, 2, 3, 7, 4); +} +if (MDR) { + P(2, 1) = I1(4); + P(1, 2) = I1(4); + P(2, 2) = I1(4); +} else { + P(2, 1) = I2(7, 1, 4, 5); + P(1, 2) = I2(7, 1, 4, 7); + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUR) { + P(1, 0) = I1(4); + P(2, 0) = I1(4); +} else { + P(1, 0) = I2(7, 1, 4, 1); + P(2, 0) = I3(7, 7, 2, 1, 5, 4); +} +} break; +case 255 : +{ +P(1, 0) = I1(4); +P(0, 1) = I1(4); +P(1, 1) = I1(4); +P(2, 1) = I1(4); +P(1, 2) = I1(4); +if (MDL) { + P(0, 2) = I1(4); +} else { + P(0, 2) = I3(2, 1, 1, 4, 3, 7); +} +if (MDR) { + P(2, 2) = I1(4); +} else { + P(2, 2) = I3(2, 1, 1, 4, 5, 7); +} +if (MUL) { + P(0, 0) = I1(4); +} else { + P(0, 0) = I3(2, 1, 1, 4, 1, 3); +} +if (MUR) { + P(2, 0) = I1(4); +} else { + P(2, 0) = I3(2, 1, 1, 4, 1, 5); +} +} break; diff --git a/desmume/src/filter/hq4x.cpp b/desmume/src/filter/hq4x.cpp index f54a227b3..03ff97290 100644 --- a/desmume/src/filter/hq4x.cpp +++ b/desmume/src/filter/hq4x.cpp @@ -39,15 +39,13 @@ */ -void hq4x_32_def(u32* dst0, u32* dst1, u32* dst2, u32* dst3, - const u32* src0, const u32* src1, const u32* src2, +void hq4x_32_def(u32 *__restrict dst0, u32 *__restrict dst1, u32 *__restrict dst2, u32 *__restrict dst3, + const u32 *src0, const u32 *src1, const u32 *src2, unsigned count, unsigned flag) { - unsigned i; - - for(i=0;i> 2); @@ -252,14 +246,15 @@ void hq4x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u32 *dst3 = dst2 + (dstPitch >> 2); u32 *src0 = (u32 *)srcPtr; - u32 *src1 = src0 + (srcPitch >> 2); - u32 *src2 = src1 + (srcPitch >> 2); + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; hq4x_32_def(dst0, dst1, dst2, dst3, src0, src0, src1, width, 0); int count = height; count -= 2; - while(count) { + while (count) + { dst0 += dstPitch; dst1 += dstPitch; dst2 += dstPitch; @@ -267,7 +262,7 @@ void hq4x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, hq4x_32_def(dst0, dst1, dst2, dst3, src0, src1, src2, width, 0); src0 = src1; src1 = src2; - src2 += srcPitch >> 2; + src2 += srcPitch; --count; } @@ -278,8 +273,7 @@ void hq4x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, hq4x_32_def(dst0, dst1, dst2, dst3, src0, src1, src1, width, 0); } -void hq4x32S(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, - u8 *dstPtr, u32 dstPitch, int width, int height) +void hq4x32S(const u8 *srcPtr, const u32 srcPitch, const u8 *dstPtr, const u32 dstPitch, const int width, const int height) { u32 *dst0 = (u32 *)dstPtr; u32 *dst1 = dst0 + (dstPitch >> 2); @@ -287,14 +281,15 @@ void hq4x32S(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u32 *dst3 = dst2 + (dstPitch >> 2); u32 *src0 = (u32 *)srcPtr; - u32 *src1 = src0 + (srcPitch >> 2); - u32 *src2 = src1 + (srcPitch >> 2); + u32 *src1 = src0 + srcPitch; + u32 *src2 = src1 + srcPitch; hq4xS_32_def(dst0, dst1, dst2, dst3, src0, src0, src1, width, 0); int count = height; count -= 2; - while(count) { + while (count) + { dst0 += dstPitch; dst1 += dstPitch; dst2 += dstPitch; @@ -302,7 +297,7 @@ void hq4x32S(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, hq4xS_32_def(dst0, dst1, dst2, dst3, src0, src1, src2, width, 0); src0 = src1; src1 = src2; - src2 += srcPitch >> 2; + src2 += srcPitch; --count; } @@ -313,26 +308,12 @@ void hq4x32S(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, hq4xS_32_def(dst0, dst1, dst2, dst3, src0, src1, src1, width, 0); } -void RenderHQ4X (SSurface Src, SSurface Dst) +void RenderHQ4X(SSurface Src, SSurface Dst) { - unsigned char *lpSrc, *lpDst; - - lpSrc = Src.Surface; - lpDst = Dst.Surface; - - hq4x32 (lpSrc, Src.Pitch*2, - lpSrc, - lpDst, Dst.Pitch*2 , Src.Width, Src.Height); + hq4x32(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch*2, Src.Width, Src.Height); } -void RenderHQ4XS (SSurface Src, SSurface Dst) +void RenderHQ4XS(SSurface Src, SSurface Dst) { - unsigned char *lpSrc, *lpDst; - - lpSrc = Src.Surface; - lpDst = Dst.Surface; - - hq4x32S (lpSrc, Src.Pitch*2, - lpSrc, - lpDst, Dst.Pitch*2 , Src.Width, Src.Height); + hq4x32S(Src.Surface, Src.Pitch >> 1, Dst.Surface, Dst.Pitch*2, Src.Width, Src.Height); } diff --git a/desmume/src/filter/hq4x.h b/desmume/src/filter/hq4x.h deleted file mode 100644 index ac47a01a3..000000000 --- a/desmume/src/filter/hq4x.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the Advance project. - * - * Copyright (C) 2003, 2004, 2008 Andrea Mazzoleni - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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 for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * In addition, as a special exception, Andrea Mazzoleni - * gives permission to link the code of this program with - * the MAME library (or with modified versions of MAME that use the - * same license as MAME), and distribute linked combinations including - * the two. You must obey the GNU General Public License in all - * respects for all of the code used other than MAME. If you modify - * this file, you may extend this exception to your version of the - * file, but you are not obligated to do so. If you do not wish to - * do so, delete this exception statement from your version. - */ - -#ifndef __HQ4X_H -#define __HQ4X_H - -#include "segment.h" - -void hq4x_16_def(interp_uint16* dst0, interp_uint16* dst1, interp_uint16* dst2, interp_uint16* dst3, const interp_uint16* src0, const interp_uint16* src1, const interp_uint16* src2, unsigned count, unsigned flag); -void hq4x_32_def(interp_uint32* dst0, interp_uint32* dst1, interp_uint32* dst2, interp_uint32* dst3, const interp_uint32* src0, const interp_uint32* src1, const interp_uint32* src2, unsigned count, unsigned flag); - -#endif - diff --git a/desmume/src/filter/videofilter.cpp b/desmume/src/filter/videofilter.cpp index 2f965b3d4..12ab1ada4 100644 --- a/desmume/src/filter/videofilter.cpp +++ b/desmume/src/filter/videofilter.cpp @@ -48,7 +48,9 @@ const VideoFilterAttributes VideoFilterAttributesList[] = { {VideoFilterTypeID_2xBRZ, "2xBRZ", &Render2xBRZ, 2, 1, 0}, {VideoFilterTypeID_3xBRZ, "3xBRZ", &Render3xBRZ, 3, 1, 0}, {VideoFilterTypeID_4xBRZ, "4xBRZ", &Render4xBRZ, 4, 1, 0}, - {VideoFilterTypeID_5xBRZ, "5xBRZ", &Render5xBRZ, 5, 1, 0} }; + {VideoFilterTypeID_5xBRZ, "5xBRZ", &Render5xBRZ, 5, 1, 0}, + {VideoFilterTypeID_HQ3X, "HQ3x", &RenderHQ3X, 3, 1, 0}, + {VideoFilterTypeID_HQ3XS, "HQ3xS", &RenderHQ3XS, 3, 1, 0} }; // Parameters for Scanline filter int scanline_filter_a = 0; diff --git a/desmume/src/filter/videofilter.h b/desmume/src/filter/videofilter.h index 12e3e268b..1c349f48f 100644 --- a/desmume/src/filter/videofilter.h +++ b/desmume/src/filter/videofilter.h @@ -70,6 +70,8 @@ enum VideoFilterTypeID VideoFilterTypeID_3xBRZ, VideoFilterTypeID_4xBRZ, VideoFilterTypeID_5xBRZ, + VideoFilterTypeID_HQ3X, + VideoFilterTypeID_HQ3XS, VideoFilterTypeIDCount // Make sure this one is always last };