2 * assembly optimized versions of most funtions from draw2.c
\r
3 * (C) notaz, 2006-2008
\r
5 * This work is licensed under the terms of MAME license.
\r
6 * See COPYING file in the top-level directory.
\r
8 * this is highly specialized, be careful if changing related C code!
\r
11 #include "pico_int_o32.h"
\r
13 @ define these constants in your include file:
\r
14 @ .equiv START_ROW, 1
\r
15 @ .equiv END_ROW, 27
\r
16 @ one row means 8 pixels. If above example was used, (27-1)*8=208 lines would be rendered.
\r
27 @ void BackFillFull(void *dst, int reg7)
\r
29 .global BackFillFull
\r
32 stmfd sp!, {r4-r9,lr}
\r
38 orr r0, r0, r0, lsl #8
\r
39 orr r0, r0, r0, lsl #16
\r
41 mov r1, r0 @ 25 opcodes wasted?
\r
51 mov r12, #(END_ROW-START_ROW)*8
\r
58 stmia lr!, {r0-r9} @ 10*4*8
\r
69 ldmfd sp!, {r4-r9,lr}
\r
74 @ -------- some macros --------
\r
77 .macro add_c24 d s c
\r
78 add \d, \s, #(\c & 0x00ff00)
\r
80 add \d, \d, #(\c & 0x0000ff)
\r
83 add \d, \d, #(\c & 0xff0000)
\r
87 @ TileLineSinglecol (r1=pdest, r2=pixels8, r3=pal) r4: scratch, r0: pixels8_old
\r
88 .macro TileLineSinglecol notsinglecol=0
\r
89 and r2, r2, #0xf @ #0x0000000f
\r
91 cmp r2, r0, lsr #28 @ if these don't match,
\r
92 bicne r9, r9, #2 @ it is a sign that whole tile is not singlecolor (only it's lines may be)
\r
95 orr r4, r4, r4, lsl #8
\r
97 tst r1, #1 @ not aligned?
\r
103 strneb r4, [r1], #1 @ have a remaining unaligned pixel?
\r
107 orr r0, r0, r2, lsl #28 @ we will need the old palindex later
\r
111 @ TileNorm (r1=pdest, r2=pixels8, r3=pal) r0,r4: scratch
\r
112 .macro TileLineNorm
\r
113 ands r4, r0, r2, lsr #12 @ #0x0000f000
\r
116 ands r4, r0, r2, lsr #8 @ #0x00000f00
\r
119 ands r4, r0, r2, lsr #4 @ #0x000000f0
\r
122 ands r4, r0, r2 @ #0x0000000f
\r
125 ands r4, r0, r2, lsr #28 @ #0xf0000000
\r
128 ands r4, r0, r2, lsr #24 @ #0x0f000000
\r
131 ands r4, r0, r2, lsr #20 @ #0x00f00000
\r
134 ands r4, r0, r2, lsr #16 @ #0x000f0000
\r
139 @ TileFlip (r1=pdest, r2=pixels8, r3=pal) r0,r4: scratch
\r
140 .macro TileLineFlip
\r
141 ands r4, r0, r2, lsr #16 @ #0x000f0000
\r
144 ands r4, r0, r2, lsr #20 @ #0x00f00000
\r
147 ands r4, r0, r2, lsr #24 @ #0x0f000000
\r
150 ands r4, r0, r2, lsr #28 @ #0xf0000000
\r
153 ands r4, r0, r2 @ #0x0000000f
\r
156 ands r4, r0, r2, lsr #4 @ #0x000000f0
\r
159 ands r4, r0, r2, lsr #8 @ #0x00000f00
\r
162 ands r4, r0, r2, lsr #12 @ #0x0000f000
\r
167 @ Tile (r1=pdest, r3=pal, r9=prevcode, r10=Pico.vram) r2,r4,r7: scratch, r0=0xf
\r
168 .macro Tile hflip vflip
\r
169 mov r7, r9, lsl #13 @ r9=code<<8; addr=(code&0x7ff)<<4;
\r
170 add r7, r10, r7, lsr #16
\r
171 orr r9, r9, #3 @ emptytile=singlecolor=1, r9 must be <code_16> 00000xxx
\r
173 @ we read tilecodes in reverse order if we have vflip
\r
176 @ loop through 8 lines
\r
177 orr r9, r9, #(7<<24)
\r
180 0: @ singlecol_loop
\r
181 subs r9, r9, #(1<<24)
\r
182 add r1, r1, #328 @ set pointer to next line
\r
183 bmi 8f @ loop_exit with r0 restore
\r
186 ldr r2, [r7, #-4]! @ pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
\r
191 beq 2f @ empty line
\r
194 bne 3f @ not singlecolor
\r
201 subs r9, r9, #(1<<24)
\r
202 add r1, r1, #328 @ set pointer to next line
\r
203 bmi 8f @ loop_exit with r0 restore
\r
205 ldr r2, [r7, #-4]! @ next pack
\r
209 mov r0, #0xf @ singlecol_loop might have messed r0
\r
213 bic r9, r9, #3 @ if we are here, it means we have empty and not empty line
\r
216 3: @ not empty, not singlecol
\r
221 4: @ not empty, not singlecol loop
\r
222 subs r9, r9, #(1<<24)
\r
223 add r1, r1, #328 @ set pointer to next line
\r
226 ldr r2, [r7, #-4]! @ next pack
\r
231 beq 4b @ empty line
\r
234 beq 7f @ singlecolor line
\r
243 TileLineSinglecol 1
\r
249 add r9, r9, #(1<<24) @ fix r9
\r
250 sub r1, r1, #328*8 @ restore pdest pointer
\r
254 @ TileLineSinglecolAl (r1=pdest, r4,r7=color)
\r
255 .macro TileLineSinglecolAl0
\r
260 .macro TileLineSinglecolAl1
\r
264 strb r4, [r1], #1+320
\r
268 .macro TileLineSinglecolAl2
\r
275 .macro TileLineSinglecolAl3
\r
279 strb r4, [r1], #1+320
\r
283 @ TileSinglecol (r1=pdest, r2=pixels8, r3=pal) r4,r7: scratch, r0=0xf
\r
284 @ kaligned==1, if dest is always aligned
\r
285 .macro TileSinglecol kaligned=0
\r
286 and r4, r2, #0xf @ we assume we have good r2 from previous time
\r
288 orr r4, r4, r4, lsl #8
\r
289 orr r4, r4, r4, lsl #16
\r
293 tst r1, #2 @ not aligned?
\r
299 TileLineSinglecolAl0
\r
300 TileLineSinglecolAl0
\r
301 TileLineSinglecolAl0
\r
302 TileLineSinglecolAl0
\r
303 TileLineSinglecolAl0
\r
304 TileLineSinglecolAl0
\r
305 TileLineSinglecolAl0
\r
306 TileLineSinglecolAl0
\r
311 TileLineSinglecolAl1
\r
312 TileLineSinglecolAl1
\r
313 TileLineSinglecolAl1
\r
314 TileLineSinglecolAl1
\r
315 TileLineSinglecolAl1
\r
316 TileLineSinglecolAl1
\r
317 TileLineSinglecolAl1
\r
318 TileLineSinglecolAl1
\r
325 TileLineSinglecolAl2
\r
326 TileLineSinglecolAl2
\r
327 TileLineSinglecolAl2
\r
328 TileLineSinglecolAl2
\r
329 TileLineSinglecolAl2
\r
330 TileLineSinglecolAl2
\r
331 TileLineSinglecolAl2
\r
332 TileLineSinglecolAl2
\r
336 TileLineSinglecolAl3
\r
337 TileLineSinglecolAl3
\r
338 TileLineSinglecolAl3
\r
339 TileLineSinglecolAl3
\r
340 TileLineSinglecolAl3
\r
341 TileLineSinglecolAl3
\r
342 TileLineSinglecolAl3
\r
343 TileLineSinglecolAl3
\r
347 sub r1, r1, #328*8 @ restore pdest pointer
\r
352 @ DrawLayerTiles(*hcache, *scrpos, (cells<<24)|(nametab<<9)|(vscroll&0x3ff)<<11|(shift[width]<<8)|planeend, (ymask<<24)|(planestart<<16)|[htab||hscroll]
\r
354 @ void DrawLayerFull(int plane, int *hcache, int planestart, int planeend,
\r
355 @ struct PicoEState *est)
\r
357 .global DrawLayerFull
\r
361 stmfd sp!, {r4-r11,lr}
\r
363 mov r6, r1 @ hcache
\r
365 ldr r11, [r12, #OFS_EST_Pico]
\r
366 ldr r10, [r12, #OFS_EST_PicoMem_vram]
\r
367 ldrb r5, [r11, #OFS_Pico_video_reg+13] @ pvid->reg[13]
\r
368 ldrb r7, [r11, #OFS_Pico_video_reg+11]
\r
371 and lr, lr, #0x00ff0000 @ lr=cells
\r
373 mov r5, r5, lsl #10 @ htab=pvid->reg[13]<<9; (halfwords)
\r
374 add r5, r5, r0, lsl #1 @ htab+=plane
\r
375 bic r5, r5, #0x00ff0000 @ just in case
\r
377 tst r7, #3 @ full screen scroll? (if ==0)
\r
378 ldrb r7, [r11, #OFS_Pico_video_reg+16] @ ??hh??ww
\r
379 ldreqh r5, [r10, r5]
\r
380 biceq r5, r5, #0x0000fc00 @ r5=hscroll (0-0x3ff)
\r
381 movne r5, r5, lsr #1
\r
382 orrne r5, r5, #0x8000 @ this marks that we have htab pointer, not hscroll here
\r
386 orr r5, r5, r7, lsl #1+24
\r
387 orr r5, r5, #0x1f000000
\r
389 biclt r5, r5, #0x80000000
\r
390 biceq r5, r5, #0xc0000000
\r
391 bicgt r5, r5, #0xe0000000
\r
393 mov r9, r2, lsl #24
\r
394 orr r5, r5, r9, lsr #8 @ r5=(ymask<<24)|(trow<<16)|[htab||hscroll]
\r
398 subge r4, r4, #1 @ r4=shift[width] (5,6,6,7)
\r
401 orr lr, lr, r3, lsl #24 @ lr=(planeend<<24)|(cells<<16)|shift[width]
\r
404 mov r8, r8, lsl #24+5
\r
405 orr r8, r8, #0x1f000000
\r
409 ldreqb r4, [r11, #OFS_Pico_video_reg+2]
\r
410 moveq r4, r4, lsr #3
\r
411 ldrneb r4, [r11, #OFS_Pico_video_reg+4]
\r
413 orr lr, lr, r4, lsl #13 @ lr|=nametab_bits{3}<<13
\r
415 ldr r11,[sp, #9*4] @ est
\r
416 sub r4, r9, #(START_ROW<<24)
\r
417 ldr r11, [r11, #OFS_EST_Draw2FB]
\r
418 mov r4, r4, asr #24
\r
420 mla r11, r4, r7, r11 @ scrpos+=8*328*(planestart-START_ROW);
\r
422 @ Get vertical scroll value:
\r
423 add_c24 r7, r10, (OFS_PMEM_vsram-OFS_PMEM_vram)
\r
426 moveq r7, r7, lsl #22
\r
427 movne r7, r7, lsl #6
\r
428 mov r7, r7, lsr #22 @ r7=vscroll (10 bits)
\r
430 orr lr, lr, r7, lsl #3
\r
431 mov lr, lr, ror #24 @ packed: cccccccc nnnvvvvv vvvvvsss pppppppp: cells, nametab, vscroll, shift[width], planeend
\r
434 addne lr, lr, #1 @ we have vertically clipped tiles due to vscroll, so we need 1 more row
\r
437 str r7, [r6], #4 @ push y-offset to tilecache
\r
439 mla r11, r4, r7, r11 @ scrpos+=(8-(vscroll&7))*328;
\r
441 mov r9, #0xff000000 @ r9=(prevcode<<8)|flags: 1~tile empty, 2~tile singlecolor
\r
444 mov r4, lr, lsl #11
\r
445 mov r4, r4, lsr #25 @ r4=vscroll>>3 (7 bits)
\r
446 add r4, r4, r5, lsr #16 @ +trow
\r
447 and r4, r4, r5, lsr #24 @ &=ymask
\r
449 and r7, r7, #7 @ shift[width]
\r
451 and r0, r0, #0x7000 @ nametab
\r
452 add r12,r0, r4, lsl r7 @ nametab_row = nametab + (((trow+(vscroll>>3))&ymask)<<shift[width]);
\r
454 mov r4, lr, lsr #24
\r
455 orr r12,r12,r4, lsl #23
\r
456 mov r12,r12,lsl #1 @ (nametab_row|(cells<<24)) (halfword compliant)
\r
460 moveq r7, r5, lsl #22 @ hscroll (0-3FFh)
\r
461 moveq r7, r7, lsr #22
\r
462 beq .rtr_hscroll_done
\r
464 @ get hscroll from htab
\r
465 mov r7, r5, lsl #17
\r
466 ands r4, r5, #0x00ff0000
\r
467 add r7, r7, r4, lsl #5 @ +=trow<<4
\r
468 andne r4, lr, #0x3800
\r
469 subne r7, r7, r4, lsl #7 @ if(trow) htaddr-=(vscroll&7)<<1;
\r
470 mov r7, r7, lsr #16 @ halfwords
\r
474 and r8, r8, #0xff000000
\r
475 rsb r4, r7, #0 @ r4=tilex=(-ts->hscroll)>>3
\r
478 orr r8, r8, r4 @ r8=(xmask<<24)|tilex
\r
482 add r7, r7, #1 @ r7=dx=((ts->hscroll-1)&7)+1
\r
485 subeq r12,r12, #0x01000000 @ we will loop cells+1 times, so loop less when there is no hscroll
\r
487 add r1, r11, r7 @ r1=pdest
\r
491 @ r4 & r7 are scratch in this loop
\r
492 .rtrloop: @ 40-41 times
\r
494 subs r12,r12, #0x01000000
\r
499 and r7, r8, r8, lsr #24
\r
500 add r7, r10, r7, lsl #1
\r
501 bic r4, r12, #0xff000000 @ Pico.vram[nametab_row+(tilex&xmask)];
\r
502 ldrh r7, [r7, r4] @ r7=code (int, but from unsigned, no sign extend)
\r
508 bne .rtr_notsamecode
\r
509 @ we know stuff about this tile already
\r
511 bne .rtrloop @ empty tile
\r
513 bne .rtr_singlecolor @ singlecolor tile
\r
517 and r4, r9, #0x600000
\r
518 mov r9, r7, lsl #8 @ remember new code
\r
521 and r7, r7, #0x6000
\r
522 mov r3, r7, asr #9 @ r3=pal=((code&0x6000)>>9);
\r
525 tst r9, #0x100000 @ vflip?
\r
528 tst r9, #0x080000 @ hflip?
\r
531 @ Tile (r1=pdest, r3=pal, r9=prevcode, r10=Pico.vram) r2,r4,r7: scratch, r0=0xf
\r
540 tst r9, #0x080000 @ hflip?
\r
541 bne .rtr_vflip_hflip
\r
555 @ *(*hcache)++ = code|(dx<<16)|(trow<<27);
\r
557 orr r7, r7, r4, lsl #16
\r
558 and r4, r5, #0x00ff0000
\r
559 orr r7, r7, r4, lsl #11 @ (trow<<27)
\r
560 str r7, [r6], #4 @ cache hi priority tile
\r
564 add r5, r5, #0x00010000
\r
566 cmp r4, lr, lsl #24
\r
567 bge .rtrloop_outer_exit
\r
568 add r11, r11, #328*8
\r
571 .rtrloop_outer_exit:
\r
573 @ terminate cache list
\r
575 str r0, [r6] @ save cache pointer
\r
577 ldmfd sp!, {r4-r11,lr}
\r
583 @ void DrawTilesFromCacheF(int *hc, struct PicoEState *est)
\r
585 .global DrawTilesFromCacheF
\r
587 DrawTilesFromCacheF:
\r
588 stmfd sp!, {r4-r10,lr}
\r
590 mov r9, #0xff000000 @ r9=prevcode=-1
\r
591 mvn r6, #0 @ r6=prevy=-1
\r
593 ldr r4, [r1, #OFS_EST_Draw2FB]
\r
594 ldr r2, [r0], #4 @ read y offset
\r
597 sub r12, r2, #(328*8*START_ROW) @ r12=scrpos
\r
599 ldr r10, [r1, #OFS_EST_PicoMem_vram]
\r
604 @ *hcache++ = code|(dx<<16)|(trow<<27); // cache it
\r
607 ldr r7, [r8], #4 @ read code
\r
608 movs r1, r7, lsr #16 @ r1=dx;
\r
609 ldmeqfd sp!, {r4-r10,pc} @ dx is never zero, this must be a terminator, return
\r
612 cmp r6, r7, lsr #27
\r
613 movne r6, r7, lsr #27
\r
615 mlane r5, r4, r6, r12 @ r5=pd = scrpos + prevy*328*8
\r
617 bic r1, r1, #0xf800
\r
618 add r1, r5, r1 @ r1=pdest (halfwords)
\r
620 mov r7, r7, lsl #16
\r
621 mov r7, r7, lsr #16
\r
624 bne .dtfcf_notsamecode
\r
625 @ we know stuff about this tile already
\r
627 bne .dtfcf_loop @ empty tile
\r
629 bne .dtfcf_singlecolor @ singlecolor tile
\r
632 .dtfcf_notsamecode:
\r
633 and r4, r9, #0x600000
\r
634 mov r9, r7, lsl #8 @ remember new code
\r
637 and r7, r7, #0x6000
\r
638 mov r3, r7, asr #9 @ r3=pal=((code&0x6000)>>9);
\r
643 tst r9, #0x100000 @ vflip?
\r
646 tst r9, #0x080000 @ hflip?
\r
649 @ Tile (r1=pdest, r3=pal, r9=prevcode, r10=Pico.vram) r2,r4,r7: scratch, r0=0xf
\r
658 tst r9, #0x080000 @ hflip?
\r
659 bne .dtfcf_vflip_hflip
\r
664 .dtfcf_vflip_hflip:
\r
668 .dtfcf_singlecolor:
\r
677 @ (tile_start<<16)|row_start
\r
678 @ void DrawWindowFull(int start, int end, int prio, struct PicoEState *est)
\r
680 .global DrawWindowFull
\r
683 stmfd sp!, {r4-r11,lr}
\r
685 ldr r11, [r3, #OFS_EST_Pico]
\r
686 ldrb r12, [r11, #OFS_Pico_video_reg+3] @ pvid->reg[3]
\r
687 mov r12, r12, lsl #10
\r
689 ldr r4, [r11, #OFS_Pico_video_reg+12]
\r
690 mov r5, #1 @ nametab_step
\r
691 tst r4, #1 @ 40 cell mode?
\r
692 andne r12, r12, #0xf000 @ 0x3c<<10
\r
693 andeq r12, r12, #0xf800
\r
694 movne r5, r5, lsl #7
\r
695 moveq r5, r5, lsl #6 @ nametab_step
\r
698 mla r12, r5, r4, r12 @ nametab += nametab_step*start;
\r
700 ldr r10, [r3, #OFS_EST_PicoMem_vram]
\r
701 mov r4, r0, lsr #16 @ r4=start_cell_h
\r
702 add r7, r12, r4, lsl #1
\r
704 @ fetch the first code now
\r
706 cmp r2, r7, lsr #15
\r
707 ldmnefd sp!, {r4-r11,pc} @ hack: simply assume that whole window uses same priority
\r
709 rsb r8, r4, r1, lsr #16 @ cells (h)
\r
710 orr r8, r8, r4, lsl #8
\r
711 mov r4, r1, lsl #24
\r
712 sub r4, r4, r0, lsl #24
\r
713 orr r8, r8, r4, lsr #8 @ r8=cells_h|(start_cell_h<<8)|(cells_v<<16)
\r
714 sub r8, r8, #0x010000 @ adjust for algo
\r
716 mov r9, #0xff000000 @ r9=prevcode=-1
\r
718 ldr r11, [r3, #OFS_EST_Draw2FB]
\r
720 add r11, r11, #328*8
\r
721 sub r4, r4, #START_ROW
\r
725 mla r11, r7, r4, r11 @ scrpos+=8*328*(start-START_ROW);
\r
729 and r6, r8, #0xff00 @ r6=tilex
\r
730 add r1, r11, r6, lsr #5 @ r1=pdest
\r
731 add r6, r12, r6, lsr #7
\r
732 add r6, r10, r6 @ r6=Pico.vram+nametab+tilex
\r
733 orr r8, r8, r8, lsl #24
\r
734 sub r8, r8, #0x01000000 @ cell loop counter
\r
737 @ r4 & r7 are scratch in this loop
\r
740 subs r8, r8, #0x01000000
\r
744 ldrh r7, [r6], #2 @ r7=code
\r
747 bne .dwf_notsamecode
\r
748 @ we know stuff about this tile already
\r
750 bne .dwfloop @ empty tile
\r
752 bne .dwf_singlecolor @ singlecolor tile
\r
756 and r4, r9, #0x600000
\r
757 mov r9, r7, lsl #8 @ remember new code
\r
760 and r7, r7, #0x6000
\r
761 mov r3, r7, asr #9 @ r3=pal=((code&0x6000)>>9);
\r
765 tst r9, #0x100000 @ vflip?
\r
768 tst r9, #0x080000 @ hflip?
\r
771 @ Tile (r1=pdest, r3=pal, r9=prevcode, r10=PicoMem.vram)
\r
772 @ r2,r4,r7: scratch, r0=0xf
\r
781 tst r9, #0x080000 @ hflip?
\r
782 bne .dwf_vflip_hflip
\r
796 bic r8, r8, #0xff000000 @ fix r8
\r
797 subs r8, r8, #0x010000
\r
798 ldmmifd sp!, {r4-r11,pc}
\r
799 add r11, r11, #328*8
\r
800 add r12, r12, r5 @ nametab+=nametab_step
\r
806 @ ---------------- sprites ---------------
\r
808 .macro SpriteLoop hflip vflip
\r
810 mov r1, r5, lsr #24 @ height
\r
812 mla r11, r1, r0, r11 @ scrpos+=height*328*8;
\r
813 add r12, r12, r1, lsl #3 @ sy+=height*8
\r
818 add r8, r8, r1, lsl #3 @ sx+=width*8
\r
822 add r9, r9, r5, lsr #16
\r
823 sub r5, r5, #1 @ sub width
\r
827 cmp r8, #0 @ skip tiles hidden on the left of screen
\r
830 add r9, r9, r5, lsr #16
\r
839 add r8, r8, #8 @ sx+=8
\r
841 bic r5, r5, #0xff000000 @ fix height
\r
842 orr r5, r5, r5, lsl #16
\r
845 sub r5, r5, #1 @ width--
\r
846 movs r1, r5, lsl #24
\r
847 ldmmifd sp!, {r4-r11,pc} @ end of tile
\r
849 subs r8, r8, #8 @ sx-=8
\r
850 ldmlefd sp!, {r4-r11,pc} @ tile offscreen
\r
853 ldmgefd sp!, {r4-r11,pc} @ tile offscreen
\r
855 mov r6, r12 @ r6=sy
\r
856 add r1, r11, r8 @ pdest=scrpos+sx
\r
860 add r9, r9, #1<<8 @ tile++
\r
862 add r6, r6, #8 @ sy+=8
\r
868 subs r5, r5, #0x01000000
\r
871 sub r6, r6, #8 @ sy-=8
\r
876 cmp r6, #(START_ROW*8)
\r
879 cmp r6, #(END_ROW*8+8)
\r
882 @ Tile (r1=pdest, r3=pal, r9=prevcode, r10=PicoMem.vram)
\r
883 @ r2,r4,r7: scratch, r0=0xf
\r
884 Tile \hflip, \vflip
\r
888 @ void DrawSpriteFull(unsigned int *sprite, struct PicoEState *est)
\r
890 .global DrawSpriteFull
\r
893 stmfd sp!, {r4-r11,lr}
\r
895 ldr r3, [r0] @ sprite[0]
\r
897 mov r6, r5, lsr #30
\r
898 add r6, r6, #1 @ r6=width
\r
900 mov r5, r5, lsr #30
\r
901 add r5, r5, #1 @ r5=height
\r
903 mov r12, r3, lsl #23
\r
904 mov r12, r12, lsr #23
\r
906 ldr lr, [r0, #4] @ lr=code
\r
907 sub r12, r12, #0x78 @ r12=sy
\r
909 mov r8, r8, lsr #23
\r
910 sub r8, r8, #0x78 @ r8=sx
\r
912 mov r9, lr, lsl #21
\r
913 mov r9, r9, lsr #13 @ r9=tile<<8
\r
915 and r3, lr, #0x6000
\r
916 mov r3, r3, lsr #9 @ r3=pal=((code>>9)&0x30);
\r
918 ldr r11, [r1, #OFS_EST_Draw2FB]
\r
919 ldr r10, [r1, #OFS_EST_PicoMem_vram]
\r
920 sub r1, r12, #(START_ROW*8)
\r
922 mla r11, r1, r0, r11 @ scrpos+=(sy-START_ROW*8)*328;
\r
924 orr r5, r5, r5, lsl #16 @
\r
925 orr r5, r6, r5, lsl #8 @ r5=width|(height<<8)|(height<<24)
\r
927 tst lr, #0x1000 @ vflip?
\r
930 tst lr, #0x0800 @ hflip?
\r
939 tst lr, #0x0800 @ hflip?
\r
940 bne .dsf_vflip_hflip
\r
949 @ vim:filetype=armasm
\r