File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,45 @@ void BinaryFix::setUIRatio()
8686 OutputDebugString (" skScreen: UI screen ratio was set" );
8787}
8888
89+
90+ void BinaryFix::setTextTiltRatio ()
91+ {
92+ uint32_t address = 0 ;
93+
94+ // TODO remowrk to use getAPI and getRelease? But we do memory patching, so hash is the best option here for now
95+ std::string hash = gameVersion.getGameHash ();
96+
97+ // search for 1.332999945
98+ if (hash == " E4BAF3E5CACD51AFCE61007F72781167" ) {
99+ // International DirectX
100+ address = 0x46e6ec ;
101+ }
102+ else if (hash == " C5801F89E46C53A67AC8D7C18A94ACD8" ) {
103+ // International Glide
104+ address = 0x46d7ac ;
105+ }
106+ else if (hash == " CE9A034310D45EED6D6E2C1B6014376E" ) {
107+ // Polish DirectX
108+ address = 0x46f68c ;
109+ }
110+ else if (hash == " 7D7EB6DFB099CF06FEF28F436CAE6E52" ) {
111+ // Polish Glide
112+ address = 0x46d754 ;
113+ }
114+
115+ std::stringstream ss;
116+ ss << " got hash: " << hash << " with res " << gameConfig.getWidth () << " x" << gameConfig.getHeight ();
117+ OutputDebugString (ss.str ().c_str ());
118+
119+ if (!address) {
120+ throw std::runtime_error (" skScreen: unknown game version" );
121+ }
122+ // 0.0000520833345945 is a magic value, the game by default sets 640x480 resolution
123+ float ratio = 0 .0000520833345945f * (480 .0f / static_cast <float >(gameConfig.getHeight ()));
124+ replaceMemory (address, ratio);
125+ OutputDebugString (" skScreen: 3D screen ratio was set" );
126+ }
127+
89128void BinaryFix::removeResolutionLimit ()
90129{
91130 uint32_t addressX = 0 ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ class BinaryFix {
1414
1515 void set3DRatio ();
1616 void setUIRatio ();
17+ void setTextTiltRatio ();
1718
1819 void removeResolutionLimit ();
1920 void fixRadeon ();
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ BOOL Initialize()
1919
2020 binaryFix.set3DRatio ();
2121 binaryFix.setUIRatio ();
22+ binaryFix.setTextTiltRatio ();
2223
2324 binaryFix.removeResolutionLimit ();
2425
You can’t perform that action at this time.
0 commit comments