Prev: 6D17 Up: Map Next: 6DA6
6D4E: Print 'HUNGRY' or 'HORACE' on the title screen
Used by the routine at 6000.
Input
BC 160 (number of tiles to draw)
DE Display file address
HL 6E8F (HUNGRY) or 6F2F (HORACE)
6D4E PUSH BC Save the tile counter.
6D4F LD A,(HL) Pick up a data byte.
6D50 AND $30 Keep only bits 4 and 5.
6D52 CP $00 Are bits 4 and 5 both reset?
6D54 JR Z,$6D6A Jump if so.
6D56 CP $10 Is bit 4 set and bit 5 reset?
6D58 JR Z,$6D66 Jump if so.
6D5A CP $20 Is bit 4 reset and bit 5 set?
6D5C JR Z,$6D62 Jump if so.
6D5E LD C,%11111111 Bits 5 and 4 of A are both set.
6D60 JR $6D6C
6D62 LD C,%00001111 Bit 5 of A is reset and bit 4 is set.
6D64 JR $6D6C
6D66 LD C,%11110000 Bit 5 of A is set and bit 4 is reset.
6D68 JR $6D6C
6D6A LD C,%00000000 Bits 5 and 4 of A are both reset.
6D6C LD B,$04 Draw the top four pixel rows of the character cell using the bit pattern in C.
6D6E LD A,C
6D6F LD (DE),A
6D70 INC D
6D71 DJNZ $6D6F
6D73 LD A,(HL) Pick up the data byte again.
6D74 AND $03 Keep only bits 0 and 1.
6D76 CP $00 Are bits 0 and 1 both reset?
6D78 JR Z,$6D8E Jump if so.
6D7A CP $01 Is bit 0 set and bit 1 reset?
6D7C JR Z,$6D8A Jump if so.
6D7E CP $02 Is bit 0 reset and bit 1 set?
6D80 JR Z,$6D86 Jump if so.
6D82 LD C,%11111111 Bits 1 and 0 of A are both set.
6D84 JR $6D90
6D86 LD C,%00001111 Bit 1 of A is reset and bit 0 is set.
6D88 JR $6D90
6D8A LD C,%11110000 Bit 1 of A is set and bit 0 is reset.
6D8C JR $6D90
6D8E LD C,%00000000 Bits 1 and 0 of A are both reset.
6D90 LD B,$04 Draw the bottom four pixel rows of the character cell using the bit pattern in C.
6D92 LD A,C
6D93 LD (DE),A
6D94 INC D
6D95 DJNZ $6D93
6D97 INC E Set DE to the display file address of the next cell to the right.
6D98 JR Z,$6D9E
6D9A LD A,D
6D9B SUB $08
6D9D LD D,A
6D9E INC HL Point HL at the next data byte.
6D9F POP BC Restore the tile counter to BC.
6DA0 DEC BC Decrement the tile counter.
6DA1 LD A,B Is it zero now?
6DA2 OR C
6DA3 JR NZ,$6D4E Jump back if not.
6DA5 RET
Prev: 6D17 Up: Map Next: 6DA6