1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-28 07:29:45 +00:00

Merge pull request #1097 from TomHarte/Templates

Tidy up 68000, primarily switching from macros to templates.
This commit is contained in:
Thomas Harte 2022-10-19 22:31:28 -04:00 committed by GitHub
commit 149c940a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 669 additions and 786 deletions

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,18 @@ struct Status {
FlagT overflow_flag = 0; // The overflow flag is set if and only if this value is non-zero.
FlagT negative_flag = 0; // The negative flag is set if and only this value is non-zero.
/// Sets the negative flag per @c value
template <typename IntT> void set_negative(IntT value) {
constexpr auto top_bit = IntT(1 << ((sizeof(IntT) * 8) - 1));
negative_flag = value & top_bit;
}
/// Sets both the negative and zero flags according to @c value.
template <typename IntT> void set_neg_zero(IntT value) {
zero_result = value;
set_negative(value);
}
/// Gets the current condition codes.
constexpr uint16_t ccr() const {
return

View File

@ -316,6 +316,7 @@
4B7136911F789C93008B8ED9 /* SegmentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B71368F1F789C93008B8ED9 /* SegmentParser.cpp */; };
4B74CF812312FA9C00500CE8 /* HFV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B74CF802312FA9C00500CE8 /* HFV.cpp */; };
4B74CF822312FA9C00500CE8 /* HFV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B74CF802312FA9C00500CE8 /* HFV.cpp */; };
4B75EBFE28FF9CA20088AB22 /* MacintoshVolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B4C81C928B56CF800F84AE9 /* MacintoshVolume.cpp */; };
4B75F979280D7C5100121055 /* 68000DecoderTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B75F978280D7C5100121055 /* 68000DecoderTests.mm */; };
4B75F97B280D7C7700121055 /* 68000 Decoding in Resources */ = {isa = PBXBuildFile; fileRef = 4B75F97A280D7C7700121055 /* 68000 Decoding */; };
4B7752A628217DF80073E2C5 /* Dave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BFEA2ED2682A7B900EBF94C /* Dave.cpp */; };
@ -6183,6 +6184,7 @@
4BEE4BD425A26E2B00011BD2 /* x86DecoderTests.mm in Sources */,
4B778F3623A5F1040000D260 /* Target.cpp in Sources */,
4B1D08061E0F7A1100763741 /* TimeTests.mm in Sources */,
4B75EBFE28FF9CA20088AB22 /* MacintoshVolume.cpp in Sources */,
4B778F3D23A5F1750000D260 /* ncr5380.cpp in Sources */,
4BF701A026FFD32300996424 /* AmigaBlitterTests.mm in Sources */,
4B7752B428217ECB0073E2C5 /* ZXSpectrumTAP.cpp in Sources */,