![]() |
Routines |
| Prev: C96F | Up: Map | Next: C9B3 |
|
Used by the routines at DrawMenuOption, DamageShip, UpdateBeams, SetObjectAttributes, DrawShot, DrawSideFlames, DrawHUD, ColourFuelGauge, DrawFrame, ColourShip and ColourPlayfield.
Fills an area of the attributes with one value. The area starts with its width, its height and the attribute. The position is that of the bottom row of the area, and the rows are filled going up the screen.
|
||||||||||
| FillAttributes | C991 | LD A,(DE) | Read DE. | |||||||
| C992 | LD B,A | B=A. | ||||||||
| C993 | INC DE | Advance DE. | ||||||||
| C994 | LD A,(DE) | Read DE. | ||||||||
| C995 | LD C,A | C=A. | ||||||||
| C996 | CALL AttributeAddress | Call AttributeAddress. | ||||||||
| C999 | INC DE | Advance DE. | ||||||||
| C99A | LD A,(DE) | Read DE. | ||||||||
| C99B | INC DE | Advance DE. | ||||||||
| C99C | PUSH DE | Stash DE on the stack. | ||||||||
| C99D | LD D,A | D=A. | ||||||||
| C99E | LD E,B | E=B. | ||||||||
| FillAttributes_Row | C99F | PUSH HL | Stash HL on the stack. | |||||||
| C9A0 | LD B,E | B=E. | ||||||||
| FillAttributes_Loop | C9A1 | LD (HL),D | Write D where HL points. | |||||||
| C9A2 | INC HL | Advance HL. | ||||||||
| C9A3 | DJNZ FillAttributes_Loop | Decrease B and jump to FillAttributes_Loop until none remain. | ||||||||
| C9A5 | POP HL | Bring HL back off the stack. | ||||||||
| C9A6 | PUSH BC | Stash BC on the stack. | ||||||||
| C9A7 | LD BC,$0020 | BC=20. | ||||||||
| C9AA | AND A | Is A zero? | ||||||||
| C9AB | SBC HL,BC | Subtract BC and the carry from HL. | ||||||||
| C9AD | POP BC | Bring BC back off the stack. | ||||||||
| C9AE | DEC C | Step C back. | ||||||||
| C9AF | JR NZ,FillAttributes_Row | Jump to FillAttributes_Row if the zero flag is clear. | ||||||||
| C9B1 | POP DE | Bring DE back off the stack. | ||||||||
| C9B2 | RET | Return. | ||||||||
| Prev: C96F | Up: Map | Next: C9B3 |