Prev: 64090 Up: Map Next: 64158
64106: Clip Rectangle
Used by the routines at Draw_Box, Erase_Entity, Fill_Tiles and Draw_Actor.
Clips the print rectangle against *ClipWindow.
Next_PrintCell 64106 LD A,(25625) Jump to Next_PrintCell_Branch if this row is inside *ClipWindow.
64109 CP B
64110 JR NC,Next_PrintCell_Branch
Next_PrintCell_Continue 64112 DEC D Skip down until the row is inside the clip window.
64113 RET Z
64114 DEC B
64115 CP B
64116 JR NZ,Next_PrintCell_Continue
Next_PrintCell_Branch 64118 LD A,B L=the bottom row of this rectangle.
64119 SUB D
64120 INC A
64121 LD L,A
64122 LD A,(25626)
Next_PrintCell_Target 64125 CP L Shrink the height until the bottom is inside *ClipWindow_MaximumRow.
64126 JR C,Next_PrintCell_Branch2
64128 INC L
64129 DEC D
64130 RET Z
64131 JR Next_PrintCell_Target
Next_PrintCell_Branch2 64133 LD A,(25627) A=*ClipWindow_MinimumColumn.
Next_PrintCell_Target2 64136 CP C Skip left until the column is inside *ClipWindow_MinimumColumn.
64137 JR NC,Next_PrintCell_Branch3
64139 DEC E
64140 RET Z
64141 DEC C
64142 JR Next_PrintCell_Target2
Next_PrintCell_Branch3 64144 LD A,C L=the right-hand column of this rectangle.
64145 SUB E
64146 INC A
64147 LD L,A
64148 LD A,(25628)
Next_PrintCell_Target3 64151 CP L Shrink the width until the right edge is inside *25628.
64152 RET C
64153 INC L
64154 DEC E
64155 RET Z
64156 JR Next_PrintCell_Target3
Prev: 64090 Up: Map Next: 64158