An emulator, assembler, and disassembler for the Sega Game Gear
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

13 рядки
305 B

  1. /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #include "util.h"
  4. /*
  5. Convert a BCD-encoded hexadecimal number to decimal.
  6. */
  7. uint8_t bcd_decode(uint8_t num)
  8. {
  9. return ((num >> 4) * 10) + (num & 0x0F);
  10. }