![]() |
Routines |
| Prev: 53433 | Up: Map | Next: 53557 |
|
Used by the routines at UpdateLightYears, PrintTextSingleColour, PrintTextStandardFont, DisplayObjectsCarried, CopyAreaToScreen, DrawChangedObjects and PrintSprite.
Finds the address in ScreenBuffer of the byte that holds a pixel. The buffer has the lines of the screen from the bottom, 32 bytes to a line.
|
||||||||||||||
|
Work out the byte from the position.
|
||||||||||||||
| CalculateBufferAddress | 53536 | PUSH HL | Stash HL on the stack. | |||||||||||
| 53537 | SRL B | Divide BC by two. | ||||||||||||
| 53539 | RR C | |||||||||||||
| 53541 | SRL B | Divide BC by four. | ||||||||||||
| 53543 | RR C | |||||||||||||
| 53545 | SRL B | Divide BC by eight. | ||||||||||||
| 53547 | RR C | |||||||||||||
| 53549 | LD HL,53760 | Point HL at ScreenBuffer. | ||||||||||||
| 53552 | ADD HL,BC | Add BC to HL. | ||||||||||||
| 53553 | LD C,L | Copy HL to BC. | ||||||||||||
| 53554 | LD B,H | |||||||||||||
| 53555 | POP HL | Restore HL from the stack and return. | ||||||||||||
| 53556 | RET | |||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: 53433 | Up: Map | Next: 53557 |