From e7ea07e8ce979ab3d0e6a16c06c9ca5c4dbeb7c5 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Wed, 22 May 2019 23:10:33 +0200 Subject: [PATCH] Use Supexec() to query EdDI version. Fixes for Coldfire CPU build. Contributed by Miro Kropacek --- src/video/ataricommon/SDL_atarieddi.S | 34 ++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/video/ataricommon/SDL_atarieddi.S b/src/video/ataricommon/SDL_atarieddi.S index d8cbf48f2..5fbbd337b 100644 --- a/src/video/ataricommon/SDL_atarieddi.S +++ b/src/video/ataricommon/SDL_atarieddi.S @@ -33,10 +33,38 @@ /*--- Vector installer ---*/ _Atari_get_EdDI_version: - movel sp@(4),a0 /* Value of EdDI cookie */ +#if defined(__mcoldfire__) + movel sp@(4),a0 + movel a0,eddi_cookie + lea sp@(-8),sp + moveml d2/a2,sp@ +#else + movel sp@(4),eddi_cookie + moveml d2/a2,sp@- +#endif + + /* Supexec() to avoid crash on FreeMiNT with MP */ + pea get_EdDI_version(pc) + movew #38,sp@- + trap #14 + addql #6,sp + +#if defined(__mcoldfire__) + moveml sp@,d2/a2 + lea sp@(8),sp +#else + moveml sp@+,d2/a2 +#endif + rts + +get_EdDI_version: + movel eddi_cookie,a0 /* Call EdDI function #0 */ clrw d0 - jsr (a0) + jmp (a0) - rts + .bss + + .even + .comm eddi_cookie, 4