Example #1
0
    void DataSerializer::Serialize<float>(const float& value)
    {
      const uint32_t& tmp = reinterpret_cast<const uint32_t&>(value);
      const uint16_t lo = LoWord(tmp);
      const uint16_t hi = HiWord(tmp);

      *this << HiByte(hi) << LoByte(hi) << HiByte(lo) << LoByte(lo);
    }
Example #2
0
int ext_getch(void)
{
    int key;
#ifdef __OS2__
    extern KBDKEYINFO ki;         /* defined in ISSHIFT.C */
    KBDINFO kb_state;

    kb_state = setkbmode();       /* Change keyboard to binary mode */
    KbdCharIn(&ki, IO_WAIT, 0);   /* Get the key */
    restkbmode(kb_state);         /* restore previous keyboard mode */

    key = (ki.chScan << 8) + ki.chChar;       /* format it into an int */
#else                       /* assume DOS */
    union REGS regs;

#if USING_DOS
    regs.h.ah = 7;
    intdos(&regs, &regs);
    key = regs.h.al;
    if (0 == key)
    {
        regs.h.ah = 7;
        intdos(&regs, &regs);
        key = (regs.h.al << 8);
    }
#else
    regs.h.ah = 0x10;
    int86(0x16, &regs, &regs);
    key = regs.x.ax;
#endif

    switch (LoByte(key))
    {
    case 0:
        key = HiByte(key) + 256;
        break;

    case 0xe0:
        key = HiByte(key) + 512;
        break;

    default:
        if (0xe0 == HiByte(key))
            key = LoByte(key) + 512;
        else
        {
            if (ispunct(LoByte(key)) && HiByte(key) > 0x36)
                key = LoByte(key) + 512;
            else  key = LoByte(key);
        }
    }
#endif
    return key;
}
Example #3
0
void playSoundSingle(unsigned int size)
{
	unsigned short rate = 65536 - (256000000/11025);

	oldSB_ISR = getvect(0xF);
	setvect(0xF, SB_ISR);

	outp(0x226, 0x01);
	outp(0x226, 0x00);
	outp(0x22C, 0x1D);

	outp(0x22C, 0x40);
	outp(0x22C, HiByte(rate));

      //	outp(0x22C, 0x41);
      //	outp(0x22C, LoByte(rate));
      //	outp(0x22C, HiByte(rate));

	outp(0x22C, 0xC0);
	outp(0x22C, 0x00);

	outp(0x22C, LoByte(size));
	outp(0x22C, HiByte(size));
}
Example #4
0
 void DataSerializer::Serialize<uint16_t>(const uint16_t& value)
 {
   Buffer.push_back(LoByte(value));
   Buffer.push_back(HiByte(value));
 }
Example #5
0
 void SetGridFlag  (unsigned short flag)  {
     m_cib[6] = LoByte(flag);
     m_cib[7] = HiByte(flag);
 }
Example #6
0
 void SetGridType  (unsigned short type)  {
     m_cib[4] = LoByte(type);
     m_cib[5] = HiByte(type);
 }