diff --git a/.gitattributes b/.gitattributes
index 7ee6184..ffe0357 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5,3 +5,19 @@ TotalA.exe filter=lfs diff=lfs merge=lfs -text
TADemoM.ufo filter=lfs diff=lfs merge=lfs -text
TADemo/SERVER.EXE filter=lfs diff=lfs merge=lfs -text
mplayx.dll filter=lfs diff=lfs merge=lfs -text
+bassmix.dll filter=lfs diff=lfs merge=lfs -text
+basscd.dll filter=lfs diff=lfs merge=lfs -text
+basswasapi.dll filter=lfs diff=lfs merge=lfs -text
+tdraw.dll filter=lfs diff=lfs merge=lfs -text
+tplayx.dll filter=lfs diff=lfs merge=lfs -text
+bass.dll filter=lfs diff=lfs merge=lfs -text
+dplayx.dll filter=lfs diff=lfs merge=lfs -text
+tmusi.dll filter=lfs diff=lfs merge=lfs -text
+wgmus.dll filter=lfs diff=lfs merge=lfs -text
+bassflac.dll filter=lfs diff=lfs merge=lfs -text
+ddraw.dll filter=lfs diff=lfs merge=lfs -text
+ddraw_custom.dll filter=lfs diff=lfs merge=lfs -text
+dsound.dll filter=lfs diff=lfs merge=lfs -text
+win32.dll filter=lfs diff=lfs merge=lfs -text
+cnc-ddraw[[:space:]]config.exe filter=lfs diff=lfs merge=lfs -text
+shaders/shader-package.zip filter=lfs diff=lfs merge=lfs -text
diff --git a/1092 to 11 changelog.txt b/1092 to 11 changelog.txt
new file mode 100644
index 0000000..e2fc1e4
--- /dev/null
+++ b/1092 to 11 changelog.txt
@@ -0,0 +1,517 @@
+Version 11 changelog (from 10.92)
+- included new dplayx/tplayx setup from FunkyFr3sh
+- included new tdraw.dll with many fixes and features by Axle1975
+**Highlights and Bugfixes**
+- changed all T3 constructor names to say construction unit instead of giving them individual unit names. Updated all translations also
+- updated buildpics: Arm Banisher, Boa, G2, Impala, Invincible, Mofo, Odin, Orca, Pike, T3 Metal-making fusion, Core Raider, Harbinger, Neptune, Proteus, Smasher
+- fixed core antinuke cloak button
+- fixed non-functional Damascus nuke bomber bomb (was dropping way too early)
+- adjusted accuracy of Arm Orion nuke bomber so it doesn't overshoot its target (still does slightly, but within its area of effect)
+- Updated Arm Huntsman and Core Slingshot models, both now pop down turret(s) when not firing
+- increased Shiva cannon animation speed to keep up with fire rate
+- changed Arm Impala to 3-barrel gattling style, faster reload
+- changed Arm MoFo to 2-barrel main weapon, faster reload
+- changed Arm Wolf to 2-barrel annihilator weapon, faster reload
+- changed Arm Orca to 2-barrel main weapon, faster reload
+- changed Core Harbinger to 3-barrel main weapon, faster reload
+- changed Orca to 3-barrel main weapon, faster reload
+- changed Core Walking Construction Ship to a Walking Construction Sub (walks on land)
+- Updated Arm Samurai model to 8-barrel main weapon (2x4-barrel gattling) from 6 barrels (2x3)
+- Updated Core Broadsword model (thanks M1Garland)
+- updated bomb drop sounds
+
+**T1 updates**
+Rocko
+Damage 110 down from 115
+Reload 3.8s up from 3.7s
+DPS 28.9 down from 31.1
+OTA for reference: 105/4s 26.25 DPS
+Storm
+Damage 100 (unchanged)
+Reload 3.4s up from 3.2s
+DPS 29.3 down from 31.25
+OTA for reference: 100/3.7s 27 DPS
+Stumpy
+Health 1140 down from 1200
+OTA: 992 ProTA: 1200
+Speed 1.64 up from 1.6
+OTA: 1.7 ProTA: 1.65
+Raider
+Health 1200 health down from 1260
+OTA: 1058 ProTA: 1250
+Speed 1.58 up from 1.55
+OTA: 1.6 ProTA: 1.55
+
+**Defence Updates**
+Shark's Teeth: increased height of core one, was only 19 and arm's was 26. Both 26 now (both also waterline 3)
+
+Light Laser Towers:
+Arm
+Health 810 down from 860
+Core
+Health 840 down from 890
+OTA for reference: Health 700 and 710
+
+Floating Light Laser Towers:
+Arm Shrimp
+Energy 1740 down from 1840
+Metal 178 down from 195
+Build time 3660 down from 3900
+Health 695 down from 700
+Core Floater
+Energy 1750 down from 1850
+Metal 176 down from 190
+Build time 3620 down from 3800
+Health 710 down from 720
+
+Arm Sunspot (EMG Tower)
+Health 1050 down from 1100
+Core Immolator
+Health 1100 down from 1150
+
+Arm Radical short-range plasma cannon
+Health 2010 down from 2109
+Core Blocker short-range plasma cannon
+Health 2060 down from 2160
+
+Arm Sentinel
+Health 1550 down from 1630
+OTA: 1230 ProTA: 1250
+Core GAAT gun
+Health 1600 down from 1680
+OTA: 1200 ProTA: 1280
+Arm Stingray (Floating HLT)
+Health 1480 down from 1530
+OTA: 1325
+Core Thunderbolt (Floating HLT)
+Health 1540 down from 1590
+OTA: 1385
+
+Arm Guardian
+Health 2848 down from 3017
+OTA: 2477
+Damage 384 up from 380
+Reload 3s up from 2.9s
+DPS 128 down from 131
+Core Punisher
+Health 2921 down from 3080
+OTA: 2540
+Reload 2.8s up from 2.7s
+DPS 121.43 down from 125.9
+
+Arm Ambusher
+Health 3240 down from 3540
+OTA: 1658 ProTA: 2477
+Range 1350 (unchanged) ProTA: 1350
+Damage 520 up from 460
+Reload 3.65s up from 3.2s
+DPS 142.5 down from 143.75 ProTA: 120
+AOE 96 (unchanged) ProTA: 100
+Core Toaster
+Health 3320 down from 3592
+OTA: 1877 ProTA: 2540
+Range 1350 (unchanged) ProTA: 1350
+Damage 465 down from 490
+Reload 3.4s down from 3.5s
+DPS 136.8 down from 140 ProTA: 114.29
+AOE: 108 (unchanged) ProTA: 100
+
+Rapid fire medium range plasma cannons:
+Arm Archgun
+Metal 3036 down from 3136
+Build time 30360 up from 25088
+Health 2423 down from 2723
+Range 1480 (unchanged)
+Damage 260 (was 270)
+Reload 0.591s (was 0.55s)
+DPS 440 (was 540)
+AOE 64 (unchanged)
+Core Chainsaw
+Metal 3112 down from 3212
+Build time 31120 up from 25696
+Health 2482 down from 2782
+Range 1450 (unchanged)
+Damage 310 (unchanged)
+Reload 0.72s (was 0.66s)
+DPS 430.6 (was 469.7)
+AOE 80 (unchanged)
+
+Arm Annihilator
+Health 3520 down from 3620
+Core Doomsday Machine
+Health 3800 down from 3925
+
+Arm Moho Mine Health 1440 down from 1572
+Upgrade Health 3600 down from 3930
+Core Moho Mine health 1460 down from 1536
+Upgrade health 3650 down from 3840
+
+**Hover updates**
+Arm Anaconda
+Metal 199 up from 195
+Buildtime 3980 up from 3900
+Health 1040 down from 1110
+Core Snapper
+Metal 195 up from 192
+Buildtime 3900 up from 3840
+Health 1080 down from 1150
+
+Arm Mongoose T1 Assault Hover
+Metal 154 up from 150
+Buildtime 3696 up from 3600
+Core Gharial T1 Assault Hover
+Metal 158 up from 155
+Buildtime 3792 up from 3700
+
+Arm Grizzly T2 Skirmish/Antisub Hover
+Health 1920 down from 1960
+Speed 1.72 down from 1.8
+Core Kendo T2 Skirmish/Antisub Hover
+Health 2010 down from 2180
+Speed 1.68 down from 1.7
+
+Arm Hippo T2 Heavy Hovertank
+Health 3230 down from 3346
+Core Crusher T2 Heavy Hovertank
+Health 3620 down from 3775
+
+Arm Moose T2 Rapid Artillery Hover
+Energy 5589 Metal 428, up from 5389/418
+Build time 10272 up from 10032
+Damage 63 reload 0.75s 84 DPS down from 70/0.72s 97.2 DPS
+Health 1150 up from 1038
+Core Viceroy T2 Artillery Hover
+Energy 5962 Metal 441, up from 5562/431
+Build time 10584 up from 10344
+Damage/shot 96 reload 1.25s 76.8 DPS up from 105/1.45s 72.4 DPS
+Laser Damage 40 reload 0.8s 50 DPS down from 44/0.8 55 DPS
+Health 1360 (unchanged)
+
+Arm Wombat T2 Vlaunch Rocket Hover
+Metal 455 up from 435
+Buildtime 13650 up from 13050
+Health 905 down from 925
+Core Nixer T2 Vlaunch Rocket Hover
+Metal 450 up from 445
+Buildtime 13500 up from 13350
+Health 950 down from 990
+
+Arm Hovercraft Platform
+Metal 755 up from 715
+Build Time 7550 up from 7150
+Arm Floating Hovercraft Platform
+Metal 787 up from 747
+Build Time 7870 up from 7470
+Core Hovercraft Platform
+Metal 750M up from 710
+Build Time 7500 up from 7100
+Core Floating Hovercraft Platform
+Metal 780 up from 740
+Build Time 7800 up from 7400
+
+**T2 Updates**
+
+Arm Panther
+Health 1320 down from 1400
+Core Leveler
+Health 1440 down from 1560
+
+Arm Triton
+Metal 342 down from 349
+Build time 6156 up from 5520
+Health 2030 down from 2142
+Core Crock
+Metal 339M down from 342
+Build time 6048 up from 5472
+Health 2120 down from 2230
+
+Arm Luger
+Metal 276 down from 284
+Buildtime 4416 down from 4544
+Health 1040 up from 930
+Damage 216 down from 240
+Reload 3s (unchanged)
+DPS 72 down from 80
+OTA/ProTA: 130/2.75s 47.3 DPS
+Core Pillager
+Metal 284 down from 296
+Build time 4544 down from 4736
+Health 1130 up from 1010
+Damage 245 down from 280
+Reload 3.5s (unchanged)
+DPS 70 down from 80
+OTA/ProTA: 140/2.95s 47.46 DPS
+
+Arm Cipher Fast Stealth Tank
+Energy 8020 down from 8620
+Health 1780 down from 1880
+Speed 1.72 (unchanged)
+Core Cremator
+- changed description to "Flame Assault Tank"
+Energy 7200 up from 6400
+Metal 528 down from 548
+Buildtime 12672 up from 10960
+Health 2100 down from 2400
+Speed 1.68 up from 1.64
+Turnrate 390 up from 350
+
+Core Replenisher Mobile Air Repair pad
+Health 1100 down from 1150
+Speed 0.92 up from 0.78
+
+Arm Warrior
+Changed description to "Heavy Infantry Kbot"
+(was "Medium Infantry Kbot)
+Health 1400 down from 1480
+Speed 1.45 down from 1.54
+turnrate 850 up from 750
+Core Pyro - Assault Kbot (was "Fast Assault Kbot")
+Health 1280 down from 1350
+Speed 1.6 down from 1.65
+
+Arm Zeus
+changed description to "Armored Infantry Kbot"
+(was "Heavy Assault Kbot")
+Health 2560 up from 2500
+Speed 1.02 down from 1.05
+Core The Can - Armored Assault Kbot
+Health 2940 (unchanged)
+Speed 0.88 up from 0.85
+
+Core Gimp
+Changed description to "Underwater Amphib Kbot"
+Health 1540 down from 1660
+Removed ballistic cannon, added torpedo launcher
+Changed laser to 2-barrel
+Laser Damage 120 reload 1.3s DPS 92.3 (was 128/1.6s 80 DPS)
+Torpedo range 320 damage 116 reload 3.2s DPS 36.25
+
+Arm Maverick
+Health 1750 down from 1900
+Speed 1.4 (unchanged)
+Range 330 up from 320
+Core Reiver T2 Riot Kbot
+Energy 10295 up from 9695
+Metal 639 up from 599
+Build time 19170 up from 17970
+Health 2200 down from 2250
+Speed 1.3 up from 1.25
+Range 320 up from 310
+
+Arm Fido Burst Artillery Kbot
+Energy 3950 down from 4250
+Speed 1.35 down from 1.45
+Turnrate 720 down from 800
+Acceleration 0.06 down from 0.1
+Range 720 down from 750
+Damage 45 down from 48 (burst 4)
+Sprayangle 720 down from 800
+DPS 72 down from 76.8
+Core Morty
+Energy 3700 up from 3500
+Speed 1.2 (unchanged)
+Damage 96 down from 105
+DPS 66 down from 72.4
+Range 800 (unchanged)
+Improved script:
+- maximum time to fire while walking 0.2s (was 1.23s)
+
+Arm Kodiak Ballistic Rocket Kbot
+Health 1290 up from 1120
+Core Dominator Ballistic Rocket Kbot
+Health 1380 up from 1180
+
+Arm Odin - Fast Assault Kbot
+Energy 9800 up from 8800
+Metal 770 up from 730
+Buildtime 18480 up from 17520
+Health 2300 down from 2700
+Speed 1.7 up from 1.65
+
+Bertha and Intimidator: Made descriptions only show the energy/shot
+Same for Vulcan, Buzzsaw, Dora, Terminator
+
+**T3 Updates**
+
+Arm Indra Amphibious crawler
+Metal 4210M up from 3910
+Build time 84200 down from 93840
+Health 11000 up from 9400
+Damage 320 (unchanged)
+Reload 0.56s down from 0.7
+DPS 571 up from 457
+AOE 24 (unchanged)
+Core Boss Amphibious kbot
+Metal 4120 up from 3820
+Build time 82400 down from 91680
+Health 12000 up from 10200
+Damage 640 up from 450
+Reload 1.22s up from 1.1s
+DPS 525 up from 409
+AOE 108 (unchanged)
+
+Arm Razorback Heavy Assault Kbot
+Energy 95000 up from 89000
+Metal 6650 up from 6350
+Build time 159600 up from 152400
+Main weapon:
+Range 400 down from 420
+Noexplode weapon:
+Range 560 down from 640
+Damage 540+ up from 480+
+Reload 6.5s up from 6s
+DPS 83+ up from 80
+vlaunch AA missile (new):
+Range 800, DPS: 56 to ground 300 to air, AOE 64
+Core Ketzer Heavy Assault Kbot
+Energy 93600 up from 85600
+Metal 6740M up from 6240
+Build time 161760 up from 149760
+Main weapon:
+Range 408 down from 428
+noexplode weapon (new):
+Range 560, Damage 480+, Reload 5.8s, DPS 82.8+, AOE 48
+
+Arm Zephyr AA kbot
+Health 10560 up from 10000
+Core Jupiter AA kbot
+Health 11200 up from 10760
+Max speed 0.95 up from 0.9
+
+Arm Wolf - Amphibious Sniper doggo Kbot
+Health 15000 up from 13500
+Core Krab - Amphibious Energy Weapon (noexplode) Kbot
+Health 17200 up from 16000
+
+Arm Tiger - Heavy Assault Tank (with flak)
+Health 20800 up from 20200
+Core Rattlesnake - Rapid Laser Assault Tank
+Health 21600 up from 21200
+
+Arm Impala - Energy weapon (noexplode) Tank
+Health 14000 up from 13200
+Core War Machine - Energy Weapon Tank
+Health 15900 up from 14900
+
+Arm G2 - Rapid Artillery Tank
+149000E down from 156000E
+Health 23600 up from 21800
+Core Smasher - Heavy Artillery Tank
+144000E down from 150000E
+Health 24800 up from 23000
+
+Arm Scudd - Mobile Tactical Nuke Launcher
+Health 4250 down from 4800
+Turnrate 200 down from 210
+Core Precluder - Mobile Tactical Nuke Launcher
+Health 4500 down from 5400
+Turnrate 215 down from 230
+
+Arm Invincible
+Gauss weapon Damage 450 down from 480
+Reload 0.45s down from 0.55s
+DPS 1000 up from 872.7
+Range 820 (unchanged)
+AOE 32 (unchanged)
+Ballistic Rocket:
+
+Core Excelsior - Battlecruiser
+Riot weapon Damage 640 up from 450
+Reload 0.7s up from 0.5s
+DPS 914 up from 900
+Range 800 (unchanged)
+AOE 108 (unchanged)
+
+Arm Samurai - Dreadnaught Hovercraft
+499100E, 22500M, 540000 BT up from 459100E 21200M 508800 BT
+Health 42000 up from 37000
+Damage 450 reload 0.35 1286DPS up from 480/0.4 1200 DPS
+Core Broadsword - Dreadnaught Hovercraft
+520600E, 23100M, 554400 BT up from 480600E 21800M 523200 BT
+Health 45000 up from 40000
+Damage 1000 reload 0.8 1250DPS up from 1000/0.92 1087 DPS
+
+**Eco Updates**
+Moho Metal makers: reduced costs, big reduction in build time
+Reduced production, and slightly reduced energy to metal conversion efficiency
+Arm Moho Metal Maker
+Energy 16360 down from 19635
+Metal 50 down from 55
+Buildtime 30000 down from 44000
+Energy use 800 down from 900
+Metal production 14 down from 16
+(Efficiency 57.2E/1M, was 56.25)
+OTA/ProTA: -800E/+16M, efficiency 50E/1M
+Death Explosion ESTOR_BUILDINGEX (900 damage 220 AOE) was ESTOR_BUILDING (1900 damage 420 AOE)
+Self-D explosion ESTOR_BUILDING (unchanged)
+
+Core Moho Metal Maker
+Energy 15845 down from 17680
+Metal 46 down from 50
+Buildtime 27600 down from 40000
+Energy use 700 down from 800
+Metal production 12 down from 14
+(efficiency 58.3E/1M, was 57.2E/1M)
+OTA/ProTA: -625E/12M, efficiency 52.1E/1M
+Death Explosion ESTOR_BUILDINGEX (900 damage 220 AOE) was LARGE_BUILDING (1800 damage 400 AOE)
+Self-D explosion LARGE_BUILDING (unchanged)
+
+Arm Underwater Moho Metal Maker
+Energy 18200 down from 21051
+Metal 85 down from 120
+Buildtime 34000 down from 48000
+Energy use 916 down from 1020
+Metal production 16 down from 18
+(efficiency 57.25E/1M, was 56.67)
+Death and self-d explosion same as land version (was LARGE_BUILDING/LARGE_BUILDING)
+
+Core Underwater Moho Metal Maker
+Energy 17800 down from 18077
+Metal 80 down from 108
+Buildtime 32000 down from 43200
+Energy Use 860 up from 850
+Metal production 15 (unchanged)
+(efficiency 57.33E/1M, was 56.67)
+Death and self-d explosion same as land version (was LARGE_BUILDING/LARGE_BUILDING)
+
+Arm Cloaking Fusion
+Energy 73816 up from 72816
+Metal 6275 down from 6845
+Build Time 150600 up from 136900
+Energy Production 1500 down from 1600
+Cloak Cost 300 down from 320
+
+Core Cloaking Fusion
+Energy 79850 (unchanged)
+Metal 6784 down from 7582
+Build time 162816 up from 151640
+Energy Production 1700 down from 1900
+Cloak Cost 350 down from 400
+
+Arm Underwater Fusion
+Energy 56787 down from 63787
+Metal 7085 up from 6785
+Build time 141700 up from 135700
+Energy production 1400 down from 1500
+
+Core Underwater Fusion
+Energy 62849 down from 69849
+Metal 7520 up from 7460
+Buildtime 150400 up from 149200
+Energy Production 1600 down from 1800
+
+Arm Metal Making Super Fusion
+Energy 629900 up from 599900
+Metal 43800 up from 40800
+Build time 876000 up from 816000
+Makes 10500 energy up from 10k
+turned on trades -5k for +90 metal down from +96
+Cloaks for 1000E (unchanged)
+
+Core Metal Making Uber Fusion
+Energy 699800 up from 679800
+Metal 47700M u from 45200
+Build time 954000 up from 904000
+Makes 12k energy (unchanged)
+turned on trades -6k for +108 metal down from +115
+Cloaks for 1100E (unchanged)
\ No newline at end of file
diff --git a/1092 to 113 changelog.txt b/1092 to 113 changelog.txt
new file mode 100644
index 0000000..c74f5bb
--- /dev/null
+++ b/1092 to 113 changelog.txt
@@ -0,0 +1,785 @@
+Version 11.3 changelog (from 11.2)
+- fixed crashing on water maps due to sfx issue
+- fixed shipyard buildpic on some core cons units
+- fixed swapped shipyard and airplant build buttons on some arm cons units
+- updated buildpics for Arm Assassin, Arm Samurai and Core Adonis T3 hovers
+- more tweaked/improved sounds
+- small increase in metal cost and buildtime for T3 fusions
+
+Version 11.2 changelog (from 10.92)
+- included new dplayx/tplayx setup from FunkyFr3sh
+- included new tdraw.dll with many fixes and features by Axle1975
+**Engine Updates** thanks to Axle1975
+- Set start positions based on teams (or alliances) set in battleroom
+- Repair battleroom team icons so they can be used to create teams before launching
+- Add +autoteam battleroom and in-game commands (host only) to automatically assign teams (in battleroom: by skill level. Ingame: by map position.)
+- Add +randomteam battleroom command (host only) to automatically assign random teams
+- Add gui buttons for common commands on H sharing dialog: +shootall, +noshake, .ready
+- Add gui button for .autopause in battleroom (active for host only)
+- ClickSnap to snap to nearest mex, geo or reclaimable feature (mayhem default/maximum: mex 3, reclaim 1)
+- add clicksnap settings to ctrl-F2 ingame dialog
+- Show clock and weather report (wind and tidal strength) on top resource panel (no need for +clock)
+- Sync wind speed across all players
+- Add .exereport, .tdreport, .tpreport, .gp3report, .crcreport battleroom commands to report CRC32 of each player's totala.exe, tdraw.dll, tplayx.dll, mayhem.gp3 or all of them respectively
+- Add ability to move queued orders
+- Con units patrol behaviour - hold position: reclaim only
+- Enable start button in multiplayer lobby if only one player + AI are present
+- Fix Allied victory if more than 2 players on a team still ingame
+- Fix the "ghost commander" bug (remote commanders appear in top left of map during first 50sec of game)
+- Fix the "units exploding in factories" bug by holding back recycling of deceased units' IDs for 5 seconds
+- Option to render DTs and fortwalls that belong to the map (not built by a player)
+- Supress "qqqqqq" whiteboard marker lables when "q" is used as the whiteboard key
+- Set default resolution on new installs to 1024x768
+- Disable relay of F11 chatmacro text to other players (watchers can no longer exploit this to chat to players)
+- Prevent +logo commands from affecting other players - changes colour for local only
+- Change whiteboard, mappos and resource indicator colours in response to +logo commands
+- Ctrl-B selects only construction units, not mobile repair pads or carriers
+- Ctrl-F centres view on idle factory, selects only factories not silos etc
+- Set +lostype as a cheatcode (not available unless cheats enabled)
+- Increase megamap FPS. Add FPS counter to megamap (in F10 dev mode with cheats enabled)
+- Grey background on mega map to distinguish from unmapped area
+- Prevent Ctrl-F2 dialog and allies resource bar from moving off screen
+- Improve responsiveness of whiteboard marker movements sent to remote players
+- Render cursor while in megamap
+- Fix crash when removing markers
+- Fix crash on simultaneous whiteboard marker move and delete
+- Fix rare crash on TA Hook line drawing
+- Radar and sonar jammers no longer jam your own radar and sonar in >3 player multiplayer
+
+**Highlights and Bugfixes**
+- fixed sfx issues on water maps - hovers, subs, ships, amphib units
+- reduced commander animation at game start to 5 seconds from 52 seconds (because ghost commander bug is fixed!)
+- Arm and Core Construction Kbot faster open/close
+- fixes to all mobile constructor building logic, no random interruption with rapid-building (eg nanoblocking with dts etc)
+...this makes them more consistent but actually means nanoframes may not hang around for as long, because the construction unit will get out its nanolathe faster and start building - a nanoframe that hasn't been started on lasts longer than one that has.
+- changed self-destruct countdown on solars, wind generators and tidal generators (basic ones) to 3 secs instead of 5. - Changed self-d explosion to much smaller weapon that doesn't damage neighbouring units (small_unitex instead of small_building).
+- reduced durability of most corpses, especially T3 ones
+- fixed footprint sizes of of many corpses to match the unit - to avoid overlapping when resurrected
+- reduced health of corpses back to OTA levels - in some case lower than OTA.
+- drastically reduced health of T3 corpses
+- added more team colour to all hovercraft platforms at all tech levels
+- fixed core antinuke cloak button
+- fixed Core Mammoth torp and missing sonar
+- changed Gimp to 2-barrel laser, removed ballistic cannon, added small torpedo launcher, add short-range sonar
+- Updated Arm Huntsman and Core Slingshot models, both now pop down turret(s) when not firing
+- improved Arm Bulldog model
+- added basic build menus to Decoy Commanders (just resource/storage, radar/sonar)
+- improved Ranger model, improved Ranger and Hydra firing animation
+- reverted Hawk and Vamp to have 2 missile launchers (this was supposed to happen long ago)...
+- increased build distances for T2 constructors from 120-150 to 150-180
+- increased build distances for T3 constructors from 160-200 to 224-270
+- increased build speeds for T3 constructors
+- changed all T3 constructor names to say construction unit instead of giving them individual unit names. Updated all translations also
+- fixed intermittent crash bug with Orca/Proteus
+- updated buildpics: Arm Boa, Huntsman, Odin, Pike, Banisher, G2, Impala, Invincible, Mofo, Orca, T3 Metal-making fusion; Core Raider, Slingshot, Harbinger, Neptune, Proteus, Smasher
+- improved walking/aiming script for Razorback and Ketzer so they are ready to fire immediately instead of waiting for the current walk cycle to complete (~2.5 seconds)
+- fixed non-functional Damascus nuke bomber bomb (was dropping way too early)
+- adjusted accuracy of Arm Orion nuke bomber so it doesn't overshoot its target (still does slightly, but within its area of effect)
+- increased Shiva cannon animation speed to keep up with fire rate
+- changed Arm Impala to 3-barrel gattling style, faster reload
+- changed Arm MoFo to 2-barrel main weapon, faster reload
+- changed Arm Wolf to 2-barrel annihilator weapon, faster reload
+- changed Arm Orca to 2-barrel main weapon, faster reload
+- changed Core Harbinger to 3-barrel main weapon, faster reload
+- changed Orca to 3-barrel main weapon, faster reload
+- changed Core Walking Construction Ship to a Walking Construction Sub (walks on land)
+- reduced footprint of T3 super fusions
+- Updated Arm Samurai model to 8-barrel main weapon (2x4-barrel gattling) from 6 barrels (2x3)
+- Updated Core Broadsword model (thanks M1Garland)
+- Updated Arm T3 Construction Kbot model and script for increased readability
+- updated bomb drop sounds
+- added new sound schemes for most T3 land units
+- added new cannon sounds for many units
+- Arm Ghost T3 Amphibious Jammer added shootme=1
+
+
+**T1 updates**
+
+Rocko
+Damage 110 down from 115
+Reload 3.8s up from 3.7s
+DPS 28.9 down from 31.1
+OTA for reference: 105/4s 26.25 DPS
+Storm
+Damage 100 (unchanged)
+Reload 3.4s up from 3.2s
+DPS 29.3 down from 31.25
+OTA for reference: 100/3.7s 27 DPS
+
+Stumpy
+Health 1140 down from 1200
+OTA: 992 ProTA: 1200
+Speed 1.64 up from 1.6
+OTA: 1.7 ProTA: 1.65
+Raider
+Health 1200 health down from 1260
+OTA: 1058 ProTA: 1250
+Speed 1.58 up from 1.55
+OTA: 1.6 ProTA: 1.55
+
+
+**Defence Updates**
+
+Shark's Teeth: increased height of core one, was only 19 and arm's was 26. Both 26 now (both also waterline 3)
+
+Light Laser Towers:
+Arm
+Health 810 down from 860
+Core Health 840 down from 890
+OTA for reference: Health 700 and 710
+
+Floating Light Laser Towers:
+Arm Shrimp
+Energy 1740 down from 1840
+Metal 178 down from 195
+Build time 3660 down from 3900
+Health 695 down from 700
+Core Floater
+Energy 1750 down from 1850
+Metal 176 down from 190
+Build time 3620 down from 3800
+Health 710 down from 720
+
+Arm Sunspot (EMG Tower)
+Health 1050 down from 1100
+Core Immolator
+Health 1100 down from 1150
+
+Arm Radical short-range plasma cannon
+Health 2010 down from 2109
+Core Blocker short-range plasma cannon
+Health 2060 down from 2160
+
+Arm Sentinel
+Health 1550 down from 1630
+OTA: 1230 ProTA: 1250
+Core GAAT gun
+Health 1600 down from 1680
+OTA: 1200 ProTA: 1280
+Arm Stingray (Floating HLT)
+Health 1480 down from 1530
+OTA: 1325
+Core Thunderbolt (Floating HLT)
+Health 1540 down from 1590
+OTA: 1385
+
+Arm Guardian
+Health 2848 down from 3017
+OTA: 2477
+Damage 384 up from 380
+Reload 3s up from 2.9s
+DPS 128 down from 131
+Core Punisher
+Health 2921 down from 3080
+OTA: 2540
+Reload 2.8s up from 2.7s
+DPS 121.43 down from 125.9
+
+Arm Ambusher
+new gun sound
+Health 2940 down from 3540
+Double health when closed (was 2.5x)
+OTA: 1658 ProTA: 2477
+Range 1350 (unchanged) ProTA: 1350
+Damage 520 up from 460
+Reload 3.65s up from 3.2s
+DPS 142.5 down from 143.75 ProTA: 120
+AOE 96 (unchanged) ProTA: 100
+Core Toaster
+new gun sound
+Health 3020 down from 3592
+Double health when closed (was 2.5x)
+OTA: 1877 ProTA: 2540
+Range 1350 (unchanged) ProTA: 1350
+Damage 465 down from 490
+Reload 3.4s down from 3.5s
+DPS 136.8 down from 140 ProTA: 114.29
+AOE: 108 (unchanged) ProTA: 100
+
+Rapid fire medium range plasma cannons:
+Arm Archgun
+new gun sound
+Metal 3036 down from 3136
+Build time 30360 up from 25088
+Health 2423 down from 2723
+Range 1480 (unchanged)
+Damage 260 (was 270)
+Reload 0.591s (was 0.55s)
+DPS 440 (was 540)
+AOE 64 (unchanged)
+Core Chainsaw
+new gun sound
+Metal 3112 down from 3212
+Build time 31120 up from 25696
+Health 2482 down from 2782
+Range 1450 (unchanged)
+Damage 310 (unchanged)
+Reload 0.72s (was 0.66s)
+DPS 430.6 (was 469.7)
+AOE 80 (unchanged)
+
+Arm Annihilator
+Health 3520 down from 3620
+Core Doomsday Machine
+Health 3800 down from 3925
+
+T2 pop-up missile towers:
+Arm Warden
+Energy 3430 down from 3830
+Metal 330 up from 320
+Build Time 6600 down from 7680
+Armored state when closed 50% (1800 health) instead of 40% (2250)
+DPS 59.72 to ground/323.6 to air, was 53.75/293.75
+Core Smiter
+Energy 3405 down from 3905
+Metal 322 up from 312
+Buildtime 6440 down from 7488
+Armored state when closed 50% (1840 health) instead of 40% (2300)
+DPS 60 to ground/324 to air, was 40.54/218.9
+
+T2 Submersible missile towers:
+Arm Pantheon
+Energy 3687 down from 4287
+Metal 358 (unchanged)
+buildtime 7160 down from 8592
+Health 840 down from 860
+DPS 59.72 to ground/323.6 to air, was 53.75/293.75
+Core Duster
+Energy 3624 down from 4324
+Metal 348 (unchanged)
+buildtime 6960 down from 8352
+Health 850 down from 870
+DPS 60 to ground/324 to air, was 48.93/264.3
+
+Arm Moho Mine Health 1440 down from 1572
+Upgrade Health 3600 down from 3930
+Core Moho Mine health 1460 down from 1536
+Upgrade health 3650 down from 3840
+
+
+**Hover updates**
+
+Arm Anaconda
+Metal 199 up from 195
+Buildtime 3980 up from 3900
+Health 1040 down from 1110
+Core Snapper
+Metal 195 up from 192
+Buildtime 3900 up from 3840
+Health 1080 down from 1150
+
+Arm Mongoose T1 Assault Hover
+Metal 154 up from 150
+Buildtime 3696 up from 3600
+Core Gharial T1 Assault Hover
+Metal 158 up from 155
+Buildtime 3792 up from 3700
+
+Arm Grizzly T2 Skirmish/Antisub Hover
+Health 1920 down from 1960
+Speed 1.72 down from 1.8
+Gauss weapon reload 1.7s up from 1.5s
+Damage 220 up from 210
+DPS 129.4 down from 140
+Core Kendo T2 Skirmish/Antisub Hover
+Health 2010 down from 2180
+Speed 1.68 down from 1.7
+Script error fixed - reload was 0.85s, 211.8 DPS should have been 1.3s, 138.5 DPS
+New reload 1.44s, 125 DPS
+new laser weapon sound
+
+Arm Hippo T2 Heavy Hovertank
+New cannon sound
+Health 3230 down from 3346
+Core Crusher T2 Heavy Hovertank
+New cannon sound
+Health 3620 down from 3775
+
+Arm Moose T2 Rapid Artillery Hover
+Energy 5589 Metal 428, up from 5389/418
+Build time 10272 up from 10032
+Damage 63 reload 0.75s 84 DPS down from 70/0.72s 97.2 DPS
+Health 1150 up from 1038
+Core Viceroy T2 Artillery Hover
+Energy 5962 Metal 441, up from 5562/431
+Build time 10584 up from 10344
+Damage/shot 96 reload 1.25s 76.8 DPS up from 105/1.45s 72.4 DPS
+Laser Damage 40 reload 0.8s 50 DPS down from 44/0.8 55 DPS
+Health 1360 (unchanged)
+
+Arm Wombat T2 Vlaunch Rocket Hover
+Metal 455 up from 435
+Buildtime 13650 up from 13050
+Health 905 down from 925
+Core Nixer T2 Vlaunch Rocket Hover
+Metal 450 up from 445
+Buildtime 13500 up from 13350
+Health 950 down from 990
+
+Arm Hovercraft Platform
+Metal 755 up from 715
+Build Time 7550 up from 7150
+Arm Floating Hovercraft Platform
+Metal 787 up from 747
+Build Time 7870 up from 7470
+Core Hovercraft Platform
+Metal 750M up from 710
+Build Time 7500 up from 7100
+Core Floating Hovercraft Platform
+Metal 780 up from 740
+Build Time 7800 up from 7400
+
+
+**T2 Updates**
+
+Arm Panther
+Health 1320 down from 1400
+Core Leveler
+Health 1440 down from 1560
+
+Arm Triton
+Metal 342 down from 349
+Build time 6156 up from 5520
+Health 2030 down from 2142
+Core Crock
+New cannon sound
+Metal 339M down from 342
+Build time 6048 up from 5472
+Health 2120 down from 2230
+
+Arm Luger
+New cannon sound
+Health 1040 up from 930
+Damage 225 down from 240
+Reload 3s (unchanged)
+DPS 75 down from 80
+OTA/ProTA: 130/2.75s 47.3 DPS
+Core Pillager
+New cannon sound
+Health 1130 up from 1010
+Damage 262 down from 280
+Reload 3.5s (unchanged)
+DPS 74.9 down from 80
+OTA/ProTA: 140/2.95s 47.46 DPS
+
+Arm Cipher Fast Stealth Tank
+Energy 8020 down from 8620
+Health 1780 down from 1880
+Speed 1.72 (unchanged)
+Core Cremator
+- changed description to "Flame Assault Tank"
+Energy 7200 up from 6400
+Metal 528 down from 548
+Buildtime 12672 up from 10960
+Health 2100 down from 2400
+Speed 1.68 up from 1.64
+Turnrate 390 up from 350
+
+Core Replenisher Mobile Air Repair pad
+Health 1100 down from 1150
+Speed 0.92 up from 0.78
+
+Arm Warrior
+Changed description to "Heavy Infantry Kbot"
+(was "Medium Infantry Kbot)
+Health 1400 down from 1480
+Speed 1.45 down from 1.54
+turnrate 850 up from 750
+Core Pyro - Assault Kbot (was "Fast Assault Kbot")
+Health 1280 down from 1350
+Speed 1.6 down from 1.65
+
+Arm Zeus
+changed description to "Armored Infantry Kbot"
+(was "Heavy Assault Kbot")
+Health 2560 up from 2500
+Speed 1.02 down from 1.05
+Core The Can - Armored Assault Kbot
+Health 2940 (unchanged)
+Speed 0.88 up from 0.85
+
+Core Gimp
+Changed description to "Underwater Amphib Kbot"
+New laser sound
+Health 1540 down from 1660
+Removed ballistic cannon, added torpedo launcher
+Changed laser to 2-barrel
+Laser Damage 120 reload 1.3s DPS 92.3 (was 128/1.6s 80 DPS)
+Torpedo range 320 damage 116 reload 3.2s DPS 36.25
+
+Arm Maverick
+Health 1750 down from 1900
+Speed 1.4 (unchanged)
+Range 330 up from 320
+Core Reiver T2 Riot Kbot
+Energy 10295 up from 9695
+Metal 639 up from 599
+Build time 19170 up from 17970
+Health 2200 down from 2250
+Speed 1.3 up from 1.25
+Range 320 up from 310
+
+Arm Fido Burst Artillery Kbot
+New cannon sound
+Energy 3950 down from 4250
+Speed 1.35 down from 1.45
+Turnrate 720 down from 800
+Acceleration 0.06 down from 0.1
+Range 720 down from 750
+Damage 45 down from 48 (burst 4)
+Sprayangle 720 down from 800
+DPS 72 down from 76.8
+Core Morty
+New cannon sound
+Energy 3600 up from 3500
+Speed 1.2 (unchanged)
+Damage 96 down from 105
+DPS 66 down from 72.4
+Range 800 (unchanged)
+Improved script:
+- maximum time to fire while walking 0.2s (was 1.23s)
+
+Arm Kodiak Ballistic Rocket Kbot
+Health 1290 up from 1120
+Core Dominator Ballistic Rocket Kbot
+Health 1380 up from 1180
+
+Arm Odin - Fast Assault Kbot
+Energy 9800 up from 8800
+Metal 770 up from 730
+Buildtime 18480 up from 17520
+Health 2300 down from 2700
+Weapon range 260 down from 284
+
+T2 AA Kbots
+- both have pop-up turrets now
+Arm Huntsman
+Energy 3700 up from 3500
+Metal 360 up from 340
+Buildtime 7200 up from 6800
+Added armored state: takes 75% damage (1520 health) when closed.
+1140 health when opened to fire (unchanged)
+Reload 0.85s down from 1s
+DPS 50.6 vs ground 274 vs air, up from 42/235
+Core Slingshot
+Energy 3800 up from 3600
+Metal 370 up from 350
+Buildtime 7400 up from 7000
+Added armored state: takes 75% damage (1760 health) when closed.
+1320 health when opened to fire (unchanged)
+Reload 1.5s down from 1.8s
+DPS 50 vs ground 270 vs air, up from 41.67/225
+
+Arm Hawk, Core Vamp
+Reverted back to 2 missile launchers instead of 1 with half the reload
+
+Arm Brawler, Core Rapier
+Death Explosion SMALL_UNITEX (was BIG_UNITEX)
+- less chain reaction from multiple aircraft deaths close together
+
+Arm Millenium
+New cannon sound
+Increased delay between cannon salvos to 4.5 seconds (was 4s)
+260 per shot (was 270)
+3 shots per 5.5 secs, 141.8 DPS (was 270*3/5s 162 DPS)
+
+Core Warlord
+New cannon sound
+Increased delay between cannon salvos to 4.95 seconds (was 4.3s)
+310 per shot (unchanged)
+3 shots per 6.6 secs, 140.9 DPS (was 310*3/5.6 166.1 DPS)
+
+Bertha and Intimidator: Made descriptions only show the energy/shot
+Same for Vulcan, Buzzsaw, Dora, Terminator
+
+
+**T3 Updates**
+
+T3 Construction Kbots:
+build speed 480 up from 420
+build range 224 up from 160
+
+T3 Construction Vehicles:
+build speed 600 up from 480
+Build range 270 up from 180
+
+T3 Construction Subs:
+build speed 720 up from 540
+Build range 300 up from 200
+
+T3 Construction Hovercraft:
+Build speed 540 up from 420
+Build range 256 up from 190
+
+T3 Construction Aircraft:
+Build speed 360 up from 270
+Build range 200 up from 120
+
+T3 Resurrection Kbots (Kali, Dante)
+Build speed 600 up from 480
+(also applies to resurrect speed)
+Build range 256 up from 180
+- also reduced footprint to 2x2 (same as commander, construction kbots)
+
+Arm Indra Amphibious crawler
+Metal 4210M up from 3910
+Build time 84200 down from 93840
+Health 11000 up from 9400
+Damage 320 (unchanged)
+Reload 0.6s down from 0.7
+DPS 533.3 up from 457
+AOE 24 (unchanged)
+Core Boss Amphibious kbot
+Metal 4120 up from 3820
+Build time 82400 down from 91680
+Health 12000 up from 10200
+Damage 640 up from 450
+Reload 1.22s up from 1.1s
+DPS 525 up from 409
+AOE 108 (unchanged)
+
+Arm Razorback Heavy Assault Kbot
+Energy 95000 up from 89000
+Metal 6650 up from 6350
+Build time 159600 up from 152400
+Main weapon:
+Range 400 down from 420
+Noexplode weapon:
+Range 560 down from 640
+Damage 540+ up from 480+
+Reload 6.5s up from 6s
+DPS 83+ up from 80
+vlaunch AA missile (new):
+Range 800, DPS: 56 to ground 300 to air, AOE 64
+Core Ketzer Heavy Assault Kbot
+Energy 93600 up from 85600
+Metal 6740M up from 6240
+Build time 161760 up from 149760
+Main weapon:
+Range 408 down from 428
+noexplode weapon (new):
+Range 560, Damage 480+, Reload 5.8s, DPS 82.8+, AOE 48
+
+Arm Zephyr AA kbot
+Health 10560 up from 10000
+Core Jupiter AA kbot
+Health 11200 up from 10760
+Max speed 0.95 up from 0.9
+
+Arm Wolf - Amphibious Sniper doggo Kbot
+Health 15000 up from 13500
+Core Krab - Amphibious Energy Weapon (noexplode) Kbot
+Health 17200 up from 16000
+
+Arm Tiger - Heavy Assault Tank (with flak)
+Health 20800 up from 20200
+Core Rattlesnake - Rapid Laser Assault Tank
+Health 21600 up from 21200
+
+Arm Impala - Energy weapon (noexplode) Tank
+Health 14000 up from 13200
+Core War Machine - Energy Weapon Tank
+Health 15900 up from 14900
+
+Arm G2 - Rapid Artillery Tank
+149000E down from 156000E
+Health 23600 up from 21800
+Core Smasher - Heavy Artillery Tank
+144000E down from 150000E
+Health 24800 up from 23000
+
+Arm Scudd - Mobile Tactical Nuke Launcher
+Health 4250 down from 4800
+Turnrate 200 down from 210
+Core Precluder - Mobile Tactical Nuke Launcher
+Health 4500 down from 5400
+Turnrate 215 down from 230
+
+Arm Invincible
+Gauss weapon Damage 450 down from 480
+Reload 0.45s down from 0.55s
+DPS 1000 up from 872.7
+Range 820 (unchanged)
+AOE 32 (unchanged)
+Core Excelsior - Battlecruiser
+Riot weapon Damage 640 up from 450
+Reload 0.7s up from 0.5s
+DPS 914 up from 900
+Range 800 (unchanged)
+AOE 108 (unchanged)
+
+T3 Aircraft carriers - changed description to "Aircraft Repair and Antinuke with Radar and Sonar"
+Arm Longreach
+Metal 7220 up from 7020
+Buildtime 144400 up from 140400
+Energy production 1250 up from 800
+Core Fulcrum
+Metal 7400 up from 7200
+Buildtime 148000 up from 144000
+Energy production 1320 up from 900
+
+Arm Prophet - Capital Ship
+Radar range 2800 down from 3000 (to match main gun range)
+Energy production 1500 up from 450
+Energy storage 2500 (unchanged)
+Long range cannon range 2800 (unchanged)
+Faster reload between shots, longer delay between salvos
+- reload 0.4s from 0.54s
+damage 1080 down from 1140
+delay between 8-shot salvos 3.463s up from 2.928s
+8 shots per 6.263s down from 6.708s
+DPS 1379.5 up from 1359.6
+Energy per shot 1200 up from 1000
+Energy/sec average 1532.8
+Core Omen - Capital Ship
+Radar range 2980 down from 3100 (to match main gun range)
+Energy production 1600 up from 480
+Energy storage 3000 up from 2500
+Long range cannon Range 2980 (unchanged)
+Faster reload between shots, longer delay between salvos
+- reload 0.56s from 0.72s
+damage 1440 (unchanged)
+delay between 6-shot salvos 3.483s up from 2.65s
+6 shots per 6.283s down from 6.4s
+DPS 1375 up from 1350
+Energy per shot 1600 up from 1250
+Energy/sec average 1528
+
+Arm Samurai - Dreadnaught Hovercraft
+499100E, 22500M, 540000 BT up from 459100E 21200M 508800 BT
+Health 42000 up from 37000
+Main weapon range 820 (unchanged)
+Damage 450 reload 0.32 1406 DPS up from 480/0.4 1200 DPS
+Core Broadsword - Dreadnaught Hovercraft
+520600E, 23100M, 554400 BT up from 480600E 21800M 523200 BT
+Health 45000 up from 40000
+Main weapon range 820 (up from 810)
+Damage 1000 reload 0.75 1333 DPS up from 1000/0.92 1087 DPS
+
+
+**T3 Defence updates**
+
+Arm Vulcan
+reload 0.3 (was 0.32)
+4 second delay between 8-shot salvos (was 5.2s)
+DPS 1521.3 up from 1288.9
+Energy to fire: 3000/shot, average 3934/sec
+Core Buzzsaw
+4.7 second delay between 6-shot salvos (was 6 seconds)
+DPS 1500 up from 1270.6
+Energy to fire: 5000/shot, average 4167/sec
+Note: with veterancy, energy/sec will increase
+
+Arm RAAMS T3 AA missile tower
+Reload 0.45 (was 0.5) - 2209 DPS vs air, was 1988
+Startvelocity 740 up from 540
+Added edgeeffectiveness=0.9 same as flak (was 0) - big effective damage area increase
+Smokedelay 0.01 from 0.1 (more smoketrail)
+removed unitsonly tag
+Core Screamer T3 AA missile tower
+Reload 1.4 (was 1.6) - 2164 DPS vs air, was 1894
+Startvelocity 700 up from 500
+Added edgeeffectiveness=0.9 same as flak (was 0) - big effective damage area increase
+Smokedelay 0.01 from 0.1 (more smoketrail)
+removed unitsonly tag
+
+
+**Eco Updates**
+
+Moho Metal makers: reduced costs, big reduction in build time
+Reduced production, and slightly reduced energy to metal conversion efficiency (still better than T1 60E/1M)
+Arm Moho Metal Maker
+Energy 16360 down from 19635
+Metal 50 down from 55
+Buildtime 30000 down from 44000
+Energy use 800 down from 900
+Metal production 14 down from 16
+Efficiency 57.2E/1M, was 56.25
+OTA/ProTA: -800E/+16M, efficiency 50E/1M
+Death Explosion ESTOR_BUILDINGEX (900 damage 220 AOE) was ESTOR_BUILDING (1900 damage 420 AOE)
+Self-D explosion ESTOR_BUILDING (unchanged)
+
+Core Moho Metal Maker
+Energy 15845 down from 17680
+Metal 46 down from 50
+Buildtime 27600 down from 40000
+Energy use 690 down from 800
+Metal production 12 down from 14
+Efficiency 57.5E/1M, was 57.2
+OTA/ProTA: -625E/12M, efficiency 52.1E/1M
+Death Explosion ESTOR_BUILDINGEX (900 damage 220 AOE) was LARGE_BUILDING (1800 damage 400 AOE)
+Self-D explosion LARGE_BUILDING (unchanged)
+
+Arm Underwater Moho Metal Maker
+Energy 18200 down from 21051
+Metal 85 down from 120
+Buildtime 34000 down from 48000
+Energy use 912 down from 1020
+Metal production 16 down from 18
+(efficiency 57.0E/1M, was 56.67)
+Death and self-d explosion same as land version (was LARGE_BUILDING/LARGE_BUILDING)
+
+Core Underwater Moho Metal Maker
+Energy 17800 down from 18077
+Metal 80 down from 108
+Buildtime 32000 down from 43200
+Energy Use 860 up from 850
+Metal production 15 (unchanged)
+(efficiency 57.33E/1M, was 56.67)
+Death and self-d explosion same as land version (was LARGE_BUILDING/LARGE_BUILDING)
+
+Arm Fusion
+Energy 39865 down from 42865
+Metal 5180 (unchanged)
+Build time 102600 (unchanged)
+Energy production 1050 (up from 1000)
+
+Core Fusion
+Energy 43725 down from 48225
+Metal 5592 down from 5804
+Buildtime 111840 down from 116080
+Energy production 1200 (unchanged)
+
+Arm Cloaking Fusion
+Energy 67816 down from 72816
+Metal 6575 down from 6845
+Build Time 157800 up from 136900
+Energy Production 1500 down from 1600
+Cloak Cost 280 down from 320
+
+Core Cloaking Fusion
+Energy 73850 down from 79850
+Metal 7074 down from 7582
+Build time 169776 up from 151640
+Energy Production 1700 down from 1900
+Cloak Cost 300 down from 400
+
+Arm Underwater Fusion
+Energy 54787 down from 63787
+Metal 6885 up from 6785
+Build time 137700 up from 135700
+Energy production 1400 down from 1500
+
+Core Underwater Fusion
+Energy 60849 down from 69849
+Metal 7480 up from 7460
+Buildtime 149600 up from 149200
+Energy Production 1600 down from 1800
+
+Arm Metal Making Super Fusion
+Makes 10500 energy up from 10k
+turned on trades -5k E for +90 metal down from +96
+Metal conversion efficiency: 55.6E/1M (was 52.1)
+Cloaks for 1000E (unchanged)
+Reduced footprint to 12x7 from 14x8
+Metal cost 42800 up from 40800
+Buildtime 856000 up from 816000
+
+Core Metal Making Uber Fusion
+Makes 12k energy (unchanged)
+turned on trades -6K E for +107 metal down from +115
+Metal conversion efficiency: 56.1E/1m (was 52.2)
+Cloaks for 1100E (unchanged)
+Reduced footprint to 10x10 from 12x12
+Metal cost 46200 up from 44200
+Buildtime 924000 up from 884000
\ No newline at end of file
diff --git a/Icon/AIRCONS.PCX b/Icon/AIRCONS.PCX
new file mode 100644
index 0000000..92a1381
Binary files /dev/null and b/Icon/AIRCONS.PCX differ
diff --git a/Icon/AIRCRAFTCOMBAT.PCX b/Icon/AIRCRAFTCOMBAT.PCX
new file mode 100644
index 0000000..92a1381
Binary files /dev/null and b/Icon/AIRCRAFTCOMBAT.PCX differ
diff --git a/Icon/ARM.pcx b/Icon/ARM.pcx
new file mode 100644
index 0000000..5e80b1b
Binary files /dev/null and b/Icon/ARM.pcx differ
diff --git a/Icon/BUILDING.PCX b/Icon/BUILDING.PCX
new file mode 100644
index 0000000..55436c9
Binary files /dev/null and b/Icon/BUILDING.PCX differ
diff --git a/Icon/CONS.PCX b/Icon/CONS.PCX
new file mode 100644
index 0000000..ddef939
Binary files /dev/null and b/Icon/CONS.PCX differ
diff --git a/Icon/CORE.pcx b/Icon/CORE.pcx
new file mode 100644
index 0000000..704b418
Binary files /dev/null and b/Icon/CORE.pcx differ
diff --git a/Icon/FACTORY.PCX b/Icon/FACTORY.PCX
new file mode 100644
index 0000000..6df3876
Binary files /dev/null and b/Icon/FACTORY.PCX differ
diff --git a/Icon/GOK.pcx b/Icon/GOK.pcx
new file mode 100644
index 0000000..60925af
Binary files /dev/null and b/Icon/GOK.pcx differ
diff --git a/Icon/MOBILECOMBAT.PCX b/Icon/MOBILECOMBAT.PCX
new file mode 100644
index 0000000..ddef939
Binary files /dev/null and b/Icon/MOBILECOMBAT.PCX differ
diff --git a/Icon/NONE.PCX b/Icon/NONE.PCX
new file mode 100644
index 0000000..ddef939
Binary files /dev/null and b/Icon/NONE.PCX differ
diff --git a/Icon/NUKEICON.pcx b/Icon/NUKEICON.pcx
new file mode 100644
index 0000000..f1b25b3
Binary files /dev/null and b/Icon/NUKEICON.pcx differ
diff --git a/Icon/UNKNOWN.PCX b/Icon/UNKNOWN.PCX
new file mode 100644
index 0000000..ddef939
Binary files /dev/null and b/Icon/UNKNOWN.PCX differ
diff --git a/Icon/iconcfg.ini b/Icon/iconcfg.ini
new file mode 100644
index 0000000..6102b51
--- /dev/null
+++ b/Icon/iconcfg.ini
@@ -0,0 +1,23 @@
+; Megamap Icon Settings
+
+[Option] ; General Settings
+
+FillColor=245; ; The color that will be replaced by the player color
+TransparentColor=9; ; The color that will be replaced by transparency
+SelectedColor=255; ; The color that will be shown only when the unit is selected
+HoverColor=84; ; The color that will show when the icon is hovered on
+UseCircleHover=FALSE; ; Enable or disable a drawn ring when hovered on, disabled by default
+UseDefaultIcon=TRUE; ; Enable to use default icons, disable to use custom icons
+
+[ICON] ; Custom Icons
+
+Unknow=UNKNOWN.PCX;
+Nothing=NONE.pcx;
+NukeIcon=NUKEICON.pcx;
+
+; When custom icons are enabled, set them below using the category tags from unit fbi files
+; You can use your own custom icon files, they must be in the TA color palette and PCX format
+; A disabled example of the syntax is provided below
+; In the example, any unit with KBOT as a category will use KBOT.pcx as the icon (not provided)
+
+;KBOT=KBOT.pcx
\ No newline at end of file
diff --git a/Icon/smallcircle.pcx b/Icon/smallcircle.pcx
new file mode 100644
index 0000000..aa4f293
Binary files /dev/null and b/Icon/smallcircle.pcx differ
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..41838b3
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,79 @@
+# TA Demo Recorder and Community Patch
+
+## LICENSE
+
+### TA Community Patch (original filename: tdraw.dll; source directory: src/DDRaw)
+
+The MIT License (MIT)
+
+Copyright (c) 2023 Axle1975, FunkyFr3sh
+Copyright (c) 2019 Xpoy
+Copyright (c) 2003 SJ, Yeha
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+### TA Demo Recorder (original filename: tplayx.dll; source directory: src/Recorder)
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Rime
+Copyright (c) 2003 SJ, Yeha
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+### TA Demo Replayer (original filename: SERVER.EXE, source directory: src/Server)
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Chaos
+Copyright (c) 2003 Fnordia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Shaders/crt/crt-lottes-fast-no-warp-bilinear.glsl b/Shaders/crt/crt-lottes-fast-no-warp-bilinear.glsl
new file mode 100644
index 0000000..449b9be
--- /dev/null
+++ b/Shaders/crt/crt-lottes-fast-no-warp-bilinear.glsl
@@ -0,0 +1,701 @@
+//_____________________________/\_______________________________
+//==============================================================
+//
+//
+// [CRTS] PUBLIC DOMAIN CRT-STYLED SCALAR - 20180120b
+//
+// by Timothy Lottes
+// https://www.shadertoy.com/view/MtSfRK
+// adapted for RetroArch by hunterk
+//
+//
+//==============================================================
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+//_____________________________/\_______________________________
+//==============================================================
+//
+// WHAT'S NEW
+//
+//--------------------------------------------------------------
+// Evolution of prior shadertoy example
+//--------------------------------------------------------------
+// This one is semi-optimized
+// - Less texture fetches
+// - Didn't get to instruction level optimization
+// - Could likely use texture fetch to generate phosphor mask
+//--------------------------------------------------------------
+// Added options to disable unused features
+//--------------------------------------------------------------
+// Added in exposure matching
+// - Given scan-line effect and mask always darkens image
+// - Uses generalized tonemapper to boost mid-level
+// - Note this can compress highlights
+// - And won't get back peak brightness
+// - But best option if one doesn't want as much darkening
+//--------------------------------------------------------------
+// Includes option saturation and contrast controls
+//--------------------------------------------------------------
+// Added in subtractive aperture grille
+// - This is a bit brighter than prior
+//--------------------------------------------------------------
+// Make sure input to this filter is already low-resolution
+// - This is not designed to work on titles doing the following
+// - Rendering to hi-res with nearest sampling
+//--------------------------------------------------------------
+// Added a fast and more pixely option for 2 tap/pixel
+//--------------------------------------------------------------
+// Improved the vignette when WARP is enabled
+//--------------------------------------------------------------
+// Didn't test HLSL or CPU options
+// - Will incorportate patches if they are broken
+// - But out of time to try them myself
+//==============================================================
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+//_____________________________/\_______________________________
+//==============================================================
+//
+// LICENSE = UNLICENSE (aka PUBLIC DOMAIN)
+//
+//--------------------------------------------------------------
+// This is free and unencumbered software released into the
+// public domain.
+//--------------------------------------------------------------
+// Anyone is free to copy, modify, publish, use, compile, sell,
+// or distribute this software, either in source code form or as
+// a compiled binary, for any purpose, commercial or
+// non-commercial, and by any means.
+//--------------------------------------------------------------
+// In jurisdictions that recognize copyright laws, the author or
+// authors of this software dedicate any and all copyright
+// interest in the software to the public domain. We make this
+// dedication for the benefit of the public at large and to the
+// detriment of our heirs and successors. We intend this
+// dedication to be an overt act of relinquishment in perpetuity
+// of all present and future rights to this software under
+// copyright law.
+//--------------------------------------------------------------
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+//--------------------------------------------------------------
+// For more information, please refer to
+//
+//==============================================================
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+
+#pragma parameter MASK "Mask Type" 1.0 0.0 3.0 1.0
+#pragma parameter MASK_INTENSITY "Mask Intensity" 0.5 0.0 1.0 0.05
+#pragma parameter SCANLINE_THINNESS "Scanline Intensity" 0.5 0.0 1.0 0.1
+#pragma parameter SCAN_BLUR "Sharpness" 2.5 1.0 3.0 0.1
+#pragma parameter CURVATURE "Curvature" 0.02 0.0 0.25 0.01
+#pragma parameter TRINITRON_CURVE "Trinitron-style Curve" 0.0 0.0 1.0 1.0
+#pragma parameter CORNER "Corner Round" 3.0 0.0 11.0 1.0
+#pragma parameter CRT_GAMMA "CRT Gamma" 2.4 0.0 51.0 0.1
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+
+vec4 _oPosition1;
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+// compatibility #defines
+#define vTexCoord TEX0.xy
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ TEX0.xy = TexCoord.xy;
+}
+
+#elif defined(FRAGMENT)
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out COMPAT_PRECISION vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+
+// compatibility #defines
+#define Source Texture
+#define vTexCoord TEX0.xy
+
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+#ifdef PARAMETER_UNIFORM
+uniform COMPAT_PRECISION float CRT_GAMMA;
+uniform COMPAT_PRECISION float SCANLINE_THINNESS;
+uniform COMPAT_PRECISION float SCAN_BLUR;
+uniform COMPAT_PRECISION float MASK_INTENSITY;
+uniform COMPAT_PRECISION float CURVATURE;
+uniform COMPAT_PRECISION float CORNER;
+uniform COMPAT_PRECISION float MASK;
+uniform COMPAT_PRECISION float TRINITRON_CURVE;
+#else
+#define CRT_GAMMA 2.4
+#define SCANLINE_THINNESS 0.5
+#define SCAN_BLUR 2.5
+#define MASK_INTENSITY 0.54
+#define CURVATURE 0.00
+#define CORNER 3.0
+#define MASK 1.0
+#define TRINITRON_CURVE 0.0
+#endif
+
+//_____________________________/\_______________________________
+//==============================================================
+//
+// GAMMA FUNCTIONS
+//
+//--------------------------------------------------------------
+//--------------------------------------------------------------
+// Since shadertoy doesn't have sRGB textures
+// And we need linear input into shader
+// Don't do this in your code
+ float FromSrgb1(float c){
+ return (c<=0.04045)?c*(1.0/12.92):
+ pow(c*(1.0/1.055)+(0.055/1.055),CRT_GAMMA);}
+//--------------------------------------------------------------
+vec3 FromSrgb(vec3 c){return vec3(
+ FromSrgb1(c.r),FromSrgb1(c.g),FromSrgb1(c.b));}
+
+// Convert from linear to sRGB
+// Since shader toy output is not linear
+float ToSrgb1(float c){
+ return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);}
+//--------------------------------------------------------------
+vec3 ToSrgb(vec3 c){return vec3(
+ ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));}
+//--------------------------------------------------------------
+
+//_____________________________/\_______________________________
+//==============================================================
+//
+// DEFINES
+//
+//--------------------------------------------------------------
+// CRTS_CPU - CPU code
+// CRTS_GPU - GPU code
+//--------------------------------------------------------------
+// CRTS_GLSL - GLSL
+// CRTS_HLSL - HLSL (not tested yet)
+//--------------------------------------------------------------
+// CRTS_DEBUG - Define to see on/off split screen
+//--------------------------------------------------------------
+// CRTS_WARP - Apply screen warp
+//--------------------------------------------------------------
+// CRTS_2_TAP - Faster very pixely 2-tap filter (off is 8)
+//--------------------------------------------------------------
+// CRTS_MASK_GRILLE - Aperture grille (aka Trinitron)
+// CRTS_MASK_GRILLE_LITE - Brighter (subtractive channels)
+// CRTS_MASK_NONE - No mask
+// CRTS_MASK_SHADOW - Horizontally stretched shadow mask
+//--------------------------------------------------------------
+// CRTS_TONE - Normalize mid-level and process color
+// CRTS_CONTRAST - Process color - enable contrast control
+// CRTS_SATURATION - Process color - enable saturation control
+//--------------------------------------------------------------
+#define CRTS_STATIC
+#define CrtsPow
+#define CRTS_RESTRICT
+//==============================================================
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+
+//==============================================================
+// SETUP FOR CRTS
+//--------------------------------------------------------------
+//==============================================================
+//#define CRTS_DEBUG 1
+#define CRTS_GPU 1
+#define CRTS_GLSL 1
+//--------------------------------------------------------------
+//#define CRTS_2_TAP 1
+//--------------------------------------------------------------
+#define CRTS_TONE 1
+#define CRTS_CONTRAST 0
+#define CRTS_SATURATION 0
+//--------------------------------------------------------------
+#define CRTS_WARP 1
+//--------------------------------------------------------------
+// Try different masks -> moved to runtime parameters
+//#define CRTS_MASK_GRILLE 1
+//#define CRTS_MASK_GRILLE_LITE 1
+//#define CRTS_MASK_NONE 1
+//#define CRTS_MASK_SHADOW 1
+//--------------------------------------------------------------
+// Scanline thinness
+// 0.50 = fused scanlines
+// 0.70 = recommended default
+// 1.00 = thinner scanlines (too thin)
+#define INPUT_THIN 0.5 + (0.5 * SCANLINE_THINNESS)
+//--------------------------------------------------------------
+// Horizonal scan blur
+// -3.0 = pixely
+// -2.5 = default
+// -2.0 = smooth
+// -1.0 = too blurry
+#define INPUT_BLUR -1.0 * SCAN_BLUR
+//--------------------------------------------------------------
+// Shadow mask effect, ranges from,
+// 0.25 = large amount of mask (not recommended, too dark)
+// 0.50 = recommended default
+// 1.00 = no shadow mask
+#define INPUT_MASK 1.0 - MASK_INTENSITY
+//--------------------------------------------------------------
+#define INPUT_X InputSize.x
+#define INPUT_Y InputSize.y
+//--------------------------------------------------------------
+// Setup the function which returns input image color
+vec3 CrtsFetch(vec2 uv){
+ // For shadertoy, scale to get native texels in the image
+ uv*=vec2(INPUT_X,INPUT_Y)/TextureSize.xy;
+ // Move towards intersting parts
+// uv+=vec2(0.5,0.5);
+ // Non-shadertoy case would not have the color conversion
+ return FromSrgb(COMPAT_TEXTURE(Texture,uv.xy,-16.0).rgb);}
+#endif
+
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////
+//_____________________________/\_______________________________
+//==============================================================
+//
+// GPU CODE
+//
+//==============================================================
+#ifdef CRTS_GPU
+//_____________________________/\_______________________________
+//==============================================================
+// PORTABILITY
+//==============================================================
+ #ifdef CRTS_GLSL
+ #define CrtsF1 float
+ #define CrtsF2 vec2
+ #define CrtsF3 vec3
+ #define CrtsF4 vec4
+ #define CrtsFractF1 fract
+ #define CrtsRcpF1(x) (1.0/(x))
+ #define CrtsSatF1(x) clamp((x),0.0,1.0)
+//--------------------------------------------------------------
+ CrtsF1 CrtsMax3F1(CrtsF1 a,CrtsF1 b,CrtsF1 c){
+ return max(a,max(b,c));}
+ #endif
+//==============================================================
+ #ifdef CRTS_HLSL
+ #define CrtsF1 float
+ #define CrtsF2 float2
+ #define CrtsF3 float3
+ #define CrtsF4 float4
+ #define CrtsFractF1 frac
+ #define CrtsRcpF1(x) (1.0/(x))
+ #define CrtsSatF1(x) saturate(x)
+//--------------------------------------------------------------
+ CrtsF1 CrtsMax3F1(CrtsF1 a,CrtsF1 b,CrtsF1 c){
+ return max(a,max(b,c));}
+ #endif
+//_____________________________/\_______________________________
+//==============================================================
+// TONAL CONTROL CONSTANT GENERATION
+//--------------------------------------------------------------
+// This is in here for rapid prototyping
+// Please use the CPU code and pass in as constants
+//==============================================================
+ CrtsF4 CrtsTone(
+ CrtsF1 contrast,
+ CrtsF1 saturation,
+ CrtsF1 thin,
+ CrtsF1 mask){
+//--------------------------------------------------------------
+ if(MASK == 0.0) mask=1.0;
+//--------------------------------------------------------------
+ if(MASK == 1.0){
+ // Normal R mask is {1.0,mask,mask}
+ // LITE R mask is {mask,1.0,1.0}
+ mask=0.5+mask*0.5;
+ }
+//--------------------------------------------------------------
+ CrtsF4 ret;
+ CrtsF1 midOut=0.18/((1.5-thin)*(0.5*mask+0.5));
+ CrtsF1 pMidIn=pow(0.18,contrast);
+ ret.x=contrast;
+ ret.y=((-pMidIn)+midOut)/((1.0-pMidIn)*midOut);
+ ret.z=((-pMidIn)*midOut+pMidIn)/(midOut*(-pMidIn)+midOut);
+ ret.w=contrast+saturation;
+ return ret;}
+//_____________________________/\_______________________________
+//==============================================================
+// MASK
+//--------------------------------------------------------------
+// Letting LCD/OLED pixel elements function like CRT phosphors
+// So "phosphor" resolution scales with display resolution
+//--------------------------------------------------------------
+// Not applying any warp to the mask (want high frequency)
+// Real aperture grille has a mask which gets wider on ends
+// Not attempting to be "real" but instead look the best
+//--------------------------------------------------------------
+// Shadow mask is stretched horizontally
+// RRGGBB
+// GBBRRG
+// RRGGBB
+// This tends to look better on LCDs than vertical
+// Also 2 pixel width is required to get triad centered
+//--------------------------------------------------------------
+// The LITE version of the Aperture Grille is brighter
+// Uses {dark,1.0,1.0} for R channel
+// Non LITE version uses {1.0,dark,dark}
+//--------------------------------------------------------------
+// 'pos' - This is 'fragCoord.xy'
+// Pixel {0,0} should be {0.5,0.5}
+// Pixel {1,1} should be {1.5,1.5}
+//--------------------------------------------------------------
+// 'dark' - Exposure of of masked channel
+// 0.0=fully off, 1.0=no effect
+//==============================================================
+ CrtsF3 CrtsMask(CrtsF2 pos,CrtsF1 dark){
+ if(MASK == 2.0){
+ CrtsF3 m=CrtsF3(dark,dark,dark);
+ CrtsF1 x=CrtsFractF1(pos.x*(1.0/3.0));
+ if(x<(1.0/3.0))m.r=1.0;
+ else if(x<(2.0/3.0))m.g=1.0;
+ else m.b=1.0;
+ return m;
+ }
+//--------------------------------------------------------------
+ if(MASK == 1.0){
+ CrtsF3 m=CrtsF3(1.0,1.0,1.0);
+ CrtsF1 x=CrtsFractF1(pos.x*(1.0/3.0));
+ if(x<(1.0/3.0))m.r=dark;
+ else if(x<(2.0/3.0))m.g=dark;
+ else m.b=dark;
+ return m;
+ }
+//--------------------------------------------------------------
+ if(MASK == 0.0){
+ return CrtsF3(1.0,1.0,1.0);
+ }
+//--------------------------------------------------------------
+ if(MASK == 3.0){
+ pos.x+=pos.y*2.9999;
+ CrtsF3 m=CrtsF3(dark,dark,dark);
+ CrtsF1 x=CrtsFractF1(pos.x*(1.0/6.0));
+ if(x<(1.0/3.0))m.r=1.0;
+ else if(x<(2.0/3.0))m.g=1.0;
+ else m.b=1.0;
+ return m;
+ }
+ }
+//_____________________________/\_______________________________
+//==============================================================
+// FILTER ENTRY
+//--------------------------------------------------------------
+// Input must be linear
+// Output color is linear
+//--------------------------------------------------------------
+// Must have fetch function setup: CrtsF3 CrtsFetch(CrtsF2 uv)
+// - The 'uv' range is {0.0 to 1.0} for input texture
+// - Output of this must be linear color
+//--------------------------------------------------------------
+// SCANLINE MATH & AUTO-EXPOSURE NOTES
+// ===================================
+// Each output line has contribution from at most 2 scanlines
+// Scanlines are shaped by a windowed cosine function
+// This shape blends together well with only 2 lines of overlap
+//--------------------------------------------------------------
+// Base scanline intensity is as follows
+// which leaves output intensity range from {0 to 1.0}
+// --------
+// thin := range {thick 0.5 to thin 1.0}
+// off := range {0.0 to <1.0},
+// sub-pixel offset between two scanlines
+// --------
+// a0=cos(min(0.5, off *thin)*2pi)*0.5+0.5;
+// a1=cos(min(0.5,(1.0-off)*thin)*2pi)*0.5+0.5;
+//--------------------------------------------------------------
+// This leads to a image darkening factor of roughly:
+// {(1.5-thin)/1.0}
+// This is further reduced by the mask:
+// {1.0/2.0+mask*1.0/2.0}
+// Reciprocal of combined effect is used for auto-exposure
+// to scale up the mid-level in the tonemapper
+//==============================================================
+ CrtsF3 CrtsFilter(
+//--------------------------------------------------------------
+ // SV_POSITION, fragCoord.xy
+ CrtsF2 ipos,
+//--------------------------------------------------------------
+ // inputSize / outputSize (in pixels)
+ CrtsF2 inputSizeDivOutputSize,
+//--------------------------------------------------------------
+ // 0.5 * inputSize (in pixels)
+ CrtsF2 halfInputSize,
+//--------------------------------------------------------------
+ // 1.0 / inputSize (in pixels)
+ CrtsF2 rcpInputSize,
+//--------------------------------------------------------------
+ // 1.0 / outputSize (in pixels)
+ CrtsF2 rcpOutputSize,
+//--------------------------------------------------------------
+ // 2.0 / outputSize (in pixels)
+ CrtsF2 twoDivOutputSize,
+//--------------------------------------------------------------
+ // inputSize.y
+ CrtsF1 inputHeight,
+//--------------------------------------------------------------
+ // Warp scanlines but not phosphor mask
+ // 0.0 = no warp
+ // 1.0/64.0 = light warping
+ // 1.0/32.0 = more warping
+ // Want x and y warping to be different (based on aspect)
+ CrtsF2 warp,
+//--------------------------------------------------------------
+ // Scanline thinness
+ // 0.50 = fused scanlines
+ // 0.70 = recommended default
+ // 1.00 = thinner scanlines (too thin)
+ // Shared with CrtsTone() function
+ CrtsF1 thin,
+//--------------------------------------------------------------
+ // Horizonal scan blur
+ // -3.0 = pixely
+ // -2.5 = default
+ // -2.0 = smooth
+ // -1.0 = too blurry
+ CrtsF1 blur,
+//--------------------------------------------------------------
+ // Shadow mask effect, ranges from,
+ // 0.25 = large amount of mask (not recommended, too dark)
+ // 0.50 = recommended default
+ // 1.00 = no shadow mask
+ // Shared with CrtsTone() function
+ CrtsF1 mask,
+//--------------------------------------------------------------
+ // Tonal curve parameters generated by CrtsTone()
+ CrtsF4 tone
+//--------------------------------------------------------------
+ ){
+//--------------------------------------------------------------
+ #ifdef CRTS_DEBUG
+ CrtsF2 uv=ipos*rcpOutputSize;
+ // Show second half processed, and first half un-processed
+ if(uv.x<0.5){
+ // Force nearest to get squares
+ uv*=1.0/rcpInputSize;
+ uv=floor(uv)+CrtsF2(0.5,0.5);
+ uv*=rcpInputSize;
+ CrtsF3 color=CrtsFetch(uv);
+ return color;}
+ #endif
+//--------------------------------------------------------------
+ // Optional apply warp
+ CrtsF2 pos;
+ #ifdef CRTS_WARP
+ // Convert to {-1 to 1} range
+ pos=ipos*twoDivOutputSize-CrtsF2(1.0,1.0);
+ // Distort pushes image outside {-1 to 1} range
+ pos*=CrtsF2(
+ 1.0+(pos.y*pos.y)*warp.x,
+ 1.0+(pos.x*pos.x)*warp.y);
+ // TODO: Vignette needs optimization
+ CrtsF1 vin=(1.0-(
+ (1.0-CrtsSatF1(pos.x*pos.x))*(1.0-CrtsSatF1(pos.y*pos.y)))) * (0.998 + (0.001 * CORNER));
+ vin=CrtsSatF1((-vin)*inputHeight+inputHeight);
+ // Leave in {0 to inputSize}
+ pos=pos*halfInputSize+halfInputSize;
+ #else
+ pos=ipos*inputSizeDivOutputSize;
+ #endif
+//--------------------------------------------------------------
+ // Snap to center of first scanline
+ CrtsF1 y0=floor(pos.y-0.5)+0.5;
+ #ifdef CRTS_2_TAP
+ // Using Inigo's "Improved Texture Interpolation"
+ // http://iquilezles.org/www/articles/texture/texture.htm
+ pos.x+=0.5;
+ CrtsF1 xi=floor(pos.x);
+ CrtsF1 xf=pos.x-xi;
+ xf=xf*xf*xf*(xf*(xf*6.0-15.0)+10.0);
+ CrtsF1 x0=xi+xf-0.5;
+ CrtsF2 p=CrtsF2(x0*rcpInputSize.x,y0*rcpInputSize.y);
+ // Coordinate adjusted bilinear fetch from 2 nearest scanlines
+ CrtsF3 colA=CrtsFetch(p);
+ p.y+=rcpInputSize.y;
+ CrtsF3 colB=CrtsFetch(p);
+ #else
+ // Snap to center of one of four pixels
+ CrtsF1 x0=floor(pos.x-1.5)+0.5;
+ // Inital UV position
+ CrtsF2 p=CrtsF2(x0*rcpInputSize.x,y0*rcpInputSize.y);
+ // Fetch 4 nearest texels from 2 nearest scanlines
+ CrtsF3 colA0=CrtsFetch(p);
+ p.x+=rcpInputSize.x;
+ CrtsF3 colA1=CrtsFetch(p);
+ p.x+=rcpInputSize.x;
+ CrtsF3 colA2=CrtsFetch(p);
+ p.x+=rcpInputSize.x;
+ CrtsF3 colA3=CrtsFetch(p);
+ p.y+=rcpInputSize.y;
+ CrtsF3 colB3=CrtsFetch(p);
+ p.x-=rcpInputSize.x;
+ CrtsF3 colB2=CrtsFetch(p);
+ p.x-=rcpInputSize.x;
+ CrtsF3 colB1=CrtsFetch(p);
+ p.x-=rcpInputSize.x;
+ CrtsF3 colB0=CrtsFetch(p);
+ #endif
+//--------------------------------------------------------------
+ // Vertical filter
+ // Scanline intensity is using sine wave
+ // Easy filter window and integral used later in exposure
+ CrtsF1 off=pos.y-y0;
+ CrtsF1 pi2=6.28318530717958;
+ CrtsF1 hlf=0.5;
+ CrtsF1 scanA=cos(min(0.5, off *thin )*pi2)*hlf+hlf;
+ CrtsF1 scanB=cos(min(0.5,(-off)*thin+thin)*pi2)*hlf+hlf;
+//--------------------------------------------------------------
+ #ifdef CRTS_2_TAP
+ #ifdef CRTS_WARP
+ // Get rid of wrong pixels on edge
+ scanA*=vin;
+ scanB*=vin;
+ #endif
+ // Apply vertical filter
+ CrtsF3 color=(colA*scanA)+(colB*scanB);
+ #else
+ // Horizontal kernel is simple gaussian filter
+ CrtsF1 off0=pos.x-x0;
+ CrtsF1 off1=off0-1.0;
+ CrtsF1 off2=off0-2.0;
+ CrtsF1 off3=off0-3.0;
+ CrtsF1 pix0=exp2(blur*off0*off0);
+ CrtsF1 pix1=exp2(blur*off1*off1);
+ CrtsF1 pix2=exp2(blur*off2*off2);
+ CrtsF1 pix3=exp2(blur*off3*off3);
+ CrtsF1 pixT=CrtsRcpF1(pix0+pix1+pix2+pix3);
+ #ifdef CRTS_WARP
+ // Get rid of wrong pixels on edge
+ pixT*=vin;
+ #endif
+ scanA*=pixT;
+ scanB*=pixT;
+ // Apply horizontal and vertical filters
+ CrtsF3 color=
+ (colA0*pix0+colA1*pix1+colA2*pix2+colA3*pix3)*scanA +
+ (colB0*pix0+colB1*pix1+colB2*pix2+colB3*pix3)*scanB;
+ #endif
+//--------------------------------------------------------------
+ // Apply phosphor mask
+ color*=CrtsMask(ipos,mask);
+//--------------------------------------------------------------
+ // Optional color processing
+ #ifdef CRTS_TONE
+ // Tonal control, start by protecting from /0
+ CrtsF1 peak=max(1.0/(256.0*65536.0),
+ CrtsMax3F1(color.r,color.g,color.b));
+ // Compute the ratios of {R,G,B}
+ CrtsF3 ratio=color*CrtsRcpF1(peak);
+ // Apply tonal curve to peak value
+ #ifdef CRTS_CONTRAST
+ peak=pow(peak,tone.x);
+ #endif
+ peak=peak*CrtsRcpF1(peak*tone.y+tone.z);
+ // Apply saturation
+ #ifdef CRTS_SATURATION
+ ratio=pow(ratio,CrtsF3(tone.w,tone.w,tone.w));
+ #endif
+ // Reconstruct color
+ return ratio*peak;
+ #else
+ return color;
+ #endif
+//--------------------------------------------------------------
+ }
+
+
+void main()
+{
+ vec2 warp_factor;
+ warp_factor.x = CURVATURE;
+ warp_factor.y = (3.0 / 4.0) * warp_factor.x; // assume 4:3 aspect
+ warp_factor.x *= (1.0 - TRINITRON_CURVE);
+ FragColor.rgb = CrtsFilter(vTexCoord.xy * OutputSize.xy*(TextureSize.xy / InputSize.xy),
+ InputSize.xy / OutputSize.xy,
+ InputSize.xy * vec2(0.5,0.5),
+ 1.0/InputSize.xy,
+ 1.0/OutputSize.xy,
+ 2.0/OutputSize.xy,
+ InputSize.y,
+ warp_factor,
+ INPUT_THIN,
+ INPUT_BLUR,
+ INPUT_MASK,
+ CrtsTone(1.0,0.0,INPUT_THIN,INPUT_MASK));
+
+ // Shadertoy outputs non-linear color
+ FragColor.rgb=ToSrgb(FragColor.rgb);
+}
+#endif
diff --git a/Shaders/cubic/catmull-rom-bilinear.glsl b/Shaders/cubic/catmull-rom-bilinear.glsl
new file mode 100644
index 0000000..03d5b77
--- /dev/null
+++ b/Shaders/cubic/catmull-rom-bilinear.glsl
@@ -0,0 +1,137 @@
+/*
+ The following code is licensed under the MIT license: https://gist.github.com/TheRealMJP/bc503b0b87b643d3505d41eab8b332ae
+ Ported from code: https://gist.github.com/TheRealMJP/c83b8c0f46b63f3a88a5986f4fa982b1
+ Samples a texture with Catmull-Rom filtering, using 9 texture fetches instead of 16.
+ See http://vec3.ca/bicubic-filtering-in-fewer-taps/ for more details
+ ATENTION: This code only work using LINEAR filter sampling set on Retroarch!
+ Modified to use 5 texture fetches
+*/
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+precision COMPAT_PRECISION float;
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ COL0 = COLOR;
+ TEX0.xy = TexCoord.xy;
+}
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out mediump vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+
+// compatibility #defines
+#define Source Texture
+#define vTexCoord TEX0.xy
+
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define outsize vec4(OutputSize, 1.0 / OutputSize)
+
+void main()
+{
+ // We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding
+ // down the sample location to get the exact center of our "starting" texel. The starting texel will be at
+ // location [1, 1] in the grid, where [0, 0] is the top left corner.
+ vec2 samplePos = vTexCoord * SourceSize.xy;
+ vec2 texPos1 = floor(samplePos - 0.5) + 0.5;
+
+ // Compute the fractional offset from our starting texel to our original sample location, which we'll
+ // feed into the Catmull-Rom spline function to get our filter weights.
+ vec2 f = samplePos - texPos1;
+
+ // Compute the Catmull-Rom weights using the fractional offset that we calculated earlier.
+ // These equations are pre-expanded based on our knowledge of where the texels will be located,
+ // which lets us avoid having to evaluate a piece-wise function.
+ vec2 w0 = f * (-0.5 + f * (1.0 - 0.5 * f));
+ vec2 w1 = 1.0 + f * f * (-2.5 + 1.5 * f);
+ vec2 w2 = f * (0.5 + f * (2.0 - 1.5 * f));
+ vec2 w3 = f * f * (-0.5 + 0.5 * f);
+
+ // Work out weighting factors and sampling offsets that will let us use bilinear filtering to
+ // simultaneously evaluate the middle 2 samples from the 4x4 grid.
+ vec2 w12 = w1 + w2;
+ vec2 offset12 = w2 / (w1 + w2);
+
+ // Compute the final UV coordinates we'll use for sampling the texture
+ vec2 texPos0 = texPos1 - 1.;
+ vec2 texPos3 = texPos1 + 2.;
+ vec2 texPos12 = texPos1 + offset12;
+
+ texPos0 *= SourceSize.zw;
+ texPos3 *= SourceSize.zw;
+ texPos12 *= SourceSize.zw;
+
+ float wtm = w12.x * w0.y;
+ float wml = w0.x * w12.y;
+ float wmm = w12.x * w12.y;
+ float wmr = w3.x * w12.y;
+ float wbm = w12.x * w3.y;
+
+ vec3 result = vec3(0.0f);
+
+ result += COMPAT_TEXTURE(Source, vec2(texPos12.x, texPos0.y)).rgb * wtm;
+ result += COMPAT_TEXTURE(Source, vec2(texPos0.x, texPos12.y)).rgb * wml;
+ result += COMPAT_TEXTURE(Source, vec2(texPos12.x, texPos12.y)).rgb * wmm;
+ result += COMPAT_TEXTURE(Source, vec2(texPos3.x, texPos12.y)).rgb * wmr;
+ result += COMPAT_TEXTURE(Source, vec2(texPos12.x, texPos3.y)).rgb * wbm;
+
+ FragColor = vec4(result * (1./(wtm+wml+wmm+wmr+wbm)), 1.0);
+}
+#endif
diff --git a/Shaders/interpolation/bilinear.glsl b/Shaders/interpolation/bilinear.glsl
new file mode 100644
index 0000000..aa7bee6
--- /dev/null
+++ b/Shaders/interpolation/bilinear.glsl
@@ -0,0 +1,73 @@
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = VertexCoord.x * MVPMatrix[0] + VertexCoord.y * MVPMatrix[1] + VertexCoord.z * MVPMatrix[2] + VertexCoord.w * MVPMatrix[3];
+ TEX0.xy = TexCoord.xy;
+}
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+
+void main()
+{
+ FragColor = COMPAT_TEXTURE(Texture, TEX0.xy);
+}
+#endif
\ No newline at end of file
diff --git a/Shaders/nearest-neighbor.glsl b/Shaders/nearest-neighbor.glsl
new file mode 100644
index 0000000..aa7bee6
--- /dev/null
+++ b/Shaders/nearest-neighbor.glsl
@@ -0,0 +1,73 @@
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = VertexCoord.x * MVPMatrix[0] + VertexCoord.y * MVPMatrix[1] + VertexCoord.z * MVPMatrix[2] + VertexCoord.w * MVPMatrix[3];
+ TEX0.xy = TexCoord.xy;
+}
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+
+void main()
+{
+ FragColor = COMPAT_TEXTURE(Texture, TEX0.xy);
+}
+#endif
\ No newline at end of file
diff --git a/Shaders/readme.txt b/Shaders/readme.txt
new file mode 100644
index 0000000..abd02a0
--- /dev/null
+++ b/Shaders/readme.txt
@@ -0,0 +1,10 @@
+This is a package of pixel shaders intended for old school emulators.
+Copyrights are held by the respective authors.
+
+https://github.com/libretro/glsl-shaders
+
+
+Note: Filename must end with "bilinear.glsl" to enable bilinear hardware filtering (GL_LINEAR)
+
+
+Extract shader-package.zip to unlock 100+ additional shaders
diff --git a/Shaders/scanlines/scanline.glsl b/Shaders/scanlines/scanline.glsl
new file mode 100644
index 0000000..7c8423b
--- /dev/null
+++ b/Shaders/scanlines/scanline.glsl
@@ -0,0 +1,106 @@
+// Parameter lines go here:
+#pragma parameter SCANLINE_BASE_BRIGHTNESS "Scanline Base Brightness" 0.95 0.0 1.0 0.01
+#pragma parameter SCANLINE_SINE_COMP_A "Scanline Sine Comp A" 0.0 0.0 0.10 0.01
+#pragma parameter SCANLINE_SINE_COMP_B "Scanline Sine Comp B" 0.15 0.0 1.0 0.05
+
+#define pi 3.141592654
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+COMPAT_VARYING vec2 omega;
+
+vec4 _oPosition1;
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ COL0 = COLOR;
+ TEX0.xy = TexCoord.xy;
+ omega = vec2(pi * OutputSize.x, 2.0 * pi * TextureSize.y);
+}
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+COMPAT_VARYING vec2 omega;
+
+// compatibility #defines
+#define Source Texture
+#define vTexCoord TEX0.xy
+
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutputSize vec4(OutputSize, 1.0 / OutputSize)
+
+#ifdef PARAMETER_UNIFORM
+// All parameter floats need to have COMPAT_PRECISION in front of them
+uniform COMPAT_PRECISION float SCANLINE_BASE_BRIGHTNESS;
+uniform COMPAT_PRECISION float SCANLINE_SINE_COMP_A;
+uniform COMPAT_PRECISION float SCANLINE_SINE_COMP_B;
+#else
+#define SCANLINE_BASE_BRIGHTNESS 0.95
+#define SCANLINE_SINE_COMP_A 0.0
+#define SCANLINE_SINE_COMP_B 0.15
+#endif
+
+void main()
+{
+ vec2 sine_comp = vec2(SCANLINE_SINE_COMP_A, SCANLINE_SINE_COMP_B);
+ vec3 res = COMPAT_TEXTURE(Source, vTexCoord).xyz;
+ vec3 scanline = res * (SCANLINE_BASE_BRIGHTNESS + dot(sine_comp * sin(vTexCoord * omega), vec2(1.0, 1.0)));
+ FragColor = vec4(scanline.x, scanline.y, scanline.z, 1.0);
+}
+#endif
diff --git a/Shaders/shader-package.zip b/Shaders/shader-package.zip
new file mode 100644
index 0000000..4959e8b
--- /dev/null
+++ b/Shaders/shader-package.zip
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ba138d8133da3e9b493d30383fc24380a44a376ddf7d54f3aef39338967fc6d7
+size 280111
diff --git a/Shaders/sharpen/fast-sharpen.glsl b/Shaders/sharpen/fast-sharpen.glsl
new file mode 100644
index 0000000..623fd6d
--- /dev/null
+++ b/Shaders/sharpen/fast-sharpen.glsl
@@ -0,0 +1,148 @@
+/*
+ Fast Sharpen Shader
+
+ Copyright (C) 2005 - 2019 guest(r) - guest.r@gmail.com
+
+ 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#pragma parameter SHARPEN "Sharpen strength" 1.00 0.0 2.00 0.05
+#pragma parameter CONTR "Ammount of sharpening" 0.07 0.0 0.25 0.01
+#pragma parameter DETAILS "Details sharpened " 1.00 0.0 1.00 0.05
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 TEX0;
+
+vec4 _oPosition1;
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+COMPAT_VARYING vec2 g10;
+COMPAT_VARYING vec2 g01;
+COMPAT_VARYING vec2 g12;
+COMPAT_VARYING vec2 g21;
+
+// compatibility #defines
+#define vTexCoord TEX0.xy
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ TEX0.xy = TexCoord.xy * 1.00001;
+ g10 = vec2( 0.3333,-1.0)*SourceSize.zw;
+ g01 = vec2(-1.0,-0.3333)*SourceSize.zw;
+ g12 = vec2(-0.3333, 1.0)*SourceSize.zw;
+ g21 = vec2( 1.0, 0.3333)*SourceSize.zw;
+}
+
+#elif defined(FRAGMENT)
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out COMPAT_PRECISION vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+COMPAT_VARYING vec2 g10;
+COMPAT_VARYING vec2 g01;
+COMPAT_VARYING vec2 g12;
+COMPAT_VARYING vec2 g21;
+
+// compatibility #defines
+#define Source Texture
+#define vTexCoord TEX0.xy
+
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+#ifdef PARAMETER_UNIFORM
+uniform COMPAT_PRECISION float SHARPEN;
+uniform COMPAT_PRECISION float CONTR;
+uniform COMPAT_PRECISION float DETAILS;
+#else
+#define SHARPEN 1.2
+#define CONTR 0.08
+#define DETAILS 1.0
+#endif
+
+void main()
+{
+ vec3 c10 = COMPAT_TEXTURE(Source, vTexCoord + g10).rgb;
+ vec3 c01 = COMPAT_TEXTURE(Source, vTexCoord + g01).rgb;
+ vec3 c21 = COMPAT_TEXTURE(Source, vTexCoord + g21).rgb;
+ vec3 c12 = COMPAT_TEXTURE(Source, vTexCoord + g12).rgb;
+ vec3 c11 = COMPAT_TEXTURE(Source, vTexCoord ).rgb;
+ vec3 b11 = (c10+c01+c12+c21)*0.25;
+
+ float contrast = max(max(c11.r,c11.g),c11.b);
+ contrast = mix(2.0*CONTR, CONTR, contrast);
+
+ vec3 mn1 = min(min(c10,c01),min(c12,c21)); mn1 = min(mn1,c11*(1.0-contrast));
+ vec3 mx1 = max(max(c10,c01),max(c12,c21)); mx1 = max(mx1,c11*(1.0+contrast));
+
+ vec3 dif = pow(mx1-mn1+0.0001, vec3(0.75,0.75,0.75));
+ vec3 sharpen = mix(vec3(SHARPEN*DETAILS), vec3(SHARPEN), dif);
+
+ c11 = clamp(mix(c11,b11,-sharpen), mn1,mx1);
+
+ FragColor = vec4(c11,1.0);
+}
+#endif
diff --git a/Shaders/windowed/lanczos2-sharp.glsl b/Shaders/windowed/lanczos2-sharp.glsl
new file mode 100644
index 0000000..5f83af3
--- /dev/null
+++ b/Shaders/windowed/lanczos2-sharp.glsl
@@ -0,0 +1,205 @@
+/*
+ Hyllian's jinc windowed-jinc 2-lobe sharper with anti-ringing Shader
+
+ Copyright (C) 2011-2016 Hyllian/Jararaca - sergiogdb@gmail.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+*/
+
+#define JINC2_WINDOW_SINC 0.5
+#define JINC2_SINC 1.0
+#define JINC2_AR_STRENGTH 0.8
+
+#define texCoord TEX0
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define OUT out
+#define IN in
+#define tex2D texture
+#else
+#define OUT varying
+#define IN attribute
+#define tex2D texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+
+IN vec4 VertexCoord;
+IN vec4 Color;
+IN vec2 TexCoord;
+OUT vec4 color;
+OUT vec2 texCoord;
+
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ color = Color;
+ texCoord = TexCoord;
+}
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define IN in
+#define tex2D texture
+out vec4 FragColor;
+#else
+#define IN varying
+#define FragColor gl_FragColor
+#define tex2D texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D s_p;
+IN vec2 texCoord;
+
+const float halfpi = 1.5707963267948966192313216916398;
+const float pi = 3.1415926535897932384626433832795;
+const float wa = JINC2_WINDOW_SINC*pi;
+const float wb = JINC2_SINC*pi;
+
+// Calculates the distance between two points
+float d(vec2 pt1, vec2 pt2)
+{
+ vec2 v = pt2 - pt1;
+ return sqrt(dot(v,v));
+}
+
+vec3 min4(vec3 a, vec3 b, vec3 c, vec3 d)
+{
+ return min(a, min(b, min(c, d)));
+}
+
+vec3 max4(vec3 a, vec3 b, vec3 c, vec3 d)
+{
+ return max(a, max(b, max(c, d)));
+}
+
+vec4 resampler(vec4 x)
+{
+ vec4 res;
+
+ res.x = (x.x==0.0) ? wa*wb : sin(x.x*wa)*sin(x.x*wb)/(x.x*x.x);
+ res.y = (x.y==0.0) ? wa*wb : sin(x.y*wa)*sin(x.y*wb)/(x.y*x.y);
+ res.z = (x.z==0.0) ? wa*wb : sin(x.z*wa)*sin(x.z*wb)/(x.z*x.z);
+ res.w = (x.w==0.0) ? wa*wb : sin(x.w*wa)*sin(x.w*wb)/(x.w*x.w);
+
+ return res;
+}
+
+void main()
+{
+
+ vec3 color;
+ vec4 weights[4];
+
+ vec2 dx = vec2(1.0, 0.0);
+ vec2 dy = vec2(0.0, 1.0);
+
+ vec2 pc = texCoord*TextureSize;
+
+ vec2 tc = (floor(pc-vec2(0.5,0.5))+vec2(0.5,0.5));
+
+ weights[0] = resampler(vec4(d(pc, tc -dx -dy), d(pc, tc -dy), d(pc, tc +dx -dy), d(pc, tc+2.0*dx -dy)));
+ weights[1] = resampler(vec4(d(pc, tc -dx ), d(pc, tc ), d(pc, tc +dx ), d(pc, tc+2.0*dx )));
+ weights[2] = resampler(vec4(d(pc, tc -dx +dy), d(pc, tc +dy), d(pc, tc +dx +dy), d(pc, tc+2.0*dx +dy)));
+ weights[3] = resampler(vec4(d(pc, tc -dx+2.0*dy), d(pc, tc +2.0*dy), d(pc, tc +dx+2.0*dy), d(pc, tc+2.0*dx+2.0*dy)));
+
+ dx = dx/TextureSize;
+ dy = dy/TextureSize;
+ tc = tc/TextureSize;
+
+ vec3 c00 = tex2D(s_p, tc -dx -dy).xyz;
+ vec3 c10 = tex2D(s_p, tc -dy).xyz;
+ vec3 c20 = tex2D(s_p, tc +dx -dy).xyz;
+ vec3 c30 = tex2D(s_p, tc+2.0*dx -dy).xyz;
+ vec3 c01 = tex2D(s_p, tc -dx ).xyz;
+ vec3 c11 = tex2D(s_p, tc ).xyz;
+ vec3 c21 = tex2D(s_p, tc +dx ).xyz;
+ vec3 c31 = tex2D(s_p, tc+2.0*dx ).xyz;
+ vec3 c02 = tex2D(s_p, tc -dx +dy).xyz;
+ vec3 c12 = tex2D(s_p, tc +dy).xyz;
+ vec3 c22 = tex2D(s_p, tc +dx +dy).xyz;
+ vec3 c32 = tex2D(s_p, tc+2.0*dx +dy).xyz;
+ vec3 c03 = tex2D(s_p, tc -dx+2.0*dy).xyz;
+ vec3 c13 = tex2D(s_p, tc +2.0*dy).xyz;
+ vec3 c23 = tex2D(s_p, tc +dx+2.0*dy).xyz;
+ vec3 c33 = tex2D(s_p, tc+2.0*dx+2.0*dy).xyz;
+
+ color = tex2D(s_p, texCoord).xyz;
+
+ // Get min/max samples
+ vec3 min_sample = min4(c11, c21, c12, c22);
+ vec3 max_sample = max4(c11, c21, c12, c22);
+/*
+ color = mat4x3(c00, c10, c20, c30) * weights[0];
+ color+= mat4x3(c01, c11, c21, c31) * weights[1];
+ color+= mat4x3(c02, c12, c22, c32) * weights[2];
+ color+= mat4x3(c03, c13, c23, c33) * weights[3];
+ mat4 wgts = mat4(weights[0], weights[1], weights[2], weights[3]);
+ vec4 wsum = wgts * vec4(1.0,1.0,1.0,1.0);
+ color = color/(dot(wsum, vec4(1.0,1.0,1.0,1.0)));
+*/
+
+
+ color = vec3(dot(weights[0], vec4(c00.x, c10.x, c20.x, c30.x)), dot(weights[0], vec4(c00.y, c10.y, c20.y, c30.y)), dot(weights[0], vec4(c00.z, c10.z, c20.z, c30.z)));
+ color+= vec3(dot(weights[1], vec4(c01.x, c11.x, c21.x, c31.x)), dot(weights[1], vec4(c01.y, c11.y, c21.y, c31.y)), dot(weights[1], vec4(c01.z, c11.z, c21.z, c31.z)));
+ color+= vec3(dot(weights[2], vec4(c02.x, c12.x, c22.x, c32.x)), dot(weights[2], vec4(c02.y, c12.y, c22.y, c32.y)), dot(weights[2], vec4(c02.z, c12.z, c22.z, c32.z)));
+ color+= vec3(dot(weights[3], vec4(c03.x, c13.x, c23.x, c33.x)), dot(weights[3], vec4(c03.y, c13.y, c23.y, c33.y)), dot(weights[3], vec4(c03.z, c13.z, c23.z, c33.z)));
+ color = color/(dot(weights[0], vec4(1,1,1,1)) + dot(weights[1], vec4(1,1,1,1)) + dot(weights[2], vec4(1,1,1,1)) + dot(weights[3], vec4(1,1,1,1)));
+
+ // Anti-ringing
+ vec3 aux = color;
+ color = clamp(color, min_sample, max_sample);
+ color = mix(aux, color, JINC2_AR_STRENGTH);
+
+ // final sum and weight normalization
+ FragColor.xyz = color;
+}
+#endif
diff --git a/Shaders/xbr/xbr-lv2-noblend.glsl b/Shaders/xbr/xbr-lv2-noblend.glsl
new file mode 100644
index 0000000..bbc2aae
--- /dev/null
+++ b/Shaders/xbr/xbr-lv2-noblend.glsl
@@ -0,0 +1,300 @@
+#version 130
+
+/*
+ Hyllian's xBR-lv2-noblend Shader
+
+ Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ Incorporates some of the ideas from SABR shader. Thanks to Joshua Street.
+*/
+
+#pragma parameter XBR_EQ_THRESHOLD "Eq Threshold" 0.6 0.0 2.0 0.1
+#pragma parameter XBR_LV2_COEFFICIENT "Lv2 Coefficient" 2.0 1.0 3.0 0.1
+
+#define mul(a,b) (b*a)
+
+// Uncomment just one of the three params below to choose the corner detection
+#define CORNER_A
+//#define CORNER_B
+//#define CORNER_C
+//#define CORNER_D
+
+#define lv2_cf XBR_LV2_COEFFICIENT
+
+#define texCoord TEX0
+#define t1 TEX1
+#define t2 TEX2
+#define t3 TEX3
+#define t4 TEX4
+#define t5 TEX5
+#define t6 TEX6
+#define t7 TEX7
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define OUT out
+#define IN in
+#define tex2D texture
+#else
+#define OUT varying
+#define IN attribute
+#define tex2D texture2D
+#endif
+
+#ifdef GL_ES
+#define PRECISION mediump
+#else
+#define PRECISION
+#endif
+
+
+IN vec4 VertexCoord;
+IN vec4 Color;
+IN vec2 TexCoord;
+
+OUT vec4 color;
+OUT vec2 texCoord;
+OUT vec4 t1;
+OUT vec4 t2;
+OUT vec4 t3;
+OUT vec4 t4;
+OUT vec4 t5;
+OUT vec4 t6;
+OUT vec4 t7;
+
+uniform mat4 MVPMatrix;
+uniform PRECISION int FrameDirection;
+uniform PRECISION int FrameCount;
+uniform PRECISION vec2 OutputSize;
+uniform PRECISION vec2 TextureSize;
+uniform PRECISION vec2 InputSize;
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ color = Color;
+
+ float dx = (1.0/TextureSize.x);
+ float dy = (1.0/TextureSize.y);
+
+ texCoord = TexCoord;
+ texCoord.x *= 1.00000001;
+ t1 = TexCoord.xxxy + vec4( -dx, 0, dx,-2.0*dy); // A1 B1 C1
+ t2 = TexCoord.xxxy + vec4( -dx, 0, dx, -dy); // A B C
+ t3 = TexCoord.xxxy + vec4( -dx, 0, dx, 0); // D E F
+ t4 = TexCoord.xxxy + vec4( -dx, 0, dx, dy); // G H I
+ t5 = TexCoord.xxxy + vec4( -dx, 0, dx, 2.0*dy); // G5 H5 I5
+ t6 = TexCoord.xyyy + vec4(-2.0*dx,-dy, 0, dy); // A0 D0 G0
+ t7 = TexCoord.xyyy + vec4( 2.0*dx,-dy, 0, dy); // C4 F4 I4
+}
+
+
+#elif defined(FRAGMENT)
+
+#if __VERSION__ >= 130
+#define IN in
+#define tex2D texture
+out vec4 FragColor;
+#else
+#define IN varying
+#define FragColor gl_FragColor
+#define tex2D texture2D
+#endif
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define PRECISION mediump
+#else
+#define PRECISION
+#endif
+
+uniform PRECISION int FrameDirection;
+uniform PRECISION int FrameCount;
+uniform PRECISION vec2 OutputSize;
+uniform PRECISION vec2 TextureSize;
+uniform PRECISION vec2 InputSize;
+uniform sampler2D decal;
+IN vec2 texCoord;
+IN vec4 t1;
+IN vec4 t2;
+IN vec4 t3;
+IN vec4 t4;
+IN vec4 t5;
+IN vec4 t6;
+IN vec4 t7;
+
+#ifdef PARAMETER_UNIFORM
+uniform PRECISION float XBR_EQ_THRESHOLD;
+uniform PRECISION float XBR_LV2_COEFFICIENT;
+#else
+#define XBR_EQ_THRESHOLD 0.6
+#define XBR_LV2_COEFFICIENT 2.0
+#endif
+// END PARAMETERS //
+
+const vec3 Y = vec3(0.2126, 0.7152, 0.0722);
+
+// Difference between vector components.
+vec4 df(vec4 A, vec4 B)
+{
+ return vec4(abs(A-B));
+}
+
+// Compare two vectors and return their components are different.
+vec4 diff(vec4 A, vec4 B)
+{
+ return vec4(notEqual(A, B));
+}
+
+// Determine if two vector components are equal based on a threshold.
+vec4 eq(vec4 A, vec4 B)
+{
+ return (step(df(A, B), vec4(XBR_EQ_THRESHOLD)));
+}
+
+// Determine if two vector components are NOT equal based on a threshold.
+vec4 neq(vec4 A, vec4 B)
+{
+ return (vec4(1.0, 1.0, 1.0, 1.0) - eq(A, B));
+}
+
+// Weighted distance.
+vec4 wd(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h)
+{
+ return (df(a,b) + df(a,c) + df(d,e) + df(d,f) + 4.0*df(g,h));
+}
+
+vec4 weighted_distance(vec4 a, vec4 b, vec4 c, vec4 d, vec4 e, vec4 f, vec4 g, vec4 h, vec4 i, vec4 j, vec4 k, vec4 l)
+{
+ return (df(a,b) + df(a,c) + df(d,e) + df(d,f) + df(i,j) + df(k,l) + 2.0*df(g,h));
+}
+
+float c_df(vec3 c1, vec3 c2)
+{
+ vec3 df = abs(c1 - c2);
+ return df.r + df.g + df.b;
+}
+
+void main()
+{
+ vec4 edri, edr, edr_l, edr_u; // px = pixel, edr = edge detection rule
+ vec4 irlv1, irlv2l, irlv2u, block_3d;
+ bvec4 nc, px;
+ vec4 fx, fx_l, fx_u; // inequations of straight lines.
+
+ vec2 fp = fract(texCoord*TextureSize);
+
+ vec3 A1 = tex2D(decal, t1.xw ).xyz;
+ vec3 B1 = tex2D(decal, t1.yw ).xyz;
+ vec3 C1 = tex2D(decal, t1.zw ).xyz;
+ vec3 A = tex2D(decal, t2.xw ).xyz;
+ vec3 B = tex2D(decal, t2.yw ).xyz;
+ vec3 C = tex2D(decal, t2.zw ).xyz;
+ vec3 D = tex2D(decal, t3.xw ).xyz;
+ vec3 E = tex2D(decal, t3.yw ).xyz;
+ vec3 F = tex2D(decal, t3.zw ).xyz;
+ vec3 G = tex2D(decal, t4.xw ).xyz;
+ vec3 H = tex2D(decal, t4.yw ).xyz;
+ vec3 I = tex2D(decal, t4.zw ).xyz;
+ vec3 G5 = tex2D(decal, t5.xw ).xyz;
+ vec3 H5 = tex2D(decal, t5.yw ).xyz;
+ vec3 I5 = tex2D(decal, t5.zw ).xyz;
+ vec3 A0 = tex2D(decal, t6.xy ).xyz;
+ vec3 D0 = tex2D(decal, t6.xz ).xyz;
+ vec3 G0 = tex2D(decal, t6.xw ).xyz;
+ vec3 C4 = tex2D(decal, t7.xy ).xyz;
+ vec3 F4 = tex2D(decal, t7.xz ).xyz;
+ vec3 I4 = tex2D(decal, t7.xw ).xyz;
+
+ vec4 b = mul( mat4x3(B, D, H, F), Y );
+ vec4 c = mul( mat4x3(C, A, G, I), Y );
+ vec4 e = mul( mat4x3(E, E, E, E), Y );
+ vec4 d = b.yzwx;
+ vec4 f = b.wxyz;
+ vec4 g = c.zwxy;
+ vec4 h = b.zwxy;
+ vec4 i = c.wxyz;
+
+ vec4 i4 = mul( mat4x3(I4, C1, A0, G5), Y );
+ vec4 i5 = mul( mat4x3(I5, C4, A1, G0), Y );
+ vec4 h5 = mul( mat4x3(H5, F4, B1, D0), Y );
+ vec4 f4 = h5.yzwx;
+
+ vec4 Ao = vec4( 1.0, -1.0, -1.0, 1.0 );
+ vec4 Bo = vec4( 1.0, 1.0, -1.0,-1.0 );
+ vec4 Co = vec4( 1.5, 0.5, -0.5, 0.5 );
+ vec4 Ax = vec4( 1.0, -1.0, -1.0, 1.0 );
+ vec4 Bx = vec4( 0.5, 2.0, -0.5,-2.0 );
+ vec4 Cx = vec4( 1.0, 1.0, -0.5, 0.0 );
+ vec4 Ay = vec4( 1.0, -1.0, -1.0, 1.0 );
+ vec4 By = vec4( 2.0, 0.5, -2.0,-0.5 );
+ vec4 Cy = vec4( 2.0, 0.0, -1.0, 0.5 );
+
+ // These inequations define the line below which interpolation occurs.
+ fx = vec4(greaterThan(Ao*fp.y+Bo*fp.x, Co));
+ fx_l = vec4(greaterThan(Ax*fp.y+Bx*fp.x, Cx));
+ fx_u = vec4(greaterThan(Ay*fp.y+By*fp.x, Cy));
+
+#ifdef CORNER_A
+ irlv1 = diff(e,f) * diff(e,h);
+#endif
+#ifdef CORNER_B
+ irlv1 = (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c));
+#endif
+#ifdef CORNER_D
+ vec4 c1 = i4.yzwx;
+ vec4 g0 = i5.wxyz;
+ irlv1 = (neq(f,b) * neq(h,d) + eq(e,i) * neq(f,i4) * neq(h,i5) + eq(e,g) + eq(e,c) ) * (diff(f,f4) * diff(f,i) + diff(h,h5) * diff(h,i) + diff(h,g) + diff(f,c) + eq(b,c1) * eq(d,g0));
+#endif
+#ifdef CORNER_C
+ irlv1 = (neq(f,b) * neq(f,c) + neq(h,d) * neq(h,g) + eq(e,i) * (neq(f,f4) * neq(f,i4) + neq(h,h5) * neq(h,i5)) + eq(e,g) + eq(e,c));
+#endif
+
+ irlv2l = diff(e,g) * diff(d,g);
+ irlv2u = diff(e,c) * diff(b,c);
+
+ vec4 wd1 = wd( e, c, g, i, h5, f4, h, f);
+ vec4 wd2 = wd( h, d, i5, f, i4, b, e, i);
+
+ edri = step(wd1, wd2) * irlv1;
+ edr = step(wd1 + vec4(0.1, 0.1, 0.1, 0.1), wd2) * step(vec4(0.5, 0.5, 0.5, 0.5), irlv1);
+ edr_l = step( lv2_cf*df(f,g), df(h,c) ) * irlv2l * edr;
+ edr_u = step( lv2_cf*df(h,c), df(f,g) ) * irlv2u * edr;
+
+ nc = bvec4( edr * ( fx + edr_l * (fx_l)) + edr_u * fx_u);
+
+ px = lessThanEqual(df(e, f), df(e, h));
+
+ vec3 res1 = nc.x ? px.x ? F : H : nc.y ? px.y ? B : F : nc.z ? px.z ? D : B : E;
+ vec3 res2 = nc.w ? px.w ? H : D : nc.z ? px.z ? D : B : nc.y ? px.y ? B : F : E;
+
+ vec2 df12 = abs( mul( mat2x3(res1, res2), Y ) - e.xy);
+
+ vec3 res = mix(res1, res2, step(df12.x, df12.y));
+
+ FragColor.xyz = res;
+}
+#endif
diff --git a/Shaders/xbrz/xbrz-freescale.glsl b/Shaders/xbrz/xbrz-freescale.glsl
new file mode 100644
index 0000000..3cc9edd
--- /dev/null
+++ b/Shaders/xbrz/xbrz-freescale.glsl
@@ -0,0 +1,375 @@
+/*
+ Hyllian's xBR-vertex code and texel mapping
+
+ Copyright (C) 2011/2016 Hyllian - sergiogdb@gmail.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+*/
+
+// This shader also uses code and/or concepts from xBRZ as it appears
+// in the Desmume source code. The license for which is as follows:
+
+// ****************************************************************************
+// * This file is part of the HqMAME project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
+// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
+// * *
+// * Additionally and as a special exception, the author 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. *
+// ****************************************************************************
+
+#if defined(VERTEX)
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING out
+#define COMPAT_ATTRIBUTE in
+#define COMPAT_TEXTURE texture
+#else
+#define COMPAT_VARYING varying
+#define COMPAT_ATTRIBUTE attribute
+#define COMPAT_TEXTURE texture2D
+#endif
+
+#ifdef GL_ES
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+COMPAT_ATTRIBUTE vec4 VertexCoord;
+COMPAT_ATTRIBUTE vec4 COLOR;
+COMPAT_ATTRIBUTE vec4 TexCoord;
+COMPAT_VARYING vec4 COL0;
+COMPAT_VARYING vec4 TEX0;
+
+vec4 _oPosition1;
+uniform mat4 MVPMatrix;
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+
+// compatibility #defines
+#define vTexCoord TEX0.xy
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+#ifdef PARAMETER_UNIFORM
+uniform COMPAT_PRECISION float WHATEVER;
+#else
+#define WHATEVER 0.0
+#endif
+
+void main()
+{
+ gl_Position = MVPMatrix * VertexCoord;
+ TEX0.xy = TexCoord.xy * 1.0001;
+}
+
+#elif defined(FRAGMENT)
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#define COMPAT_PRECISION mediump
+#else
+#define COMPAT_PRECISION
+#endif
+
+#if __VERSION__ >= 130
+#define COMPAT_VARYING in
+#define COMPAT_TEXTURE texture
+out COMPAT_PRECISION vec4 FragColor;
+#else
+#define COMPAT_VARYING varying
+#define FragColor gl_FragColor
+#define COMPAT_TEXTURE texture2D
+#endif
+
+uniform COMPAT_PRECISION int FrameDirection;
+uniform COMPAT_PRECISION int FrameCount;
+uniform COMPAT_PRECISION vec2 OutputSize;
+uniform COMPAT_PRECISION vec2 TextureSize;
+uniform COMPAT_PRECISION vec2 InputSize;
+uniform sampler2D Texture;
+COMPAT_VARYING vec4 TEX0;
+
+// compatibility #defines
+#define Source Texture
+#define vTexCoord TEX0.xy
+
+#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
+#define OutSize vec4(OutputSize, 1.0 / OutputSize)
+
+#define BLEND_NONE 0
+#define BLEND_NORMAL 1
+#define BLEND_DOMINANT 2
+#define LUMINANCE_WEIGHT 1.0
+#define EQUAL_COLOR_TOLERANCE 30.0/255.0
+#define STEEP_DIRECTION_THRESHOLD 2.2
+#define DOMINANT_DIRECTION_THRESHOLD 3.6
+
+float DistYCbCr(vec3 pixA, vec3 pixB)
+{
+ const vec3 w = vec3(0.2627, 0.6780, 0.0593);
+ const float scaleB = 0.5 / (1.0 - w.b);
+ const float scaleR = 0.5 / (1.0 - w.r);
+ vec3 diff = pixA - pixB;
+ float Y = dot(diff.rgb, w);
+ float Cb = scaleB * (diff.b - Y);
+ float Cr = scaleR * (diff.r - Y);
+
+ return sqrt(((LUMINANCE_WEIGHT * Y) * (LUMINANCE_WEIGHT * Y)) + (Cb * Cb) + (Cr * Cr));
+}
+
+bool IsPixEqual(const vec3 pixA, const vec3 pixB)
+{
+ return (DistYCbCr(pixA, pixB) < EQUAL_COLOR_TOLERANCE);
+}
+
+float get_left_ratio(vec2 center, vec2 origin, vec2 direction, vec2 scale)
+{
+ vec2 P0 = center - origin;
+ vec2 proj = direction * (dot(P0, direction) / dot(direction, direction));
+ vec2 distv = P0 - proj;
+ vec2 orth = vec2(-direction.y, direction.x);
+ float side = sign(dot(P0, orth));
+ float v = side * length(distv * scale);
+
+// return step(0, v);
+ return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v);
+}
+
+#define eq(a,b) (a == b)
+#define neq(a,b) (a != b)
+
+#define P(x,y) COMPAT_TEXTURE(Source, coord + SourceSize.zw * vec2(x, y)).rgb
+
+void main()
+{
+ //---------------------------------------
+ // Input Pixel Mapping: -|x|x|x|-
+ // x|A|B|C|x
+ // x|D|E|F|x
+ // x|G|H|I|x
+ // -|x|x|x|-
+
+ vec2 scale = OutputSize.xy * SourceSize.zw;
+ vec2 pos = fract(vTexCoord * SourceSize.xy) - vec2(0.5, 0.5);
+ vec2 coord = vTexCoord - pos * SourceSize.zw;
+
+ vec3 A = P(-1.,-1.);
+ vec3 B = P( 0.,-1.);
+ vec3 C = P( 1.,-1.);
+ vec3 D = P(-1., 0.);
+ vec3 E = P( 0., 0.);
+ vec3 F = P( 1., 0.);
+ vec3 G = P(-1., 1.);
+ vec3 H = P( 0., 1.);
+ vec3 I = P( 1., 1.);
+
+ // blendResult Mapping: x|y|
+ // w|z|
+ ivec4 blendResult = ivec4(BLEND_NONE,BLEND_NONE,BLEND_NONE,BLEND_NONE);
+
+ // Preprocess corners
+ // Pixel Tap Mapping: -|-|-|-|-
+ // -|-|B|C|-
+ // -|D|E|F|x
+ // -|G|H|I|x
+ // -|-|x|x|-
+ if (!((eq(E,F) && eq(H,I)) || (eq(E,H) && eq(F,I))))
+ {
+ float dist_H_F = DistYCbCr(G, E) + DistYCbCr(E, C) + DistYCbCr(P(0,2), I) + DistYCbCr(I, P(2.,0.)) + (4.0 * DistYCbCr(H, F));
+ float dist_E_I = DistYCbCr(D, H) + DistYCbCr(H, P(1,2)) + DistYCbCr(B, F) + DistYCbCr(F, P(2.,1.)) + (4.0 * DistYCbCr(E, I));
+ bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_H_F) < dist_E_I;
+ blendResult.z = ((dist_H_F < dist_E_I) && neq(E,F) && neq(E,H)) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
+ }
+
+
+ // Pixel Tap Mapping: -|-|-|-|-
+ // -|A|B|-|-
+ // x|D|E|F|-
+ // x|G|H|I|-
+ // -|x|x|-|-
+ if (!((eq(D,E) && eq(G,H)) || (eq(D,G) && eq(E,H))))
+ {
+ float dist_G_E = DistYCbCr(P(-2.,1.) , D) + DistYCbCr(D, B) + DistYCbCr(P(-1.,2.), H) + DistYCbCr(H, F) + (4.0 * DistYCbCr(G, E));
+ float dist_D_H = DistYCbCr(P(-2.,0.) , G) + DistYCbCr(G, P(0.,2.)) + DistYCbCr(A, E) + DistYCbCr(E, I) + (4.0 * DistYCbCr(D, H));
+ bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_D_H) < dist_G_E;
+ blendResult.w = ((dist_G_E > dist_D_H) && neq(E,D) && neq(E,H)) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
+ }
+
+ // Pixel Tap Mapping: -|-|x|x|-
+ // -|A|B|C|x
+ // -|D|E|F|x
+ // -|-|H|I|-
+ // -|-|-|-|-
+ if (!((eq(B,C) && eq(E,F)) || (eq(B,E) && eq(C,F))))
+ {
+ float dist_E_C = DistYCbCr(D, B) + DistYCbCr(B, P(1.,-2.)) + DistYCbCr(H, F) + DistYCbCr(F, P(2.,-1.)) + (4.0 * DistYCbCr(E, C));
+ float dist_B_F = DistYCbCr(A, E) + DistYCbCr(E, I) + DistYCbCr(P(0.,-2.), C) + DistYCbCr(C, P(2.,0.)) + (4.0 * DistYCbCr(B, F));
+ bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_B_F) < dist_E_C;
+ blendResult.y = ((dist_E_C > dist_B_F) && neq(E,B) && neq(E,F)) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
+ }
+
+ // Pixel Tap Mapping: -|x|x|-|-
+ // x|A|B|C|-
+ // x|D|E|F|-
+ // -|G|H|-|-
+ // -|-|-|-|-
+ if (!((eq(A,B) && eq(D,E)) || (eq(A,D) && eq(B,E))))
+ {
+ float dist_D_B = DistYCbCr(P(-2.,0.), A) + DistYCbCr(A, P(0.,-2.)) + DistYCbCr(G, E) + DistYCbCr(E, C) + (4.0 * DistYCbCr(D, B));
+ float dist_A_E = DistYCbCr(P(-2.,-1.), D) + DistYCbCr(D, H) + DistYCbCr(P(-1.,-2.), B) + DistYCbCr(B, F) + (4.0 * DistYCbCr(A, E));
+ bool dominantGradient = (DOMINANT_DIRECTION_THRESHOLD * dist_D_B) < dist_A_E;
+ blendResult.x = ((dist_D_B < dist_A_E) && neq(E,D) && neq(E,B)) ? ((dominantGradient) ? BLEND_DOMINANT : BLEND_NORMAL) : BLEND_NONE;
+ }
+
+ vec3 res = E;
+
+ // Pixel Tap Mapping: -|-|-|-|-
+ // -|-|B|C|-
+ // -|D|E|F|x
+ // -|G|H|I|x
+ // -|-|x|x|-
+ if(blendResult.z != BLEND_NONE)
+ {
+ float dist_F_G = DistYCbCr(F, G);
+ float dist_H_C = DistYCbCr(H, C);
+ bool doLineBlend = (blendResult.z == BLEND_DOMINANT ||
+ !((blendResult.y != BLEND_NONE && !IsPixEqual(E, G)) || (blendResult.w != BLEND_NONE && !IsPixEqual(E, C)) ||
+ (IsPixEqual(G, H) && IsPixEqual(H, I) && IsPixEqual(I, F) && IsPixEqual(F, C) && !IsPixEqual(E, I))));
+
+ vec2 origin = vec2(0.0, 1.0 / sqrt(2.0));
+ vec2 direction = vec2(1.0, -1.0);
+ if(doLineBlend)
+ {
+ bool haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_F_G <= dist_H_C) && neq(E,G) && neq(D,G);
+ bool haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_H_C <= dist_F_G) && neq(E,C) && neq(B,C);
+ origin = haveShallowLine? vec2(0.0, 0.25) : vec2(0.0, 0.5);
+ direction.x += haveShallowLine? 1.0: 0.0;
+ direction.y -= haveSteepLine? 1.0: 0.0;
+ }
+
+ vec3 blendPix = mix(H,F, step(DistYCbCr(E, F), DistYCbCr(E, H)));
+ res = mix(res, blendPix, get_left_ratio(pos, origin, direction, scale));
+ }
+
+ // Pixel Tap Mapping: -|-|-|-|-
+ // -|A|B|-|-
+ // x|D|E|F|-
+ // x|G|H|I|-
+ // -|x|x|-|-
+ if(blendResult.w != BLEND_NONE)
+ {
+ float dist_H_A = DistYCbCr(H, A);
+ float dist_D_I = DistYCbCr(D, I);
+ bool doLineBlend = (blendResult.w == BLEND_DOMINANT ||
+ !((blendResult.z != BLEND_NONE && !IsPixEqual(E, A)) || (blendResult.x != BLEND_NONE && !IsPixEqual(E, I)) ||
+ (IsPixEqual(A, D) && IsPixEqual(D, G) && IsPixEqual(G, H) && IsPixEqual(H, I) && !IsPixEqual(E, G))));
+
+ vec2 origin = vec2(-1.0 / sqrt(2.0), 0.0);
+ vec2 direction = vec2(1.0, 1.0);
+ if(doLineBlend)
+ {
+ bool haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_H_A <= dist_D_I) && neq(E,A) && neq(B,A);
+ bool haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_D_I <= dist_H_A) && neq(E,I) && neq(F,I);
+ origin = haveShallowLine? vec2(-0.25, 0.0) : vec2(-0.5, 0.0);
+ direction.y += haveShallowLine? 1.0: 0.0;
+ direction.x += haveSteepLine? 1.0: 0.0;
+ }
+ origin = origin;
+ direction = direction;
+
+ vec3 blendPix = mix(H,D, step(DistYCbCr(E, D), DistYCbCr(E, H)));
+ res = mix(res, blendPix, get_left_ratio(pos, origin, direction, scale));
+ }
+
+ // Pixel Tap Mapping: -|-|x|x|-
+ // -|A|B|C|x
+ // -|D|E|F|x
+ // -|-|H|I|-
+ // -|-|-|-|-
+ if(blendResult.y != BLEND_NONE)
+ {
+ float dist_B_I = DistYCbCr(B, I);
+ float dist_F_A = DistYCbCr(F, A);
+ bool doLineBlend = (blendResult.y == BLEND_DOMINANT ||
+ !((blendResult.x != BLEND_NONE && !IsPixEqual(E, I)) || (blendResult.z != BLEND_NONE && !IsPixEqual(E, A)) ||
+ (IsPixEqual(I, F) && IsPixEqual(F, C) && IsPixEqual(C, B) && IsPixEqual(B, A) && !IsPixEqual(E, C))));
+
+ vec2 origin = vec2(1.0 / sqrt(2.0), 0.0);
+ vec2 direction = vec2(-1.0, -1.0);
+
+ if(doLineBlend)
+ {
+ bool haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_B_I <= dist_F_A) && neq(E,I) && neq(H,I);
+ bool haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_F_A <= dist_B_I) && neq(E,A) && neq(D,A);
+ origin = haveShallowLine? vec2(0.25, 0.0) : vec2(0.5, 0.0);
+ direction.y -= haveShallowLine? 1.0: 0.0;
+ direction.x -= haveSteepLine? 1.0: 0.0;
+ }
+
+ vec3 blendPix = mix(F,B, step(DistYCbCr(E, B), DistYCbCr(E, F)));
+ res = mix(res, blendPix, get_left_ratio(pos, origin, direction, scale));
+ }
+
+ // Pixel Tap Mapping: -|x|x|-|-
+ // x|A|B|C|-
+ // x|D|E|F|-
+ // -|G|H|-|-
+ // -|-|-|-|-
+ if(blendResult.x != BLEND_NONE)
+ {
+ float dist_D_C = DistYCbCr(D, C);
+ float dist_B_G = DistYCbCr(B, G);
+ bool doLineBlend = (blendResult.x == BLEND_DOMINANT ||
+ !((blendResult.w != BLEND_NONE && !IsPixEqual(E, C)) || (blendResult.y != BLEND_NONE && !IsPixEqual(E, G)) ||
+ (IsPixEqual(C, B) && IsPixEqual(B, A) && IsPixEqual(A, D) && IsPixEqual(D, G) && !IsPixEqual(E, A))));
+
+ vec2 origin = vec2(0.0, -1.0 / sqrt(2.0));
+ vec2 direction = vec2(-1.0, 1.0);
+ if(doLineBlend)
+ {
+ bool haveShallowLine = (STEEP_DIRECTION_THRESHOLD * dist_D_C <= dist_B_G) && neq(E,C) && neq(F,C);
+ bool haveSteepLine = (STEEP_DIRECTION_THRESHOLD * dist_B_G <= dist_D_C) && neq(E,G) && neq(H,G);
+ origin = haveShallowLine? vec2(0.0, -0.25) : vec2(0.0, -0.5);
+ direction.x -= haveShallowLine? 1.0: 0.0;
+ direction.y += haveSteepLine? 1.0: 0.0;
+ }
+
+ vec3 blendPix = mix(D,B, step(DistYCbCr(E, B), DistYCbCr(E, D)));
+ res = mix(res, blendPix, get_left_ratio(pos, origin, direction, scale));
+ }
+
+ FragColor = vec4(res, 1.0);
+}
+#endif
diff --git a/TADemo/MAPS.TXT b/TADemo/MAPS.TXT
new file mode 100644
index 0000000..2d4b241
--- /dev/null
+++ b/TADemo/MAPS.TXT
@@ -0,0 +1,67 @@
+;
+; Default list of maps that the Random Map Selector (tm) will chose from, with weightings.
+; Thanks to Xeno for making the list of mapnames!
+;
+; Structure of this file (quite simple)
+;
+; +Group_name
+;
+;
+; ...
+; +Group_name
+; ...
+;
+; NOTE: If you want to disable a group, just remove the + since all lines that doesn't start with either an
+; integer or a + will be considered as groups to ignore. (and no +10 won't count as an integer). If you want
+; to disable a specific map, just delete the line or perhaps set the weight to 0.
+;
+; About the weightings: They are an INTEGER, and the chance for getting a certain map is proportional to
+; / .
+
++ORIGINAL TA MAPS
+
+100 Brilliant Cut Lake
+100 Cluster Freak
+100 Comet Catcher
+100 Gasplant Plain
+100 [V] Aelston
+100 [V] Anarky
+100 [V] Apache Canyon
+100 [V] Aramon Shores
+100 [V] Astral Arena
+100 [V] Back to War
+100 [V] Brain Coral
+100 [V] Bullet Holes
+100 [V] Burnt Hills
+100 [V] Capacitor
+100 [V] Cappa
+100 [V] Celestial
+100 [V] Death Valley
+100 [V] Duel - Acid
+100 [V] Duel - Aramon
+100 [V] Duel - Crystal
+100 [V] Duel - Green
+100 [V] Flasheller
+100 [V] Gods of War 2
+100 [V] Gods of Adaman
+100 [V] Great Divide x2
+100 [V] Green Ace Extended
+100 [V] Irish Desert
+100 [V] Island Stretch
+100 [V] King of the Hill
+100 [V] Matty's Clutch
+100 [V] Matty's Pass
+100 [V] Mesopotania
+100 [V] Molten Floods
+100 [V] Nuggenland
+100 [V] Plains of Salt 2
+100 [V] Sail Here
+100 [V] Slate Meltdown
+100 [V] Slated Hatred
+100 [V] This Type of Thinking
+100 [V] Utopia
+100 [V] Volcano
+100 [V] Water Corridor
+
+
+
diff --git a/TADemo/SERVER.EXE b/TADemo/SERVER.EXE
index 139ce1d..82d15bc 100644
--- a/TADemo/SERVER.EXE
+++ b/TADemo/SERVER.EXE
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bead33da3babe82244ba81539a6607de068482e74ce80dc15b104c1e299b429a
+oid sha256:f1d15ef3adc496e8843c8bc594041222335480fd072d5584155fa4502b849efb
size 574976
diff --git a/TADemo/unitid.txt b/TADemo/unitid.txt
new file mode 100644
index 0000000..392f7ae
--- /dev/null
+++ b/TADemo/unitid.txt
@@ -0,0 +1,99 @@
+;
+; TA Demo Recoder 0.90ß.
+;
+; This file describes different groups of units.
+; You can therefore add 3rd party units etc to this list if you feel like.
+;
+; The hex-number is the same number that is saved in a unit restrictions file. Don't know
+; how that is related to the unit, or if it can be found in the unit's file somewhere. So if
+; you know, feel free to enlighten me.
+;
+; If you add stuff to the file, you could always send it to me so that future releases of TA Demo can
+; recognize what 3rd-party units was used. (If there should happen to be a nice easy way to get the unit
+; names from those id numbers, this file might become obsolete)
+;
+; Edited by Fnordia 990220
+; 991027
+; 000219
+; 010318
+;
+;
+; Syntax: (very simple)
+;
+; =
+;
+;
+; <...>
+;
+; =
+;
+; etc..
+;
+; update: only units in one of the +-groups will show. with the group furthest down takes presedence.
+; however, the units before the first +-group will be tested for all groups
+
+; I just added one unit to CC cuz I'm lazy. Btw, it's inclusive, so if any unit in the groups list were
+; enabled in the game, this group's name will be listed under used units.
+
+=BAI
+6da73737
+
+=Queller
+; albatross
+62cc5579
+
+=Counterstrike
+; fluxor
+9a34465c
+
++regular ta
+=Core Contingency
+
+; it's the nixter btw. :)
+848ebee6
+
+=ARM Flea
+371d264a
+
+=ARM Scarab
+6b81b8be
+
+=CORE Hedgehog
+763476f4
+
+=CORE Immolator
+3fcf5935
+
+=ARM Fast Attack-Repair Kbot
+d6d867f3
+
+=CORE Necro
+f4c81832
+
++uberhack 1.0
+=UberHack 1.0 TAEC
+; The anemone
+b9f36d39
+
++uberhack 1.1
+=Uberhack 1.1
+; the gimp
+16b40f07
+
+=TAEC units
+; the thumper hehe
+a89cec32
+
++uberhack 3.0
+=Uberhack 3.0
+;centurion
+3b978743
+
++xta 0.8
+=XTA 0.8
+f804eafe
+
++xta betas
+=XTA pre1.0
+; fortwall
+6d197dcf
\ No newline at end of file
diff --git a/TADemoM.ufo b/TADemoM.ufo
index 59ee154..0d9f96b 100644
--- a/TADemoM.ufo
+++ b/TADemoM.ufo
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b1b19c3d16733f7f8e5fc9ab812b316592344bdbfc3ea257c9efaec7a1e073a3
-size 27151
+oid sha256:6193d97d33d8e74e3c0d936c580a1c70869bc841821ff4dd5065c1bff259fb4b
+size 24883
diff --git a/TotalA.exe b/TotalA.exe
index e3eb932..af953b9 100755
--- a/TotalA.exe
+++ b/TotalA.exe
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e4f3a50a671cea11dd9ffd16619c9edf62a66a760f0eb39ea26b127f620f3bf8
-size 1179648
+oid sha256:3b9c0fadabf3dc67ed5f05a70f1e1505a0c65deadd1a3c930adfe30e2a84995e
+size 1178624
diff --git a/bass.dll b/bass.dll
new file mode 100644
index 0000000..cb33ffa
--- /dev/null
+++ b/bass.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6e1bf8ea63f9923687709f4e2f0dac7ff558b2ab923e8c8aa147384746e05b1d
+size 139128
diff --git a/basscd.dll b/basscd.dll
new file mode 100644
index 0000000..6b5c44e
--- /dev/null
+++ b/basscd.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:be21262fa29851b8406520dc2a3ec4b6fd55d278087c1a237c0a8c8397e002c7
+size 26776
diff --git a/bassflac.dll b/bassflac.dll
new file mode 100644
index 0000000..52002f7
--- /dev/null
+++ b/bassflac.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4f794959bab15dac55e389de358a3f2abfcc5a3556740a5af9dc4c771281e40c
+size 39232
diff --git a/bassmix.dll b/bassmix.dll
new file mode 100644
index 0000000..df14384
--- /dev/null
+++ b/bassmix.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cff3edc109bc0d186ba8ddf60bc99e48ff3467771e741c7168adbdbe03379506
+size 32080
diff --git a/basswasapi.dll b/basswasapi.dll
new file mode 100644
index 0000000..1e31fd4
--- /dev/null
+++ b/basswasapi.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:79dcfad6dec9ac93faac81aacdcb7167dad38a55388bc58b2c48982545f0cca4
+size 22000
diff --git a/cnc-ddraw config.exe b/cnc-ddraw config.exe
new file mode 100644
index 0000000..cbb3818
--- /dev/null
+++ b/cnc-ddraw config.exe
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9af89d1f79450e17328af566b27a034347a4d49ccf2e2bfe651baacd8363774
+size 4617728
diff --git a/ddraw.dll b/ddraw.dll
new file mode 100644
index 0000000..7fe7d87
--- /dev/null
+++ b/ddraw.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9e9cf3f56a7458c5fdf632ca4814ca4ed556ec242c2371467767a63c873672e8
+size 358912
diff --git a/ddraw.ini b/ddraw.ini
new file mode 100644
index 0000000..b72a36f
--- /dev/null
+++ b/ddraw.ini
@@ -0,0 +1,899 @@
+; cnc-ddraw - https://github.com/FunkyFr3sh/cnc-ddraw
+
+[ddraw]
+; ### Optional settings ###
+; Use the following settings to adjust the look and feel to your liking
+
+
+; Stretch to custom resolution, 0 = defaults to the size game requests
+width=0
+height=0
+
+; Override the width/height settings shown above and always stretch to fullscreen
+; Note: Can be combined with 'windowed=true' to get windowed-fullscreen aka borderless mode
+fullscreen=true
+
+; Run in windowed mode rather than going fullscreen
+windowed=true
+
+; Maintain aspect ratio
+maintas=false
+
+; Windowboxing / Integer Scaling
+boxing=false
+
+; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap
+; Note: Does not have an impact on the game speed, to limit your game speed use 'maxgameticks='
+maxfps=-1
+
+; Vertical synchronization, enable if you get tearing - (Requires 'renderer=auto/opengl*/direct3d9*')
+; Note: vsync=true can fix tearing but it will cause input lag
+vsync=false
+
+; Automatic mouse sensitivity scaling
+; Note: Only works if stretching is enabled. Sensitivity will be adjusted according to the size of the window
+adjmouse=false
+
+; Preliminary libretro shader support - (Requires 'renderer=opengl*') https://github.com/libretro/glsl-shaders
+; 2x scaling example: https://imgur.com/a/kxsM1oY - 4x scaling example: https://imgur.com/a/wjrhpFV
+; You can specify a full path to a .glsl shader file here or use one of the values listed below
+; Possible values: Nearest neighbor, Bilinear, Bicubic, Lanczos, xBR-lv2
+shader=Shaders\cubic\catmull-rom-bilinear.glsl
+
+; Window position, -32000 = center to screen
+posX=-32000
+posY=-32000
+
+; Renderer, possible values: auto, opengl, openglcore, gdi, direct3d9, direct3d9on12 (auto = try direct3d9/opengl, fallback = gdi)
+renderer=opengl
+
+; Developer mode (don't lock the cursor)
+devmode=false
+
+; Show window borders in windowed mode
+border=true
+
+; Save window position/size/state on game exit and restore it automatically on next game start
+; Possible values: 0 = disabled, 1 = save to global 'ddraw' section, 2 = save to game specific section
+savesettings=1
+
+; Should the window be resizable by the user in windowed mode?
+resizable=true
+
+; Upscaling filter for the direct3d9* renderers
+; Possible values: 0 = nearest-neighbor, 1 = bilinear, 2 = bicubic, 3 = lanczos (bicubic/lanczos only support 16/32bit color depth games)
+d3d9_filter=2
+
+; Enable upscale hack for high resolution patches (Supports C&C1, Red Alert 1 and KKND Xtreme)
+vhack=false
+
+; Where should screenshots be saved
+screenshotdir=.\Screenshots\
+
+; Switch between windowed/borderless modes with alt+enter rather than windowed/fullscreen modes
+toggle_borderless=true
+
+; Switch between windowed/fullscreen upscaled modes with alt+enter rather than windowed/fullscreen modes
+toggle_upscaled=false
+
+
+; ### Compatibility settings ###
+; Use the following settings in case there are any issues with the game
+
+
+; Hide WM_ACTIVATEAPP and WM_NCACTIVATE messages to prevent problems on alt+tab
+noactivateapp=false
+
+; Max game ticks per second, possible values: -1 = disabled, -2 = refresh rate, 0 = emulate 60hz vblank, 1-1000 = custom game speed
+; Note: Can be used to slow down a too fast running game, fix flickering or too fast animations
+; Note: Usually one of the following values will work: 60 / 30 / 25 / 20 / 15 (lower value = slower game speed)
+maxgameticks=0
+
+; Force minimum FPS, possible values: 0 = disabled, -1 = use 'maxfps=' value, -2 = same as -1 but force full redraw, 1-1000 = custom FPS
+; Note: Set this to a low value such as 5 or 10 if some parts of the game are not being displayed (e.g. menus or loading screens)
+minfps=0
+
+; Disable fullscreen-exclusive mode for the direct3d9*/opengl* renderers
+; Note: Can be used in case some GUI elements like buttons/textboxes/videos/etc.. are invisible
+nonexclusive=false
+
+; Force CPU0 affinity, avoids crashes/freezing, *might* have a performance impact
+; Note: Disable this if the game is not running smooth or there are sound issues
+singlecpu=false
+
+; Available resolutions, possible values: 0 = Small list, 1 = Very small list, 2 = Full list
+; Note: Set this to 2 if your chosen resolution is not working or does not show up in the list
+; Note: Set this to 1 if the game is crashing on startup
+resolutions=0
+
+; Child window handling, possible values: 0 = Disabled, 1 = Display top left, 2 = Display top left + repaint, 3 = Hide
+; Note: Disables upscaling if a child window was detected (to ensure the game is fully playable, may look weird though)
+fixchilds=2
+
+; Enable one of the following settings if your cursor doesn't work properly when upscaling is enabled
+hook_peekmessage=false
+hook_getmessage=false
+
+
+; Undocumented settings - You may or may not change these (You should rather focus on the settings above)
+releasealt=false
+game_handles_close=true
+fixnotresponding=false
+hook=4
+guard_lines=200
+max_resolutions=32
+limit_bltfast=false
+lock_surfaces=true
+allow_wmactivate=false
+flipclear=false
+fixmousehook=false
+rgb555=false
+no_dinput_hook=false
+refresh_rate=0
+anti_aliased_fonts_min_size=13
+custom_width=0
+custom_height=0
+min_font_size=0
+direct3d_passthrough=false
+
+
+
+; ### Hotkeys ###
+; Use the following settings to configure your hotkeys, 0x00 = disabled
+; Virtual-Key Codes: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
+
+
+; Switch between windowed and fullscreen mode = [Alt] + ???
+keytogglefullscreen=0x0D
+
+; Maximize window = [Alt] + ???
+keytogglemaximize=0x22
+
+; Unlock cursor 1 = [Ctrl] + ???
+keyunlockcursor1=0x09
+
+; Unlock cursor 2 = [Right Alt] + ???
+keyunlockcursor2=0xA3
+
+; Screenshot
+keyscreenshot=0x2C
+
+
+
+; ### Config program settings ###
+; The following settings are for cnc-ddraw config.exe
+
+
+; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian
+configlang=auto
+
+; cnc-ddraw config program theme, possible values: Windows10, Cobalt XEMedia
+configtheme=Windows10
+
+; Hide the 'Compatibility Settings' tab in cnc-ddraw config
+hide_compat_tab=false
+
+; Allow the users to 'Restore default settings' via cnc-ddraw config
+allow_reset=true
+
+
+
+; ### Game specific settings ###
+; The following settings override all settings shown above, section name = executable name
+
+
+; Atrox
+[Atrox]
+fixchilds=0
+allow_wmactivate=true
+
+; Atomic Bomberman
+[BM]
+maxgameticks=60
+
+; Age of Empires
+[empires]
+nonexclusive=true
+adjmouse=true
+resolutions=2
+
+; Age of Empires: The Rise of Rome
+[empiresx]
+nonexclusive=true
+adjmouse=true
+resolutions=2
+
+; Age of Empires II
+[EMPIRES2]
+nonexclusive=true
+adjmouse=true
+
+; Age of Empires II: The Conquerors
+[age2_x1]
+nonexclusive=true
+adjmouse=true
+
+; American Conquest / Cossacks
+[DMCR]
+resolutions=2
+guard_lines=300
+minfps=-2
+
+; Age of Wonders 2
+[AoW2]
+resolutions=2
+renderer=opengl
+singlecpu=false
+
+; Age of Wonders 2
+[AoW2Compat]
+resolutions=2
+renderer=opengl
+singlecpu=false
+
+; Age of Wonders 2 Config Tool
+[aow2Setup]
+resolutions=2
+
+; Age of Wonders: Shadow Magic
+[AoWSM]
+resolutions=2
+renderer=opengl
+singlecpu=false
+
+; Age of Wonders: Shadow Magic
+[AoWSMCompat]
+resolutions=2
+renderer=opengl
+singlecpu=false
+
+; Age of Wonders: Shadow Magic Config Tool
+[AoWSMSetup]
+resolutions=2
+
+; Anstoss 3
+[anstoss3]
+renderer=gdi
+adjmouse=true
+
+; Anno 1602
+[1602]
+adjmouse=true
+
+; Alien Nations
+[AN]
+adjmouse=true
+
+; Atlantis
+[ATLANTIS]
+renderer=opengl
+maxgameticks=60
+
+; Airline Tycoon Deluxe
+[AT]
+fixchilds=0
+
+; Baldur's Gate II
+; Note: 'Use 3D Acceleration' must be disabled and 'Full Screen' must be enabled in BGConfig.exe
+[BGMain]
+resolutions=2
+
+; BALDR FORCE EXE
+[BaldrForce]
+noactivateapp=true
+
+; Blade & Sword
+[comeon]
+maxgameticks=60
+fixchilds=3
+
+; Blood II - The Chosen / Shogo - Mobile Armor Division
+[Client]
+checkfile=.\SOUND.REZ
+noactivateapp=true
+
+; Carmageddon
+[CARMA95]
+noactivateapp=true
+flipclear=true
+
+; Carmageddon
+[CARM95]
+noactivateapp=true
+flipclear=true
+
+; Carmageddon 2
+[Carma2_SW]
+noactivateapp=true
+
+; Captain Claw
+[claw]
+adjmouse=true
+noactivateapp=true
+nonexclusive=true
+
+; Command & Conquer: Sole Survivor
+[SOLE]
+maxgameticks=120
+maxfps=60
+minfps=-1
+
+; Command & Conquer Gold - CnCNet
+[cnc95]
+maxfps=125
+
+; Command & Conquer Gold
+[C&C95]
+maxgameticks=120
+maxfps=60
+minfps=-1
+
+; Command & Conquer: Red Alert - CnCNet
+[ra95-spawn]
+maxfps=125
+
+; Command & Conquer: Red Alert
+[ra95]
+maxgameticks=120
+maxfps=60
+minfps=-1
+
+; Command & Conquer: Red Alert
+[ra95_Mod-Launcher]
+maxgameticks=120
+maxfps=60
+minfps=-1
+
+; Command & Conquer: Red Alert
+[ra95p]
+maxfps=60
+minfps=-1
+
+; Command & Conquer: Tiberian Sun / Command & Conquer: Red Alert 2
+[game]
+checkfile=.\blowfish.dll
+tshack=true
+noactivateapp=true
+adjmouse=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Tiberian Sun Demo
+[SUN]
+noactivateapp=true
+tshack=true
+adjmouse=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Tiberian Sun - CnCNet
+[ts-spawn]
+noactivateapp=true
+tshack=true
+adjmouse=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2 - XWIS
+[ra2]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2 - XWIS
+[Red Alert 2]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2: Yuri's Revenge
+[gamemd]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2: Yuri's Revenge - ?ModExe?
+[ra2md]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2: Yuri's Revenge - CnCNet
+[gamemd-spawn]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Command & Conquer: Red Alert 2: Yuri's Revenge - XWIS
+[Yuri's Revenge]
+noactivateapp=true
+tshack=true
+maxfps=60
+minfps=-1
+maintas=false
+boxing=false
+
+; Commandos
+[comandos]
+maxgameticks=-1
+
+; Commandos
+[comandos_w10]
+maxgameticks=-1
+
+; Caesar III
+[c3]
+nonexclusive=true
+adjmouse=true
+
+; Chris Sawyer's Locomotion
+[LOCO]
+adjmouse=true
+
+; Cultures 2
+[Cultures2]
+adjmouse=true
+
+; Cultures 2 MP
+[Cultures2MP]
+adjmouse=true
+
+; Close Combat 2: A Bridge Too Far
+[cc2]
+adjmouse=true
+nonexclusive=true
+
+; Close Combat 3: The Russian Front
+[cc3]
+adjmouse=true
+nonexclusive=true
+
+; Close Combat 4: The Battle of the Bulge
+[cc4]
+adjmouse=true
+nonexclusive=true
+
+; Close Combat 5: Invasion: Normandy
+[cc5]
+adjmouse=true
+nonexclusive=true
+
+; Call To Power 2
+[ctp2]
+maintas=false
+boxing=false
+
+; Corsairs Gold
+[corsairs]
+adjmouse=true
+
+; Divine Divinity
+[div]
+resolutions=2
+singlecpu=false
+
+; Dragon Throne: Battle of Red Cliffs
+[AdSanguo]
+maxgameticks=60
+noactivateapp=true
+limit_bltfast=true
+
+; Dark Reign: The Future of War
+[DKReign]
+maxgameticks=60
+
+; Dungeon Keeper 2
+[DKII]
+maxgameticks=60
+noactivateapp=true
+
+; Deadlock 2
+[DEADLOCK]
+fixchilds=0
+adjmouse=false
+maintas=false
+boxing=false
+
+; Diablo
+[Diablo]
+devmode=true
+
+; Diablo: Hellfire
+[hellfire]
+devmode=true
+
+; Escape Velocity Nova
+[EV Nova]
+hook_peekmessage=true
+rgb555=true
+keytogglefullscreen=0x46
+adjmouse=true
+
+; Economic War
+[EcoW]
+maxgameticks=60
+fixnotresponding=true
+
+; Enemy Infestation
+[EI]
+hook_getmessage=true
+
+; Fairy Tale About Father Frost, Ivan and Nastya
+[mrazik]
+guard_lines=0
+
+; Future Cop - L.A.P.D.
+[FCopLAPD]
+nonexclusive=true
+adjmouse=true
+
+; G-Police
+[GPOLICE]
+maxgameticks=60
+
+; Gangsters: Organized Crime
+[gangsters]
+adjmouse=true
+nonexclusive=true
+
+; Grand Theft Auto
+[Grand Theft Auto]
+singlecpu=false
+
+; Grand Theft Auto: London 1969
+[gta_uk]
+singlecpu=false
+
+; Grand Theft Auto: London 1961
+[Gta_61]
+singlecpu=false
+
+; Gruntz
+[GRUNTZ]
+adjmouse=true
+noactivateapp=true
+nonexclusive=true
+; Heroes of Might and Magic II: The Succession Wars
+[HEROES2W]
+adjmouse=true
+
+; Heroes of Might and Magic III
+[Heroes3]
+game_handles_close=true
+
+; Heroes of Might and Magic III HD Mod
+[Heroes3 HD]
+game_handles_close=true
+
+; Hard Truck: Road to Victory
+[htruck]
+maxgameticks=25
+renderer=opengl
+noactivateapp=true
+
+; Icewind Dale 2
+; Note: 'Full Screen' must be enabled in Config.exe
+; Note: 1070x602 is the lowest possible 16:9 resolution for the Widescreen patch (600/601 height will crash)
+[iwd2]
+resolutions=2
+custom_width=1070
+custom_height=602
+
+; Invictus
+[Invictus]
+adjmouse=true
+renderer=opengl
+
+; Interstate 76
+[i76]
+adjmouse=true
+
+; Infantry Online
+[infantry]
+devmode=true
+resolutions=2
+infantryhack=true
+max_resolutions=90
+
+; Jagged Alliance 2
+[ja2]
+singlecpu=false
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Jagged Alliance 2: Unfinished Business
+[JA2UB]
+singlecpu=false
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Jagged Alliance 2: Wildfire
+[WF6]
+singlecpu=false
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Jagged Alliance 2 - UC mod
+[JA2_UC]
+singlecpu=false
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Jagged Alliance 2 - Vengeance Reloaded mod
+[JA2_Vengeance]
+singlecpu=false
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Jedi Knight Dark Forces 2
+[JK]
+direct3d_passthrough=true
+
+; Kings Quest 8
+[Mask]
+renderer=opengl
+
+; Konung
+[konung]
+fixchilds=0
+
+; Konung 2
+[Konung2]
+fixchilds=0
+
+; KKND Xtreme (With high resolution patch)
+[KKNDgame]
+vhack=true
+
+; KKND2: Krossfire
+[KKND2]
+noactivateapp=true
+
+; Lionheart
+[Lionheart]
+hook_peekmessage=true
+
+; Majesty Gold
+[Majesty]
+minfps=-2
+
+; Majesty Gold HD
+[MajestyHD]
+adjmouse=true
+
+; Majesty Gold HD
+[MajestyHD - Old]
+adjmouse=true
+
+; Mech Warrior 3
+[Mech3]
+nonexclusive=true
+
+; Moorhuhn 2
+[Moorhuhn2]
+releasealt=true
+
+; New Robinson
+[ROBY]
+adjmouse=true
+hook_peekmessage=true
+
+; Nox
+[NOX]
+checkfile=.\NOX.ICD
+renderer=direct3d9
+nonexclusive=false
+windowed=false
+maxgameticks=125
+
+; Nox Reloaded
+[NoxReloaded]
+maxgameticks=125
+
+; Nox GOG
+[Game/2]
+checkfile=.\nox.cfg
+maxgameticks=125
+
+; Outlaws
+[olwin]
+noactivateapp=true
+maxgameticks=60
+adjmouse=true
+renderer=gdi
+
+; Pharaoh
+[Pharaoh]
+adjmouse=true
+
+; Pax Imperia
+[Pax Imperia]
+nonexclusive=true
+
+; Railroad Tycoon II
+[RT2]
+adjmouse=true
+
+; ROAD RASH
+[RoadRash]
+adjmouse=true
+fixchilds=1
+
+; Sim Copter
+[SimCopter]
+nonexclusive=true
+
+; Settlers 3
+[s3]
+nonexclusive=true
+
+; Star Trek - Armada
+[Armada]
+armadahack=true
+nonexclusive=true
+adjmouse=true
+maintas=false
+boxing=false
+
+; Star Wars: Galactic Battlegrounds
+[battlegrounds]
+nonexclusive=true
+adjmouse=true
+
+; Star Wars: Galactic Battlegrounds: Clone Campaigns
+[battlegrounds_x1]
+nonexclusive=true
+adjmouse=true
+
+; Starcraft
+[StarCraft]
+game_handles_close=true
+
+; Space Rangers
+[Rangers]
+hook_peekmessage=true
+
+; Stronghold Crusader HD
+[Stronghold Crusader]
+resolutions=2
+stronghold_hack=true
+adjmouse=true
+
+; Stronghold Crusader Extreme HD
+[Stronghold_Crusader_Extreme]
+resolutions=2
+stronghold_hack=true
+adjmouse=true
+
+; Stronghold HD
+[Stronghold]
+resolutions=2
+stronghold_hack=true
+adjmouse=true
+
+; Sim City 3000
+[SC3]
+minfps=-2
+
+; Shadow Watch
+[sw]
+adjmouse=true
+
+; Shadow Flare
+[ShadowFlare]
+nonexclusive=true
+adjmouse=true
+maintas=false
+boxing=false
+
+; Total Annihilation (Unofficial Beta Patch v3.9.02)
+[TotalA]
+max_resolutions=32
+lock_surfaces=true
+singlecpu=false
+
+; Total Annihilation Replay Viewer (Unofficial Beta Patch v3.9.02)
+[Viewer]
+max_resolutions=32
+lock_surfaces=true
+singlecpu=false
+
+; Total Annihilation: Kingdoms
+[Kingdoms]
+game_handles_close=true
+max_resolutions=32
+
+; Three Kingdoms: Fate of the Dragon
+[sanguo]
+maxgameticks=60
+noactivateapp=true
+limit_bltfast=true
+
+; RollerCoaster Tycoon
+[rct]
+no_dinput_hook=true
+singlecpu=false
+maxfps=0
+adjmouse=true
+
+; Twisted Metal
+[TWISTED]
+nonexclusive=true
+maxgameticks=25
+minfps=5
+
+; Twisted Metal 2
+[Tm2]
+nonexclusive=true
+maxgameticks=60
+adjmouse=true
+fixchilds=1
+maintas=false
+boxing=false
+
+; Tzar: The Burden of the Crown
+; Note: Must set 'DIRECTXDEVICE=0' in 'Tzar.ini'
+[Tzar]
+adjmouse=true
+
+; Uprising
+[uprising]
+adjmouse=true
+
+; Uprising 2
+[Uprising 2]
+renderer=opengl
+adjmouse=true
+
+; Vermeer
+[vermeer]
+adjmouse=true
+vermeer_hack=true
+
+; Wizardry 8
+[Wiz8]
+fixmousehook=true
+noactivateapp=true
+releasealt=true
+
+; Worms Armageddon
+[WA]
+adjmouse=true
+width=0
+height=0
+resizable=false
+
+; War Wind
+[WW]
+minfps=-1
+
+; Zeus and Poseidon
+[Zeus]
+adjmouse=true
+
diff --git a/ddraw_custom.dll b/ddraw_custom.dll
new file mode 100644
index 0000000..39d5c10
--- /dev/null
+++ b/ddraw_custom.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f6309648e70fe6988a1d366f001dd6f7abcddd0cd3b9210bef5592f2f8de30ac
+size 316928
diff --git a/dplayx.dll b/dplayx.dll
new file mode 100644
index 0000000..20e2168
--- /dev/null
+++ b/dplayx.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:10cb34d05e48c043b1ade6683d6ba19cdf8f8d77c68f6acb39562f9b16492974
+size 34816
diff --git a/dsound.dll b/dsound.dll
new file mode 100644
index 0000000..60073ab
--- /dev/null
+++ b/dsound.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ed404272b44cba471661f0694fa186b784cc66743e19717748a2f385240f8652
+size 76288
diff --git a/mayhem.gp3 b/mayhem.gp3
index a044df5..4d7d0bc 100644
--- a/mayhem.gp3
+++ b/mayhem.gp3
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e67982225f0e237587858fce493652466b41bdb5af128ae5341d2a2000a0b3cc
-size 19523281
+oid sha256:923acec3fa810d8d29b131c4ba5f7ffc365e2b082859d4a1359dc88fcb1992e1
+size 21728857
diff --git a/mayhem.ini b/mayhem.ini
new file mode 100644
index 0000000..c86e176
--- /dev/null
+++ b/mayhem.ini
@@ -0,0 +1,273 @@
+[Settings]
+
+OptimizeDTEnabled=1
+
+FullRingsEnabled=1
+
+WhiteboardKey=220
+
+MegaMapKey=115
+
+BuildLinesRingsKey=88
+
+MegaMapEmptyRegionColor=92
+
+IncomePosX=1587
+
+IncomePosY=32
+
+IncomeBackgroundEnabled=1
+
+IncomeBackgroundColor=0
+
+IncomeTextBackgroundEnabled=0
+
+IncomeTextBackgroundColor=0
+
+; Total Mayhem advanced settings
+
+; Windowed mode will disable many Total Mayhem features (including some of these) and is not recommended
+
+[Preferences] ; custom settings, if any entry is disabled the "Total Mayhem default" values will be used
+
+; Display minimum resolution
+DisplayModeMinHeight768=TRUE;
+
+; This is a setting for the hotfix to fix performance on certain GPUs
+; If you weren't affected by the crash and downloaded the fix anyway and it broke your game...
+; ...you should set this to FALSE and everything should be fine
+;UseVideoMemory=TRUE; Disabled in mdraw.dll
+
+; Unit limit per player
+; Set from 20 - 6553 (setting higher than 1500 may cause instability)
+; TA v3.1 default is 250
+; Total Mayhem default is 1500
+
+UnitLimit = 1500;
+
+; Pathfinding cycles
+; Setting too low (such as TA v3.1 default) ruins pathfinding but setting extremely high lowers fps
+; TA v3.1 default is 1333
+; Total Mayhem default is 66650
+
+AISearchMapEntries = 66650;
+
+; Special effects limit (smoke, etc.)
+; Setting too low (such as TA v3.1 default) will degrade visual quality
+; This setting is still experimental, if you experience visual issues set to 400
+; TA v3.1 default is 400
+; Total Mayhem default is 20480
+
+SfxLimit = 20480;
+
+; Unit model size limit
+; Set max width and height for unit model drawing buffer
+; TA v3.1 default is 600x600
+; Total Mayhem default is 1280x1280
+
+X_CompositeBuf = 1280;
+Y_CompositeBuf = 1280;
+
+; Unit ID limit
+; Set the maximum number of unique unit IDs
+; TA v3.1 default is 512
+; Total Mayhem default is 16000
+
+UnitType = 16000;
+
+; Weapon ID limit
+; Set the maximum number of unique weapon IDs
+; TA v3.1 default is 256
+; Total Mayhem default is 16000
+
+WeaponType = 16000;
+
+; Weapon ID multiplayer patch
+; Set to TRUE to enable increased Weapon ID limit in multiplayer
+; Set to FALSE to allow increased Weapon ID limit only in single player
+; TA v3.1 default is FALSE
+; Total Mayhem default is FALSE (Weapon ID limit increase not yet compatible with Replayer)
+
+MultiGameWeapon = FALSE;
+
+; Double-click selection
+; Enable or disable the new "double-click to select all units of the same type on screen" feature
+; TA v3.1 default is FALSE
+; Total Mayhem default is TRUE
+
+DoubleClick = TRUE;
+
+; Expanded Multiplayer Sharing Menu
+; Enable or disable the new expanded multiplayer sharing menu
+; TA v3.1 default is FALSE
+; Total Mayhem default is TRUE
+
+ShareDialogExpand = TRUE;
+
+; Main menu resolution adjuster
+; Set to FALSE to keep main menu resolution at the default 640x480
+; Set to TRUE to match main menu resolution to the in-game resolution set via options menu
+; If TRUE, the main menu will not be upscaled to fit increased output resolution
+; If resolution is not valid, the game will not start (use resolution overrider below to fix)
+; TA v3.1 default is FALSE
+; Total Mayhem default is FALSE
+
+MenuResolution = FALSE;
+
+; Megamap
+; Enable or disable the new megamap
+; TA v3.1 default is FALSE
+; Total Mayhem default is TRUE
+
+FullScreenMinimap = TRUE;
+
+; Megamap FPS Limit
+
+MegamapFpsLimit = 1000;
+
+; Megamap Icon Configuration File
+; Set the location of the megamap's icon configuration file
+; Total Mayhem default is .\Icon\iconcfg.ini
+
+MegaMapConfig = .\Icon\iconcfg.ini;
+
+; Megamap Configuration Settings
+; Use the fields below to customize the megamap
+
+; Megamap Mouse Wheel Zooming
+; Enable or disable ability to zoom in and out of the megamap with the mouse wheel
+; Total Mayhem default is TRUE;
+
+WheelZoom = TRUE;
+
+; Megamap Mouse Wheel Zoom In Mode
+; Set to TRUE to zoom to the cursor location when rolling the wheel up from the megamap
+; Set to FALSE to zoom to the previous camera location when rolling the wheel up from the megamap
+; Total Mayhem default is TRUE;
+
+WheelMoveMegaMap = TRUE;
+
+; Megamap Double-Click to Zoom Option
+; Enable or disable the option to zoom to the cursor location...
+; ...when double-clicking terrain on the megamap
+; Total Mayhem default is FALSE;
+
+DoubleClickMoveMegamap = FALSE;
+
+; Megamap Unit Icon Flashing When Under Attack
+; Enable or disable megamap unit icon flashing when under attack
+
+UnderAttackFlash=TRUE;
+
+; Megamap Minimum Sensor Range Ring Distances
+; Set the minimum sensor values required to display range rings on the megamap
+; These settings could be helpful if you want to eliminate clutter from short-ranged rings
+; Total Mayhem default is 0 for all sensors
+
+MegamapRadarMinimum = 128;
+MegamapSonarMinimum = 128;
+MegamapSonarJamMinimum = 64;
+MegamapRadarJamMinimum = 64;
+MegamapAntiNukeMinimum = 512;
+
+; Player Icon and Line Marker Colors
+; Customize the colors of the player minimap/megamap icons and line markers
+; Set from 0 to 255 to select colors from the TA indexed color palette
+; These settings are disabled by default (remove the semicolons to enable)
+
+Player1DotColors=227; ;Blue
+Player2DotColors=202; ;Red
+Player3DotColors=251; ;Yellow
+Player4DotColors=233; ;Green
+Player5DotColors=36; ;Teal
+Player6DotColors=253; ;Purple/Magenta
+Player7DotColors=81; ;White
+Player8DotColors=94; ;Black
+Player9DotColors=210; ;Orange
+Player10DotColors=67; ;Tan
+
+; Player Dot Marker Colors
+; Customize the colors of player dot markers by setting a custom icon file
+; Edit the example smallcircle.pcx file or create a new icon file
+; The icon file must contain all 10 player markers from left to right
+; The icon width and height settings must match the dimensions of your icons
+; These settings are disabled by default (remove the semicolons to enable)
+
+; Player Dot Marker Colors
+; Customize the colors of player dot markers by setting a custom icon file
+; Edit the example smallcircle.pcx file or create a new icon file
+; The icon file must contain all 10 player markers from left to right
+; The icon width and height settings must match the dimensions of your icons
+; These settings are disabled by default (remove the semicolons to enable)
+PerPlayerMarkerWidth=10;
+PerPlayerMarkerHeight=10;
+PlayerMarkerPcx=Icon\smallcircle.pcx;
+
+[REG] ; registry override settings, if any entry is disabled the last value used will be remembered
+
+; Sound mode
+; Set to 0 for no sound, 1 for mono sound, and 2 for 3D positional sound
+; When set to 3D, the speaker layout is read from the Windows control panel
+; All speaker layouts are supported by the 3D sound engine (stereo, 5.1, 7.1, etc.)
+; TA v3.1 default is Mono (dword:1)
+; Total Mayhem default is 3D (dword:2)
+
+"Sound Mode" = dword:2
+
+; Max number of simultaneous sounds before sounds are cut off
+; Set from 2 - 32 for specific limits or 33 or higher for unlimited
+; TA v3.1 default is 8 (dword:8)
+; Total Mayhem default is 128 / unlimited (dword:128)
+
+"MixingBuffers" = dword:128
+
+; Default game speed
+; Set from 0 - 20 (corresponding to game speed -10 to +10)
+; Use plus and minus keys to adjust while playing
+; TA and Total Mayhem default is 10 which is equivalent to Normal game speed (dword:10)
+
+"GameSpeed" = dword:10
+
+; Group selection hotkey modifier
+; Set to 1 to select unit groups with number key and build menus with ALT + number key
+; Set to 0 to select build menus with number key and unit groups with ALT + number key
+; TA v3.1 default is 0 (dword:0)
+; Total Mayhem default is 1 (dword:1)
+
+"SwitchAlt" = dword:1
+
+; Max number of players in skirmish mode
+; Set from 2 - 10
+; TA v3.1 default is 4 (dword:4)
+; Total Mayhem default is 10 (dword:10)
+
+"NumSkirmishPlayers" = dword:10
+
+; Default setting for display of chat messages from other players
+; Set to 1 to enable and 0 to disable
+; Use "+screenchat" command in-game to toggle setting for the current game
+; TA and Total Mayhem default is 1
+
+"ScreenChat" = dword:1
+
+; Music playback mode
+; Set to 1 for Play All, 2 for Random, 3 for Repeat, and 4 for Custom.
+; When set to Custom, the game will attempt to use the dynamic build/battle system...
+; ...however this mode is buggy and almost never works correctly on modern systems...
+; ...resulting in only a single track being played, either stopping thereafter (CD version)...
+; ...or looping forever (MP3 version), therefore Random is best for most people
+; TA v3.1 default is Custom (dword:4)
+; Total Mayhem default is Random (dword:2)
+
+"CDMode" = dword:2
+
+; Resolution overrider (disabled by default)
+; Use this to override the resolution set in the options menu (remove semicolons to enable)
+; All resolutions and aspect ratios supported by your setup are supported by the game...
+; ...as long as they are available in 8-bit color depth (if not, create a custom resolution)
+; If you set a resolution not supported by your setup (driver or display) the game will crash
+; The override is set at game launch, using options menu will defeat override until next launch
+; Example: dword:1920 x dword:1080 (1920x1080)
+
+;"DisplayModeWidth" = dword:1920
+;"DisplayModeHeight" = dword:1080
diff --git a/mplayx.dll b/mplayx.dll
deleted file mode 100644
index dd8e8ed..0000000
--- a/mplayx.dll
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d8cf7b470d341bbcb205e3a9a7fd4c5b3366a61348a467fe6b94ab20ced10470
-size 298496
diff --git a/tdraw.dll b/tdraw.dll
new file mode 100644
index 0000000..d17e302
--- /dev/null
+++ b/tdraw.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8ea362e1bf3e47f00b43e929cd2689746b89338dbb9a7cf0f4b8b6ea2e73a9d
+size 628224
diff --git a/tmusi.dll b/tmusi.dll
new file mode 100644
index 0000000..e333318
--- /dev/null
+++ b/tmusi.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b6bce8deda7bc4d25d8709b54e012b24266ab37a378d2b124bedae758d30fa4
+size 44544
diff --git a/tplayx.dll b/tplayx.dll
new file mode 100644
index 0000000..ab8870c
--- /dev/null
+++ b/tplayx.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:688d42b4901c1e825db5b1688353db6ecc286ae75c0fe6885a4c42aea054c6b6
+size 298496
diff --git a/wgmus.dll b/wgmus.dll
new file mode 100644
index 0000000..b6e8b5e
--- /dev/null
+++ b/wgmus.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c6c2caf72f1e2a172cff128558b3c309671ea1ea07378229092c882f010bd2f8
+size 62976
diff --git a/wgmus.ini b/wgmus.ini
new file mode 100644
index 0000000..c178c9d
--- /dev/null
+++ b/wgmus.ini
@@ -0,0 +1,13 @@
+[Settings]
+;Accepted file formats
+;0 wav
+;1 mp3
+;2 ogg
+;3 flac
+;4 aiff
+FileFormat=1
+;Accepted music playback modes
+;0 CD
+;1 Folder
+PlaybackMode=1
+MusicFolder=tamus
\ No newline at end of file
diff --git a/win32.dll b/win32.dll
new file mode 100644
index 0000000..e333318
--- /dev/null
+++ b/win32.dll
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2b6bce8deda7bc4d25d8709b54e012b24266ab37a378d2b124bedae758d30fa4
+size 44544