5 %define which
[ebp+36] ; int which
6 %define line
[ebp+40] ; int line
7 %define where
[ebp+44] ; unsigned char *where
9 %define vram
[ebp+24] ; unsigned char *vram
10 %define reg
[ebp+28] ; unsigned char reg[0x20]
11 %define highpal
[ebp+32] ; unsigned int *highpal
13 ;%define cache_align times ($$-$) & 3 nop ; Align to 4-byte boundary
14 ;%define cache_align times ($$-$) & 7 nop ; Align to 8-byte boundary
15 %define cache_align times
($$
-$
) & 31 nop ; Align to 32-byte boundary
18 global drawtile1_solid
20 global drawtile2_solid
22 global drawtile3_solid
24 global drawtile4_solid
29 xor %1, %2 ; Triple XOR for a neat register exchange ;)
34 %macro blit_pixel1
1-* ; 8bpp blitting, solid
45 %macro blit_pixel1_trans
1-* ; 8bpp blitting, transparent
58 %macro blit_pixel2
1-* ; 16bpp blitting, solid
70 %macro blit_pixel2_trans
1-* ; 16bpp blitting, transparent
84 %macro blit_pixel3
1-* ; 24bpp blitting, solid
90 lea edx, [esi+eax*4+1]
100 %macro blit_pixel3_trans
1-* ; 24bpp blitting, transparent
107 lea edx, [esi+eax*4+1]
121 %macro blit_pixel4
1-* ; 32bpp blitting, solid
133 %macro blit_pixel4_trans
1-* ; 32bpp blitting, transparent
147 ; ----------------------------------------
148 ; int _asm_tiles_init
149 ; (unsigned char *vram, unsigned char *reg, unsigned char *highpal)
150 ; ----------------------------------------
180 ; ----------------------------------------
181 ; int _drawtile1_solid
182 ; (int which, int line, unsigned char *where)
183 ; ----------------------------------------
255 jz near .x_not_flipped
259 blit_pixel1
0x0f000000, 24 ; pixel 8
260 blit_pixel1
0xf0000000, 28 ; ..... 7
261 blit_pixel1
0x000f0000, 16 ; ..... 6
262 blit_pixel1
0x00f00000, 20 ; ..... 5
263 blit_pixel1
0x00000f00, 8 ; ..... 4
264 blit_pixel1
0x0000f000, 12 ; ..... 3
265 blit_pixel1
0x0000000f ; ..... 2
266 blit_pixel1
0x000000f0, 4 ; ..... 1
274 blit_pixel1
0x000000f0, 4 ; pixel 1
275 blit_pixel1
0x0000000f ; ..... 2
276 blit_pixel1
0x0000f000, 12 ; ..... 3
277 blit_pixel1
0x00000f00, 8 ; ..... 4
278 blit_pixel1
0x00f00000, 20 ; ..... 5
279 blit_pixel1
0x000f0000, 16 ; ..... 6
280 blit_pixel1
0xf0000000, 28 ; ..... 7
281 blit_pixel1
0x0f000000, 24 ; ..... 8
293 ; ----------------------------------------
361 jz near .cleanup
; Don't waste time if the tile is blank!
366 jz near .x_not_flipped
370 blit_pixel1_trans
0x0f000000, 24 ; pixel 8
371 blit_pixel1_trans
0xf0000000, 28 ; ..... 7
372 blit_pixel1_trans
0x000f0000, 16 ; ..... 6
373 blit_pixel1_trans
0x00f00000, 20 ; ..... 5
374 blit_pixel1_trans
0x00000f00, 8 ; ..... 4
375 blit_pixel1_trans
0x0000f000, 12 ; ..... 3
376 blit_pixel1_trans
0x0000000f ; ..... 2
377 blit_pixel1_trans
0x000000f0, 4 ; ..... 1
385 blit_pixel1_trans
0x000000f0, 4 ; pixel 1
386 blit_pixel1_trans
0x0000000f ; ..... 2
387 blit_pixel1_trans
0x0000f000, 12 ; ..... 3
388 blit_pixel1_trans
0x00000f00, 8 ; ..... 4
389 blit_pixel1_trans
0x00f00000, 20 ; ..... 5
390 blit_pixel1_trans
0x000f0000, 16 ; ..... 6
391 blit_pixel1_trans
0xf0000000, 28 ; ..... 7
392 blit_pixel1_trans
0x0f000000, 24 ; ..... 8
404 ; ----------------------------------------
429 mov eax, [ecx + edx*4]
484 jz near .x_not_flipped
488 blit_pixel2
0x0f000000, 24 ; pixel 8
489 blit_pixel2
0xf0000000, 28 ; ..... 7
490 blit_pixel2
0x000f0000, 16 ; ..... 6
491 blit_pixel2
0x00f00000, 20 ; ..... 5
492 blit_pixel2
0x00000f00, 8 ; ..... 4
493 blit_pixel2
0x0000f000, 12 ; ..... 3
494 blit_pixel2
0x0000000f ; ..... 2
495 blit_pixel2
0x000000f0, 4 ; ..... 1
503 blit_pixel2
0x000000f0, 4 ; pixel 1
504 blit_pixel2
0x0000000f ; ..... 2
505 blit_pixel2
0x0000f000, 12 ; ..... 3
506 blit_pixel2
0x00000f00, 8 ; ..... 4
507 blit_pixel2
0x00f00000, 20 ; ..... 5
508 blit_pixel2
0x000f0000, 16 ; ..... 6
509 blit_pixel2
0xf0000000, 28 ; ..... 7
510 blit_pixel2
0x0f000000, 24 ; ..... 8
521 ; ----------------------------------------
589 jz near .cleanup
; Don't waste time if the tile is blank!
594 jz near .x_not_flipped
598 blit_pixel2_trans
0x0f000000, 24 ; pixel 8
599 blit_pixel2_trans
0xf0000000, 28 ; ..... 7
600 blit_pixel2_trans
0x000f0000, 16 ; ..... 6
601 blit_pixel2_trans
0x00f00000, 20 ; ..... 5
602 blit_pixel2_trans
0x00000f00, 8 ; ..... 4
603 blit_pixel2_trans
0x0000f000, 12 ; ..... 3
604 blit_pixel2_trans
0x0000000f ; ..... 2
605 blit_pixel2_trans
0x000000f0, 4 ; ..... 1
613 blit_pixel2_trans
0x000000f0, 4 ; pixel 1
614 blit_pixel2_trans
0x0000000f ; ..... 2
615 blit_pixel2_trans
0x0000f000, 12 ; ..... 3
616 blit_pixel2_trans
0x00000f00, 8 ; ..... 4
617 blit_pixel2_trans
0x00f00000, 20 ; ..... 5
618 blit_pixel2_trans
0x000f0000, 16 ; ..... 6
619 blit_pixel2_trans
0xf0000000, 28 ; ..... 7
620 blit_pixel2_trans
0x0f000000, 24 ; ..... 8
630 ; ----------------------------------------
653 mov eax, [ecx + edx*4]
708 jz near .x_not_flipped
712 blit_pixel3
0x0f000000, 24 ; pixel 8
713 blit_pixel3
0xf0000000, 28 ; ..... 7
714 blit_pixel3
0x000f0000, 16 ; ..... 6
715 blit_pixel3
0x00f00000, 20 ; ..... 5
716 blit_pixel3
0x00000f00, 8 ; ..... 4
717 blit_pixel3
0x0000f000, 12 ; ..... 3
718 blit_pixel3
0x0000000f ; ..... 2
719 blit_pixel3
0x000000f0, 4 ; ..... 1
727 blit_pixel3
0x000000f0, 4 ; pixel 1
728 blit_pixel3
0x0000000f ; ..... 2
729 blit_pixel3
0x0000f000, 12 ; ..... 3
730 blit_pixel3
0x00000f00, 8 ; ..... 4
731 blit_pixel3
0x00f00000, 20 ; ..... 5
732 blit_pixel3
0x000f0000, 16 ; ..... 6
733 blit_pixel3
0xf0000000, 28 ; ..... 7
734 blit_pixel3
0x0f000000, 24 ; ..... 8
746 ; ----------------------------------------
814 jz near .cleanup
; Don't waste time if the tile is blank!
819 jz near .x_not_flipped
823 blit_pixel3_trans
0x0f000000, 24 ; pixel 8
824 blit_pixel3_trans
0xf0000000, 28 ; ..... 7
825 blit_pixel3_trans
0x000f0000, 16 ; ..... 6
826 blit_pixel3_trans
0x00f00000, 20 ; ..... 5
827 blit_pixel3_trans
0x00000f00, 8 ; ..... 4
828 blit_pixel3_trans
0x0000f000, 12 ; ..... 3
829 blit_pixel3_trans
0x0000000f ; ..... 2
830 blit_pixel3_trans
0x000000f0, 4 ; ..... 1
838 blit_pixel3_trans
0x000000f0, 4 ; pixel 1
839 blit_pixel3_trans
0x0000000f ; ..... 2
840 blit_pixel3_trans
0x0000f000, 12 ; ..... 3
841 blit_pixel3_trans
0x00000f00, 8 ; ..... 4
842 blit_pixel3_trans
0x00f00000, 20 ; ..... 5
843 blit_pixel3_trans
0x000f0000, 16 ; ..... 6
844 blit_pixel3_trans
0xf0000000, 28 ; ..... 7
845 blit_pixel3_trans
0x0f000000, 24 ; ..... 8
857 ; ----------------------------------------
880 mov eax, [ecx + edx*4]
935 jz near .x_not_flipped
939 blit_pixel4
0x0f000000, 24 ; pixel 8
940 blit_pixel4
0xf0000000, 28 ; ..... 7
941 blit_pixel4
0x000f0000, 16 ; ..... 6
942 blit_pixel4
0x00f00000, 20 ; ..... 5
943 blit_pixel4
0x00000f00, 8 ; ..... 4
944 blit_pixel4
0x0000f000, 12 ; ..... 3
945 blit_pixel4
0x0000000f ; ..... 2
946 blit_pixel4
0x000000f0, 4 ; ..... 1
954 blit_pixel4
0x000000f0, 4 ; pixel 1
955 blit_pixel4
0x0000000f ; ..... 2
956 blit_pixel4
0x0000f000, 12 ; ..... 3
957 blit_pixel4
0x00000f00, 8 ; ..... 4
958 blit_pixel4
0x00f00000, 20 ; ..... 5
959 blit_pixel4
0x000f0000, 16 ; ..... 6
960 blit_pixel4
0xf0000000, 28 ; ..... 7
961 blit_pixel4
0x0f000000, 24 ; ..... 8
973 ; ----------------------------------------
1041 jz near .cleanup
; Don't waste time if the tile is blank!
1046 jz near .x_not_flipped
1050 blit_pixel4_trans
0x0f000000, 24 ; pixel 8
1051 blit_pixel4_trans
0xf0000000, 28 ; ..... 7
1052 blit_pixel4_trans
0x000f0000, 16 ; ..... 6
1053 blit_pixel4_trans
0x00f00000, 20 ; ..... 5
1054 blit_pixel4_trans
0x00000f00, 8 ; ..... 4
1055 blit_pixel4_trans
0x0000f000, 12 ; ..... 3
1056 blit_pixel4_trans
0x0000000f ; ..... 2
1057 blit_pixel4_trans
0x000000f0, 4 ; ..... 1
1065 blit_pixel4_trans
0x000000f0, 4 ; pixel 1
1066 blit_pixel4_trans
0x0000000f ; ..... 2
1067 blit_pixel4_trans
0x0000f000, 12 ; ..... 3
1068 blit_pixel4_trans
0x00000f00, 8 ; ..... 4
1069 blit_pixel4_trans
0x00f00000, 20 ; ..... 5
1070 blit_pixel4_trans
0x000f0000, 16 ; ..... 6
1071 blit_pixel4_trans
0xf0000000, 28 ; ..... 7
1072 blit_pixel4_trans
0x0f000000, 24 ; ..... 8
1090 ; ----------------------------------------
1092 %ifdef NASM_STACK_NOEXEC
1093 section .note.GNU
-stack noalloc noexec nowrite progbits