This commit is contained in:
thrust26 2024-08-11 19:48:23 +02:00
commit a5757a1562
7 changed files with 18 additions and 15 deletions

View File

@ -173,7 +173,7 @@ namespace {
{
if (!props) return SystemType::ntsc;
string displayFormat = props->get(PropType::Display_Format);
const string displayFormat = props->get(PropType::Display_Format);
if(displayFormat == "PAL" || displayFormat == "SECAM") return SystemType::pal;
if(displayFormat == "PAL60") return SystemType::pal60;

View File

@ -64,7 +64,7 @@ class ElfFile {
ElfFile() = default;
virtual ~ElfFile() = default;
virtual const uInt8 *getData() const = 0;
virtual const uInt8* getData() const = 0;
virtual size_t getSize() const = 0;
virtual const vector<Section>& getSections() const = 0;

View File

@ -166,7 +166,7 @@ ElfLinker::RelocatedSymbol ElfLinker::findRelocatedSymbol(string_view name) cons
if (!myRelocatedSymbols[i])
ElfSymbolResolutionError::raise("symbol could not be relocated");
return myRelocatedSymbols[i].value();
return myRelocatedSymbols[i].value(); // NOLINT: we know the value is valid
}
ElfSymbolResolutionError::raise("symbol not found");
@ -423,7 +423,7 @@ void ElfLinker::copyInitArrays(vector<uInt32>& initArray, const std::unordered_m
void ElfLinker::applyRelocationToSection(const ElfFile::Relocation& relocation, size_t iSection)
{
const auto& targetSection = myElf.getSections()[iSection];
const auto& targetSectionRelocated = myRelocatedSections[iSection].value();
const auto& targetSectionRelocated = myRelocatedSections[iSection].value(); // NOLINT
const auto& symbol = myElf.getSymbols()[relocation.symbol];
const auto& relocatedSymbol = myRelocatedSymbols[relocation.symbol];

View File

@ -109,7 +109,7 @@ void ElfParser::parse(const uInt8 *elfData, size_t size)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const uInt8 *ElfParser::getData() const { return myData; }
const uInt8* ElfParser::getData() const { return myData; }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
size_t ElfParser::getSize() const { return mySize; }
@ -144,14 +144,16 @@ uInt8 ElfParser::read8(uInt32 offset) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 ElfParser::read16(uInt32 offset) const
{
return myBigEndian ? ((read8(offset) << 8) | read8(offset + 1))
return myBigEndian
? ((read8(offset) << 8) | read8(offset + 1))
: ((read8(offset + 1) << 8) | read8(offset));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 ElfParser::read32(uInt32 offset) const
{
return myBigEndian ? ((read8(offset) << 24) | (read8(offset + 1) << 16) |
return myBigEndian
? ((read8(offset) << 24) | (read8(offset + 1) << 16) |
(read8(offset + 2) << 8) | read8(offset + 3))
: ((read8(offset + 3) << 24) | (read8(offset + 2) << 16) |
(read8(offset + 1) << 8) | read8(offset));

View File

@ -48,7 +48,7 @@ class ElfParser : public ElfFile {
void parse(const uInt8 *elfData, size_t size);
const uInt8 *getData() const override;
const uInt8* getData() const override;
size_t getSize() const override;
const vector<Section>& getSections() const override;

View File

@ -176,6 +176,7 @@ void VcsLib::vcsLda2(uInt8 value)
.injectROM(value);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CortexM0::err_t VcsLib::stackOperation(uInt16& value, uInt8& op, uInt8 opcode)
{
myTransactionQueue