0 Members and 1 Guest are viewing this topic.
#include <os.h>main: .global main push {r4-r11, lr} bl lcd_ingray bl clrscr ldr r0, =0xC0000010 ldr r0, [r0] mov r2, #8 adr r1, sprite add r0, #200 @ x add r0, #SCREEN_WIDTH/2 * 80 @ ydraw: ldr r3, [r1], #4 str r3, [r0] add r0, #SCREEN_WIDTH/2 subs r2, #1 bne draw @ if there are lines left, draw the next one bl wait_key_pressed mov r0, #0 pop {r4-r11, pc} sprite: .word 0x00000000, 0x00000000, 0x00FFFF00, 0x00FFFF00, 0x00FFFF00, 0x00FFFF00, 0x00000000, 0x00000000
bl lcd_ingray
You should switch to writing bytes, not words, and then since pixels are 4 bits, have two different routines, one byte aligned and the other not which you choose when the x coordinate is even or odd respectively. Alternatively, if you need this to be really fast, you can set the LCD controller to 8 bits per pixel.
What I don't get is how a 4 bit pixel can use 65536 different colors on CX models