Anyway after a lot of messing about and some very weird and wonderful results I came up with the following which I'm happy with. It supports the full charset, lower and upper case etc... and is pretty small in size as it doesn't need any graphics storing.
Not sure if anybody has already done this or a variation (very likely) but thought would be good to share in case anybody wants to use it.
Total code size is <100bytes minus the text and obviously not including the ROM charset.
Code: Select all
_main:
ld hl,_txt
ld de,18432+(3*32) ; start pos
_loop:
ld a,(hl) ; get text -> A=0x41
sub 0x20
ret c
push hl
ld l,a
ld h,0
add hl,hl ; x2
add hl,hl ; x4
add hl,hl ; x8
ld bc,0x3d00 ; rom font
add hl,bc ; hl now correct graphic
; plot font
push de
ld b,8
ld c,b ; c=8
_pltloop:
ld a,(hl)
inc hl
ld (de),a
inc d
; what to plot on 2nd line
push bc
push de
push hl
ld d,a
ld b,c ; b=8
ld e,(hl)
xor a
ld c,a
ld l,1
ld h,1
_testloop:
rrc d
jr nc,_testloop100
ex af,af'
ld a,c
add a,l
ld c,a
ex af,af'
inc l ; cumulative +1
jr _testloop110
_testloop100:
ld l,1 ; reset cumulative counter
_testloop110:
rrc e
jr nc,_testloop120
add a,h
inc h
jr _testloop120
_testloop120:
ld h,1 ; reset cumulative counter
_testloop130:
djnz _testloop
pop hl
cp c
ld a,d
jr nc,_plotc
ld a,(hl)
_plotc:
pop de
pop bc
ld (de),a
inc d
; over char line?
ld a,d
and %00000111
jr nz,_inchar
ld a,e
add a,32
ld e,a
ld a,d
sub c ; sub 8
ld d,a
_inchar:
djnz _pltloop
; onto next
pop de
pop hl
inc hl
inc e
jr _loop
;
_txt:
defb "Loading ",0x22,"ChuckieEgg",0x22," Please Wait",0