MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Flat Mode Flat  

Quantum Leaper
OCRer and Monkey Typist for Galaxy Game
Reged: 03/08/04
Posts: 198
Loc: Orion spiral arm of the Milky Way
Send PM
Re: Binary-coded decimal arithmetic?
06/09/12 03:53 AM


> 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)







Entire thread
Subject Posted by Posted on
* Binary-coded decimal arithmetic? amused 06/03/12 06:35 PM
. * Re: Binary-coded decimal arithmetic? Robbbert  06/12/12 12:54 AM
. * Re: Binary-coded decimal arithmetic? Quantum Leaper  06/09/12 03:53 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 42 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 2845