Correct some more compilation warnings (across the whole EightBit project).

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-11-25 19:02:11 +00:00
parent 21a16a3c97
commit e156b1ff1a
10 changed files with 57 additions and 40 deletions

View File

@ -202,9 +202,9 @@ void EightBit::Disassembler::disassemble(std::ostringstream& output, Intel8080&
}
void EightBit::Disassembler::disassemble(
std::ostringstream& output,
const Intel8080& cpu,
uint16_t pc,
std::ostringstream&,
const Intel8080&,
uint16_t,
std::string& specification,
int& dumpCount,
int x, int y, int z,

View File

@ -30,14 +30,10 @@ namespace EightBit {
return cycles() * 4;
}
virtual register16_t& AF() final {
af.low = higherNibble(af.low);
return af;
}
virtual register16_t& BC() final { return bc; }
virtual register16_t& DE() final { return de; }
virtual register16_t& HL() final { return hl; }
virtual register16_t& AF() final;
virtual register16_t& BC() final;
virtual register16_t& DE() final;
virtual register16_t& HL() final;
protected:
virtual int execute(uint8_t opcode) final;

View File

@ -207,13 +207,13 @@ void EightBit::GameBoy::Disassembler::disassemble(std::ostringstream& output, LR
}
void EightBit::GameBoy::Disassembler::disassembleCB(
std::ostringstream& output,
LR35902& cpu,
uint16_t pc,
std::ostringstream&,
LR35902&,
uint16_t,
std::string& specification,
int& dumpCount,
int&,
int x, int y, int z,
int p, int q) {
int, int) {
switch (x) {
case 0: // rot[y] r[z]

View File

@ -9,6 +9,23 @@ EightBit::GameBoy::LR35902::LR35902(Bus& memory)
m_bus(memory) {
}
EightBit::register16_t& EightBit::GameBoy::LR35902::AF() {
af.low = higherNibble(af.low);
return af;
}
EightBit::register16_t& EightBit::GameBoy::LR35902::BC() {
return bc;
}
EightBit::register16_t& EightBit::GameBoy::LR35902::DE() {
return de;
}
EightBit::register16_t& EightBit::GameBoy::LR35902::HL() {
return hl;
}
void EightBit::GameBoy::LR35902::handleRESET() {
IntelProcessor::handleRESET();
di();
@ -57,7 +74,6 @@ bool EightBit::GameBoy::LR35902::jrConditionalFlag(const int flag) {
default:
UNREACHABLE;
}
throw std::logic_error("Unhandled JR conditional");
}
bool EightBit::GameBoy::LR35902::jumpConditionalFlag(const int flag) {
@ -73,7 +89,6 @@ bool EightBit::GameBoy::LR35902::jumpConditionalFlag(const int flag) {
default:
UNREACHABLE;
}
throw std::logic_error("Unhandled JP conditional");
}
void EightBit::GameBoy::LR35902::reti() {
@ -94,7 +109,6 @@ bool EightBit::GameBoy::LR35902::returnConditionalFlag(const int flag) {
default:
UNREACHABLE;
}
throw std::logic_error("Unhandled RET conditional");
}
bool EightBit::GameBoy::LR35902::callConditionalFlag(const int flag) {
@ -110,7 +124,6 @@ bool EightBit::GameBoy::LR35902::callConditionalFlag(const int flag) {
default:
UNREACHABLE;
}
throw std::logic_error("Unhandled CALL conditional");
}
void EightBit::GameBoy::LR35902::add(register16_t& operand, const register16_t value) {
@ -348,7 +361,7 @@ int EightBit::GameBoy::LR35902::execute(const uint8_t opcode) {
return clockCycles();
}
void EightBit::GameBoy::LR35902::executeCB(const int x, const int y, const int z, const int p, const int q) {
void EightBit::GameBoy::LR35902::executeCB(const int x, const int y, const int z, int, int) {
switch (x) {
case 0: { // rot[y] r[z]
auto operand = R(z);

View File

@ -17,15 +17,15 @@ EightBit::Profiler::Profiler(MOS6502& targetProcessor, Disassembly& disassembler
}
void EightBit::Profiler::Generate() {
StartingOutput.fire(EventArgs());
StartingOutput.fire(EventArgs::empty());
EmitProfileInformation();
StartingOutput.fire(EventArgs());
StartingOutput.fire(EventArgs::empty());
}
void EightBit::Profiler::EmitProfileInformation() {
{
StartingLineOutput.fire(EventArgs());
StartingLineOutput.fire(EventArgs::empty());
// For each memory address
for (int address = 0; address < 0x10000; ++address) {
// If there are any cycles associated
@ -36,11 +36,11 @@ void EightBit::Profiler::EmitProfileInformation() {
EmitLine.fire(ProfileLineEventArgs(source, cycles));
}
}
FinishedLineOutput.fire(EventArgs());
FinishedLineOutput.fire(EventArgs::empty());
}
{
StartingScopeOutput.fire(EventArgs());
StartingScopeOutput.fire(EventArgs::empty());
for (auto& scopeCycle : scopeCycles) {
auto name = scopeCycle.first;
auto cycles = scopeCycle.second;
@ -48,7 +48,7 @@ void EightBit::Profiler::EmitProfileInformation() {
auto count = addressCounts[namedAddress];
EmitScope.fire(ProfileScopeEventArgs(name, cycles, count));
}
FinishedScopeOutput.fire(EventArgs());
FinishedScopeOutput.fire(EventArgs::empty());
}
}

View File

@ -95,8 +95,8 @@ namespace EightBit {
protected:
// Default push/pop handlers
virtual void push(const uint8_t value) final { pushS(value); }
virtual uint8_t pop() final { return popS(); }
virtual void push(uint8_t value) final;
virtual uint8_t pop() final;
// Interrupt (etc.) handlers

View File

@ -577,6 +577,14 @@ void EightBit::mc6809::execute11(const uint8_t opcode) {
//
void EightBit::mc6809::push(const uint8_t value) {
pushS(value);
}
uint8_t EightBit::mc6809::pop() {
return popS();
}
void EightBit::mc6809::push(register16_t& stack, const uint8_t value) {
BUS().write(--stack, value);
}

View File

@ -236,13 +236,13 @@ void EightBit::Disassembler::disassemble(std::ostringstream& output, Z80& cpu, u
}
void EightBit::Disassembler::disassembleCB(
std::ostringstream& output,
const Z80& cpu,
uint16_t pc,
std::ostringstream&,
const Z80&,
uint16_t,
std::string& specification,
int& dumpCount,
int&,
int x, int y, int z,
int p, int q) const {
int, int) const {
switch (x) {
case 0: // rot[y] r[z]
@ -286,9 +286,9 @@ void EightBit::Disassembler::disassembleCB(
}
void EightBit::Disassembler::disassembleED(
std::ostringstream& output,
const Z80& cpu,
uint16_t pc,
std::ostringstream&,
const Z80&,
uint16_t,
std::string& specification,
int& dumpCount,
int x, int y, int z,

View File

@ -32,7 +32,7 @@ namespace EightBit {
}
};
const auto& getDecodedOpcode(const int i) const {
const auto& getDecodedOpcode(const size_t i) const {
return m_decodedOpcodes[i];
}
@ -156,7 +156,7 @@ namespace EightBit {
}
auto jrConditional(const int condition) {
const auto offset = fetchByte();
const int8_t offset = fetchByte();
if (condition)
jr(offset);
return !!condition;

View File

@ -22,7 +22,7 @@ namespace EightBit {
auto& INT() { return m_intLine; }
auto& IRQ() { return INT(); } // Synonym
virtual void powerOn();
virtual void powerOn() override;
void reset() { lower(RESET()); }
int run(int limit);