grosged wrote:
I succeeded in changing lcdbuffer to $ff0000 area , and resolution 4bpp...
But it seems I can't write anthing : all I can see is a "sparking" purple screen (and no freeze, no reset)
But it seems I can't write anthing : all I can see is a "sparking" purple screen (and no freeze, no reset)
What? The CE only has RAM addresses up to D657FF. Everything else is pretty much unmapped or just mmio, and probably shouldn't be touched. Here's some code that executes double buffering; you basically just call it multiple times and it handles everything for you: (Note that you have to set currentDrawingBuffer to $D40000) first, before you try anything
Code:
;-------------------------------------------------------------------------------
lcdSize equ lcdWidth*lcdHeight
currentDrawingBuffer equ mpLcdCursorImg+1024-3
;-------------------------------------------------------------------------------
_SwapDraw:
; Safely swap the vRam buffer pointers for double buffered output
; Arguments:
; None
; Returns:
; None
ld hl,mpLcdBase&$ff<<8|mpLcdRis
ld a,(hl)
and a,4
jr z,-_
ld l,mpLcdIcr&$ff
ld (hl),a
ld l,h
ld bc,(hl)
and b
ld de,vRam
jr nz,_
ld de,vRam+lcdSize
_:
ld (hl),de
ld l,currentDrawingBuffer&$ff
ld (hl),bc
ret