src/video/ataricommon/SDL_ataric2p.S
author Sam Lantinga
Wed, 17 May 2006 08:18:28 +0000
branchSDL-1.3
changeset 1659 14717b52abc0
parent 1312 c9b51268668f
child 2859 99210400e8b9
permissions -rw-r--r--
Merge trunk-1.3-3
slouken@281
     1
/*
slouken@281
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@281
     4
slouken@281
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@281
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@281
     9
slouken@281
    10
    This library is distributed in the hope that it will be useful,
slouken@281
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@281
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@281
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@281
    18
slouken@281
    19
    Sam Lantinga
slouken@281
    20
    slouken@libsdl.org
slouken@281
    21
*/
slouken@281
    22
slouken@281
    23
/*
patmandin@734
    24
	Chunky to planar conversion routine
patmandin@734
    25
	1 byte/pixel -> 4 or 8 bit planes
slouken@281
    26
patmandin@734
    27
	Patrice Mandin
patmandin@734
    28
	Xavier Joubert
patmandin@734
    29
	Mikael Kalms
patmandin@734
    30
*/
slouken@281
    31
patmandin@734
    32
	.globl	_SDL_Atari_C2pConvert
patmandin@734
    33
	.globl	_SDL_Atari_C2pConvert8
patmandin@734
    34
	.globl	_SDL_Atari_C2pConvert4
patmandin@734
    35
	.globl	_SDL_Atari_C2pConvert4_pal
slouken@281
    36
slouken@281
    37
/* ------------	Conversion C2P, 8 bits ------------ */
slouken@281
    38
patmandin@734
    39
	.text
patmandin@734
    40
_SDL_Atari_C2pConvert8:
patmandin@734
    41
	movel	sp@(4),c2p_source
patmandin@734
    42
	movel	sp@(8),c2p_dest
patmandin@734
    43
	movel	sp@(12),c2p_width
patmandin@734
    44
	movel	sp@(16),c2p_height
patmandin@734
    45
	movel	sp@(20),c2p_dblligne
patmandin@734
    46
	movel	sp@(24),c2p_srcpitch
patmandin@734
    47
	movel	sp@(28),c2p_dstpitch
patmandin@734
    48
patmandin@734
    49
	moveml	d2-d7/a2-a6,sp@-
patmandin@734
    50
patmandin@734
    51
	movel	c2p_source,c2p_cursrc
patmandin@734
    52
	movel	c2p_dest,c2p_curdst
patmandin@734
    53
	movel	#0x0f0f0f0f,d4
patmandin@734
    54
	movel	#0x00ff00ff,d5
patmandin@734
    55
	movel	#0x55555555,d6
patmandin@734
    56
	movew	c2p_height+2,c2p_row
patmandin@734
    57
	movew	c2p_width+2,d0
patmandin@734
    58
	andw	#-8,d0
patmandin@734
    59
	movew	d0,c2p_rowlen
patmandin@734
    60
patmandin@734
    61
SDL_Atari_C2p8_rowloop:
patmandin@734
    62
patmandin@734
    63
	movel	c2p_cursrc,a0
patmandin@734
    64
	movel	c2p_curdst,a1
patmandin@734
    65
patmandin@734
    66
	movel	a0,a2
patmandin@734
    67
	addw	c2p_rowlen,a2
patmandin@734
    68
patmandin@734
    69
	movel	a0@+,d0
patmandin@734
    70
	movel	a0@+,d1
patmandin@734
    71
	movel	a0@+,d2
patmandin@734
    72
	movel	a0@+,d3
patmandin@734
    73
/*
patmandin@734
    74
	d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
patmandin@734
    75
	d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
patmandin@734
    76
	d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
patmandin@734
    77
	d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
patmandin@734
    78
*/
patmandin@734
    79
	movel	d1,d7
patmandin@734
    80
	lsrl	#4,d7
patmandin@734
    81
	eorl	d0,d7
patmandin@734
    82
	andl	d4,d7
patmandin@734
    83
	eorl	d7,d0
patmandin@734
    84
	lsll	#4,d7
patmandin@734
    85
	eorl	d7,d1
patmandin@734
    86
patmandin@734
    87
	movel	d3,d7
patmandin@734
    88
	lsrl	#4,d7
patmandin@734
    89
	eorl	d2,d7
patmandin@734
    90
	andl	d4,d7
patmandin@734
    91
	eorl	d7,d2
patmandin@734
    92
	lsll	#4,d7
