![]() |
Routines |
| Prev: D0B9 | Up: Map | Next: D135 |
|
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, 20 bytes to a line.
|
||||||||||||||
|
Work out the byte from the position.
|
||||||||||||||
| CalculateBufferAddress | D120 | PUSH HL | Stash HL on the stack. | |||||||||||
| D121 | SRL B | Divide BC by two. | ||||||||||||
| D123 | RR C | |||||||||||||
| D125 | SRL B | Divide BC by four. | ||||||||||||
| D127 | RR C | |||||||||||||
| D129 | SRL B | Divide BC by eight. | ||||||||||||
| D12B | RR C | |||||||||||||
| D12D | LD HL,$D200 | Point HL at ScreenBuffer. | ||||||||||||
| D130 | ADD HL,BC | Add BC to HL. | ||||||||||||
| D131 | LD C,L | Copy HL to BC. | ||||||||||||
| D132 | LD B,H | |||||||||||||
| D133 | POP HL | Restore HL from the stack and return. | ||||||||||||
| D134 | RET | |||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: D0B9 | Up: Map | Next: D135 |