Alright, i am having a problem.
This is my code right now:
Code:
.nolist
#include "ti84pce.inc"
.list
.org UserMem-2
.db tExtTok,tAsm84CeCmp
;start up
di
ld a,lcdBpp8
ld (mpLcdCtrl),a
; mateo's sprite rutine thing
ld hl,from_paletteStart
ld de,mpLcdPalette
ld bc,from_paletteEnd-from_paletteStart
ldir
ld hl,from_sprite ; The first sprite
call clearScreen ;CLEAR SCREEN
ld bc,320/1
drawSprite:
ld (NextLine+1),bc
ld de,vRAM
ld a,(hl) ; width
ld (AddMe+1),a
inc hl
ld a,(hl) ; height
inc hl
InLoop:
ld bc,0
AddMe:
ld c,0
push de
ldir ; hl->data
pop de
ex de,hl
NextLine:
ld bc,0
add hl,bc
ex de,hl
dec a
jr nz,InLoop
waitForClear:
call keyScan
;scan here
ld hl,$F5001C
ld a,(hl)
and a,%01000000
jr z, waitForClear
;exit
ld a,lcdBpp16
ld (mpLcdCtrl),a
ei
ret
keyScan:
ld hl,0F50000h
ld (hl),2 ; Set Single Scan mode
xor a,a
scan_wait:
cp a,(hl) ; Wait for Idle mode
jr nz,scan_wait
ret
init8bpp:
ld hl,mpLcdPalette ; palette mem
ld b,0
_cp1555loop:
ld d,b
ld a,b
and %11000000
srl d
rra
ld e,a
ld a,%00011111
and b
or e
ld (hl),a
inc hl
ld (hl),d
inc hl
inc b
jr nz,_cp1555loop
ret
clearScreen:
ld hl,vRAM
push hl
pop de
inc de
ld (hl),0
ld bc,320*240*2
ldir ; Clear vRAM
ret
from_paletteStart:
.dw $8000 ; 0
.dw $d6b5 ; 1
.dw $d294 ; 2
.dw $b5ad ; 3
.dw $b9ce ; 4
.dw $a94a ; 5
.dw $bdef ; 6
.dw $b18c ; 7
.dw $ad6b ; 8
.dw $a529 ; 9
from_paletteEnd:
from_sprite:
.db $c8,$14 ; width, height
.db $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0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9,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$5,$8,$5,$5,$8,$5,$5,$0
.db $0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
This code produces a black screen with a few white pixels in the corner, and no image.
When i comment out the "call clearScreen", then the image is drawn correctly, and the screen is black, but there are some random grey pixels on the left hand side.