patmandin@734
    93
	eorl	d7,d3
patmandin@734
    94
patmandin@734
    95
	movel	d2,d7
patmandin@734
    96
	lsrl	#8,d7
patmandin@734
    97
	eorl	d0,d7
patmandin@734
    98
 	andl	d5,d7
patmandin@734
    99
	eorl	d7,d0
patmandin@734
   100
	lsll	#8,d7
patmandin@734
   101
	eorl	d7,d2
patmandin@734
   102
patmandin@734
   103
	movel	d3,d7
patmandin@734
   104
	lsrl	#8,d7
patmandin@734
   105
	eorl	d1,d7
patmandin@734
   106
 	andl	d5,d7
patmandin@734
   107
	eorl	d7,d1
patmandin@734
   108
	lsll	#8,d7
patmandin@734
   109
	eorl	d7,d3
patmandin@734
   110
/*
patmandin@734
   111
	d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
patmandin@734
   112
	d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
patmandin@734
   113
	d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
patmandin@734
   114
	d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
patmandin@734
   115
*/
patmandin@734
   116
	bras	SDL_Atari_C2p8_start
patmandin@734
   117
patmandin@734
   118
SDL_Atari_C2p8_pix16:
patmandin@734
   119
patmandin@734
   120
	movel	a0@+,d0
patmandin@734
   121
	movel	a0@+,d1
patmandin@734
   122
	movel	a0@+,d2
patmandin@734
   123
	movel	a0@+,d3
patmandin@734
   124
/*
patmandin@734
   125
	d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
patmandin@734
   126
	d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
patmandin@734
   127
	d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
patmandin@734
   128
	d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
patmandin@734
   129
*/
patmandin@734
   130
	movel	d1,d7
patmandin@734
   131
	lsrl	#4,d7
patmandin@734
   132
	movel	a3,a1@+
patmandin@734
   133
	eorl	d0,d7
patmandin@734
   134
	andl	d4,d7
patmandin@734
   135
	eorl	d7,d0
patmandin@734
   136
	lsll	#4,d7
patmandin@734
   137
	eorl	d7,d1
patmandin@734
   138
patmandin@734
   139
	movel	d3,d7
patmandin@734
   140
	lsrl	#4,d7
patmandin@734
   141
	eorl	d2,d7
patmandin@734
   142
	andl	d4,d7
patmandin@734
   143
	eorl	d7,d2
patmandin@734
   144
	movel	a4,a1@+
patmandin@734
   145
	lsll	#4,d7
patmandin@734
   146
	eorl	d7,d3
patmandin@734
   147
patmandin@734
   148
	movel	d2,d7
patmandin@734
   149
	lsrl	#8,d7
patmandin@734
   150
	eorl	d0,d7
patmandin@734
   151
	andl	d5,d7
patmandin@734
   152
	eorl	d7,d0
patmandin@734
   153
	movel	a5,a1@+
patmandin@734
   154
	lsll	#8,d7
patmandin@734
   155
	eorl	d7,d2
slouken@281
   156
patmandin@734
   157
	movel	d3,d7
patmandin@734
   158
	lsrl	#8,d7
patmandin@734
   159
	eorl	d1,d7
patmandin@734
   160
	andl	d5,d7
patmandin@734
   161
	eorl	d7,d1
patmandin@734
   162
	movel	a6,a1@+
patmandin@734
   163
	lsll	#8,d7
patmandin@734
   164
	eorl	d7,d3
patmandin@734
   165
/*
patmandin@734
   166
	d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
patmandin@734
   167
	d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
patmandin@734
   168
	d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
patmandin@734
   169
	d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
patmandin@734
   170
*/
patmandin@734
   171
patmandin@734
   172
SDL_Atari_C2p8_start:
patmandin@734
   173
patmandin@734
   174
	movel	d2,d7
patmandin@734
   175
	lsrl	#1,d7
patmandin@734
   176
	eorl	d0,d7
patmandin@734
   177
	andl	d6,d7
patmandin@734
   178
	eorl	d7,d0
patmandin@734
   179
	addl	d7,d7
patmandin@734
   180
	eorl	d7,d2
patmandin@734
   181
patmandin@734
   182
	movel	d3,d7
patmandin@734
   183
	lsrl	#1,d7
patmandin@734
   184
	eorl	d1,d7
patmandin@734
   185
	andl	d6,d7
patmandin@734
   186
	eorl	d7,d1
patmandin@734
   187
	addl	d7,d7
