See Update 3 at the bottom.
In addition to @harold's answer: if there's a need for a faster alternative a well-known trick with PUSH can be used.
I'm not familiar with TI-84, the stack trick might be unacceptable on some systems or require interrupts to be disabled. And of course you are supposed to store/restore the SP before/after the above code.
Update 3: Removed my code snippet as it was incorrect for eZ80 anyway.
However, thanks to the links provided by @DrDnar here is someone's -not mine! :)- attempt to push the performance to the limit (yes, I'm aware that filling with $55 is not the same as alternating between $31 and $00):
Code:
FastClr:
ld de,$555555 ; will write byte 85 (= blue color)
or a
sbc hl,hl
ld b,217
di
add hl,sp ; saves SP in HL
ld sp,vram+76818 ; for best optimisation , we'll write 18 extra bytes
ClrLp: .fill 118,$d5 ; = 118 * "PUSH DE"
djnz ClrLp ; during 217 times
ld sp,hl ; restore SP
ei
16+4+8+8+4+4+16+217*(118*10+13)-5+4+4=258944 States !!! ;D (the
classic LDIR takes about 537600 states)
Cemetech source There are more (allegedly faster) examples there.
This at least raises certain doubts regarding the claim that LDIR is the fastest option, so i would be interested in @DrDnar's comments.
Note: I'm not saying the claim is wrong as I'm not in the position to test any of this and see for myself. I've noticed that the author of the above code, although they mention "TI83PCE/TI84+CE" in the original post, perform the actual measurements on a TI83PCE only - and this might be important.
Also, the addresses and the size used in the code are not the same as in the OP's code, and the "8bpp mode" is mentioned, which again tells me very little but the OP does not mention any particular mode.
Update 4: The link provided by @iPhoenix contains loads of info on the TI-84+CE, including the LCD Controller details.
This page explains, among other things, why '8bpp mode' has been specifically mentioned by the author of that code above:
When the LCD is in 8bpp mode, data written to VRAM will act as an 8-bit index
to the LCD's 256x16-bit Color Palette. Note that the colour palette
must be initialized prior to setting this mode or you will receive
unexpected results. (See LCDPalette register - 0x200 for information
on the Color Palette). This will effectively halve the amount of VRAM
required to store a full resolution 320x240 image (76800 bytes vs
153600 bytes). The extra 76800 bytes of VRAM could be used to double
buffer or for temporary data storage. Note that the TIOS will not be
usable in this mode, it expects 16bpp 5:6:5 mode at all times.
In other words - rather than filling the 153600 bytes of VRAM with 0x31,0x00 (16bpp colour, presumably), the OP could fill half of VRAM with a single byte value XY and configure (prior to the actual filling) the Color Palette so that the XY value maps to the desired 16bpp colour and thus achieve the same result.
With this approach any "inconveniences" of alternating between 31 and 00 just go away naturally.