Wow, that must be the first time ever I've found assembler easier to read
than C... :)
// Wigren
Sunday 30 September 2001 21.59 skrev du:
> Ive been trying to learn asm so I can help Ben wirh the scale2x code.
> Ive managed to get a small start that really doesn't speed things up but
>
> maybe after awhile may get better. Heres what Ive got if someone wants
> to tweak and play with it (x86 only code).
> This just replaces the first (if else) with asm.
>
>
> Just coded for the function so far.
>
> static void effect_scale2x_16_32
>
> --------
> added just after the while(count) {
>
> s0 = (UINT32 *)(((UINT32 *)lookup)[((UINT16*)src0)[0]]);
> s1 = (UINT32 *)(((UINT32 *)lookup)[((UINT16*)src1)[0]]);
> ------
> comment out
> if (((UINT16*)src1)[-1] == ((UINT16*)src0)[0] &&
> ((UINT16*)src2)[0] != ((UINT16*)src0)[0] && ((UINT16*)src1)[1] !=
> ((UINT16*)src0)[0])
> *((UINT32*)dst0) = ((UINT32 *)lookup)[((UINT16*)src0)[0]];
>
> else *((UINT32*)dst0) = ((UINT32
> *)lookup)[((UINT16*)src1)[0]];
> ------
>
> add after the last (if else)
> __asm__ __volatile__(
> "cmp -16(%3),%2\n"
> "jne 1f\n"
> "cmp %4,%2\n"
> "je 1f\n"
> "cmp 16(%3),%2\n"
> "je 1f\n"
> "movl %5, 0(%0)\n"
> "jmp 2f\n"
> "1:\n"
> "movl %6,0(%0)\n"
> "2:\n"
>
> : "=r" ((UINT32*)(dst0)), "=r" ((UINT32*)(dst1))
> : "r"((UINT16*)(src0)), "r" ((UINT16*)(src1)), \
>
> "r" ((UINT16*)(src2)), "r" ((UINT32*)(s0)), "r"
> ((UINT32*)(s1))
> );
>
>
> Ken
_______________________________________________
Xmame mailing list
[EMAIL PROTECTED]
http://toybox.twisted.org.uk/mailman/listinfo/xmame