BCDtoInternal

From WikiPrizm
Revision as of 14:33, 31 July 2014 by Gbl08ma (talk | contribs) (Created page with "{{syscall | name = BCDtoInternal | header = fxcg/misc.h | index = 0x0160 | signature = int BCDtoInternal(struct BCDinternal* target, struct BCDvalue* source) | synopsis = Conv...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Synopsis

Header: fxcg/misc.h
Syscall index: 0x0160
Function signature: int BCDtoInternal(struct BCDinternal* target, struct BCDvalue* source)

Converts a BCD-coded digit to its special internal representation. Helps saving code when converting a BCD value to a double.

Parameters

  • target - pointer to a struct that will hold the conversion result. The struct is as follows:
struct BCDinternal {
  int exponent;
  int sign;
  int unknown;
  char mantissa[15];
}
  • source - pointer to BCD value to convert. The struct containing it is as follows:
typedef struct{
  unsigned char hnibble:4;
  unsigned char lnibble:4;
} TBCDbyte;

typedef struct{
  unsigned short exponent:12;
  unsigned short mantissa0:4;
  TBCDbyte mantissa[7];
  char flags;
  short info;
} TBCDvalue;

Returns

0 on success, -1 on error.