Prev: 37571 Up: Map Next: 37654
37613: Load A with ASCII code of character in stored display file address
The display file address of interest is stored at 36488.
Used by the routines at 37333 and 37552.
Output
A ASCII code of character
37613 LD HL,64252 Point HL at start of letter "A" graphic in character set
37616 EX DE,HL Swap into DE
37617 LD B,26 Load B with 26
37619 PUSH BC Store BC
37620 LD HL,(36488) Load (video) memory location to start printing character into HL
37623 LD BC,2048 Load B with 8 and C with zero
37626 LD A,(DE) Read a byte of the character's graphic data...
37627 CP (HL) ...compare to what is already displayed in display file at to-print location...
37628 JR Z,37631 ...and if they're the same, jump to 37631
37630 INC C Else increase C
37631 INC H Move down one pixel row (advance by 256 bytes) in display file
37632 INC DE Advance to next pixel row of character of interest
37633 DJNZ 37626 Loop back for next row
37635 LD A,C Copy C into A...
37636 OR A ...and if it is zero (i.e. current character in character set is same as character at to-print location in display file)...
37637 JR Z,37645 ...jump ahead to 37645
37639 POP BC Restore BC
37640 DJNZ 37619 Loop back for next character
37642 LD A,48 Load A with 48
37644 RET Return
37645 POP BC Character in display file at to-print location is same as character with index (26 - B)...
37646 LD A,B ...so load B into A...
37647 SUB 26 ...subtract 26...
37649 NEG ...and negate to get index of character in A (e.g. A=0, B=1, C=2 ...)
37651 ADD A,65 Add 65 to get ASCII index
37653 RET Return
Prev: 37571 Up: Map Next: 37654