I found a couple of functions by MateoConLechuga here and copy pasted them into my program, but it seems to make the entire screen look like a grid of different colors. I can't post a screenshot as it seems to show everything as if it was fine.
Here's the source:
Code:
As you can see, all I'm trying to do is make the screen a bit red+green. Or am I stupid and double-buffering isn't supported on 16bpp?
Here's the source:
Code:
SJQ_gameloop:
ld HL, SJQ_current_buffer
ld DE, %1111100011100011
ld BC, 320 * 240
call SJQ_MemSet16
call SJQ_bufswap
call _GetCSC
cp A, skEnter
jp NZ, SJQ_gameloop
SJQ_gameend:
call _homeup
call _ClrScrnFull
ret
SJQ_bufsetup:
ld HL, SJQ_current_buffer
ld DE, vRam + 320 * 240
ld (HL), DE
ld L, mpLcdIcr & $FF
ld (HL), 4
ret
SJQ_bufswap:
ld HL, vRam
ld DE, (mpLcdBase)
or A, A
sbc HL,DE
add HL,DE
jr NZ, +_
ld HL, vRam + 320 * 240
_:
ld (SJQ_current_buffer), DE
ld (mpLcdBase), HL
ld HL, mpLcdIcr
set 2, (HL)
ld L, mpLcdRis & $FF
_:
bit 2, (HL)
jr Z, -_
ret
SJQ_current_buffer equ 0e30014h
As you can see, all I'm trying to do is make the screen a bit red+green. Or am I stupid and double-buffering isn't supported on 16bpp?