patmandin@734
   188
	eorl	d7,d3
patmandin@734
   189
/*
patmandin@734
   190
	d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5
patmandin@734
   191
	d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1
patmandin@734
   192
	d2 = a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
patmandin@734
   193
	d3 = a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
patmandin@734
   194
*/
patmandin@734
   195
	movew	d2,d7
patmandin@734
   196
	movew	d0,d2
patmandin@734
   197
	swap	d2
patmandin@734
   198
	movew	d2,d0
patmandin@734
   199
	movew	d7,d2
patmandin@734
   200
patmandin@734
   201
	movew	d3,d7
patmandin@734
   202
	movew	d1,d3
patmandin@734
   203
	swap	d3
patmandin@734
   204
	movew	d3,d1
patmandin@734
   205
	movew	d7,d3
patmandin@734
   206
/*
patmandin@734
   207
	d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4
patmandin@734
   208
	d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0
patmandin@734
   209
	d2 = c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
patmandin@734
   210
	d3 = c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
patmandin@734
   211
*/
patmandin@734
   212
	movel	d2,d7
patmandin@734
   213
	lsrl	#2,d7
patmandin@734
   214
	eorl	d0,d7
patmandin@734
   215
	andl	#0x33333333,d7
patmandin@734
   216
	eorl	d7,d0
patmandin@734
   217
	lsll	#2,d7
patmandin@734
   218
	eorl	d7,d2
patmandin@734
   219
patmandin@734
   220
	movel	d3,d7
patmandin@734
   221
	lsrl	#2,d7
patmandin@734
   222
	eorl	d1,d7
patmandin@734
   223
	andl	#0x33333333,d7
patmandin@734
   224
	eorl	d7,d1
patmandin@734
   225
	lsll	#2,d7
patmandin@734
   226
	eorl	d7,d3
patmandin@734
   227
/*
patmandin@734
   228
	d0 = a7b7c7d7e7f7g7h7 i7j7k7l7m7n7o7p7 a6b6c6d6e6f6g6h6 i6j6k6l6m6n6o6p6
patmandin@734
   229
	d1 = a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2
patmandin@734
   230
	d2 = a5b5c5d5e5f5g5h5 i5j5k5l5m5n5o5p5 a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
patmandin@734
   231
	d3 = a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0
patmandin@734
   232
*/
patmandin@734
   233
	swap	d0
patmandin@734
   234
	swap	d1
patmandin@734
   235
	swap	d2
patmandin@734
   236
	swap	d3
patmandin@734
   237
patmandin@734
   238
	movel	d0,a6
patmandin@734
   239
	movel	d2,a5
patmandin@734
   240
	movel	d1,a4
patmandin@734
   241
	movel	d3,a3
patmandin@734
   242
patmandin@734
   243
	cmpl	a0,a2
patmandin@1086
   244
	bgt		SDL_Atari_C2p8_pix16
patmandin@734
   245
patmandin@734
   246
	movel	a3,a1@+
patmandin@734
   247
	movel	a4,a1@+
patmandin@734
   248
	movel	a5,a1@+
patmandin@734
   249
	movel	a6,a1@+
patmandin@734
   250
patmandin@734
   251
	/* Double the line ? */
patmandin@734
   252
patmandin@734
   253
	movel	c2p_srcpitch,d0
patmandin@734
   254
	movel	c2p_dstpitch,d1
patmandin@734
   255
patmandin@734
   256
	tstl	c2p_dblligne
patmandin@734
   257
	beqs	SDL_Atari_C2p8_nodblline
patmandin@734
   258
patmandin@734
   259
	movel	c2p_curdst,a0
patmandin@734
   260
	movel	a0,a1
patmandin@734
   261
	addl	d1,a1
patmandin@734
   262
patmandin@734
   263
	movew	c2p_width+2,d7
patmandin@734
   264
	lsrw	#4,d7
patmandin@734
   265
	subql	#1,d7
patmandin@734
   266
SDL_Atari_C2p8_dblloop:
patmandin@734
   267
	movel	a0@+,a1@+
patmandin@734
   268
	movel	a0@+,a1@+
patmandin@734
   269
	movel	a0@+,a1@+
patmandin@734
   270
	movel	a0@+,a1@+
patmandin@734
   271
	dbra	d7,SDL_Atari_C2p8_dblloop
patmandin@734
   272
patmandin@734
   273
	addl	d1,c2p_curdst
patmandin@734
   274
patmandin@734
   275
