SDL-1.2: atari: don't use .comm directive

From 74b2f033dc2763f30837bf40a054bb8a3c32e30f Mon Sep 17 00:00:00 2001
From: Miro Kropacek <[EMAIL REDACTED]>
Date: Sat, 1 Jan 2022 20:37:52 +0100
Subject: [PATCH] atari: don't use .comm directive

This is doing something completely else! It (globally) allocates space in bss segment so it was totally pointless to put it in .data and even .text (XBRA was not working at all).

Replaced also in bss sections as we lose the option to align stuff plus .ds.X makes it more readable in general. Kept only in mintaudio as those are the only variables referenced globally.
---
 src/video/ataricommon/SDL_ataric2p.S       | 45 ++++++++++++++--------
 src/video/ataricommon/SDL_atarieddi.S      |  3 +-
 src/video/ataricommon/SDL_ikbdinterrupt.S  | 26 ++++++++-----
 src/video/ataricommon/SDL_xbiosinterrupt.S | 30 ++++++++++-----
 4 files changed, 69 insertions(+), 35 deletions(-)

diff --git a/src/video/ataricommon/SDL_ataric2p.S b/src/video/ataricommon/SDL_ataric2p.S
index 3cd1961b8..450003c53 100644
--- a/src/video/ataricommon/SDL_ataric2p.S
+++ b/src/video/ataricommon/SDL_ataric2p.S
@@ -303,7 +303,7 @@ _SDL_Atari_C2pConvert4:
 
 	movel	c2p_source,a0
 	movel	c2p_dest,a1
-	lea	_SDL_Atari_table_c2p,a2
+	lea	c2p_table,a2
 	movel	#0x00070001,d3
 #if defined(__mc68020__)
 	moveq	#0,d0
@@ -408,7 +408,7 @@ _SDL_Atari_C2pConvert4_pal:
 
 	moveml	d2-d3,sp@-
 
-	lea		_SDL_Atari_table_c2p,a1
+	lea	c2p_table,a1
 	movew	#255,d3
 c2p_pal_initbcl:
 	movew	a0@+,d0
@@ -436,17 +436,30 @@ c2p_pal_initbyte:
 	.bss
 
 	.even
-	.comm	_SDL_Atari_C2pConvert,4
-	.comm	_SDL_Atari_table_c2p,1024
-
-	.comm	c2p_source,4	/* Source framebuffer */
-	.comm	c2p_dest,4		/* Destination framebuffer */
-	.comm	c2p_width,4		/* Width of zone to convert */
-	.comm	c2p_height,4	/* Height of zone to convert */
-	.comm	c2p_dblligne,4	/* Double the lines while converting ? */
-	.comm	c2p_srcpitch,4	/* Source pitch */
-	.comm	c2p_dstpitch,4	/* Destination pitch */
-	.comm	c2p_cursrc,4	/* Current source line */
-	.comm	c2p_curdst,4	/* Current destination line */
-	.comm	c2p_rowlen,2	/* Line length in bytes */
-	.comm	c2p_row,2		/* Current line number */
+_SDL_Atari_C2pConvert:
+	.ds.l	1
+
+c2p_table:
+	.ds.l	1024/4
+c2p_source:
+	.ds.l	1	/* Source framebuffer */
+c2p_dest:
+	.ds.l	1		/* Destination framebuffer */
+c2p_width:
+	.ds.l	1		/* Width of zone to convert */
+c2p_height:
+	.ds.l	1	/* Height of zone to convert */
+c2p_dblligne:
+	.ds.l	1	/* Double the lines while converting ? */
+c2p_srcpitch:
+	.ds.l	1	/* Source pitch */
+c2p_dstpitch:
+	.ds.l	1	/* Destination pitch */
+c2p_cursrc:
+	.ds.l	1	/* Current source line */
+c2p_curdst:
+	.ds.l	1	/* Current destination line */
+c2p_rowlen:
+	.ds.w	1	/* Line length in bytes */
+c2p_row:
+	.ds.w	1		/* Current line number */
diff --git a/src/video/ataricommon/SDL_atarieddi.S b/src/video/ataricommon/SDL_atarieddi.S
index 5fbbd337b..8e2cbf8ce 100644
--- a/src/video/ataricommon/SDL_atarieddi.S
+++ b/src/video/ataricommon/SDL_atarieddi.S
@@ -67,4 +67,5 @@ get_EdDI_version:
 	.bss
 
 	.even
