Prev: 29915 Up: Map Next: 29977
29916: Print Level Name
game
This looks confusing but it's basically HL=48032+(level*28).
Level Address Attribute Name
0 48032 INK: RED, PAPER: BLACK (BRIGHT)    THE   
BOUNCING
HEDGEHOGS
1 48060 INK: CYAN, PAPER: BLACK (BRIGHT)    THE   
  WILY   
WALLABIES
2 48088 INK: YELLOW, PAPER: BLACK (BRIGHT)    THE   
KILLER  
  BEES   
3 48116 INK: BLACK, PAPER: RED (BRIGHT)    ALL   
  THAT   
BOUNCES
4 48144 INK: BLACK, PAPER: YELLOW (BRIGHT)    THE   
  SWARM  
         
5 48172 INK: YELLOW, PAPER: RED (BRIGHT) SPRING  
   AND   
  STING  
6 48200 INK: GREEN, PAPER: BLACK (BRIGHT) NIGHTMARE
  PARK   
         
7 48228 INK: YELLOW, PAPER: RED (BRIGHT) FLASH: ON ABANDON
   ALL   
  HOPE!  
PrintLevelName 29916 LD A,(30752) A=*CurrentLevel.
29919 ADD A,A A*=4.
29920 ADD A,A
29921 LD L,A L=A (level*4).
29922 ADD A,A A*=2.
29923 LD H,A H=A (level*8).
29924 ADD A,A L=160+H+L+(level*16).
29925 ADD A,H
29926 ADD A,L
29927 ADD A,160
29929 LD L,A
29930 LD A,0 H=187+carry.
29932 ADC A,187
29934 LD H,A
29935 LD DE,23127 DE=23127 (attribute buffer location).
29938 LD C,3 C=3 (counter; three lines).
LevelName_ColourLineLoop 29940 LD A,(HL) A=*HL.
29941 LD B,9 B=9 (counter; length of each line).
LevelName_ColourLoop 29943 LD (DE),A Write A to *DE.
29944 INC E Increment E by one.
29945 DJNZ LevelName_ColourLoop Decrease counter by one and loop back to LevelName_ColourLoop until counter is zero.
Move down one line (and reset the position - 9+23=32).
29947 LD A,E E+=23.
29948 ADD A,23
29950 LD E,A
29951 DEC C Decrease C by one.
29952 JR NZ,LevelName_ColourLineLoop Jump to LevelName_ColourLineLoop until C is zero.
29954 INC L Increment L by one.
29955 EXX Switch to the shadow registers.
29956 LD DE,20567 DE'=20567 (screen buffer location).
29959 EXX Switch back to the normal registers.
29960 LD C,3 C=3 (counter; three lines).
PrintLevelName_Loop 29962 LD B,9 B=9 (counter; length of each line).
29964 CALL Print_Loop Call Print_Loop.
Move down one line (and reset the position - 9+23=32).
29967 EXX Switch to the shadow registers.
29968 LD A,E E'+=23.
29969 ADD A,23
29971 LD E,A
29972 EXX Switch back to the normal registers.
Have we printed all three lines of the level name yet?
29973 DEC C Decrease C by one.
29974 JR NZ,PrintLevelName_Loop Jump to PrintLevelName_Loop until C is zero.
29976 RET Return.
Prev: 29915 Up: Map Next: 29977