xboxfb.c (156243) | xboxfb.c (170837) |
---|---|
1/*- 2 * Copyright (c) 2005, 2006 Rink Springer <rink@il.fontys.nl> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 1/*- 2 * Copyright (c) 2005, 2006 Rink Springer <rink@il.fontys.nl> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 * 27 * $FreeBSD: head/sys/i386/xbox/xboxfb.c 156243 2006-03-03 14:52:57Z rink $ | |
28 */ 29 | 26 */ 27 |
28#include <sys/cdefs.h> 29__FBSDID("$FreeBSD: head/sys/i386/xbox/xboxfb.c 170837 2007-06-16 21:31:53Z marius $"); 30 |
|
30/* 31 * This is the syscon(4)-ized version of the Xbox Frame Buffer driver. It 32 * supports about all features required, such as mouse support. 33 * 34 * A lot of functions that are not useful to us have not been implemented. 35 * It appears that some functions are never called, but these implementations 36 * are here nevertheless. 37 */ --- 28 unchanged lines hidden (view full) --- 66 67 /* screen width (pixels) */ 68 uint32_t sc_width; 69 70 /* pointer to the actual XBOX video memory */ 71 char* sc_framebuffer; 72 73 /* pointer to the font used */ | 31/* 32 * This is the syscon(4)-ized version of the Xbox Frame Buffer driver. It 33 * supports about all features required, such as mouse support. 34 * 35 * A lot of functions that are not useful to us have not been implemented. 36 * It appears that some functions are never called, but these implementations 37 * are here nevertheless. 38 */ --- 28 unchanged lines hidden (view full) --- 67 68 /* screen width (pixels) */ 69 uint32_t sc_width; 70 71 /* pointer to the actual XBOX video memory */ 72 char* sc_framebuffer; 73 74 /* pointer to the font used */ |
74 struct gfb_font* sc_font; | 75 const struct gfb_font* sc_font; |
75}; 76 77#define SCREEN_WIDTH 640 78#define SCREEN_HEIGHT 480 79 80#define XBOXFB_DRIVER_NAME "xboxsc" 81 | 76}; 77 78#define SCREEN_WIDTH 640 79#define SCREEN_HEIGHT 480 80 81#define XBOXFB_DRIVER_NAME "xboxsc" 82 |
82extern struct gfb_font bold8x16; | 83extern const struct gfb_font bold8x16; |
83 84static vi_probe_t xboxfb_probe; 85static vi_init_t xboxfb_init; 86static vi_get_info_t xboxfb_get_info; 87static vi_query_mode_t xboxfb_query_mode; 88static vi_set_mode_t xboxfb_set_mode; 89static vi_save_font_t xboxfb_save_font; 90static vi_load_font_t xboxfb_load_font; --- 497 unchanged lines hidden (view full) --- 588 589static int 590xboxfb_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) 591{ 592 int row, col; 593 int i, j; 594 struct xboxfb_softc* sc = &xboxfb_sc; 595 uint32_t* ptri = (uint32_t*)sc->sc_framebuffer; | 84 85static vi_probe_t xboxfb_probe; 86static vi_init_t xboxfb_init; 87static vi_get_info_t xboxfb_get_info; 88static vi_query_mode_t xboxfb_query_mode; 89static vi_set_mode_t xboxfb_set_mode; 90static vi_save_font_t xboxfb_save_font; 91static vi_load_font_t xboxfb_load_font; --- 497 unchanged lines hidden (view full) --- 589 590static int 591xboxfb_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) 592{ 593 int row, col; 594 int i, j; 595 struct xboxfb_softc* sc = &xboxfb_sc; 596 uint32_t* ptri = (uint32_t*)sc->sc_framebuffer; |
596 uint8_t* fontdata; | 597 const uint8_t* fontdata; |
597 uint32_t clr; 598 uint8_t mask; 599 600 /* calculate the position in the frame buffer */ 601 row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; 602 col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; 603 fontdata = &sc->sc_font->data[c * adp->va_info.vi_cheight]; 604 ptri += (row * sc->sc_width) + col; --- 51 unchanged lines hidden --- | 598 uint32_t clr; 599 uint8_t mask; 600 601 /* calculate the position in the frame buffer */ 602 row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; 603 col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; 604 fontdata = &sc->sc_font->data[c * adp->va_info.vi_cheight]; 605 ptri += (row * sc->sc_width) + col; --- 51 unchanged lines hidden --- |