#37049 - anoneem - Sat Mar 05, 2005 6:23 pm
Sorry if there was topic like this, but in my country internet is still so expensive, that I wasn't able to check... Don't kick me, please.
Now the main message:
Hi! Problems again...
I am working in Mode 3 and trying to:
a)clear backbuffer (located at $02000000)
b)plot in it pixel
c)copy buffer to vram
Problems are:
1.if procedure czysc (clearbuff) is included, screen is black
2.if the procedure isn't called, effect is better, but not the best, becaouse 3.plotted dot is flashing - i tought that maybe vblnk could fix it, but I was wrong
4.when i tried to draw a simple horizontal line by that way:
...the screen was all filled by $ffff.
WHY?!?
Here goes the code. Please, help me to fix bugs listed above.
As always sorry for my english bugs :p.
Now the main message:
Hi! Problems again...
I am working in Mode 3 and trying to:
a)clear backbuffer (located at $02000000)
b)plot in it pixel
c)copy buffer to vram
Problems are:
1.if procedure czysc (clearbuff) is included, screen is black
2.if the procedure isn't called, effect is better, but not the best, becaouse 3.plotted dot is flashing - i tought that maybe vblnk could fix it, but I was wrong
4.when i tried to draw a simple horizontal line by that way:
Code: |
rysuj:
stmfd r13!, {r14} ldr r6, =#10 ldr r0, =$02000000 ldr r1, =#120 ldr r2, =#80 ldr r3, =#240 ldr r4, =$ffff .plot mla r5, r2, r3, r1 add r0, r0, r5, lsl#1 strh r4, [r0] add r1, r1, #1 sub r6, r6, #1 bne plot ldmfd r13!, {r14} |
...the screen was all filled by $ffff.
WHY?!?
Here goes the code. Please, help me to fix bugs listed above.
Code: |
@textarea
ldr r0, =0x403 ldr r1, =0x4000000 str r0, [r1] ;mode 3 main: stmfd r13!, {r14} bl czysc ;clear backbuffer bl rysuj ;plot a point bl vblnk ;wait for vblank bl naekr ;copy backbuff to vram ldmfd r13!, {r14} b main czysc: stmfd r13!, {r14} ldr r0, =$02000000 ldr r1, =$0000 ldr r2, =#38400 .clear strh r1, [r0, #2]! sub r2, r2, #1 bne clear ldmfd r13!, {r14} rysuj: stmfd r13!, {r14} ldr r0, =$02000000 ldr r1, =#120 ldr r2, =#80 ldr r3, =#240 ldr r4, =$ffff mla r5, r2, r3, r1 add r0, r0, r5, lsl#1 strh r4, [r0] ldmfd r13!, {r14} naekr: stmfd r13!, {r14} ldr r0, =$02000000 ldr r1, =$06000000 ldr r2, =#38400 .onscr ldrh r3, [r0, #2]! strh r3, [r1, #2]! sub r2, r2, #1 bne onscr ldmfd r13!, {r14} vblnk: stmfd r13!, {r14} ldr r0, =#$04000000 .wait1 ldrh r1, [r0, #4] tst r1, #1 bne wait1 .wait2 ldrh r1, [r0, #4] tst r1, #1 beq wait2 ldmfd r14!, {r14} @pool @endarea |
As always sorry for my english bugs :p.