--- trunk/src/include/testmachine/dev_fb.h 2007/10/08 16:20:18 27 +++ trunk/src/include/testmachine/dev_fb.h 2007/10/08 16:20:26 28 @@ -2,40 +2,58 @@ #define TESTMACHINE_FB_H /* - * Copyright (C) 2004-2006 Anders Gavare. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * - * $Id: dev_fb.h,v 1.1 2006/05/04 17:14:52 debug Exp $ - * * Definitions used by the framebuffer device in GXemul. + * + * $Id: dev_fb.h,v 1.6 2006/07/16 08:11:43 debug Exp $ + * This file is in the public domain. */ -/* Physical base address: */ -#define DEV_FB_ADDRESS 0x12000000 +/* Physical base address for linear framebuffer memory: */ +#define DEV_FB_ADDRESS 0x12000000 + +/* Physical base address for the framebuffer controller: */ +#define DEV_FBCTRL_ADDRESS 0x12f00000 +#define DEV_FBCTRL_LENGTH 0x20 + + +/* + * First choose the port by writing the port index to DEV_FBCTRL_PORT, + * then read or write DEV_FBCTRL_DATA. + */ + +#define DEV_FBCTRL_PORT 0x00 +#define DEV_FBCTRL_DATA 0x10 + +#define DEV_FBCTRL_PORT_COMMAND 0 +#define DEV_FBCTRL_PORT_X1 1 +#define DEV_FBCTRL_PORT_Y1 2 +#define DEV_FBCTRL_PORT_X2 3 +#define DEV_FBCTRL_PORT_Y2 4 +#define DEV_FBCTRL_PORT_COLOR_R 5 +#define DEV_FBCTRL_PORT_COLOR_G 6 +#define DEV_FBCTRL_PORT_COLOR_B 7 +#define DEV_FBCTRL_NPORTS 8 + + +/* + * Controller commands: + */ + +/* Do nothing. */ +#define DEV_FBCTRL_COMMAND_NOP 0 + +/* Set resolution to X1 x Y1. */ +#define DEV_FBCTRL_COMMAND_SET_RESOLUTION 1 + +/* Get current resolution into X1, Y1. */ +#define DEV_FBCTRL_COMMAND_GET_RESOLUTION 2 + +/* TODO: */ +#define DEV_FBCTRL_COMMAND_FILL 3 +#define DEV_FBCTRL_COMMAND_COPY 4 + +#define DEV_FBCTRL_MAXY(x) (((DEV_FBCTRL_ADDRESS-DEV_FB_ADDRESS) / 3) / x) #endif /* TESTMACHINE_FB_H */