2009-07-28 15:32:10 -06:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2009-07-05 20:10:26 -06:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
// Additional copyrights go to Duddie and Tratax (c) 2004
|
|
|
|
|
|
|
|
#ifndef _GDSP_CONDITION_CODES_H
|
|
|
|
#define _GDSP_CONDITION_CODES_H
|
|
|
|
|
|
|
|
// Anything to do with SR and conditions goes here.
|
|
|
|
|
|
|
|
#include "Common.h"
|
|
|
|
|
|
|
|
namespace DSPInterpreter {
|
|
|
|
|
|
|
|
bool CheckCondition(u8 _Condition);
|
|
|
|
|
|
|
|
int GetMultiplyModifier();
|
|
|
|
|
2010-02-21 03:35:28 -07:00
|
|
|
void Update_SR_Register16(s16 _Value, bool carry = false, bool overflow = false, bool overS32 = false);
|
|
|
|
void Update_SR_Register64(s64 _Value, bool carry = false, bool overflow = false);
|
2009-12-01 13:38:42 -07:00
|
|
|
void Update_SR_LZ(bool value);
|
2009-07-05 20:10:26 -06:00
|
|
|
|
2010-03-08 14:25:35 -07:00
|
|
|
inline bool isCarry(u64 val, u64 result) {
|
|
|
|
return (val>result);
|
2009-09-07 04:46:22 -06:00
|
|
|
}
|
|
|
|
|
2010-03-08 14:25:35 -07:00
|
|
|
inline bool isCarry2(u64 val, u64 result) {
|
|
|
|
return (val>=result);
|
2009-09-07 04:46:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
inline bool isOverflow(s64 val1, s64 val2, s64 res) {
|
|
|
|
return ((val1 ^ res) & (val2 ^ res)) < 0;
|
|
|
|
}
|
|
|
|
|
2010-02-21 03:35:28 -07:00
|
|
|
inline bool isOverS32(s64 acc) {
|
|
|
|
return (acc != (s32)acc) ? true : false;
|
2010-02-17 12:10:31 -07:00
|
|
|
}
|
|
|
|
|
2009-07-05 20:10:26 -06:00
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif // _GDSP_CONDITION_CODES_H
|