SDL_Atari_C2p8_nodblline:
patmandin@734
   276
patmandin@734
   277
	/* Next line */
patmandin@734
   278
patmandin@734
   279
	addl	d0,c2p_cursrc
patmandin@734
   280
	addl	d1,c2p_curdst
patmandin@734
   281
patmandin@734
   282
	subqw	#1,c2p_row
patmandin@1086
   283
	bne		SDL_Atari_C2p8_rowloop	
patmandin@734
   284
patmandin@734
   285
	moveml	sp@+,d2-d7/a2-a6
patmandin@734
   286
	rts
patmandin@734
   287
patmandin@734
   288
/* ------------	Conversion C2P, 4 bits ------------ */
patmandin@734
   289
patmandin@734
   290
_SDL_Atari_C2pConvert4:
slouken@281
   291
	movel	sp@(4),c2p_source
slouken@281
   292
	movel	sp@(8),c2p_dest
slouken@281
   293
	movel	sp@(12),c2p_width
slouken@281
   294
	movel	sp@(16),c2p_height
slouken@281
   295
	movel	sp@(20),c2p_dblligne
slouken@281
   296
	movel	sp@(24),c2p_srcpitch
slouken@281
   297
	movel	sp@(28),c2p_dstpitch
slouken@281
   298
slouken@281
   299
	moveml	d2-d7/a2-a6,sp@-
slouken@281
   300
slouken@281
   301
	movel	c2p_source,a0
slouken@281
   302
	movel	c2p_dest,a1
patmandin@734
   303
	lea	_SDL_Atari_table_c2p,a2
slouken@281
   304
	movel	#0x00070001,d3
slouken@281
   305
#if defined(__M68020__)
slouken@281
   306
	moveq	#0,d0
slouken@281
   307
#endif
slouken@281
   308
	
slouken@281
   309
	movel	c2p_height,d7
slouken@281
   310
	subql	#1,d7
slouken@281
   311
c2p4_bcly:
slouken@281
   312
	movel	a0,a4	| Save start address of source
slouken@281
   313
	movel	a1,a5	| Save start address of dest
slouken@281
   314
slouken@281
   315
	| Conversion
slouken@281
   316
                 			
slouken@281
   317
	movel	c2p_width,d6
slouken@281
   318
	lsrw	#4,d6
slouken@281
   319
	subql	#1,d6
slouken@281
   320
c2p4_bclx:
slouken@281
   321
	| Octets 0-7
slouken@281
   322
	
slouken@281
   323
	moveq	#0,d1
slouken@281
   324
	moveq	#7,d5
slouken@281
   325
c2p4_bcl07:
slouken@281
   326
#if defined(__M68020__)
slouken@281
   327
	moveb	a0@+,d0
patmandin@1086
   328
	lea		a2@(0,d0:w:4),a3
slouken@281
   329
#else
slouken@281
   330
	moveq	#0,d0
slouken@281
   331
	moveb	a0@+,d0
slouken@281
   332
	lslw	#2,d0
patmandin@1086
   333
	lea		a2@(0,d0:w),a3
slouken@281
   334
#endif
slouken@281
   335
	lsll	#1,d1
patmandin@1086
   336
	orl		a3@,d1
slouken@281
   337
	dbra	d5,c2p4_bcl07
slouken@281
   338
slouken@281
   339
	movepl	d1,a1@(0)
slouken@281
   340
	addw	d3,a1
slouken@281
   341
	swap	d3
slouken@281
   342
	
slouken@281
   343
	| Octets 8-15
slouken@281
   344
slouken@281
   345
	moveq	#0,d1
slouken@281
   346
	moveq	#7,d5
slouken@281
   347
c2p4_bcl815:
slouken@281
   348
#if defined(__M68020__)
slouken@281
   349
	moveb	a0@+,d0
patmandin@1086
   350
	lea		a2@(0,d0:w:4),a3
slouken@281
   351
#else
slouken@281
   352
	moveq	#0,d0
slouken@281
   353
	moveb	a0@+,d0
slouken@281
   354
	lslw	#2,d0
patmandin@1086
   355
	lea		a2@(0,d0:w),a3
slouken@281
   356
#endif
slouken@281
   357
	lsll	#1,d1
patmandin@1086
   358
	orl		a3@,d1
slouken@281
   359
	dbra	d5,c2p4_bcl815
slouken@281
   360
slouken@281
   361
	movepl	d1,a1@(0)
slouken@281
   362
	addw	d3,a1
