fix warnings in CPU and Bus modules

This commit is contained in:
Robert 2023-01-28 02:14:59 +01:00
parent d9b23f0b75
commit 22434d868d
3 changed files with 5 additions and 7 deletions

View file

@ -56,7 +56,7 @@ uint8_t Bus::Tick()
else
{
DMATick();
result = DMACyclesLeft;
result = (uint8_t)DMACyclesLeft;
}
@ -83,7 +83,7 @@ void Bus::DMATick()
if (DMALatch != 0)
{
Byte data = ReadCPU(((Word)DMAPage << 8) | (0x100 - DMACyclesLeft));
ppu.WriteRegister(0x2004, data);
ppu.WriteRegister(0x04, data);
DMACyclesLeft--;
}
@ -196,8 +196,6 @@ void Bus::WriteCPU(Word addr, Byte val)
{
if (0x0000 <= addr && addr < 0x2000)
{
if (addr == 0x0348)
volatile int jdfkdf = 3;
RAM[addr & 0x7FF] = val;
}
else if (0x2000 <= addr && addr < 0x4000)

View file

@ -52,7 +52,7 @@ uint8_t CPU::Tick()
currentInstruction = &(InstructionTable[opcode]);
// Add this instruction to the past instruction list
pastInstructions.push_back(std::make_pair(pc.Raw - 1, currentInstruction));
pastInstructions.push_back(std::make_pair((Word)(pc.Raw - 1), currentInstruction));
if (pastInstructions.size() > 50)
pastInstructions.pop_front();
@ -1081,7 +1081,7 @@ void CPU::SBX()
CHECK_ZERO(result);
status.Flag.Carry = ((acc & idx) >= fetchedVal);
idx = result;
idx = (Byte)(result & 0xFF);
}
void CPU::SBC()

View file

@ -45,7 +45,7 @@ union StatusFlag
Byte Negative : 1;
} Flag;
Word Raw;
Byte Raw;
};
/**