![]() |
Routines |
| Prev: 25656 | Up: Map | Next: 25728 |
|
Used by the routine at Draw_Room_Rows_Loop.
Copies a single character row (8 pixel lines) from the room buffer to the screen buffer, then copies the corresponding colour attributes.
|
||||||||
|
Copy eight pixel lines from the room buffer to the screen buffer.
|
||||||||
| Draw_Room_Row | 25686 | LD B,8 | Set the pixel line counter to 8 in B. | |||||
| 25688 | PUSH HL | Stash the room buffer pointer on the stack. | ||||||
| Draw_Room_Row_Pixel_Loop | 25689 | PUSH BC | Stash the pixel line counter and room buffer pointer on the stack. | |||||
| 25690 | PUSH HL | |||||||
| 25691 | LD D,H | Copy the room buffer pointer to DE. | ||||||
| 25692 | LD E,L | |||||||
| 25693 | RES 7,D | Reset bit 7 of D to convert from a room buffer address to the corresponding screen buffer address. | ||||||
| 25695 | LD BC,32 | Copy 32 bytes from the room buffer to the screen buffer. | ||||||
| 25698 | LDIR | |||||||
| 25700 | POP HL | Restore the room buffer pointer and pixel line counter from the stack. | ||||||
| 25701 | POP BC | |||||||
| 25702 | INC H | Advance to the next pixel line in the room buffer. | ||||||
| 25703 | DJNZ Draw_Room_Row_Pixel_Loop | Decrease the pixel line counter and loop back to Draw_Room_Row_Pixel_Loop until all 8 lines are copied. | ||||||
|
Copy the colour attributes for this character row. Convert the room buffer address to the source and destination attribute buffer addresses.
|
||||||||
| 25705 | POP HL | Restore the original room buffer pointer from the stack. | ||||||
| 25706 | LD A,H | Rotate the high byte right three positions. | ||||||
| 25707 | RRCA | |||||||
| 25708 | RRCA | |||||||
| 25709 | RRCA | |||||||
| 25710 | AND %00000011 | Mask to extract the character row index. | ||||||
| 25712 | OR %11011000 | Set bits 3-4 and 6-7 to form the source attribute buffer high byte. | ||||||
| 25714 | LD H,A | Set H to the source high byte and copy L to E. | ||||||
| 25715 | LD E,L | |||||||
| 25716 | LD A,H | Mask the high byte again. | ||||||
| 25717 | AND %00000011 | |||||||
| 25719 | OR %01011000 | Set bits 3-4 and 6 to form the destination attribute buffer high byte. | ||||||
| 25721 | LD D,A | Set D to the destination high byte. | ||||||
| 25722 | LD BC,32 | Copy 0032 attribute bytes to the screen attribute buffer. | ||||||
| 25725 | LDIR | |||||||
| 25727 | RET | Return. | ||||||
| Prev: 25656 | Up: Map | Next: 25728 |