Prev: 08DF Up: Map Next: 0998
08F7: decode_row: Decode row of teletext data and render it to the screen.
Used by the routines at wait_and_decode_page and decode_page.
decode_row 08F7 LD A,(skip_next_row_flag) If skip_next_row_flag is set, clear it and return, else jump to force_decode_row.
08FA AND A
08FB JR Z,force_decode_row
08FD XOR A
08FE LD (skip_next_row_flag),A
0901 RET
This entry point is used by the routine at display_header_row.
force_decode_row 0902 XOR A Clear row_has_double_flag.
0903 LD (row_has_double_flag),A
0906 LD (mosaics_flag),A Clear mosaics_flag.
0909 LD (held_separated_flag),A Clear held_separated_flag.
090C LD (separated_mosaics_flag),A Clear separated_mosaics_flag.
090F LD (skip_next_row_flag),A Clear skip_next_row_flag.
0912 LD (hold_mosaics_flag),A Clear hold_mosaics_flag.
0915 LD (double_height_flag),A Clear double_height_flag.
0918 LD (conceal_flag),A Clear conceal_flag.
091B LD A,$03 Set column_offset to 3.
091D LD (column_offset),A
0920 LD A,(colour_attr) Copy colour_attr to temp_attr.
0923 LD (temp_attr),A
0926 LD A,$20 Set hold_mosaic_character to $20 (space character).
0928 LD (hold_mosaic_character),A
092B CALL set_character_pointer Set character_pointer to start of current row.
092E CALL screen_address Call screen_address to get address of row.
0931 LD HL,(character_pointer) Load character_pointer into HL.
0934 PUSH HL Loop through packet until a character $0D (double height control code) is found and set row_has_double_flag if so.
0935 LD B,$28
decode_row_0 0937 LD A,(HL)
0938 CP $0D
093A JR NZ,decode_row_1
093C LD (row_has_double_flag),A
093F JR decode_row_2
decode_row_1 0941 INC HL
0942 DJNZ decode_row_0
decode_row_2 0944 POP HL
0945 LD A,$28 Set A to 40 as a column counter.
This entry point is used by the routine at code_set_at.
decode_character 0947 PUSH AF Push the column counter onto the stack.
0948 LD HL,(character_pointer) Load character from address in character_pointer and strip parity bit.
094B LD A,(HL)
094C AND $7F
094E LD (character_code),A Store result in character_code.
0951 CP $20 If character is greater than or equal to $20 (space character) jump to apply_colours, otherwise it is a control code.
0953 JP NC,apply_colours
0956 AND A If control code is $00 jump to code_set_at.
0957 JP Z,code_set_at
095A CP $08 If control code is less than $08 (alpha colours) jump to alpha_colour_code.
095C JP C,alpha_colour_code
095F CP $0C If control code is less than $0C (flash/steady and boxing) jump to code_set_at.
0961 JP C,code_set_at
0964 JP Z,normal_code If control code is $0C (normal size) jump to normal_code.
0967 CP $0D If control code is $0D (double height) jump to double_code.
0969 JP Z,double_code
096C CP $11 If control code is less than $11 jump to code_set_at.
096E JP C,code_set_at
0971 CP $18 If control code is less than $18 (mosaic colours) jump to mosaics_colour_code.
0973 JP C,mosaics_colour_code
0976 JP Z,conceal_code If control code is $18 (conceal) jump to conceal_code.
0979 CP $19 If control code is $19 (contiguous mosaics) jump to contiguous_code.
097B JP Z,contiguous_code
097E CP $1A If control code is $1A (separated mosaics) jump to separated_code.
0980 JP Z,separated_code
0983 CP $1C If control code is less than $1C jump to code_set_at.
0985 JP C,code_set_at
0988 JP Z,black_background_code If control code is $1C (black background) jump to black_background_code.
098B CP $1D If control code is $1D (new background) jump to new_background_code.
098D JP Z,new_background_code
0990 CP $1E If control code is $1E (hold mosaics) jump to hold_mosaics_code.
0992 JP Z,hold_mosaics_code
0995 JP release_mosaics_code Else control code is $1F (release mosaics), jump to release_mosaics_code.
Prev: 08DF Up: Map Next: 0998