X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Fgfx.h;h=7e12554a8d56694df1d03f19a653ad60cce747a1;hp=b19c99249c24793efb46239ccabc8ffaf1245735;hb=62c84af3483abd59e3b6672559b19a9ea17ff14d;hpb=410d47f1459aa79505198d9d09462aeeaffc612a diff --git a/src/dos/gfx.h b/src/dos/gfx.h index b19c992..7e12554 100644 --- a/src/dos/gfx.h +++ b/src/dos/gfx.h @@ -15,7 +15,35 @@ int get_color_mask(unsigned int *rmask, unsigned int *gmask, unsigned int *bmask void set_palette(int idx, int r, int g, int b); +#ifdef __WATCOMC__ void wait_vsync(void); +#pragma aux wait_vsync = \ + "mov dx, 0x3da" \ + "l1:" \ + "in al, dx" \ + "and al, 0x8" \ + "jnz l1" \ + "l2:" \ + "in al, dx" \ + "and al, 0x8" \ + "jz l2" \ + modify[al dx]; +#endif + +#ifdef __DJGPP__ +#define wait_vsync() asm volatile ( \ + "mov $0x3da, %%dx\n\t" \ + "0:\n\t" \ + "in %%dx, %%al\n\t" \ + "and $8, %%al\n\t" \ + "jnz 0b\n\t" \ + "0:\n\t" \ + "in %%dx, %%al\n\t" \ + "and $8, %%al\n\t" \ + "jz 0b\n\t" \ + :::"%eax","%edx") +#endif + #ifdef __cplusplus }