Prev: 26749 Up: Map Next: 26771
26752: Display Speedometer
Used by the routine at Handler_PlayerMovement.
Input
A The speed value
DE Points to 23109 (the attribute buffer location of the speedometer)
DisplaySpeedometer 26752 BIT 7,A Jump to ProcessSpeedValue if the speed value is negative.
26754 JR NZ,ProcessSpeedValue
26756 CPL Make the position speed value into a negative.
Strip off the signed bit.
ProcessSpeedValue 26757 AND %01111111 Keep only bits 0-6.
26759 RRA Divide the speed value by two and store the result in L (scaled speed value).
26760 LD L,A
26761 LD A,167 Set the base offset value in A of 167.
26763 NOP No operation.
26764 NOP
26765 NOP
26766 NOP
26767 SUB L Update L to 167 - the scaled speed value.
26768 LD L,A
26769 LD H,180 Set H to the high byte of the display data table.
Continue on to CopyTwelveBytes.
Prev: 26749 Up: Map Next: 26771