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); }
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(®s, ®s); key = regs.h.al; if (0 == key) { regs.h.ah = 7; intdos(®s, ®s); key = (regs.h.al << 8); } #else regs.h.ah = 0x10; int86(0x16, ®s, ®s); 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; }
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)); }
void DataSerializer::Serialize<uint16_t>(const uint16_t& value) { Buffer.push_back(LoByte(value)); Buffer.push_back(HiByte(value)); }
void SetGridFlag (unsigned short flag) { m_cib[6] = LoByte(flag); m_cib[7] = HiByte(flag); }
void SetGridType (unsigned short type) { m_cib[4] = LoByte(type); m_cib[5] = HiByte(type); }