Esempio n. 1
0
 public FrameJoystick(CMD cmd, UINT16 typeId, FP angle)
 {
     e.cmd_type    = (Byte)cmd;
     OperationType = typeId;
     Angle         = angle;
 }
Esempio n. 2
0
        // 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
        }