An emulator, assembler, and disassembler for the Sega Game Gear
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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