![]() |
Routines |
| Prev: C72E | Up: Map | Next: C7AC |
|
Used by the routines at TestBlockRow_Draw and DrawBlockSection.
Draws the bytes of a row of a block into the screen buffer. A column below 10 is off the view, and a column of C0 is drawn only when bits 1-2 of DrawingFlags are clear. The tile is read through the stack. Those bits clear draw the bytes plain, with C611; otherwise DrawShiftedRows_Two shifts them.
|
||||||||||
| DrawBlockBytes | C76D | CP $10 | A column below 10 is off the view. | |||||||
| C76F | RET C | |||||||||
| C770 | LD C,A | Keep the column. | ||||||||
| C771 | CP $C0 | A column of C0 needs the drawing flags. | ||||||||
| C773 | JR NZ,DrawBlockBytes_Return | |||||||||
| C775 | LD A,($5CF0) | Read the drawing flags. | ||||||||
| C778 | AND %00000110 | Use bits 1-2 of the drawing flags. | ||||||||
| C77A | JR Z,DrawBlockBytes_Offset | Draw when those bits are clear. | ||||||||
| DrawBlockBytes_Return | C77C | RET NC | Leave a shifted column of C0 undrawn. | |||||||
| DrawBlockBytes_Offset | C77D | SRL C | The byte offset is the column divided by eight. | |||||||
| C77F | SRL C | |||||||||
| C781 | SRL C | |||||||||
| C783 | LD ($5CDA),SP | Remember the stack pointer. | ||||||||
| C787 | LD SP,HL | Read the tile through the stack. | ||||||||
| C788 | LD HL,($5CBB) | Fetch the strip address. | ||||||||
| C78B | LD B,$00 | Add the byte offset to the strip. | ||||||||
| C78D | ADD HL,BC | |||||||||
| C78E | LD A,($5CF0) | Read the drawing flags again. | ||||||||
| C791 | AND %00000110 | Use bits 1-2 of the drawing flags. | ||||||||
| C793 | LD B,$08 | Draw the plain bytes when those bits are clear. | ||||||||
| C795 | JP Z,DrawBlockRow_Loop | |||||||||
| C798 | EX DE,HL | Keep the strip address aside. | ||||||||
| C799 | ADD A,$F8 | The shift selects the page of the shifted rows. | ||||||||
| C79B | LD HL,$B508 | Use the two-byte shifted rows. | ||||||||
| C79E | LD ($B534),HL | Give that routine to the shifted drawer. | ||||||||
| C7A1 | LD ($B539),HL | |||||||||
| C7A4 | LD H,A | Keep the page. | ||||||||
| C7A5 | LD A,$08 | The shifted row count is 08. | ||||||||
| C7A7 | EX AF,AF' | |||||||||
| C7A8 | LD A,(DE) | Read the first screen byte. | ||||||||
| C7A9 | JP DrawShiftedRows_Two | Draw the shifted rows. | ||||||||
| Prev: C72E | Up: Map | Next: C7AC |