Here you can find the source of CLAMPED_Wr(long ITERW, int FBZCP)
static int CLAMPED_Wr(long ITERW, int FBZCP)
//package com.java2s; // I ported this from the mame project, this is their license public class Main { static int CLAMPED_Wr(long ITERW, int FBZCP) { int RESULT = (short) ((ITERW) >> 32); if (!FBZCP_RGBZW_CLAMP(FBZCP)) { RESULT &= 0xffff;//ww w .j a v a2s . c om if (RESULT == 0xffff) RESULT = 0; else if (RESULT == 0x100) RESULT = 0xff; RESULT &= 0xff; return RESULT; } else { return CLAMPr(RESULT, 0, 0xff); } } static boolean FBZCP_RGBZW_CLAMP(int val) { return (((val) >> 28) & 1) != 0; } static int CLAMPr(int val, int min, int max) { if (val < min) { val = min; } else if (val > max) { val = max; } return val; } }