Move NDSCart-related global state into objects (#1871)

* Move NDSCart-related global state into objects

- RAII will now do the heavy lifting
- Mark some methods as const or noexcept

* Move GBACart-related global state into objects (#1870)

- RAII will now do the heavy lifting
- Mark some methods as const or noexcept
- Once the `NDS` object is finalized, most of these `assert`s can go away

* Make AREngine::RunCheat public (#1872)

- I use it directly in melonDS DS to apply single cheats without using ARCodeFile
- Before the AREngine refactor I could just redeclare the function in my code
- Now I can't
This commit is contained in:
Jesse Talavera-Greenberg
2023-11-09 12:57:16 -05:00
committed by GitHub
parent 3d3e4240a0
commit 88072a02c5
7 changed files with 324 additions and 322 deletions

View File

@ -43,8 +43,8 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
const NDSBanner* banner = NDSCart::Cart->Banner();
const NDSHeader& header = NDSCart::Cart->GetHeader();
const NDSBanner* banner = NDS::NDSCartSlot->GetCart()->Banner();
const NDSHeader& header = NDS::NDSCartSlot->GetCart()->GetHeader();
u32 iconData[32 * 32];
ROMManager::ROMIcon(banner->Icon, banner->Palette, iconData);
iconImage = QImage(reinterpret_cast<unsigned char*>(iconData), 32, 32, QImage::Format_ARGB32).copy();