Home | History | Annotate | Line # | Download | only in dev
      1  1.8  tsutsui /* $NetBSD: omrasopsvar.h,v 1.8 2022/10/03 17:42:35 tsutsui Exp $ */
      2  1.3  tsutsui /*
      3  1.3  tsutsui  * Copyright (c) 2013 Kenji Aoyama
      4  1.3  tsutsui  *
      5  1.3  tsutsui  * Permission to use, copy, modify, and distribute this software for any
      6  1.3  tsutsui  * purpose with or without fee is hereby granted, provided that the above
      7  1.3  tsutsui  * copyright notice and this permission notice appear in all copies.
      8  1.3  tsutsui  *
      9  1.3  tsutsui  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     10  1.3  tsutsui  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     11  1.3  tsutsui  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     12  1.3  tsutsui  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     13  1.3  tsutsui  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     14  1.3  tsutsui  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     15  1.3  tsutsui  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     16  1.3  tsutsui  */
     17  1.3  tsutsui 
     18  1.6    isaki #include <machine/board.h>
     19  1.6    isaki 
     20  1.3  tsutsui /*
     21  1.3  tsutsui  * Base addresses of LUNA's frame buffer
     22  1.3  tsutsui  * XXX: We consider only 1bpp and 4bpp for now
     23  1.3  tsutsui  */
     24  1.1  tsutsui 
     25  1.6    isaki #define OMFB_PLANEMASK		BMAP_BMSEL	/* BMSEL register */
     26  1.6    isaki #define OMFB_ROP_COMMON		BMAP_FN		/* common ROP */
     27  1.6    isaki #define OMFB_ROP_P0		BMAP_FN0
     28  1.6    isaki 
     29  1.6    isaki /* will be merged in near future */
     30  1.6    isaki #define OMFB_ROPFUNC		BMAP_FN		/* common ROP function */
     31  1.6    isaki 
     32  1.6    isaki #define OMFB_MAX_PLANECOUNT	(8)
     33  1.6    isaki #define OMFB_PLANEOFFS		(0x40000)	/* plane offset */
     34  1.6    isaki #define OMFB_STRIDE		(2048/8)	/* stride [byte] */
     35  1.6    isaki 
     36  1.6    isaki /* TODO: should be improved... */
     37  1.6    isaki extern int hwplanemask;
     38  1.3  tsutsui 
     39  1.3  tsutsui /*
     40  1.3  tsutsui  * ROP function
     41  1.1  tsutsui  *
     42  1.5      rin  * LUNA's frame buffer uses Hitachi HM53462 video RAM, which has raster
     43  1.3  tsutsui  * (logic) operation, or ROP, function.  To use ROP function on LUNA, write
     44  1.3  tsutsui  * a 32bit `mask' value to the specified address corresponding to each ROP
     45  1.3  tsutsui  * logic.
     46  1.1  tsutsui  *
     47  1.3  tsutsui  * D: the data writing to the video RAM
     48  1.3  tsutsui  * M: the data already stored on the video RAM
     49  1.1  tsutsui  */
     50  1.1  tsutsui 
     51  1.3  tsutsui /* operation		index	the video RAM contents will be */
     52  1.3  tsutsui #define ROP_ZERO	 0	/* all 0	*/
     53  1.7  tsutsui #define ROP_AND1	 1	/* D & M	*/
     54  1.3  tsutsui #define ROP_AND2	 2	/* ~D & M	*/
     55  1.3  tsutsui /* Not used on LUNA	 3			*/
     56  1.3  tsutsui #define ROP_AND3	 4	/* D & ~M	*/
     57  1.3  tsutsui #define ROP_THROUGH	 5	/* D		*/
     58  1.3  tsutsui #define ROP_EOR		 6	/* (~D & M) | (D & ~M)	*/
     59  1.3  tsutsui #define ROP_OR1		 7	/* D | M	*/
     60  1.3  tsutsui #define ROP_NOR		 8	/* ~D | ~M	*/
     61  1.3  tsutsui #define ROP_ENOR	 9	/* (D & M) | (~D & ~M)	*/
     62  1.3  tsutsui #define ROP_INV1	10	/* ~D		*/
     63  1.3  tsutsui #define ROP_OR2		11	/* ~D | M	*/
     64  1.3  tsutsui #define ROP_INV2	12	/* ~M		*/
     65  1.3  tsutsui #define ROP_OR3		13	/* D | ~M	*/
     66  1.3  tsutsui #define ROP_NAND	14	/* ~D | ~M	*/
     67  1.3  tsutsui #define ROP_ONE		15	/* all 1	*/
     68  1.3  tsutsui 
     69  1.2  tsutsui int omrasops1_init(struct rasops_info *, int, int);
     70  1.2  tsutsui int omrasops4_init(struct rasops_info *, int, int);
     71