Skool Daze Routines
29442: Slide message character into speech bubble text window (2)
Continues from the routine at 29706. Returns with the carry flag set if the speech bubble is off-screen.
A ASCII code of character from message being spoken
29442 LD E,A E=ASCII code of character from message being spoken
29443 LD A,(32612) Pick up the speech bubble lip x-coordinate in A
29446 AND 120 A=x-coordinate of right edge of text window within speech bubble
29448 ADD A,6
29450 LD HL,32512 32512 holds column at far left of screen (0-64)
29453 SUB (HL) Return with the carry flag set if the speech bubble is off-screen to the left
29454 RET C
29455 CP 32 Return with the carry flag set if the speech bubble is off-screen to the right
29457 CCF
29458 RET C
29459 LD C,A A=x-coordinate of right edge of text window within speech bubble
29460 LD A,(32613) A=y-coordinate of speech bubble lip
29463 SUB 154 D=screen y-coordinate of top row of speech bubble (0-17)
29465 LD D,A
29466 RRCA Point HL at the display file address corresponding to the top right edge of the text window within the speech bubble
29467 RRCA
29468 RRCA
29469 AND 224
29471 ADD A,C
29472 LD L,A
29473 LD A,D
29474 AND 24
29476 ADD A,68
29478 LD H,A
29479 LD D,217 C=width (in pixels) of message character
29481 LD A,(DE)
29482 LD C,A
29483 INC D A=next pixel column of message character
29484 LD A,(DE)
29485 CALL 29491 Slide this into the speech bubble text window
29488 DEC C Next pixel column
29489 JR NZ,29483 Jump back until all pixel columns are done
29491 PUSH HL Store the display file address temporarily
29492 CALL 32216 Slide the top four pixel rows of the text window one pixel to the left
29495 LD B,A Store the message character pixel column in B temporarily
29496 LD A,L Point HL at the display file address corresponding to the fifth pixel row down from the top right edge of the text window within the speech bubble
29497 ADD A,32
29499 LD L,A
29500 JR C,29506
29502 LD A,H
29503 SUB 8
29505 LD H,A
29506 LD A,B Restore the message character pixel column to A
29507 CALL 32216 Slide the bottom four pixel rows of the text window one pixel to the left
29510 POP HL Restore the display file address to HL
29511 XOR A Return with the carry flag reset
29512 RET