Use Supexec() to query EdDI version. Fixes for Coldfire CPU build. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Wed, 22 May 2019 23:10:33 +0200
branchSDL-1.2
changeset 1274899db0741486d
parent 12722 33940ce0a0ba
child 12749 af9681b14e85
Use Supexec() to query EdDI version. Fixes for Coldfire CPU build.
Contributed by Miro Kropacek
src/video/ataricommon/SDL_atarieddi.S
     1.1 --- a/src/video/ataricommon/SDL_atarieddi.S	Wed Apr 24 20:28:21 2019 +0100
     1.2 +++ b/src/video/ataricommon/SDL_atarieddi.S	Wed May 22 23:10:33 2019 +0200
     1.3 @@ -33,10 +33,38 @@
     1.4  /*--- Vector installer ---*/
     1.5  
     1.6  _Atari_get_EdDI_version:
     1.7 -	movel	sp@(4),a0	/* Value of EdDI cookie */
     1.8 +#if defined(__mcoldfire__)
     1.9 +	movel	sp@(4),a0
    1.10 +	movel	a0,eddi_cookie
    1.11 +	lea	sp@(-8),sp
    1.12 +	moveml	d2/a2,sp@
    1.13 +#else
    1.14 +	movel	sp@(4),eddi_cookie
    1.15 +	moveml	d2/a2,sp@-
    1.16 +#endif
    1.17 +
    1.18 +	/* Supexec() to avoid crash on FreeMiNT with MP */
    1.19 +	pea	get_EdDI_version(pc)
    1.20 +	movew	#38,sp@-
    1.21 +	trap	#14
    1.22 +	addql	#6,sp
    1.23 +
    1.24 +#if defined(__mcoldfire__)
    1.25 +	moveml	sp@,d2/a2
    1.26 +	lea	sp@(8),sp
    1.27 +#else
    1.28 +	moveml	sp@+,d2/a2
    1.29 +#endif
    1.30 +	rts
    1.31 +
    1.32 +get_EdDI_version:
    1.33 +	movel	eddi_cookie,a0
    1.34  
    1.35  	/* Call EdDI function #0 */
    1.36  	clrw	d0
    1.37 -	jsr	(a0)
    1.38 +	jmp	(a0)
    1.39  
    1.40 -	rts
    1.41 +	.bss
    1.42 +
    1.43 +	.even
    1.44 +	.comm	eddi_cookie, 4