![]() |
Routines |
| Prev: 62956 | Up: Map | Next: 63064 |
|
Converts the level of the active player into two digits using Convert_Base10, with a level of 255 treated as 0. The units digit is returned in C and the tens digit in A.
|
||||||||||
|
Convert the active player's level into two digits.
|
||||||||||
| Calculate_ActivePlayer_Level | 63041 | LD A,(24224) | If ActivePlayer_Level is not 255, jump to Calculate_Player_Level. | |||||||
| 63044 | CP 255 | |||||||||
| 63046 | JR NZ,Calculate_Player_Level | |||||||||
| 63048 | XOR A | A=0. | ||||||||
|
This reads A into BC as two nibbles, e.g. level 21 would be 00010101 which returns 8449.
|
||||||||||
| Calculate_Player_Level | 63049 | CALL Convert_Base10 | Call Convert_Base10. | |||||||
| 63052 | LD B,A | B=A. | ||||||||
| 63053 | AND %00001111 | Keep only bits 0-3. | ||||||||
| 63055 | LD C,A | C=A. | ||||||||
|
Shift the tens digit down into A.
|
||||||||||
| 63056 | LD A,B | A=B. | ||||||||
| 63057 | RRA | Rotate the bits of A right four times. | ||||||||
| 63058 | RRA | |||||||||
| 63059 | RRA | |||||||||
| 63060 | RRA | |||||||||
| 63061 | AND %00001111 | Keep only bits 0-3. | ||||||||
| 63063 | RET | Return. | ||||||||
| Prev: 62956 | Up: Map | Next: 63064 |