| Chase H.Q. | Routines |
| Prev: CD3A | Up: Map | Next: CDEC |
|
Used by the routines at build_curve_table and build_height_table.
|
||||||||||||||
| scale_curvature_or_height | CDD6 | LD B,$03 | 3 iterations only | |||||||||||
| CDD8 | LD E,A | Copy of multiplier to destroy | ||||||||||||
| CDD9 | XOR A | Initialise total to zero | ||||||||||||
| mult_loop | CDDA | RL E | Shift the most significant bit out of multiplier | |||||||||||
| CDDC | JR NC,mult_continue | If it was set then increase total by multiplicand | ||||||||||||
| CDDE | ADD A,C | |||||||||||||
| mult_continue | CDDF | ADD A,A | Double the total | |||||||||||
| CDE0 | DJNZ mult_loop | While iterations remain, goto mult_loop | ||||||||||||
| CDE2 | RRA | Undo final doubling | ||||||||||||
| CDE3 | SRA A | Divide by 8 with rounding | ||||||||||||
| CDE5 | SRA A | |||||||||||||
| CDE7 | SRA A | |||||||||||||
| CDE9 | ADC A,$00 | |||||||||||||
| CDEB | RET | Return | ||||||||||||
| Prev: CD3A | Up: Map | Next: CDEC |