Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- call vxWaitVsync
- ld a, $2A
- call vxSpiCmd
- ld a, $0
- call vxSpiParam
- ld a, $0
- call vxSpiParam
- ld a, $01
- call vxSpiParam
- ld a, $3F
- call vxSpiParam
- call vxWaitVsync
- vxWaitVsync:
- ; wait until the LCD finish displaying the frame
- ld hl, VX_LCD_ICR
- set 2, (hl)
- ld l, VX_LCD_ISR&$FF
- vxWaitSyncLoop:
- bit 2, (hl)
- jr z, vxWaitSyncLoop
- ret
- vxSpiParam:
- scf ; First bit is set for data
- .db 030h ; jr nc,? ; skips over one byte
- vxSpiCmd:
- or a,a ; First bit is clear for commands
- ld hl,0F80818h
- call vxSpiWrite
- ld l,h
- ld (hl),001h
- vxSpiWait:
- ld l,00Dh
- vxSpiWait1:
- ld a,(hl)
- and a,0F0h
- jr nz,vxSpiWait1
- dec l
- vxSpiWait2:
- bit 2,(hl)
- jr nz,vxSpiWait2
- ld l,h
- ld (hl),a
- ret
- vxSpiWrite:
- ld b,3
- vxSpiWriteLoop:
- rla
- rla
- rla
- ld (hl),a ; send 3 bits
- djnz vxSpiWriteLoop
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement