#name ^.Object.Printer
#type &ffd
#include OddBall:Sources.Structures
#include OddBall:Sources.Variables

;On entry
;R0 points to a data block of the form
;DCD xpos, ypos
;DCB "TEXT",0


.printtext
STMFD R13!,{R1-R7,R14}
MOV R6,R0
LDR R4,[R6],#4
LDR R5,[R6],#4
ADD R4,R4,R8
.loop2
LDRB R0,[R6],#1
CMP R0,#32
BLT textend
ADDEQ R4,R4,#6
BEQ loop2
ADD R0,R0,#texttab<<24
MOV R7,R0
SWI XFastSpr_ReadSize
MOV R3,R0
ADD R4,R4,R0,LSR #1
MOV R0,R7
MOV R1,R4
MOV R2,R5
SWI XFastSpr_Plot
ADD R4,R4,R3,LSR #1
ADD R4,R4,#2
B loop2
.textend
ADD R0,R6,#3
BIC R0,R0,#3
LDMFD R13!,{R1-R7,PC}