-	.comm	eddi_cookie, 4
+eddi_cookie:
+	.ds.l	1
diff --git a/src/video/ataricommon/SDL_ikbdinterrupt.S b/src/video/ataricommon/SDL_ikbdinterrupt.S
index a916e0c00..e13157271 100644
--- a/src/video/ataricommon/SDL_ikbdinterrupt.S
+++ b/src/video/ataricommon/SDL_ikbdinterrupt.S
@@ -168,8 +168,10 @@ ikbd_finbuffer:
 	.bss
 
 	.even
-	.comm	ikbd_ierb,1
-	.comm	ikbd_imrb,1
+ikbd_ierb:
+	.ds.b	1
+ikbd_imrb:
+	.ds.b	1
 
 /*--- Our custom IKBD vector ---*/
 
@@ -177,7 +179,8 @@ ikbd_finbuffer:
 	.even
 	.ascii	"XBRA"
 	.ascii	"LSDL"
-	.comm	old_ikbd,4*1
+old_ikbd:
+	.dc.l	0
 ikbd:
 #if defined(__mcoldfire__)
 	lea	sp@(-12),sp
@@ -392,13 +395,18 @@ ikbd_joystick:
 
 	.even
 _SDL_AtariIkbd_enabled:
-	.word	0
+	.dc.w	0
 
 	.bss
 
 	.even
-	.comm	_SDL_AtariIkbd_keyboard,128
-	.comm	_SDL_AtariIkbd_mousex,2
-	.comm	_SDL_AtariIkbd_mousey,2
-	.comm	_SDL_AtariIkbd_mouseb,2
-	.comm	_SDL_AtariIkbd_joystick,2
+_SDL_AtariIkbd_keyboard:
+	.ds.b	128
+_SDL_AtariIkbd_mousex:
+	.ds.w	1
+_SDL_AtariIkbd_mousey:
+	.ds.w	1
+_SDL_AtariIkbd_mouseb:
+	.ds.w	1
+_SDL_AtariIkbd_joystick:
+	.ds.w	1
diff --git a/src/video/ataricommon/SDL_xbiosinterrupt.S b/src/video/ataricommon/SDL_xbiosinterrupt.S
index c3ab09b78..6b0008440 100644
--- a/src/video/ataricommon/SDL_xbiosinterrupt.S
+++ b/src/video/ataricommon/SDL_xbiosinterrupt.S
@@ -185,7 +185,8 @@ no_restore_joystick:
 	.even
 	.ascii "XBRA"
 	.ascii "LSDL"
-	.comm	oldmousevector,4*1
+oldmousevector:
+	.dc.l	0
 newmousevector:
 #if defined(__mcoldfire__)
 	lea	sp@(-8),sp
@@ -244,20 +245,28 @@ no_mouse_lock:
 	rts
 
 	.data
+
 	.even
-	.comm	_SDL_AtariXbios_installmousevector,2*1
-	.comm	_SDL_AtariXbios_mouselock,2*1
-	.comm	_SDL_AtariXbios_mousex,2*1
-	.comm	_SDL_AtariXbios_mousey,2*1
-	.comm	_SDL_AtariXbios_mouseb,2*1
+_SDL_AtariXbios_installmousevector:
+	.dc.w	0
+_SDL_AtariXbios_mouselock:
+	.dc.w	0
+_SDL_AtariXbios_mousex:
+	.dc.w	0
+_SDL_AtariXbios_mousey:
+	.dc.w	0
+_SDL_AtariXbios_mouseb:
+	.dc.w	0
 
 /*--- Our joystick vector ---*/
 
 	.text
+
 	.even
 	.ascii "XBRA"
 	.ascii "LSDL"
-	.comm	oldjoystickvector,4*1
+oldjoystickvector:
+	.dc.l	0
 newjoystickvector:
 	movel	d0,sp@-
 
@@ -277,6 +286,9 @@ newjoystickvector:
 	rts
 
 	.data
+
 	.even
-	.comm	_SDL_AtariXbios_installjoystickvector,2*1
-	.comm	_SDL_AtariXbios_joystick,2*1
+_SDL_AtariXbios_installjoystickvector:
+	.dc.w	0
+_SDL_AtariXbios_joystick:
+	.dc.w	0