This is a nice print routine from Agent X II, from where you have to type in a password to allow the loading of parts 2 and 3. Uses the ROM print routine.
Code: Select all
Org Any
LD A,2 ; Upper 21 lines
CALL 05633 ; CHAN_OPEN
CALL PrintRoutine
; directly aftwards place the text to print to the screen
; you can use the normal control codes
; AT X,Y 22,x,y (0-21,0-31)
; INK 16,n (0-7)
; PAPER 17,n (0-7)
; FLASH 18,n (1 or 0)
; BRIGHT 19,n (1 or 0)
; INVERSE 20,n (1 or 0)
; OVER 21,n (1 or 0)
DEFB 22,8,3 ; AT x,y
DEFB 16,1 ; ink blue
DEFB "PLEASE ENTER THE PASSWORD."
DEFB 31 ; data end marker
; continue with your game code here....
RET
PrintRoutine
POP HL
LD A,(HL)
INC HL
PUSH HL
CP 31 ; data end marker
RET Z
RST 2 ; print it
JP PrintRoutine
A little slower, but it could save a few more bytes if you have a lot to print.