mirror of
https://github.com/andrew-jacobs/emu816.git
synced 2024-06-07 01:29:28 +00:00
21 lines
346 B
C++
21 lines
346 B
C++
|
#include "wdc816.h"
|
||
|
|
||
|
wdc816::wdc816()
|
||
|
{ }
|
||
|
|
||
|
wdc816::~wdc816()
|
||
|
{ }
|
||
|
|
||
|
char *wdc816::toHex(unsigned long value, unsigned int digits)
|
||
|
{
|
||
|
static char buffer[16];
|
||
|
unsigned int offset = sizeof(buffer);;
|
||
|
|
||
|
buffer[--offset] = 0;
|
||
|
while (digits-- > 0) {
|
||
|
buffer[--offset] = "0123456789ABCDEF"[value & 0xf];
|
||
|
value >>= 4;
|
||
|
}
|
||
|
return (&(buffer[offset]));
|
||
|
}
|