FreeBASIC  0.91.0
gfx_driver_fbdev.c File Reference
#include "../fb_gfx.h"
#include "fb_gfx_linux.h"
#include "../../rtlib/unix/fb_private_console.h"
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <linux/fb.h>
#include <pthread.h>
Include dependency graph for gfx_driver_fbdev.c:

Go to the source code of this file.

Data Structures

struct  FBDEVDRIVER
 
struct  GFXMODE
 

Macros

#define FB_AUX_VGA_PLANES_VGA4   0
 
#define OUTB(port, value)   { __asm__ __volatile__ ("outb %b0, %w1" : : "a"(value), "Nd"(port)); }
 

Typedefs

typedef struct FBDEVDRIVER FBDEVDRIVER
 

Functions

static int driver_init (char *title, int w, int h, int depth, int refresh_rate, int flags)
 
static void driver_exit (void)
 
static void driver_lock (void)
 
static void driver_unlock (void)
 
static void driver_set_palette (int index, int r, int g, int b)
 
static void driver_wait_vsync (void)
 
static int driver_get_mouse (int *x, int *y, int *z, int *buttons, int *clip)
 
static void driver_set_mouse (int x, int y, int cursor, int clip)
 
static int * driver_fetch_modes (int depth, int *size)
 
static void vga16_blitter (unsigned char *dest, int pitch)
 
static void * driver_thread (void *arg)
 
static void driver_save_screen (void)
 
static void driver_restore_screen (void)
 
static void driver_key_handler (int pressed, int repeated, int scancode, int key)
 
int fb_hFBDevInfo (ssize_t *width, ssize_t *height, ssize_t *depth, ssize_t *refresh)
 

Variables

static FBDEVDRIVER fb_fbdev
 
GFXDRIVER fb_gfxDriverFBDev
 
static const GFXMODE standard_mode []
 
static int device_fd = -1
 
static struct fb_fix_screeninfo device_info
 
static struct
fb_var_screeninfo mode 
orig_mode
 
static struct fb_cmap cmap orig_cmap
 
static unsigned char * framebuffer = NULL
 
static unsigned short * palette = NULL
 
static unsigned char color_conv [4096]
 
static BLITTERblitter
 
static int framebuffer_offset
 
static int is_running = FALSE
 
static int is_active = TRUE
 
static int vsync_flags = 0
 
static int is_palette_changed = FALSE
 
static int mouse_fd = -1
 
static int mouse_packet_size
 
static int mouse_shown = TRUE
 
static int mouse_x
 
static int mouse_y
 
static int mouse_z
 
static int mouse_buttons
 
static int mouse_clip = 0
 
static unsigned int last_click_time = 0
 
static pthread_t thread
 
static pthread_mutex_t mutex
 
static pthread_cond_t cond
 

Macro Definition Documentation

#define FB_AUX_VGA_PLANES_VGA4   0

Definition at line 17 of file gfx_driver_fbdev.c.

#define OUTB (   port,
  value 
)    { __asm__ __volatile__ ("outb %b0, %w1" : : "a"(value), "Nd"(port)); }

Definition at line 20 of file gfx_driver_fbdev.c.

Typedef Documentation

typedef struct FBDEVDRIVER FBDEVDRIVER

Function Documentation

static void driver_exit ( void  )
static

Definition at line 538 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int * driver_fetch_modes ( int  depth,
int *  size 
)
static

Definition at line 620 of file gfx_driver_fbdev.c.

static int driver_get_mouse ( int *  x,
int *  y,
int *  z,
int *  buttons,
int *  clip 
)
static

Definition at line 595 of file gfx_driver_fbdev.c.

static int driver_init ( char *  title,
int  w,
int  h,
int  depth,
int  refresh_rate,
int  flags 
)
static

Definition at line 313 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

static void driver_key_handler ( int  pressed,
int  repeated,
int  scancode,
int  key 
)
static

Definition at line 291 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void driver_lock ( void  )
static

Definition at line 570 of file gfx_driver_fbdev.c.

static void driver_restore_screen ( void  )
static

