Prev: C142 Up: Map Next: C190
C14A: Draw Decorative Line
Used by the routine at GameEntryPoint.
Draws a decorative horizontal pattern on screen as a separator.
decorative-line
Clear screen.
DrawDecorativeLine C14A CALL ClearScreen Call ClearScreen to clear the screen.
C14D LD A,$24 Store the width value (24) at *DecorativeLine_Width.
C14F LD ($C1F4),A
C152 LD HL,$50E0 Initialise the screen buffer starting point (50E0) at *DecorativeLine_ScreenPosition.
C155 LD ($C1F6),HL
C158 LD A,$02 Use 02 for the picture.
DrawDecorativeLine_Custom C15A LD ($C1FB),A Store the height value in *C1FB.
Reset screen display.
C15D CALL ResetScreenDisplay Call ResetScreenDisplay to reset the screen.
C160 LD HL,$5140 Point HL at the screen address 5140 and DE at the decorative line data at Data_DecorativeLine.
C163 LD DE,$C190
C166 LD B,$06 Set a counter in B for 06 rows.
DrawDecorativeLine_RowLoop C168 LD C,$08 Set a counter in C for 08 repetitions.
C16A PUSH BC Count 04 saving count and the pointer.
C16B PUSH HL
DrawDecorativeLine_SegmentLoop C16C LD B,$04
C16E PUSH DE
DrawDecorativeLine_CopyPatternLoop C16F LD A,(DE) Copy the pattern byte to the current screen position.
C170 LD (HL),A
C171 INC DE Increment the pattern pointer by one.
C172 INC L Increment the screen position column by one.
C173 DJNZ DrawDecorativeLine_CopyPatternLoop Count the next attribute and repeat from DrawDecorativeLine_CopyPatternLoop.
C175 POP DE Restore the caller's registers from the stack.
C176 DEC C Decrease the segment counter by one.
C177 JR NZ,DrawDecorativeLine_SegmentLoop Jump back to DrawDecorativeLine_SegmentLoop until all segments have been drawn.
Skip to the next pattern.
C179 INC DE Increment the pattern pointer by four.
C17A INC DE
C17B INC DE
C17C INC DE
C17D POP HL Restore the screen address from the stack.
C17E POP BC
C17F INC H The count, and step to the next row.
C180 DJNZ DrawDecorativeLine_RowLoop Count the next attribute and repeat from DrawDecorativeLine_RowLoop.
Now colour the line BRIGHT WHITE.
C182 LD HL,$5A40 Take the attributes, take a length of 1F attributes and copy these bytes across.
C185 LD DE,$5A41
C188 LD BC,$001F
C18B LD (HL),$78
C18D LDIR
C18F RET Return.
Prev: C142 Up: Map Next: C190