diff --git a/Core/HdNesPack.h b/Core/HdNesPack.h index fcd2e02f..0ffc285b 100644 --- a/Core/HdNesPack.h +++ b/Core/HdNesPack.h @@ -38,7 +38,7 @@ private: __forceinline void ProcessGrayscaleAndEmphasis(HdPpuPixelInfo &pixelInfo, uint32_t* outputBuffer, uint32_t hdScreenWidth); public: - static constexpr uint32_t CurrentVersion = 103; + static constexpr uint32_t CurrentVersion = 104; HdNesPack(shared_ptr hdData, EmulationSettings* settings); ~HdNesPack(); diff --git a/Core/HdPackConditions.h b/Core/HdPackConditions.h index 8d66ae38..5ad3ae04 100644 --- a/Core/HdPackConditions.h +++ b/Core/HdPackConditions.h @@ -34,7 +34,7 @@ struct HdPackBaseTileCondition : public HdPackCondition out << TileX << ","; out << TileY << ","; if(TileIndex >= 0) { - out << TileIndex << ","; + out << HexUtilities::ToHex(TileIndex) << ","; } else { for(int i = 0; i < 16; i++) { out << HexUtilities::ToHex(TileData[i]); diff --git a/Core/HdPackLoader.cpp b/Core/HdPackLoader.cpp index d58edb33..fbda588d 100644 --- a/Core/HdPackLoader.cpp +++ b/Core/HdPackLoader.cpp @@ -433,7 +433,12 @@ void HdPackLoader::ProcessConditionTag(vector &tokens, bool createInvert if(token.size() == 32) { tileData = token; } else { - tileIndex = std::stoi(token); + if(_data->Version < 104) { + tileIndex = std::stoi(token); + } else { + //Tile indexes are stored as hex starting from version 104+ + tileIndex = HexUtilities::FromHex(token); + } } uint32_t palette = HexUtilities::FromHex(tokens[index++]); diff --git a/Docs/content/hdpacks/_index.md b/Docs/content/hdpacks/_index.md index 2ac9e6b3..e824698a 100644 --- a/Docs/content/hdpacks/_index.md +++ b/Docs/content/hdpacks/_index.md @@ -55,14 +55,14 @@ Before you start recording, select the options you want to use and the location ## File Format (hires.txt) ## -The following are the specifications for the hires.txt file, as of version "103". +The following are the specifications for the hires.txt file, as of version "104". ### <ver> tag ### **Syntax**: `[integer]` -**Example**: `103` +**Example**: `104` -The format's version number (currently 103). +The format's version number (currently 104). ### <scale> tag ### @@ -123,7 +123,7 @@ The tileNearby and spriteNearby conditions are used to check whether a specific `myCondition2,tileNearby,-8,0,[tile data],[palette data]` In this case, `myCondition2` will be true if the tile 8 pixels to the left of the current tile matches the tile+palette data specified. -For CHR ROM games, `tile data` is an integer representing the position of the original tile in CHR ROM. +For CHR ROM games, `tile data` is an integer (in hexadecimal) representing the position of the original tile in CHR ROM. For CHR RAM games, `tile data` is a 32-character hexadecimal string representing all 16 bytes of the tile. `palette data` is always an 8-character hexadecimal string representing all 4 bytes of the palette used for the tile. For sprites, the first byte is always "FF". @@ -140,7 +140,7 @@ The tileAtPosition and spriteAtPosition conditions are used to check whether a s `myCondition,tileAtPosition,10,10,[tile data],[palette data]` In this case, `myCondition` will be true if the tile at position 10,10 on the NES' screen (256x240 resolution) matches the tile+palette data given. -For CHR ROM games, `tile data` is an integer representing the position of the original tile in CHR ROM. +For CHR ROM games, `tile data` is an integer (in hexadecimal) representing the position of the original tile in CHR ROM. For CHR RAM games, `tile data` is a 32-character hexadecimal string representing all 16 bytes of the tile. `palette data` is always an 8-character hexadecimal string representing all 4 bytes of the palette used for the tile. For sprites, the first byte is always "FF". @@ -304,6 +304,10 @@ These registers return the ASCII string `NEA` (NES Enhanced Audio) - this can be ## File Format Changelog ## +### Version 104 ### + +* Tile indexes for the `` tag (tileNearby/spriteNearby/tileAtPosition/spriteAtPosition) are now in hex instead of decimal (affects CHR ROM games only) + ### Version 103 ### * Added a `Mask` parameter to the memoryCheck and memoryCheckConstant conditions