Changeset - r26837:d83fc54ca1c1
[Not reviewed]
master
0 1 0
Michael Lutz - 17 months ago 2023-01-22 17:34:35
michi@icosahedron.de
Change: [NewGRF] Extend the D8xx (DCxx) string area up to FFFF.

This adds the Exxx and Fxxx blocks to the usable range for NewGRF
local strings. TTDPatch uses these ranges for internal strings, but as
we don't support any of them anyway, it is "free" real estate for us.
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -556,10 +556,10 @@ static StringID TTDPStringIDToOTTDString
 
 */
 
StringID MapGRFStringID(uint32 grfid, StringID str)
 
{
 
	if (IsInsideMM(str, 0xD800, 0xE000)) {
 
	if (IsInsideMM(str, 0xD800, 0x10000)) {
 
		/* General text provided by NewGRF.
 
		 * In the specs this is called the 0xDCxx range (misc persistent texts),
 
		 * but we meanwhile extended the range to 0xD800-0xDFFF.
 
		 * but we meanwhile extended the range to 0xD800-0xFFFF.
 
		 * Note: We are not involved in the "persistent" business, since we do not store
 
		 * any NewGRF strings in savegames. */
 
		return GetGRFStringID(grfid, str);
 
@@ -6079,7 +6079,7 @@ static void FeatureNewName(ByteReader *b
 
				break;
 

	
 
			default:
 
				if (IsInsideMM(id, 0xD000, 0xD400) || IsInsideMM(id, 0xD800, 0xE000)) {
 
				if (IsInsideMM(id, 0xD000, 0xD400) || IsInsideMM(id, 0xD800, 0x10000)) {
 
					AddGRFString(_cur.grffile->grfid, id, lang, new_scheme, true, name, STR_UNDEFINED);
 
					break;
 
				}
 
@@ -8465,7 +8465,8 @@ static void InitializeGRFSpecial()
 
	                   |                                                       (1U << 0x1F); // any switch is on
 

	
 
	_ttdpatch_flags[4] =                                                       (1U << 0x00)  // larger persistent storage
 
	                   |             ((_settings_game.economy.inflation ? 1U : 0U) << 0x01); // inflation is on
 
	                   |             ((_settings_game.economy.inflation ? 1U : 0U) << 0x01)  // inflation is on
 
	                   |                                                       (1U << 0x02); // extended string range
 
}
 

	
 
/** Reset and clear all NewGRF stations */
0 comments (0 inline, 0 general)