![]() |
Routines |
| Prev: FA6A | Up: Map | Next: FAFE |
|
Used by the routines at JumpTable_FillTiles and Move_Entity.
Fills a rectangle of tiles from the room buffers.
|
||||
| Fill_Tiles | FA9E | PUSH AF | Stash AF, BC, DE and HL. | |
| FA9F | PUSH BC | |||
| FAA0 | PUSH DE | |||
| FAA1 | PUSH HL | |||
| FAA2 | LD HL,($5C36) | Switch *CHARS to *Pointer_ActiveFont. | ||
| FAA5 | PUSH HL | |||
| FAA6 | LD HL,($640E) | |||
| FAA9 | LD ($5C36),HL | |||
|
Clip the fill rectangle.
|
||||
| FAAC | LD A,E | Store the width in *Print_Width. | ||
| FAAD | LD ($6416),A | |||
| FAB0 | CALL Next_PrintCell | Call Next_PrintCell. | ||
| FAB3 | XOR A | Jump to Fill_Tiles_Skip if the clipped size is zero. | ||
| FAB4 | CP E | |||
| FAB5 | JP Z,Fill_Tiles_Skip | |||
| FAB8 | CP D | |||
| FAB9 | JP Z,Fill_Tiles_Skip | |||
| FABC | LD A,C | Store the starting column in *6415. | ||
| FABD | LD ($6415),A | |||
| Fill_Tiles_Target | FAC0 | LD A,($6416) | E=*Print_Width. | |
| FAC3 | LD E,A | |||
| FAC4 | LD A,($6415) | C=*6415. | ||
| FAC7 | LD C,A | |||
| FAC8 | CALL Set_PrintPosition | Call Set_PrintPosition. | ||
| Fill_Tiles_Continue | FACB | PUSH BC | Advance *Print_BufferOffset and point HL at that Buffer_RoomTiles tile. | |
| FACC | LD HL,($6412) | |||
| FACF | INC HL | |||
| FAD0 | LD ($6412),HL | |||
| FAD3 | LD BC,$5DCD | |||
| FAD6 | ADD HL,BC | |||
| FAD7 | LD A,(HL) | |||
| FAD8 | CALL Print_Character | Call Print_Character with the stored tile. | ||
| FADB | LD BC,$0320 | Copy the matching Buffer_RoomAttributes attribute to the screen. | ||
| FADE | ADD HL,BC | |||
| FADF | LD A,(HL) | |||
| FAE0 | LD BC,$57FF | |||
| FAE3 | LD HL,($6412) | |||
| FAE6 | ADD HL,BC | |||
| FAE7 | LD (HL),A | |||
| FAE8 | POP BC | Move left one column and loop back to Fill_Tiles_Continue. | ||
| FAE9 | DEC C | |||
| FAEA | DEC E | |||
| FAEB | JR NZ,Fill_Tiles_Continue | |||
| FAED | DEC D | Decrease the remaining height. | ||
| FAEE | JR Z,Fill_Tiles_Skip | Jump to Fill_Tiles_Skip if it is zero. | ||
| FAF0 | PUSH DE | Copy DE to DE (using the stack). | ||
| FAF1 | POP DE | |||
| FAF2 | DEC B | Move up one row. | ||
| FAF3 | JR Fill_Tiles_Target | Jump to Fill_Tiles_Target. | ||
| Fill_Tiles_Skip | FAF5 | POP HL | Restore *CHARS from the stack. | |
| FAF6 | LD ($5C36),HL | Write it back to *CHARS. | ||
| FAF9 | POP HL | Restore the stashed registers from the stack. | ||
| FAFA | POP DE | |||
| FAFB | POP BC | |||
| FAFC | POP AF | |||
| FAFD | RET | Return. | ||
| Prev: FA6A | Up: Map | Next: FAFE |