*****************************************
*	color converter			*
*	takes sensible color format	*
*	ie:	1,2,3,4-a,b,c,d,e,f	*
*	and turns it into the ste's 	*
*	stupid format			*
*	ie:	0,8,1,9,2,a,3,b,....	*
*****************************************
converter:
	lea	p1,a0
	lea	p1end,a6	;for cmp for end
	lea	redcolors,a2
	lea	greencolors,a3
	lea	bluecolors,a4
	lea	palc,a1		;where the new pal goes
conloop:
	moveq	#0,d0		;for construction
	moveq	#0,d1
	moveq	#0,d2
	moveq	#0,d3
	moveq	#0,d4
	move.w	(a0)+,d1	;get the color
	move.w	d1,d2		;copy it
	move.w	d2,d3
	and.w	#$0f00,d1	;isolate the red
	lsr.w	#8,d1		;now use it to index
	add.w	d1,d1
	or.w	(a2,d1.w),d0
	and.w	#$00f0,d2	;isolate the red
	lsr.w	#4,d2
	add.w	d2,d2
	or.w	(a3,d2.w),d0
	and.w	#$000f,d3	;isolate the red
	add.w	d3,d3
	or.w	(a4,d3.w),d0
	move.w	d0,(a1)+
	cmp.l	a6,a0
	blt	conloop
illegal
redcolors:
	dc.w	$0000,$0800,$0100,$0900,$0200,$0a00,$0300,$0b00
	dc.w	$0400,$0c00,$0500,$0d00,$0600,$0e00,$0700,$0f00
greencolors:
	dc.w	$0000,$0080,$0010,$0090,$0020,$00a0,$0030,$00b0
	dc.w	$0040,$00c0,$0050,$00d0,$0060,$00e0,$0070,$00f0
bluecolors:
	dc.w	$0000,$0008,$0001,$0009,$0002,$000a,$0003,$000b
	dc.w	$0004,$000c,$0005,$000d,$0006,$000e,$0007,$000f



p1:
	dc.w	$0200,$0200,$0200,$0200,$0200,$0200,$0200
	dc.w	$0020,$0020,$0020,$0020,$0020,$0020,$0020

	dc.w	$0400,$0400,$0400,$0400,$0400,$0400,$0400
	dc.w	$0040,$0040,$0040,$0040,$0040,$0040,$0040

	dc.w	$0600,$0600,$0600,$0600,$0600,$0600,$0600
	dc.w	$0060,$0060,$0060,$0060,$0060,$0060,$0060

	dc.w	$0900,$0900,$0900,$0900,$0900,$0900,$0900
	dc.w	$0090,$0090,$0090,$0090,$0090,$0090,$0090

	dc.w	$0c00,$0c00,$0c00,$0c00,$0c00,$0c00,$0c00
	dc.w	$00c0,$00c0,$00c0,$00c0,$00c0,$00c0,$00c0

	dc.w	$0f33,$0f33,$0f33,$0f33,$0f33,$0f33,$0f33
	dc.w	$03f3,$03f3,$03f3,$03f3,$03f3,$03f3,$03f3

	dc.w	$0f77,$0f77,$0f77,$0f77,$0f77,$0f77,$0f77
	dc.w	$07f7,$07f7,$07f7,$07f7,$07f7,$07f7,$07f7

	dc.w	$0faa,$0faa,$0faa,$0faa,$0faa,$0faa,$0faa
	dc.w	$0afa,$0afa,$0afa,$0afa,$0afa,$0afa,$0afa

	dc.w	$0faa,$0faa,$0faa,$0faa,$0faa,$0faa,$0faa
	dc.w	$0afa,$0afa,$0afa,$0afa,$0afa,$0afa,$0afa
p1end:
palc:
	blk.w	9*14,0

pt:
	dc.w	$1234


*	0,8,1,9,2,a,3,b,4,c,5,d,6,e,7,f
palette:
*	red to yellow
	dc.w	$0f00,$0000,$0000,$0f90,$0f20,$0fa0,$0f30,$0fb0
	dc.w	$0f40,$0fc0,$0f50,$0fd0,$0f60,$0fe0,$0f70,$0ff0
*	yellow to green
	dc.w	$0ff0,$07f0,$0ef0,$06f0,$0df0,$05f0,$0cf0,$04f0
	dc.w	$0bf0,$03f0,$0af0,$02f0,$09f0,$01f0,$08f0,$00f0
*	green to cyan
	dc.w	$00f0,$00f8,$00f1,$00f9,$00f2,$00fa,$00f3,$00fb
	dc.w	$00f4,$00fc,$00f5,$00fd,$00f6,$00fe,$00f7,$00ff
*	cyan to blue
	dc.w	$000f,$000f,$000f,$000f,$000f,$000f,$000f,$000f
	dc.w	$000f,$000f,$000f,$000f,$000f,$000f,$000f,$000f
