Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Silence warnings #99

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Core/Bmc235.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class Bmc235 : public BaseMapper

void WriteRegister(uint16_t addr, uint8_t value) override
{
uint8_t bank = (addr >> 3) & 0x60 | (addr & 0x1F);
uint8_t bank = ((addr >> 3) & 0x60) | (addr & 0x1F);

if(_unrom) {
SetMirroringType(MirroringType::Vertical);
SelectPRGPage(0, GetPRGPageCount() & 0xC0 | value & 0x07);
SelectPRGPage(1, GetPRGPageCount() & 0xC0 | 0x07);
SelectPRGPage(0, (GetPRGPageCount() & 0xC0) | (value & 0x07));
SelectPRGPage(1, (GetPRGPageCount() & 0xC0) | 0x07);
return;
}

Expand Down
2 changes: 0 additions & 2 deletions Core/Bmc891227.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class Bmc891227 : public BaseMapper
}

void UpdateState() {
uint8_t prgPage = _reg & 0x1F;

SetCpuMemoryMapping(0x6000, 0x7FFF, PrgMemoryType::PrgRom, 0x2000, MemoryAccessType::Read);

switch((_reg & 0x60) >> 5) {
Expand Down
2 changes: 0 additions & 2 deletions Core/BmcCtc12in1.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class BmcCtc12in1 : public BaseMapper
}

void UpdateState() {
uint8_t prgPage = _reg & 0x1F;

SetCpuMemoryMapping(0x6000, 0x7FFF, PrgMemoryType::PrgRom, 0x2000, MemoryAccessType::Read);
SetPpuMemoryMapping(0, 0x1FFF, 0, ChrMemoryType::Default, (_reg & 0x80) ? MemoryAccessType::ReadWrite : MemoryAccessType::Read);

Expand Down
2 changes: 1 addition & 1 deletion Core/MMC3_353.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MMC3_353 : public MMC3
MMC3::InitMapper();
}

void Reset(bool softreset)
void Reset(bool softreset) override
{
_exReg = 0;
MMC3::UpdateState();
Expand Down
2 changes: 1 addition & 1 deletion Core/MMC3_370.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MMC3_370 : public MMC3
RemoveRegisterRange(0x8000, 0xFFFF, MemoryOperation::Read);
}

void Reset(bool softreset)
void Reset(bool softreset) override
{
_exReg = 0;
MMC3::UpdateState();
Expand Down
2 changes: 1 addition & 1 deletion Core/MMC3_383.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MMC3_383 : public MMC3
uint8_t ReadRegister(uint16_t addr) override
{
if(_A17A18 == 0x00) {
_A16 = MMC3::_registers[6 | (addr >> 13) & 0x01] & 0x08;
_A16 = MMC3::_registers[6 | ((addr >> 13) & 0x01)] & 0x08;
MMC3::UpdatePrgMapping();
}
return InternalReadRam(addr);
Expand Down
2 changes: 1 addition & 1 deletion Core/MMC3_391.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MMC3_391 : public MMC3
{
uint8_t mask = (_reg[0] & 0x40) ? 0x7F : 0xFF;
page &= mask;
page |= ((_reg[1] << 8) & 0x100 | ((_reg[0] << 3) & 0x80)) & ~mask;
page |= (((_reg[1] << 8) & 0x100) | ((_reg[0] << 3) & 0x80)) & ~mask;
MMC3::SelectCHRPage(slot, page, memoryType);
}

Expand Down
2 changes: 1 addition & 1 deletion Core/MMC3_401.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MMC3_401 : public MMC3_45
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
{
page &= 0x1F ^ (_reg[3] & 0x1F); // mask
page |= (_reg[2] & 0x80) | _reg[1] & 0x1F; // outerbank
page |= (_reg[2] & 0x80) | (_reg[1] & 0x1F); // outerbank
page |= (GetDipSwitches() & 0x02) ? (_reg[2] & 0x20): ((_reg[1] >> 1) & 0x20); // A18
page |= (GetDipSwitches() & 0x04) ? (_reg[2] & 0x40): ((_reg[1] << 1) & 0x40); // A19

Expand Down
4 changes: 2 additions & 2 deletions Core/Mapper319.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class Mapper319 : public BaseMapper
if(_regs[1] & 0x40) {
SelectPrgPage2x(0, (_regs[1] >> 2) & 0xE);
} else {
uint8_t bank = (_regs[1] >> 2) & 0x06 | (_regs[1] >> 5) & 0x01;
uint8_t bank = ((_regs[1] >> 2) & 0x06) | ((_regs[1] >> 5) & 0x01);
SelectPRGPage(0, bank);
SelectPRGPage(1, bank);
}
SelectCHRPage(0, (_regs[0] >> 4) & ~((_regs[0] << 2) & 0x04) | (_regs[2] << 2) & ((_regs[0] << 2) & 0x04));
SelectCHRPage(0, ((_regs[0] >> 4) & ~((_regs[0] << 2) & 0x04)) | ((_regs[2] << 2) & ((_regs[0] << 2) & 0x04)));
SetMirroringType(_regs[1] & 0x80 ? MirroringType::Vertical : MirroringType::Horizontal);
}

Expand Down
1 change: 0 additions & 1 deletion Core/Mapper449.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Mapper449 : public BaseMapper
{
uint16_t prgBank = ((addr >> 2) & 0x1F) | ((addr >> 3) & 0x20);
bool sFlag = (addr & 0x01) == 0x01;
bool lFlag = ((addr >> 9) & 0x01) == 0x01;
bool prgMode = ((addr >> 7) & 0x01) == 0x01;

_mFlag = ((addr >> 9) & 0x01) == 0x01;
Expand Down
2 changes: 1 addition & 1 deletion Core/Mapper91.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Mapper91 : public MMC3
UpdateState();
}

void UpdateState()
void UpdateState() override
{
SelectPRGPage(0, ((_outerBank << 3) & 0x30) | (_prgBanks[0] & 0x0F));
SelectPRGPage(1, ((_outerBank << 3) & 0x30) | (_prgBanks[1] & 0x0F));
Expand Down