Prev: 74DB Up: Map Next: 7519
74DC: Print Level Name
game
This looks confusing but it's basically HL=BBA0+(level*1C).
Level Address Attribute Name
00 BBA0 INK: RED, PAPER: BLACK (BRIGHT)    THE   
BOUNCING
HEDGEHOGS
01 BBBC INK: CYAN, PAPER: BLACK (BRIGHT)    THE   
  WILY   
WALLABIES
02 BBD8 INK: YELLOW, PAPER: BLACK (BRIGHT)    THE   
KILLER  
  BEES   
03 BBF4 INK: BLACK, PAPER: RED (BRIGHT)    ALL   
  THAT   
BOUNCES
04 BC10 INK: BLACK, PAPER: YELLOW (BRIGHT)    THE   
  SWARM  
         
05 BC2C INK: YELLOW, PAPER: RED (BRIGHT) SPRING  
   AND   
  STING  
06 BC48 INK: GREEN, PAPER: BLACK (BRIGHT) NIGHTMARE
  PARK   
         
07 BC64 INK: YELLOW, PAPER: RED (BRIGHT) FLASH: ON ABANDON
   ALL   
  HOPE!  
PrintLevelName 74DC LD A,($7820) A=*CurrentLevel.
74DF ADD A,A A*=04.
74E0 ADD A,A
74E1 LD L,A L=A (level*04).
74E2 ADD A,A A*=02.
74E3 LD H,A H=A (level*08).
74E4 ADD A,A L=A0+H+L+(level*10).
74E5 ADD A,H
74E6 ADD A,L
74E7 ADD A,$A0
74E9 LD L,A
74EA LD A,$00 H=BB+carry.
74EC ADC A,$BB
74EE LD H,A
74EF LD DE,$5A57 DE=5A57 (attribute buffer location).
74F2 LD C,$03 C=03 (counter; three lines).
LevelName_ColourLineLoop 74F4 LD A,(HL) A=*HL.
74F5 LD B,$09 B=09 (counter; length of each line).
LevelName_ColourLoop 74F7 LD (DE),A Write A to *DE.
74F8 INC E Increment E by one.
74F9 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 - 09+17=20).
74FB LD A,E E+=17.
74FC ADD A,$17
74FE LD E,A
74FF DEC C Decrease C by one.
7500 JR NZ,LevelName_ColourLineLoop Jump to LevelName_ColourLineLoop until C is zero.
7502 INC L Increment L by one.
7503 EXX Switch to the shadow registers.
7504 LD DE,$5057 DE'=5057 (screen buffer location).
7507 EXX Switch back to the normal registers.
7508 LD C,$03 C=03 (counter; three lines).
PrintLevelName_Loop 750A LD B,$09 B=09 (counter; length of each line).
750C CALL Print_Loop Call Print_Loop.
Move down one line (and reset the position - 09+17=20).
750F EXX Switch to the shadow registers.
7510 LD A,E E'+=17.
7511 ADD A,$17
7513 LD E,A
7514 EXX Switch back to the normal registers.
Have we printed all three lines of the level name yet?
7515 DEC C Decrease C by one.
7516 JR NZ,PrintLevelName_Loop Jump to PrintLevelName_Loop until C is zero.
7518 RET Return.
Prev: 74DB Up: Map Next: 7519