![]() |
Routines |
| Prev: 44512 | Up: Map | Next: 44567 |
|
Used by the routines at MenuWriteText, PrepDraw23, PrepDraw2, Clear_Play_Area, Clear_Panel, Draw_Ceiling, Draw_Top_Right_Corner, Draw_Right_Wall, PrintStringColour, Draw_Ceiling_Picture, Draw_Left_Wall_Picture, Draw_Top_Left_Corner_Picture, Print_Status_Panel, Print_Depth, Print_Completion_Percentage, Draw_Lives, AddPointsToScore and Draw_Line.
Converts a pixel position into the address of the matching byte of the display file.
|
||||||||||||
| ScreenAddress | 44536 | LD A,L | Fetch the x position. | |||||||||
| 44537 | RRCA | Divide it by 8. | ||||||||||
| 44538 | RRCA | |||||||||||
| 44539 | RRCA | |||||||||||
| 44540 | AND 31 | Keep only five bits. | ||||||||||
| 44542 | LD L,A | Store the column in L. | ||||||||||
| 44543 | LD A,H | Fetch the y position. | ||||||||||
| 44544 | RLCA | Multiply it by 4. | ||||||||||
| 44545 | RLCA | |||||||||||
| 44546 | AND 224 | Keep only the bits that give the character row within a third. | ||||||||||
| 44548 | OR L | Combine them with the column. | ||||||||||
| 44549 | LD L,A | Store the low byte of the address in L. | ||||||||||
| 44550 | LD A,H | Fetch the y position. | ||||||||||
| 44551 | AND 7 | Keep only the pixel line within the character. | ||||||||||
| 44553 | EX AF,AF' | Stash the line in AF'. | ||||||||||
| 44554 | LD A,H | Fetch the y position. | ||||||||||
| 44555 | RRCA | Divide it by 8. | ||||||||||
| 44556 | RRCA | |||||||||||
| 44557 | RRCA | |||||||||||
| 44558 | AND 24 | Keep only the bits that give the third of the screen. | ||||||||||
| 44560 | OR 64 | Add the start of the display file. | ||||||||||
| 44562 | LD H,A | Store the result in H. | ||||||||||
| 44563 | EX AF,AF' | Retrieve the pixel line from AF'. | ||||||||||
| 44564 | OR H | Combine it with the high byte of the address. | ||||||||||
| 44565 | LD H,A | Store the high byte of the address in H. | ||||||||||
| 44566 | RET | Return. | ||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 44512 | Up: Map | Next: 44567 |