Home | History | Annotate | Line # | Download | only in libsa
      1 | file: putimage.S
      2 | author: ITOH Yasufumi
      3 |
      4 | $NetBSD: putimage.S,v 1.5 2012/11/25 04:06:59 isaki Exp $
      5 
      6 #include <machine/asm.h>
      7 #include "iocscall.h"
      8 
      9 # define IMGWIDTH	56
     10 # define IMGHEIGHT	52
     11 |
     12 |	display title image
     13 |
     14 ENTRY_NOPROFILE(put_image)
     15 		link	%a6,#-(IMGWIDTH*IMGHEIGHT/8*2+8)| make local buffer
     16 		moveal	%sp,%a1				| buffer (plane #0) top
     17 		moveml	%d2-%d7/%a2-%a4,%sp@-
     18 
     19 		lea	%a1@(IMGWIDTH*IMGHEIGHT/8+4),%a4| buffer (plane #1) top
     20 		movel	#IMGWIDTH*0x10000+IMGHEIGHT,%a1@| image size
     21 		movel	%a1@+,%a4@+
     22 
     23 		lea	%pc@(img_title),%a2
     24 		moveal	%a2@+,%a3
     25 
     26 1:		tstb	%a2@+			| skip human readable comment
     27 		jne	1b
     28 		lea	%a2@(4),%a0		| image data here
     29 
     30 		moveq	#0,%d2			| (b) now have 0bit
     31 		moveq	#0,%d3			| (w) input bit buffer
     32 
     33 		moveq	#16,%d4			| (b) output bit count
     34 		moveq	#IMGWIDTH*IMGHEIGHT/16+0xffffff00,%d7
     35 
     36 		| d2.b: # bits in input buffer
     37 		| d3.w: input buffer
     38 		| d4.b: # bits in output buffer
     39 		| d5.w: output buffer for plane 0
     40 		| d6.w: output buffer for plane 1
     41 		| d7.b: size count
     42 		| a0: input data pointer
     43 
     44 Lrunlen:	| a run entry:
     45 		|	value	 (2bit)
     46 		|	length-1 (3bit)
     47 		subqb	#5,%d2		| have enough bits?
     48 		jcc	Lhave5b		| yes
     49 		| fill byte
     50 		cmpaw	%a0,%a3		| the register order is significant
     51 					| for word comparison
     52 		beq	Lrxabort
     53 1:		moveb	%a0@+,%d0
     54 		addqb	#8,%d2		| d2: 3: have 0bit, ..., 7: have 4bit
     55 		lslw	#8,%d0		| clear unused bits
     56 		lsrw	%d2,%d0
     57 		orw	%d0,%d3
     58 
     59 Lhave5b:	| field# 19 20 21 22 23 24 25 26 27 28 29 30 31
     60 		| d3: ... v  v  l  l  l  ?  ?  ?  ?  ?  ?  ?  0
     61 		bfexts	%d3{#19,#2},%d0	| value
     62 		bfextu	%d3{#21,#3},%d1	| length - 1
     63 		lslw	#5,%d3
     64 
     65 Lrxloop:	lslw	#2,%d6
     66 		bfins	%d0,%d6{#30,#2}
     67 		roxrw	#1,%d6
     68 		roxlw	#1,%d5
     69 		subqb	#1,%d4
     70 		jne	1f
     71 		moveq	#16,%d4
     72 		movew	%d5,%a1@+
     73 		movew	%d6,%a4@+
     74 		subqb	#1,%d7		| end?
     75 1:		dbeq	%d1,Lrxloop	| fall down if end
     76 		jne	Lrunlen		| fall down if end
     77 
     78 		moveq	#1,%d1
     79 		movew	%a2@+,%d2
     80 		IOCS(__TPALET2)
     81 		moveq	#2,%d1
     82 		movew	%a2@,%d2
     83 		IOCS(__TPALET2)
     84 
     85 |		moveq	#0x02,%d1	| plane 1 (already have it)
     86 		IOCS(__TCOLOR)
     87 		movel	%a6@(8),%d1
     88 		movel	%a6@(12),%d2
     89 		IOCS(__TEXTPUT)
     90 		moveq	#0x01,%d1	| plane 0
     91 		IOCS(__TCOLOR)
     92 		movel	%a6@(8),%d1
     93 		lea	%a6@(-(IMGWIDTH*IMGHEIGHT/8*2+8)),%a1
     94 		IOCS(__TEXTPUT)
     95 
     96 Lrxabort:	moveml	%sp@+,%d2-%d7/%a2-%a4
     97 		unlk	%a6
     98 		rts
     99 
    100 img_title:
    101 	.long	imgend1
    102 	| compressed image data
    103 
    104 	| BSD Daemon Image, used for NetBSD boot by permission.
    105 	| (Thanks for permission!)
    106 
    107 	| BSD Daemon Copyright 1988 by Marshall Kirk McKusick.
    108 	| All Rights Reserved.
    109 	|
    110 	| Permission to use the daemon may be obtained from:
    111 	|     Marshall Kirk McKusick
    112 	|     1614 Oxford St
    113 	|     Berkeley, CA 94709-1608
    114 	|     USA
    115 	| or via email at mckusick@mckusick.com
    116 
    117 	| Human readable copyright notice to be found with strings(1).
    118 	| Terminate with a nul character.
    119 
    120 	.asciz	"\nBSD Daemon Copyright 1988 by Marshall Kirk McKusick."
    121 
    122 	.word	0x5295,0xAD6A		| palet1, palet2
    123 	.word	0x39c3,0x0c1c,0xd039,0xce71,0xa327,0x3830,0x739c,0xe146
    124 	.word	0x6073,0x8227,0x39ce,0x0865,0x0738,0x2184,0x1ce7,0x3233
    125 	.word	0x049c,0xe88a,0x0e73,0x9618,0x8271,0x0486,0x6646,0x2093
    126 	.word	0x9ce4,0xcc12,0x1461,0x1622,0x3104,0x9ce7,0x2653,0x10e2
    127 	.word	0x4158,0x91a8,0x24e7,0x38d1,0x9807,0x00c8,0x7216,0x6a29
    128 	.word	0x39ce,0x4440,0x1906,0x4190,0xe031,0xe452,0x739c,0x9006
    129 	.word	0x8180,0xec18,0x0221,0xc8a0,0xe739,0xb60c,0x0380,0xdc35
    130 	.word	0x149c,0xe724,0x01b0,0x601d,0x062c,0x939c,0xe6c8,0x700c
    131 	.word	0x0b60,0xcc58,0x739c,0xf81e,0x09a0,0x6a49,0x39ce,0x6803
    132 	.word	0x00c0,0x701c,0x0740,0xd4d0,0x739c,0xd806,0x0100,0xe038
    133 	.word	0x0e81,0xb924,0xe726,0x0d0c,0x20e2,0xc839,0x249c,0xe4c4
    134 	.word	0x0ba4,0x0b42,0xc811,0xc920,0xe73c,0x070e,0x0383,0x44b5
    135 	.word	0x241c,0xe3c8,0x6228,0x701b,0x023f,0x8924,0xe726,0x0501
    136 	.word	0xc301,0xc8d3,0xfc49,0x0739,0xa01c,0x1219,0x0fc9,0x8924
    137 	.word	0xe716,0x2028,0x64a8,0xc441,0xc147,0x3249,0xce4c,0x0e38
    138 	.word	0x2a24,0x58ea,0x4939,0xcd00,0xe208,0x860a,0x8bea,0x0c39
    139 	.word	0xce09,0x0608,0x8e10,0x3449,0x1aa2,0x4e73,0x9d3a,0x4111
    140 	.word	0xfc45,0x2739,0xcb0c,0xa308,0x0205,0x0fea,0x2939,0xce4d
    141 	.word	0x2030,0x4823,0xfdc1,0x4739,0xc68c,0x4100,0x4490,0x0c8f
    142 	.word	0x70cc,0x5473,0x9ce0,0x8a22,0x1866,0x078a,0x4e72,0x6c7b
    143 	.word	0x0260,0x9e03,0xc148,0x780f,0xc090,0xc970,0x04c5,0x5c06
    144 	.word	0x45a1,0x641a,0x0e47,0xa1ec,0x7903,0xd03c,0x8310,0x0643
    145 	.word	0x91e0,0x3926,0x47b1,0xe408,0x3e05,0x9044,0x190e,0x4780
    146 	.word	0xe49a,0x0c38,0x2c1c,0x390e,0x8100,0x683a,0x2689,0xa0c3
    147 	.word	0x00d0,0x722d,0x0780,0xc8b4,0x2d8f,0x25d0,0x721c,0x8720
    148 	.word	0xc872,0x1c8b,0xa5d8,0xb25d,0x0721,0xd032,0x0c87,0x21c8
    149 	.word	0xb22c,0x8141,0xd872,0x5c86,0x1916,0xc190,0xe43a,0x0e81
    150 	.word	0x0403,0x2188,0x740d,0x1341,0xc8f6,0x0d8f,0x22d0,0x220c
    151 	.word	0x8300,0x9032,0x0c97,0x300e,0x49a0,0x6478,0x0645,0x91e8
    152 	.word	0x1816,0x0190,0x647b,0x1649,0x90e8,0x380e,0x4180,0x645a
    153 	.word	0x0e83,0x90e4,0x3b1e,0xc981,0x6c79,0x07c5,0xd0f8,0x2939
    154 	.word	0xc523,0x8946,0x820d,0x0c45,0x070f,0x6192,0xde08,0x3832
    155 	.word	0x0572,0x083c,0x3920,0x721a,0x9ac8,0x8868,0xf889,0xc160
    156 	.word	0x4377,0x8a84,0x88ee,0xd891,0xc2b0,0x2200,0xb2a2,0xa1c3
    157 	.word	0x10dc,0x1564,0x1ce3,0x79c6,0x9022,0x2258,0x1073,0x9ce7
    158 	.word	0x2a20,0x701c
    159 	.even
    160 imgend1:
    161