Well, here is my attempt.
I make it 164 bytes based on the start of the line 0 REM and ending with the second line's end of line $76 character. I'm sure I could reduce this by 10 to 20 bytes but maybe another day.... Its just occurred to me I probably don't need the $FF at the end of the text string either so that should 163 bytes.
This runs on a 1K zeddy in EightyOne emulator but I have not had time to try it on actual hardware yet.
I don't have an account on the code golf website so I guess this is as far as it goes!
Code: Select all
main
ld hl,happyBirthday
ld bc,(Line2Text+7)
add hl,bc
ex de,hl
ld b,12
ld hl,(D_FILE)
inc hl
firstLine
ld a,(de)
ld (hl),a
inc hl
inc de
djnz firstLine
ld b,4
dec hl
rightVertical
push de
ld de,13
add hl,de
pop de
ld a,(de)
ld (hl),a
inc de
djnz rightVertical
dec hl
ld b,11
lastLine
ld a,(de)
ld (hl),a
dec hl
inc de
djnz lastLine
ld b,3
inc hl
leftVertical
push de
ld de,13
sbc hl,de
pop de
ld a,(de)
ld (hl),a
inc de
djnz leftVertical
delayCode
ld hl,FRAMES ; fetch timer
ld a,(hl)
sub 10 ; wait 10 full frames (0.1 of a second)
delayLoop
cp (hl)
jr nz,delayLoop
endOfMain
ld a,(Line2Text+7)
inc a
cp 30
jr nz,notLooping
ld a,0
notLooping
ld (Line2Text+7),a
jp main
happyBirthday
DEFB _H,_A,_P,_P,_Y,__,_B,_I,_R,_T,_H,_D,_A,_Y,__,_R,_A,_F,_F,_A,_E,_L,_E,__,_C,_E,_C,_C,_O,__,_H,_A,_P,_P,_Y,__,_B,_I,_R,_T,_H,_D,_A,_Y,__,_R,_A,_F,_F,_A,_E,_L,_E,__,_C,_E,_C,_C,_O,__,$ff
I haven't included the bits to add in line 1 and line 2 etc. but have included the bytes they take up in the byte count.