Commit 9a13863a authored by Screwtape's avatar Screwtape

Update to v104r17 release.

byuu says:

Changelog:

  - processor/m68k: fix error in disassembler [Sintendo]
  - processor/m68k: work around Clang compiler bug [Cydrak, Sintendo]

This is one of the shortest WIPs I've done, but I'm trying not to change
anything before v105.
parent 5dbaec85
......@@ -12,7 +12,7 @@ using namespace nall;
namespace Emulator {
static const string Name = "higan";
static const string Version = "104.16";
static const string Version = "104.17";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org/";
......
......@@ -44,7 +44,7 @@ template<uint Size> auto M68K::_immediate() -> string {
template<uint Size> auto M68K::_address(EffectiveAddress& ea) -> string {
if(ea.mode == 7) return {"$", hex((int16)_readPC<Word>(), 6L)};
if(ea.mode == 8) return {"$", hex(readPC<Long>(), 6L)};
if(ea.mode == 8) return {"$", hex(_readPC<Long>(), 6L)};
if(ea.mode == 9) return {"$", hex(_pc + (int16)_readPC(), 6L)};
return "???";
}
......
......@@ -68,7 +68,7 @@ template<uint Size> auto M68K::fetch(EffectiveAddress& ea) -> uint32 {
return 0;
}
template<uint Size, bool Hold> auto M68K::read(EffectiveAddress& ea) -> uint32 {
template<uint Size, bool hold> auto M68K::read(EffectiveAddress& ea) -> uint32 {
ea.address = fetch<Size>(ea);
switch(ea.mode) {
......@@ -88,14 +88,14 @@ template<uint Size, bool Hold> auto M68K::read(EffectiveAddress& ea) -> uint32 {
case AddressRegisterIndirectWithPostIncrement: {
auto address = ea.address + (ea.reg == 7 && Size == Byte ? bytes<Word>() : bytes<Size>());
auto data = read<Size>(ea.address);
if(!Hold) write(AddressRegister{ea.reg}, ea.address = address);
if(!hold) write(AddressRegister{ea.reg}, ea.address = address);
return data;
}
case AddressRegisterIndirectWithPreDecrement: {
auto address = ea.address - (ea.reg == 7 && Size == Byte ? bytes<Word>() : bytes<Size>());
auto data = read<Size>(address);
if(!Hold) write(AddressRegister{ea.reg}, ea.address = address);
if(!hold) write(AddressRegister{ea.reg}, ea.address = address);
return data;
}
......@@ -132,7 +132,7 @@ template<uint Size, bool Hold> auto M68K::read(EffectiveAddress& ea) -> uint32 {
return 0;
}
template<uint Size, bool Hold> auto M68K::write(EffectiveAddress& ea, uint32 data) -> void {
template<uint Size, bool hold> auto M68K::write(EffectiveAddress& ea, uint32 data) -> void {
ea.address = fetch<Size>(ea);
switch(ea.mode) {
......@@ -152,14 +152,14 @@ template<uint Size, bool Hold> auto M68K::write(EffectiveAddress& ea, uint32 dat
case AddressRegisterIndirectWithPostIncrement: {
auto address = ea.address + (ea.reg == 7 && Size == Byte ? bytes<Word>() : bytes<Size>());
write<Size>(ea.address, data);
if(!Hold) write(AddressRegister{ea.reg}, ea.address = address);
if(!hold) write(AddressRegister{ea.reg}, ea.address = address);
return;
}
case AddressRegisterIndirectWithPreDecrement: {
auto address = ea.address - (ea.reg == 7 && Size == Byte ? bytes<Word>() : bytes<Size>());
write<Size, Reverse>(address, data);
if(!Hold) write(AddressRegister{ea.reg}, ea.address = address);
if(!hold) write(AddressRegister{ea.reg}, ea.address = address);
return;
}
......
......@@ -79,13 +79,13 @@ auto M68K::instructionABCD(EffectiveAddress with, EffectiveAddress from) -> void
r.x = r.c;
}
template<uint Size, bool Extend> auto M68K::ADD(uint32 source, uint32 target) -> uint32 {
template<uint Size, bool extend> auto M68K::ADD(uint32 source, uint32 target) -> uint32 {
auto result = (uint64)source + target;
if(Extend) result += r.x;
if(extend) result += r.x;
r.c = sign<Size>(result >> 1) < 0;
r.v = sign<Size>(~(target ^ source) & (target ^ result)) < 0;
r.z = clip<Size>(result) ? 0 : (Extend ? r.z : 1);
r.z = clip<Size>(result) ? 0 : (extend ? r.z : 1);
r.n = sign<Size>(result) < 0;
r.x = r.c;
......@@ -1059,13 +1059,13 @@ auto M68K::instructionSTOP() -> void {
r.stop = true;
}
template<uint Size, bool Extend> auto M68K::SUB(uint32 source, uint32 target) -> uint32 {
template<uint Size, bool extend> auto M68K::SUB(uint32 source, uint32 target) -> uint32 {
auto result = (uint64)target - source;
if(Extend) result -= r.x;
if(extend) result -= r.x;
r.c = sign<Size>(result >> 1) < 0;
r.v = sign<Size>((target ^ source) & (target ^ result)) < 0;
r.z = clip<Size>(result) ? 0 : (Extend ? r.z : 1);
r.z = clip<Size>(result) ? 0 : (extend ? r.z : 1);
r.n = sign<Size>(result) < 0;
r.x = r.c;
......
......@@ -102,8 +102,8 @@ struct M68K {
};
template<uint Size> auto fetch(EffectiveAddress& ea) -> uint32;
template<uint Size, bool Hold = 0> auto read(EffectiveAddress& ea) -> uint32;
template<uint Size, bool Hold = 0> auto write(EffectiveAddress& ea, uint32 data) -> void;
template<uint Size, bool hold = 0> auto read(EffectiveAddress& ea) -> uint32;
template<uint Size, bool hold = 0> auto write(EffectiveAddress& ea, uint32 data) -> void;
//instruction.cpp
auto instruction() -> void;
......@@ -120,7 +120,7 @@ struct M68K {
template<uint Size> auto sign(uint32 data) -> int32;
auto instructionABCD(EffectiveAddress with, EffectiveAddress from) -> void;
template<uint Size, bool Extend = false> auto ADD(uint32 source, uint32 target) -> uint32;
template<uint Size, bool extend = false> auto ADD(uint32 source, uint32 target) -> uint32;
template<uint Size> auto instructionADD(EffectiveAddress from, DataRegister with) -> void;
template<uint Size> auto instructionADD(DataRegister from, EffectiveAddress with) -> void;
template<uint Size> auto instructionADDA(AddressRegister ar, EffectiveAddress ea) -> void;
......@@ -233,7 +233,7 @@ struct M68K {
auto instructionSBCD(EffectiveAddress with, EffectiveAddress from) -> void;
auto instructionSCC(uint4 condition, EffectiveAddress to) -> void;
auto instructionSTOP() -> void;
template<uint Size, bool Extend = false> auto SUB(uint32 source, uint32 target) -> uint32;
template<uint Size, bool extend = false> auto SUB(uint32 source, uint32 target) -> uint32;
template<uint Size> auto instructionSUB(EffectiveAddress source, DataRegister target) -> void;
template<uint Size> auto instructionSUB(DataRegister source, EffectiveAddress target) -> void;
template<uint Size> auto instructionSUBA(AddressRegister to, EffectiveAddress from) -> void;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment