@ Mode 4 plot pixel routine by jd
@ posted in the gbadev.org forum
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

.global Mode4PlotPixel
.arm 
.align 2 
.section .iwram, "ax", %progbits 

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@void Mode4PlotPixel(u32 x, u32 y, u32 color)
@
@r0 = x 
@r1 = y 
@r2 = color 

Mode4PlotPixel: 
   ldr r12,=VideoBuffer       @ base address in VRAM, depends on page flipping
   add r12,r12,r0 
   ands r0,r0,#0x1 
   add r12,r12,r1,lsl #8 
   sub r12,r12,r1,lsl #4 
   ldreqb r1,[r12,#1] 
   addeq r1,r2,r1,lsl #8 
   ldrneb r1,[r12,#-1] 
   addne r1,r1,r2,lsl #8 
   strh r1,[r12,-r0] 
   bx lr
   
.end

   
   

    Source: geocities.com/v_d_d/gba

               ( geocities.com/v_d_d)