An emulator, assembler, and disassembler for the Sega Game Gear
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

13 linhas
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. }