Definition at line 277 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void driver_save_screen ( void  )
static

Definition at line 265 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void driver_set_mouse ( int  x,
int  y,
int  cursor,
int  clip 
)
static

Definition at line 607 of file gfx_driver_fbdev.c.

static void driver_set_palette ( int  index,
int  r,
int  g,
int  b 
)
static

Definition at line 580 of file gfx_driver_fbdev.c.

static void* driver_thread ( void *  arg)
static

Definition at line 143 of file gfx_driver_fbdev.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void driver_unlock ( void  )
static

Definition at line 575 of file gfx_driver_fbdev.c.

static void driver_wait_vsync ( void  )
static

Definition at line 588 of file gfx_driver_fbdev.c.

int fb_hFBDevInfo ( ssize_t *  width,
ssize_t *  height,
ssize_t *  depth,
ssize_t *  refresh 
)

Definition at line 659 of file gfx_driver_fbdev.c.

Here is the caller graph for this function:

static void vga16_blitter ( unsigned char *  dest,
int  pitch 
)
static

Definition at line 89 of file gfx_driver_fbdev.c.

Here is the caller graph for this function:

Variable Documentation

BLITTER* blitter
static

Definition at line 78 of file gfx_driver_fbdev.c.

unsigned char color_conv[4096]
static

Definition at line 77 of file gfx_driver_fbdev.c.

pthread_cond_t cond
static

Definition at line 87 of file gfx_driver_fbdev.c.

int device_fd = -1
static

Definition at line 71 of file gfx_driver_fbdev.c.

struct fb_fix_screeninfo device_info
static

Definition at line 72 of file gfx_driver_fbdev.c.

FBDEVDRIVER fb_fbdev
static

Definition at line 30 of file gfx_driver_fbdev.c.

unsigned char* framebuffer = NULL
static

Definition at line 75 of file gfx_driver_fbdev.c.

int framebuffer_offset
static

Definition at line 79 of file gfx_driver_fbdev.c.

int is_active = TRUE
static

Definition at line 79 of file gfx_driver_fbdev.c.

int is_palette_changed = FALSE
static

Definition at line 80 of file gfx_driver_fbdev.c.

int is_running = FALSE
static

Definition at line 79 of file gfx_driver_fbdev.c.

unsigned int last_click_time = 0
static

Definition at line 84 of file gfx_driver_fbdev.c.

int mouse_buttons
static

Definition at line 82 of file gfx_driver_fbdev.c.

int mouse_clip = 0
static

Definition at line 83 of file gfx_driver_fbdev.c.

int mouse_fd = -1
static

Definition at line 81 of file gfx_driver_fbdev.c.

int mouse_packet_size
static

Definition at line 81 of file gfx_driver_fbdev.c.

int mouse_shown = TRUE
static

Definition at line 81 of file gfx_driver_fbdev.c.

int mouse_x
static

Definition at line 82 of file gfx_driver_fbdev.c.

int mouse_y
static

Definition at line 82 of file gfx_driver_fbdev.c.

int mouse_z
static

Definition at line 82 of file gfx_driver_fbdev.c.

pthread_mutex_t mutex
static

Definition at line 86 of file gfx_driver_fbdev.c.

struct fb_cmap cmap orig_cmap
static

Definition at line 74 of file gfx_driver_fbdev.c.

struct fb_var_screeninfo mode orig_mode
static

Definition at line 73 of file gfx_driver_fbdev.c.

unsigned short* palette = NULL
static

Definition at line 76 of file gfx_driver_fbdev.c.

const GFXMODE standard_mode[]
static
Initial value:
= {
{ 320, 200 }, { 320, 240 }, { 400, 300 }, { 512, 384 }, { 640, 400 }, { 640, 480 },
{ 800, 600 }, { 1024, 768 }, { 1280, 1024 }, { 1600, 1200 }, { 0, 0 }
}

Definition at line 66 of file gfx_driver_fbdev.c.

pthread_t thread
static

Definition at line 85 of file gfx_driver_fbdev.c.

int vsync_flags = 0
static

Definition at line 80 of file gfx_driver_fbdev.c.