Skip to content

Commit

Permalink
fix: Only resize VBIOS data if it's not overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Oct 22, 2024
1 parent fdd14bd commit 83f377c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions NootedRed/NRed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,20 @@ void NRed::hwLateInit() {
DBGLOG("NRed", "Got VBIOS from PCI Expansion ROM.");
}
}

auto len = this->vbiosData->getLength();
if (len < ATOMBIOS_IMAGE_SIZE) {
DBGLOG("NRed", "Padding VBIOS to %u bytes (was %u).", ATOMBIOS_IMAGE_SIZE, len);
this->vbiosData->appendByte(0, ATOMBIOS_IMAGE_SIZE - len);
}

this->iGPU->setProperty("ATY,bin_image", this->vbiosData);
} else {
atombiosImageProp->retain();
this->vbiosData = atombiosImageProp;
SYSLOG("NRed", "!!! VBIOS MANUALLY OVERRIDDEN, MAKE SURE YOU KNOW WHAT YOU'RE DOING !!!");
}

auto len = this->vbiosData->getLength();
if (len < ATOMBIOS_IMAGE_SIZE) {
DBGLOG("NRed", "Padding VBIOS to %u bytes (was %u).", ATOMBIOS_IMAGE_SIZE, len);
this->vbiosData->appendByte(0, ATOMBIOS_IMAGE_SIZE - len);
}

this->rmmio =
this->iGPU->mapDeviceMemoryWithRegister(kIOPCIConfigBaseAddress5, kIOMapInhibitCache | kIOMapAnywhere);
PANIC_COND(this->rmmio == nullptr || this->rmmio->getLength() == 0, "NRed", "Failed to map RMMIO");
Expand Down

0 comments on commit 83f377c

Please sign in to comment.