slouken@281
   363
	swap	d3
slouken@281
   364
slouken@281
   365
	dbra	d6,c2p4_bclx
slouken@281
   366
slouken@281
   367
	| Double line ?
slouken@281
   368
slouken@281
   369
	tstl	c2p_dblligne
patmandin@1086
   370
	beqs	c2p4_nodblligne
slouken@281
   371
slouken@281
   372
	movel	a5,a6			| src line
slouken@281
   373
	movel	a5,a1			| dest line
slouken@281
   374
	addl	c2p_dstpitch,a1
slouken@281
   375
slouken@281
   376
	movel	c2p_width,d6
slouken@281
   377
	lsrw	#3,d6
slouken@281
   378
	subql	#1,d6
slouken@281
   379
c2p4_copydbl:
slouken@281
   380
	movel	a6@+,a1@+
slouken@281
   381
	dbra	d6,c2p4_copydbl
slouken@281
   382
slouken@281
   383
	addl	c2p_dstpitch,a5
slouken@281
   384
c2p4_nodblligne:
slouken@281
   385
slouken@281
   386
	| Next line
slouken@281
   387
slouken@281
   388
	movel	a4,a0		
slouken@281
   389
	addl	c2p_srcpitch,a0
slouken@281
   390
	movel	a5,a1
slouken@281
   391
	addl	c2p_dstpitch,a1
slouken@281
   392
slouken@281
   393
	dbra	d7,c2p4_bcly
slouken@281
   394
slouken@281
   395
	moveml	sp@+,d2-d7/a2-a6
slouken@281
   396
	rts
slouken@281
   397
patmandin@734
   398
/* ------------	Conversion of a light palette in 4 bits ------------ */
slouken@281
   399
patmandin@734
   400
_SDL_Atari_C2pConvert4_pal:
slouken@281
   401
	/* a0 is a 256-word light palette */
slouken@281
   402
	movel	sp@(4),a0
slouken@281
   403
slouken@281
   404
	moveml	d2-d3,sp@-
slouken@281
   405
patmandin@1086
   406
	lea		_SDL_Atari_table_c2p,a1
slouken@281
   407
	movew	#255,d3
slouken@281
   408
c2p_pal_initbcl:
slouken@281
   409
	movew	a0@+,d0
slouken@281
   410
	lsrw	#4,d0
patmandin@1086
   411
	andw	#15,d0
slouken@281
   412
slouken@281
   413
	moveq	#3,d1
slouken@281
   414
c2p_pal_initbyte:
slouken@281
   415
	btst	d1,d0
patmandin@1086
   416
	sne		d2
slouken@281
   417
	negw	d2
slouken@281
   418
	moveb	d2,a1@(0,d1:w)
slouken@281
   419
slouken@281
   420
	dbra	d1,c2p_pal_initbyte
slouken@281
   421
slouken@281
   422
	addql	#4,a1
slouken@281
   423
	dbra	d3,c2p_pal_initbcl
slouken@281
   424
slouken@281
   425
	moveml	sp@+,d2-d3
slouken@281
   426
slouken@281
   427
	rts
slouken@281
   428
slouken@281
   429
/* ------------	Buffers ------------ */
slouken@281
   430
patmandin@1086
   431
	.bss
slouken@281
   432
slouken@281
   433
	.even
patmandin@734
   434
	.comm	_SDL_Atari_C2pConvert,4
patmandin@1086
   435
	.comm	_SDL_Atari_table_c2p,1024
slouken@281
   436
patmandin@734
   437
	.comm	c2p_source,4	/* Source framebuffer */
patmandin@1086
   438
	.comm	c2p_dest,4		/* Destination framebuffer */
patmandin@1086
   439
	.comm	c2p_width,4		/* Width of zone to convert */
patmandin@734
   440
	.comm	c2p_height,4	/* Height of zone to convert */
patmandin@734
   441
	.comm	c2p_dblligne,4	/* Double the lines while converting ? */
patmandin@734
   442
	.comm	c2p_srcpitch,4	/* Source pitch */
patmandin@734
   443
	.comm	c2p_dstpitch,4	/* Destination pitch */
patmandin@734
   444
	.comm	c2p_cursrc,4	/* Current source line */
patmandin@734
   445
	.comm	c2p_curdst,4	/* Current destination line */
patmandin@734
   446
	.comm	c2p_rowlen,2	/* Line length in bytes */
patmandin@1086
   447
	.comm	c2p_row,2		/* Current line number */