-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwdc816.cc
More file actions
44 lines (39 loc) · 1.54 KB
/
wdc816.cc
File metadata and controls
44 lines (39 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//==============================================================================
// .ooooo. .o .ooo
// d88' `8. o888 .88'
// .ooooo. ooo. .oo. .oo. oooo oooo Y88.. .8' 888 d88'
// d88' `88b `888P"Y88bP"Y88b `888 `888 `88888b. 888 d888P"Ybo.
// 888ooo888 888 888 888 888 888 .8' ``88b 888 Y88[ ]88
// 888 .o 888 888 888 888 888 `8. .88P 888 `Y88 88P
// `Y8bod8P' o888o o888o o888o `V88V"V8P' `boood8' o888o `88bod8'
//
// A Portable C++ WDC 65C816 Emulator
//------------------------------------------------------------------------------
// Copyright (C),2016 Andrew John Jacobs
// All rights reserved.
//
// This work is made available under the terms of the Creative Commons
// Attribution-NonCommercial-ShareAlike 4.0 International license. Open the
// following URL to see the details.
//
// http://creativecommons.org/licenses/by-nc-sa/4.0/
//------------------------------------------------------------------------------
#include "wdc816.h"
// Never used.
wdc816::wdc816()
{ }
// Never used.
wdc816::~wdc816()
{ }
// Convert a value to a hex string
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]));
}