Remove x86 asm pragmas for readpixel and drawpixel and replace them with their C versions.

This fixes a crash in the editor's 2D mode, reported by Paul B.

git-svn-id: https://svn.eduke32.com/eduke32@5781 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-06-15 07:08:48 +00:00
parent 3dba49a1e3
commit e06cabb8aa
2 changed files with 5 additions and 26 deletions

View file

@ -451,16 +451,9 @@ void copybufreverse(const void *S, void *D, int32_t c);
: "a" (__a), "d" (__d), "S" (__S), "D" (__D) : "ebx", "cc"); \ : "a" (__a), "d" (__d), "S" (__S), "D" (__D) : "ebx", "cc"); \
__d; }) __d; })
#define readpixel(D) \ FORCE_INLINE char readpixel(void *s) { return *(char *)s; }
({ void *__D=(D); int32_t __a; \ FORCE_INLINE void drawpixel(void *s, char a) { *(char *)s = a; }
__asm__ __volatile__ ("movb (%%edi), %%al" \
: "=a" (__a): "D" (__D) : "cc"); \
__a; })
#define drawpixel(D,a) \
({ void *__D=(D); int32_t __a=(a); \
__asm__ __volatile__ ("movb %%al, (%%edi)" \
: : "D" (__D), "a" (__a) : "memory", "cc"); \
0; })
#define clearbuf(D,c,a) \ #define clearbuf(D,c,a) \
({ void *__D=(D); int32_t __c=(c), __a=(a); \ ({ void *__D=(D); int32_t __c=(c), __a=(a); \
__asm__ __volatile__ ("rep; stosl" \ __asm__ __volatile__ ("rep; stosl" \

View file

@ -82,22 +82,8 @@ static __inline int32_t dmulscale32(int32_t a, int32_t d, int32_t S, int32_t D)
} }
} }
static __inline char readpixel(void *d) static __inline char readpixel(void *s) { return *(char *)s; }
{ static __inline void drawpixel(void *s, char a) { *(char *)s = a; }
_asm {
mov edx, d
mov al, byte ptr[edx]
}
}
static __inline void drawpixel(void *d, char a)
{
_asm {
mov edx, d
mov al, a
mov byte ptr[edx], al
}
}
static __inline void clearbuf(void *d, int32_t c, int32_t a) static __inline void clearbuf(void *d, int32_t c, int32_t a)
{ {