;these are two routines for displaying centered text in both the large and small font. ;the input to both is basically the same. ; ; - for puts_center to be centered on the screen, d=10 ; - for vputs_center to be centered on the screen, d=64 ; ;-Jonah Cohen #include ;ACZ include file contains all rom calls used puts_center: ;display centered string pointed to by hl in large font ;input: ; hl->string ; a=row to display on ; d=middle column ld (_curRow),a call _strlen ;c=size of string srl c ;divide by 2 ld a,d ;center column sub c ;a=start column ld (_curCol),a jp _puts ;display line vputs_center: ;display centered string pointed to by hl in small font ;input: ; hl->string ; a=row to display on ; d=middle column push hl push de ld (_penRow),a ;set pen row ld e,0 ;length get_size: ld a,(hl) ;get next byte or a ;check if a=0 jr z,got_size ;finished getting size push hl push de call _get_vchar ;hl->size of char pop de ld a,(hl) ;get size add a,e ;add to cumulative length ld e,a ;save pop hl inc hl ;next byte jr get_size got_size: srl e ;divide by 2 pop af ;center column sub e ;a=center column ld (_penCol),a pop hl ;retrieve start of text jp _vputs ;print the text