Hello, I am trying to write a piece of code that uses one-bit-per-pixel mode and a routine to clear the screen. But I cannot figure out what is causing only the first few lines to be cleared.
Code:
Code:
#include "includes\ti84pce.inc"
.assume ADL=1
.org userMem-2
.db tExtTok,tAsm84CeCmp
call _homeup
call _RunIndicOff
ld a,lcdBpp1 ; setup 1bpp mode
ld (mpLcdCtrl),a
ld hl,mpLcdPalette ; setup the palette
ld bc,$FFFF ; 1 - black, 0 - white
ld (hl),bc
inc hl
inc hl
ld bc,0
ld (hl),bc
call CLR
loop: ;loop until button press
call _GetCSC
or a
cp a, skEnter
jr nz,loop
ld a,lcdBpp16
ld (mpLcdCtrl),a
ret
CLR:
ld bc, 320*240/8
ld hl, vRam
CLR_loop:
ld (hl),$0
inc hl
dec bc
ld a,b
sub a,c
or a
jr nz, CLR_loop
ret