// SPDX-FileCopyrightText: 2002-2026 PCSX2 Dev Team // SPDX-License-Identifier: GPL-3.0+ #include "Common.h" #include #include #include "VUmicro.h" /*****************************************/ /* NEW FLAGS */ //By asadr. Thnkx F|RES :p /*****************************************/ static __ri u32 VU_MAC_UPDATE( int shift, VURegs * VU, float f ) { u32 v = *(u32*)&f; int exp = (v >> 23) & 0xff; u32 s = v & 0x80000000; if (s) VU->macflag |= 0x0010<macflag &= ~(0x0010<macflag = (VU->macflag & ~(0x1100<macflag = (VU->macflag&~(0x1000<macflag = (VU->macflag&~(0x0101<macflag = (VU->macflag & ~(0x1101<macflag&= ~(0x1111<<3); } __fi void VU_MACy_CLEAR(VURegs * VU) { VU->macflag&= ~(0x1111<<2); } __fi void VU_MACz_CLEAR(VURegs * VU) { VU->macflag&= ~(0x1111<<1); } __fi void VU_MACw_CLEAR(VURegs * VU) { VU->macflag&= ~(0x1111<<0); } __ri void VU_STAT_UPDATE(VURegs * VU) { int newflag = 0 ; if (VU->macflag & 0x000F) newflag = 0x1; if (VU->macflag & 0x00F0) newflag |= 0x2; if (VU->macflag & 0x0F00) newflag |= 0x4; if (VU->macflag & 0xF000) newflag |= 0x8; // Replace the ZSUO cause nibble and OR the matching sticky bits in, keeping // the sticky field this op did not touch. The sticky OR has to happen HERE, // at the point the flags are produced -- statusflag is seeded from the whole // STATUS register (vu0ExecMicro), not from a bare cause nibble. // // Assigning `newflag` outright instead left the sticky field to be // re-derived from the cause nibble by whoever consumed statusflag later. // That is idempotent right up until an FSSET clears the sticky field, at // which point the stale cause regenerates the bit FSSET just cleared. // // The D/I pair is deliberately not carried here: it belongs to the div unit, // which maintains it in statusflag independently (VU_STICKY_DI). VU->statusflag = (VU->statusflag & 0xFC0) | newflag | (newflag << 6); }