Prev: 77DB Up: Map Next: 7917
784B: Display Title Screen
Used by the routine at TitleScreen.
title-screen
DisplayTitleScreen 784B LD A,$02 A=02.
784D CALL $1601 Call CHAN_OPEN.
7850 LD A,$04 Set the border to GREEN using BORDER.
7852 CALL $229B
7855 SET 3,(IY+$01) Set bit 3 of *FLAGS which sets keyboard mode "L".
7859 SET 3,(IY+$30) Set bit 3 of *FLAGS2 which sets CAPS LOCK "on".
Set the UDG graphics pointer.
785D LD HL,$F3C9 Write F3C9 (CustomFont) to *CHARS.
7860 LD ($5C36),HL
7863 LD A,$27 Write INK: WHITE, PAPER: GREEN to *ATTR_P.
7865 LD ($5C8D),A
7868 LD A,$20 Write INK: BLACK, PAPER: GREEN to *BORDCR.
786A LD ($5C48),A
786D CALL $0DAF Call CL_ALL.
Draw three sections which are white on the left, and black on the right:
empty-sections
Set the point in the attribute buffer where the black sections will begin.
7870 LD HL,$5821 HL=5821 (attribute buffer location).
7873 LD B,$03 Set a counter for the three sections to paint.
TitleScreen_SectionLoop 7875 PUSH BC Stash the section counter on the stack.
7876 LD C,$06 In each section there are six rows, so set another counter for this.
TitleScreen_RowLoop 7878 LD B,$1E The entire length of each row is 1E character blocks.
TitleScreen_Row 787A LD A,B Is the current position 17 ... This is the split for white/ black.
787B CP $17
787D LD A,$78 A=INK: BLACK, PAPER: WHITE (BRIGHT) .
787F JR NC,TitleScreen_Paint Jump to TitleScreen_Paint if the current position was 17 on line TitleScreen_Row.
7881 LD A,$07 A=INK: WHITE, PAPER: BLACK .
TitleScreen_Paint 7883 LD (HL),A Write the attribute byte to the pointer held in HL.
7884 INC HL Increment the attribute buffer pointer by one.
7885 DJNZ TitleScreen_Row Decrease the length counter by one and loop back to TitleScreen_Row until the counter is zero.
7887 INC HL Increment the attribute buffer pointer by two, this moves to the start of the next row.
7888 INC HL
7889 DEC C Decrease the row counter by one and jump back to TitleScreen_RowLoop until all rows have been painted.
788A JR NZ,TitleScreen_RowLoop
This section is now completely painted so move onto the next one.
788C LD DE,$0020 Move to the next section.
788F ADD HL,DE
7890 POP BC Restore the section counter from the stack.
7891 DJNZ TitleScreen_SectionLoop Decrease the section counter by one and loop back to TitleScreen_SectionLoop until all three sections have been painted.
Now print the icons in each box:
options
7893 LD DE,$7A4D Set a pointer in DE where the icon graphics begin: Graphics_KeyboardIcon.
Set up printing the keyboard icon.
7896 LD HL,$4021 HL=4021 (screen buffer location).
7899 LD BC,$0830 BC=0830 (width/ length).
789C PUSH BC Stash the width/ length on the stack.
789D CALL PrintGraphic Call PrintGraphic.
78A0 POP BC Restore the width/ length from the stack.
78A1 LD HL,$5821 HL=5821 (attribute buffer location).
78A4 CALL WriteAttributeData Call WriteAttributeData.
Set up printing the joystick icon.
78A7 LD HL,$4801 HL=4801 (screen buffer location).
78AA LD BC,$0828 BC=0828 (width/ length).
78AD CALL PrintGraphic Call PrintGraphic.
Set up printing the information icon.
78B0 LD HL,$48E4 HL=48E4 (screen buffer location).
78B3 LD BC,$0228 BC=0228 (width/ length).
78B6 PUSH BC Stash the width/ length on the stack.
78B7 CALL PrintGraphic Call PrintGraphic.
78BA POP BC Restore the width/ length from the stack.
78BB LD HL,$59E4 HL=59E4 (attribute buffer location).
78BE CALL WriteAttributeData Call WriteAttributeData.
Now handle printing the text.
78C1 LD DE,$7931 DE=Messaging_TitleScreen.
78C4 LD BC,$00C7 BC=00C7.
78C7 CALL $203C Call PR_STRING.
78CA LD A,$01 A=01.
78CC CALL $1601 Call CHAN_OPEN.
78CF LD HL,$79F8 HL=Messaging_FooterCopyright.
78D2 CALL $187D Call OUT_LINE2.
78D5 LD A,$02 A=02.
78D7 CALL $1601 Call CHAN_OPEN.
Lastly, print the current user-defined keys.
78DA LD HL,$6F6D HL=KeyboardKeymap.
78DD LD BC,$170B BC=170B.
PrintKeys_Loop 78E0 PUSH BC Stash BC and HL on the stack.
78E1 PUSH HL
78E2 CALL $0DE2 Call 0DE2 (CL_SET).
78E5 LD A,$10 Set INK: WHITE.
78E7 RST $10
78E8 LD A,$07
78EA RST $10
78EB LD A,$11 Set PAPER: BLACK.
78ED RST $10
78EE XOR A
78EF RST $10
78F0 POP HL Restore HL from the stack.
78F1 PUSH HL Stash HL on the stack.
78F2 LD A,(HL) A=*HL.
78F3 CP $0D Jump to PrintEnter if the key is "enter".
78F5 JR Z,PrintEnter
78F7 CP $20 Jump to PrintSpace if the key is an ASCII "space".
78F9 JR Z,PrintSpace
78FB RST $10 Print the key to the screen.
PrintKeys_Next 78FC POP HL Restore HL from the stack.
78FD INC HL Increment HL by two.
78FE INC HL
78FF POP BC Restore BC from the stack.
7900 DEC B Decrease B by one.
7901 LD A,B Jump back to PrintKeys_Loop until B is equal to 12.
7902 CP $12
7904 JR NZ,PrintKeys_Loop
7906 RET Return.
Prints the word "ENTER".
PrintEnter 7907 LD HL,$7A47 HL=Messaging_Enter.
790A CALL $187D Call OUT_LINE2.
790D JR PrintKeys_Next Jump to PrintKeys_Next.
Prints the word "SPACE".
PrintSpace 790F LD HL,$7A41 HL=Messaging_Space.
7912 CALL $187D Call OUT_LINE2.
7915 JR PrintKeys_Next Jump to PrintKeys_Next.
Prev: 77DB Up: Map Next: 7917