![]() |
Routines |
| Prev: B322 | Up: Map | Next: B356 |
|
Used by the routine at DrawShot.
Draws rows of a buffer onto the screen by ORing them in, going up the screen from the row that HL is at. The number of rows is the value in A1D8 and a row is B bytes of the buffer, which has eight bytes to a row.
|
||||||||||||
| DrawRows | B336 | LD A,B | A=B. | |||||||||
| B337 | AND A | Return if A is zero. | ||||||||||
| B338 | RET Z | |||||||||||
| B339 | LD C,B | C=B. | ||||||||||
| B33A | LD A,($A1D8) | The rows to draw. | ||||||||||
| DrawRows_Row | B33D | EX AF,AF' | Switch to the alternate accumulator and flags. | |||||||||
| B33E | LD B,C | B=C. | ||||||||||
| B33F | PUSH DE | Stash DE on the stack. | ||||||||||
| B340 | PUSH HL | Stash HL on the stack. | ||||||||||
| DrawRows_Byte | B341 | LD A,(DE) | Read DE. | |||||||||
| B342 | OR (HL) | Set the bits of A that are set in the byte at HL. | ||||||||||
| B343 | LD (HL),A | Write A where HL points. | ||||||||||
| B344 | INC L | Advance L. | ||||||||||
| B345 | INC DE | Advance DE. | ||||||||||
| B346 | DJNZ DrawRows_Byte | Decrease B and jump to DrawRows_Byte until none remain. | ||||||||||
| B348 | POP HL | Bring HL back off the stack. | ||||||||||
| B349 | CALL MoveUpARow | Call MoveUpARow. | ||||||||||
| B34C | POP DE | Bring DE back off the stack. | ||||||||||
| B34D | LD A,$08 | A=08. | ||||||||||
| B34F | ADD A,E | A gains E. | ||||||||||
| B350 | LD E,A | E=A. | ||||||||||
| B351 | EX AF,AF' | Switch to the alternate accumulator and flags. | ||||||||||
| B352 | DEC A | Step A back. | ||||||||||
| B353 | JR NZ,DrawRows_Row | Jump to DrawRows_Row if the zero flag is clear. | ||||||||||
| B355 | RET | Return. | ||||||||||
| Prev: B322 | Up: Map | Next: B356 |