| Chase H.Q. | Routines |
| Prev: 8DF9 | Up: Map | Next: 8E42 |
|
The caller, scenery_hit for instance, has already set the attribute at column 1 of every row; this copies it across the 28 columns to its right, one row at a time, with a rolling LDIR that copies each row's first byte over the rest of the row. After 16 rows transition_control is set to stop.
|
||||
| fill_attributes | 8E29 | LD HL,$5901 | Screen attribute position (1,8) | |
| 8E2C | LD B,$00 | Clear B for C to be set in a moment | ||
| 8E2E | LD A,$10 | 16 rows of attributes | ||
| fill_attributes_0 | 8E30 | LD D,H | Destination address | |
| 8E31 | LD E,L | |||
| 8E32 | LD C,$1C | 28 bytes to copy: the source column is already set, so 28 writes fill columns 2..29, giving 29 filled columns | ||
| 8E34 | INC E | Dest++ | ||
| 8E35 | LDIR | Fill by 'rolling' | ||
| 8E37 | INC HL | Skip four (32 wide - 28) | ||
| 8E38 | INC HL | |||
| 8E39 | INC HL | |||
| 8E3A | INC HL | |||
| 8E3B | DEC A | Row counter-- | ||
| 8E3C | JR NZ,fill_attributes_0 | Loop until it hits zero | ||
| 8E3E | LD ($A231),A | transition_control = 0 | ||
| 8E41 | RET | Return | ||
| Prev: 8DF9 | Up: Map | Next: 8E42 |