//INT32 m_a; //INT32 m_r; //INT32 m_g; //INT32 m_b; //inline rgbaint_t(): m_a(0), m_r(0), m_g(0), m_b(0) { } //inline rgbaint_t(UINT32 rgba) { set(rgba); } //inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } //inline rgbaint_t(rgb_t& rgba) { set(rgba); } //inline void set(rgbaint_t& other) { set(other.m_a, other.m_r, other.m_g, other.m_b); } //inline void set(UINT32 rgba) { set((rgba >> 24) & 0xff, (rgba >> 16) & 0xff, (rgba >> 8) & 0xff, rgba & 0xff); } #if false inline void set(INT32 a, INT32 r, INT32 g, INT32 b) { m_a = a; m_r = r; m_g = g; m_b = b; }
// internal sub-checks //------------------------------------------------- // validate_core - validate core internal systems //------------------------------------------------- void validate_core() { //throw new emu_unimplemented(); #if false // basic system checks if (~0 != -1) { osd_printf_error("Machine must be two's complement\n"); } #endif byte a = 0xff; byte b = (byte)(a + 1); if (b > a) { osd_printf_error("UINT8 must be 8 bits\n"); } // check size of core integer types if (sizeof(sbyte) != 1) { osd_printf_error("INT8 must be 8 bits\n"); } if (sizeof(byte) != 1) { osd_printf_error("UINT8 must be 8 bits\n"); } if (sizeof(Int16) != 2) { osd_printf_error("INT16 must be 16 bits\n"); } if (sizeof(UInt16) != 2) { osd_printf_error("UINT16 must be 16 bits\n"); } if (sizeof(int) != 4) { osd_printf_error("INT32 must be 32 bits\n"); } if (sizeof(UInt32) != 4) { osd_printf_error("UINT32 must be 32 bits\n"); } if (sizeof(Int64) != 8) { osd_printf_error("INT64 must be 64 bits\n"); } if (sizeof(UInt64) != 8) { osd_printf_error("UINT64 must be 64 bits\n"); } //throw new emu_unimplemented(); #if false // check signed right shift INT8 a8 = -3; INT16 a16 = -3; INT32 a32 = -3; INT64 a64 = -3; if (a8 >> 1 != -2) { osd_printf_error("INT8 right shift must be arithmetic\n"); } if (a16 >> 1 != -2) { osd_printf_error("INT16 right shift must be arithmetic\n"); } if (a32 >> 1 != -2) { osd_printf_error("INT32 right shift must be arithmetic\n"); } if (a64 >> 1 != -2) { osd_printf_error("INT64 right shift must be arithmetic\n"); } #endif //throw new emu_unimplemented(); #if false // check pointer size //#ifdef PTR64 if (sizeof(void *) != 8) { osdcore_global.m_osdcore.osd_printf_error("PTR64 flag enabled, but was compiled for 32-bit target\n"); } //#else if (sizeof(void *) != 4) { osdcore_global.m_osdcore.osd_printf_error("PTR64 flag not enabled, but was compiled for 64-bit target\n"); } //#endif #endif //throw new emu_unimplemented(); #if false // TODO: check if this is actually working // check endianness definition UINT16 lsbtest = 0; *(UINT8 *)&lsbtest = 0xff; //#ifdef LSB_FIRST if (lsbtest == 0xff00) { osdcore_global.m_osdcore.osd_printf_error("LSB_FIRST specified, but running on a big-endian machine\n"); } //#else if (lsbtest == 0x00ff) { osdcore_global.m_osdcore.osd_printf_error("LSB_FIRST not specified, but running on a little-endian machine\n"); } //#endif #endif }