> I have been looking for good algorithms for binary-coded decimal arithmetic. The best > I have been able to find is > this page and it really doesn't go into as much detail as I would like. In > particular, it says nothing about multiplication or division. Also, I suspect the > addition and subtraction algorithms could be improved upon. > I used to convert to Binary first, the do the BCD arithmetic on my C64, since the multiplication and division used to take far longer than conversion.
> I want to know what algorithms for BCD arithmetic anyone might have come across in > games. For example, I have seen Web pages giving very detailed information about the > workings of Pac-Man, but of course they wouldn't have the "boring" stuff such as how > the points are actually added up. Also, I am curious as to how games that multiply > numbers (for example, Giga Wing, and some gambling games) do so.
I know Bard's Tale 2 or 3 on the C64 uses BCD for amount of gold your characters have. I wrote a cheat program for Bard's Tale 1,2 and 3 on the C64, I even have the source code for BT2 and BT3 cheat programs in D64 format. My cheat program never really did any kind of arithmetic, since all I had to do was show the number and edit them.
Edited by Quantum Leaper (06/09/12 03:58 AM)
|