I am trying to write a number to a file in both hex and in decimal.
For example Hex 63 and dec 99. In a hex editor the values should be 63 and 99.
The game takes one value (in hex for example) as an internal counter and the second value 99 (in decimal) for the graphic display. I am using a numricupdown control to get the value from the user.
0x63 is 99 dec. So why do you need to write the same number to a file twice? Why not write as a decimal, read as a decimal and if needed to be in hex for some display reason do a conversion? Once read numbers are stored internally as binary and used in calculations as binary. It's only when you read/write a number that how it appears matters.
I need to write the same number 2 times because that is how they are stored in RAM on the SNES. One is stored and read as hex and the other stored and read as binary coded decimal.
The only way I know of to do this is use 2 nemericupdown controls. Each one with a different base.
There most be way of converting this some how using one control.
Binary Coded Decimal (BCD) is not decimal. It's stored in it's own format. What you need is a routine to convert to (and from?) BCD from binary. Do an internet search on this as there's loads of resources available.