Prev: 0640 Up: Map Next: 073B
06A6: print_character: Print character to the screen
Used by the routine at code_set_at.
print_character 06A6 LD A,(mosaics_flag) If mosaics_flag is zero then jump to print_character_0.
06A9 AND A
06AA JR Z,print_character_0
06AC LD A,(hold_mosaic_character) If hold_mosaic_character equals character_code or bit 5 of character_code is clear then jump forwards to print_character_0.
06AF LD B,A
06B0 LD A,(character_code)
06B3 CP B
06B4 JR Z,print_character_0
06B6 LD A,(character_code)
06B9 BIT 5,A
06BB JR Z,print_character_0
06BD LD (hold_mosaic_character),A Else copy character_code to hold_mosaic_character.
06C0 LD A,(separated_mosaics_flag) Copy separated_mosaics_flag to held_separated_flag.
06C3 LD (held_separated_flag),A
print_character_0 06C6 LD A,(column_offset) Increment column_offset modulo 4.
06C9 INC A
06CA CP $04
06CC JR C,print_character_1
06CE XOR A
print_character_1 06CF LD (column_offset),A
06D2 LD HL,$0A60 Load address of font_data - 256 into HL.
06D5 LD A,(mosaics_flag) If mosaics_flag is zero then jump to print_character_4.
06D8 AND A
06D9 JR Z,print_character_4
06DB LD HL,(mosaics_font_pointer) Set HL to mosaics_font_pointer minus 256.
06DE DEC H
06DF LD A,(hold_mosaics_flag) If hold mosaic flag is clear then jump to print_character_2.
06E2 AND A
06E3 JR Z,print_character_2
06E5 LD A,(mosaics_flag) If mosaics_flag and separated_mosaics_flag are clear, or if mosaics_flag is set and held_separated_flag is clear, then jump to print_character_4.
06E8 AND A
06E9 JR Z,print_character_2
06EB LD A,(held_separated_flag)
06EE JR print_character_3
print_character_2 06F0 LD A,(separated_mosaics_flag)
print_character_3 06F3 AND A
06F4 JR Z,print_character_4
06F6 INC H Else add $0300 to HL to get address of separated mosaics font data.
06F7 INC H
06F8 INC H
print_character_4 06F9 EX DE,HL Add character_code * 8 to font data address in HL to get address of font data for character and store result in DE.
06FA LD A,(character_code)
06FD ADD A,A
06FE LD L,A
06FF LD H,$00
0701 ADD HL,HL
0702 ADD HL,HL
0703 ADD HL,DE
0704 EX DE,HL
0705 LD HL,(char_addr) Load char_addr into HL.
0708 LD A,(double_height_flag) If double_height_flag is clear jump to print_normal.
070B AND A
070C JP Z,print_normal
070F LD A,(row_number) Else if row_number equals 7 or 15 then double height text crosses screen thirds, jump to print_double_2.
0712 CP $07
0714 JR Z,print_double_2
0716 CP $0F
0718 JR Z,print_double_2
071A CP $17 Else if row_number is >= 23, jump to print_normal.
071C JR C,print_double_1
071E JP print_normal
print_double_1 0721 CALL print_half_row Else call print_half_row to print pixel rows 0-3 of character data. Return with HL increased by $0800 and DE pointing to pixel row 4 of character data.
0724 LD BC,$07E0 Subtract $07E0 from HL to wind character location back to same column in next character row, call print_half_row again to print pixel rows 4-7 of character data, and return.
0727 OR A
0728 SBC HL,BC
072A CALL print_half_row
072D RET
print_double_2 072E CALL print_half_row Call print_half_row to print pixel rows 0-3 of character data. Return with HL increased by $0800 and DE pointing to pixel row 4 of character data.
0731 OR A Subtract $00E0 from HL to wind character location back to same column in next character row, call print_half_row again to print pixel rows 4-7 of character data, and return.
0732 LD BC,$00E0
0735 SBC HL,BC
0737 CALL print_half_row
073A RET
Prev: 0640 Up: Map Next: 073B