More formatting updates. Reduced whitespace, looks even better.

This commit is contained in:
William Ferrell
2000-03-30 20:43:33 +00:00
parent a98c8109a8
commit ddfd41f53e
78 changed files with 0 additions and 590 deletions
-25
View File
@@ -22,8 +22,6 @@ typedef enum {
beat = 8
} custom_type;
static int fd;
static void CFontz_linewrap (int on);
@@ -148,7 +146,6 @@ CFontz_init (lcd_logical_driver * driver, char *args)
cfsetispeed (&portset, speed);
tcsetattr (fd, TCSANOW, &portset);
// Set display-specific stuff..
if (reboot) {
CFontz_reboot ();
@@ -161,13 +158,11 @@ CFontz_init (lcd_logical_driver * driver, char *args)
CFontz_autoscroll (0);
CFontz_backlight (backlight_brightness);
if (!driver->framebuf) {
fprintf (stderr, "CFontz_init: No frame buffer.\n");
driver->close ();
return -1;
}
// Set the functions the driver supports...
driver->clear = (void *) -1;
@@ -201,8 +196,6 @@ CFontz_init (lcd_logical_driver * driver, char *args)
return fd;
}
/////////////////////////////////////////////////////////////////
// Clean-up
//
@@ -217,22 +210,18 @@ CFontz_close ()
CFontz->framebuf = NULL;
}
void
CFontz_flush ()
{
CFontz_draw_frame (lcd.framebuf);
}
void
CFontz_flush_box (int lft, int top, int rgt, int bot)
{
int y;
char out[LCD_MAX_WIDTH];
// printf("Flush (%i,%i)-(%i,%i)\n", lft, top, rgt, bot);
for (y = top; y <= bot; y++) {
@@ -242,10 +231,8 @@ CFontz_flush_box (int lft, int top, int rgt, int bot)
}
}
/////////////////////////////////////////////////////////////////
// Prints a character on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -261,7 +248,6 @@ CFontz_chr (int x, int y, char c)
lcd.framebuf[(y * lcd.wid) + x] = c;
}
/////////////////////////////////////////////////////////////////
// Changes screen contrast (0-255; 140 seems good)
//
@@ -282,7 +268,6 @@ CFontz_contrast (int contrast)
return status;
}
/////////////////////////////////////////////////////////////////
// Sets the backlight on or off -- can be done quickly for
// an intermediate brightness...
@@ -300,7 +285,6 @@ CFontz_backlight (int on)
write (fd, out, 3);
}
/////////////////////////////////////////////////////////////////
// Toggle the built-in linewrapping feature
//
@@ -329,7 +313,6 @@ CFontz_autoscroll (int on)
write (fd, out, 1);
}
/////////////////////////////////////////////////////////////////
// Get rid of the blinking curson
//
@@ -352,7 +335,6 @@ CFontz_reboot ()
write (fd, out, 1);
}
/////////////////////////////////////////////////////////////////
// Sets up for vertical bars. Call before lcd.vbar()
//
@@ -529,7 +511,6 @@ CFontz_vbar (int x, int len)
{
char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 };
int y;
for (y = lcd.hgt; y > 0 && len > 0; y--) {
if (len >= lcd.cellhgt)
@@ -562,7 +543,6 @@ CFontz_hbar (int x, int y, int len)
}
/////////////////////////////////////////////////////////////////
// Sets up for big numbers.
//
@@ -571,7 +551,6 @@ CFontz_init_num ()
{
}
/////////////////////////////////////////////////////////////////
// Writes a big number.
//
@@ -583,7 +562,6 @@ CFontz_num (int x, int num)
write (fd, out, 3);
}
/////////////////////////////////////////////////////////////////
// Sets a custom character from 0-7...
//
@@ -606,7 +584,6 @@ CFontz_set_char (int n, char *dat)
sprintf (out, "%c%c", 25, n);
write (fd, out, 2);
for (row = 0; row < lcd.cellhgt; row++) {
letter = 0;
for (col = 0; col < lcd.cellwid; col++) {
@@ -617,7 +594,6 @@ CFontz_set_char (int n, char *dat)
}
}
void
CFontz_icon (int which, char dest)
{
@@ -662,7 +638,6 @@ CFontz_icon (int which, char dest)
CFontz_set_char (dest, &icons[which][0]);
}
/////////////////////////////////////////////////////////////
// Blasts a single frame onscreen, to the lcd...
//
-3
View File
@@ -1,7 +1,6 @@
#ifndef CFONTZ_H
#define CFONTZ_H
extern lcd_logical_driver *CFontz;
int CFontz_init (lcd_logical_driver * driver, char *device);
@@ -21,6 +20,4 @@ void CFontz_set_char (int n, char *dat);
void CFontz_icon (int which, char dest);
void CFontz_draw_frame (char *dat);
#endif
-31
View File
@@ -56,8 +56,6 @@ static int clear = 1;
static int def[9] = { -1, -1, -1, -1, -1, -1, -1, -1, -1 };
static int use[9] = { 1, 0, 0, 0, 0, 0, 0, 0, 0 };
static void MtxOrb_linewrap (int on);
static void MtxOrb_autoscroll (int on);
static void MtxOrb_cursorblink (int on);
@@ -82,10 +80,8 @@ MtxOrb_init (lcd_logical_driver * driver, char *args)
char device[256] = "/dev/lcd";
int speed = B19200;
MtxOrb = driver;
//debug("MtxOrb_init: Args(all): %s\n", args);
argc = get_args (argv, args, 64);
@@ -159,19 +155,16 @@ MtxOrb_init (lcd_logical_driver * driver, char *args)
cfsetispeed (&portset, speed);
tcsetattr (fd, TCSANOW, &portset);
// Set display-specific stuff..
MtxOrb_linewrap (1);
MtxOrb_autoscroll (1);
MtxOrb_cursorblink (0);
if (!driver->framebuf) {
fprintf (stderr, "MtxOrb_init: No frame buffer.\n");
driver->close ();
return -1;
}
// Set the functions the driver supports...
// driver->clear = (void *)-1;
@@ -206,7 +199,6 @@ MtxOrb_init (lcd_logical_driver * driver, char *args)
return fd;
}
// TODO: Check this quick hack to detect clear of the screen.
/////////////////////////////////////////////////////////////////
// Clear: catch up when the screen get clear to be able to
@@ -221,7 +213,6 @@ MtxOrb_clear ()
clear = 1;
}
/////////////////////////////////////////////////////////////////
// Clean-up
//
@@ -236,21 +227,18 @@ MtxOrb_close ()
MtxOrb->framebuf = NULL;
}
void
MtxOrb_flush ()
{
MtxOrb_draw_frame (lcd.framebuf);
}
void
MtxOrb_flush_box (int lft, int top, int rgt, int bot)
{
int y;
char out[LCD_MAX_WIDTH];
// printf("Flush (%i,%i)-(%i,%i)\n", lft, top, rgt, bot);
for (y = top; y <= bot; y++) {
@@ -260,10 +248,8 @@ MtxOrb_flush_box (int lft, int top, int rgt, int bot)
}
}
/////////////////////////////////////////////////////////////////
// Prints a character on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -277,7 +263,6 @@ MtxOrb_chr (int x, int y, char c)
lcd.framebuf[(y * lcd.wid) + x] = c;
}
/////////////////////////////////////////////////////////////////
// Changes screen contrast (0-255; 140 seems good)
//
@@ -296,7 +281,6 @@ MtxOrb_contrast (int contrast)
return status;
}
/////////////////////////////////////////////////////////////////
// Sets the backlight on or off -- can be done quickly for
// an intermediate brightness...
@@ -314,7 +298,6 @@ MtxOrb_backlight (int on)
}
}
/////////////////////////////////////////////////////////////////
// Sets output port on or off
void
@@ -330,7 +313,6 @@ MtxOrb_output (int on)
}
}
/////////////////////////////////////////////////////////////////
// Toggle the built-in linewrapping feature
//
@@ -345,7 +327,6 @@ MtxOrb_linewrap (int on)
write (fd, out, 2);
}
/////////////////////////////////////////////////////////////////
// Toggle the built-in automatic scrolling feature
//
@@ -360,7 +341,6 @@ MtxOrb_autoscroll (int on)
write (fd, out, 2);
}
// TODO: make sure this doesn't mess up non-VFD displays
/////////////////////////////////////////////////////////////////
// Toggle cursor blink on/off
@@ -376,7 +356,6 @@ MtxOrb_cursorblink (int on)
write (fd, out, 2);
}
//// TODO: Might not be needed anymore...
/////////////////////////////////////////////////////////////////
// Sets up for vertical bars. Call before lcd.vbar()
@@ -503,7 +482,6 @@ MtxOrb_num (int x, int num)
write (fd, out, 4);
}
// TODO: This could be higly optimised if data where to be pre-computed.
/////////////////////////////////////////////////////////////////
@@ -538,7 +516,6 @@ MtxOrb_set_char (int n, char *dat)
}
}
void
MtxOrb_icon (int which, char dest)
{
@@ -605,8 +582,6 @@ MtxOrb_draw_frame (char *dat)
}
/////////////////////////////////////////////////////////////
// returns one character from the keypad...
// (A-Z) on success, 0 on failure...
@@ -642,7 +617,6 @@ MtxOrb_led (int which, int on)
}
}
/////////////////////////////////////////////////////////////////
// Ask for dynamic allocation of a custom caracter to be
// a well none bar graphic. The function is suppose to
@@ -791,7 +765,6 @@ MtxOrb_ask_bar (int type)
return (pos);
}
/////////////////////////////////////////////////////////////////
// Sets up a well known character for use.
//
@@ -1030,12 +1003,8 @@ MtxOrb_set_known_char (int car, int type)
MtxOrb_set_char (car, &all_bar[type][0]);
}
/////////////////STOP READING --- TRASH IS AT THE END////////////////
// TODO: Remove this code wich was use for developpement.
// PS: There might be reference to this code left, so keep it for some time.
void
-1
View File
@@ -1,7 +1,6 @@
#ifndef MTXORB_H
#define MTXORB_H
extern lcd_logical_driver *MtxOrb;
int MtxOrb_init (lcd_logical_driver * driver, char *device);
-13
View File
@@ -21,7 +21,6 @@
#include "curses_drv.h"
#include "drv_base.h"
lcd_logical_driver *curses_drv;
int PAD = 255;
@@ -33,7 +32,6 @@ int ELLIPSIS = 7;
static char icon_char = '@';
int
curses_drv_init (struct lcd_logical_driver *driver, char *args)
{
@@ -41,7 +39,6 @@ curses_drv_init (struct lcd_logical_driver *driver, char *args)
int argc;
int i, j;
argc = get_args (argv, args, 64);
for (i = 0; i < argc; i++) {
@@ -78,7 +75,6 @@ curses_drv_init (struct lcd_logical_driver *driver, char *args)
}
curses_drv = driver;
// Init curses...
@@ -146,7 +142,6 @@ curses_drv_clear ()
}
/////////////////////////////////////////////////////////////////
// Prints a string on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -215,7 +210,6 @@ curses_drv_num (int x, int num)
curses_drv_chr (x + dx, y, c);
}
/////////////////////////////////////////////////////////////////
// Draws a vertical bar; erases entire column onscreen.
//
@@ -254,13 +248,10 @@ curses_drv_hbar (int x, int y, int len)
len -= lcd.cellwid;
}
// move(y-1, x-1);
// hline(0, len/lcd.cellwid);
}
/////////////////////////////////////////////////////////////////
// Sets character 0 to an icon...
//
@@ -291,14 +282,12 @@ curses_drv_flush ()
curses_drv_draw_frame (curses_drv->framebuf);
}
void
curses_drv_flush_box (int lft, int top, int rgt, int bot)
{
curses_drv_flush ();
}
void
curses_drv_draw_frame (char *dat)
{
@@ -308,8 +297,6 @@ curses_drv_draw_frame (char *dat)
}
char
curses_drv_getkey ()
{
-2
View File
@@ -1,7 +1,6 @@
#ifndef LCD_CURSES_H
#define LCD_CURSES_H
extern lcd_logical_driver *curses_drv;
int curses_drv_init (struct lcd_logical_driver *driver, char *args);
@@ -20,5 +19,4 @@ char curses_drv_getkey ();
void curses_drv_init_num ();
void curses_drv_num (int x, int num);
#endif
-20
View File
@@ -9,7 +9,6 @@
#include "lcd.h"
#include "debug.h"
//////////////////////////////////////////////////////////////////////////
////////////////////// For Debugging Output //////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -17,7 +16,6 @@
// TODO: somehow allow access to the driver->framebuffer to each
// function...
int
debug_init (struct lcd_logical_driver *driver, char *args)
{
@@ -28,7 +26,6 @@ debug_init (struct lcd_logical_driver *driver, char *args)
driver->framebuf = malloc (lcd.wid * lcd.hgt);
}
if (!driver->framebuf) {
debug_close ();
return -1;
@@ -61,7 +58,6 @@ debug_init (struct lcd_logical_driver *driver, char *args)
driver->getkey = debug_getkey;
return 200; // 200 is arbitrary. (must be 1 or more)
}
@@ -70,7 +66,6 @@ debug_close ()
{
// Ack! This shouldn't crash the program, but does.. Why??
printf ("debug_close()\n");
// This is the line which crashes.
@@ -95,7 +90,6 @@ debug_clear ()
}
//////////////////////////////////////////////////////////////////
// Flushes all output to the lcd...
//
@@ -107,7 +101,6 @@ debug_flush ()
lcd.draw_frame ();
}
/////////////////////////////////////////////////////////////////
// Prints a string on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -120,7 +113,6 @@ debug_string (int x, int y, char string[])
printf ("string(%i, %i):%s \n", x, y, string);
x -= 1; // Convert 1-based coords to 0-based...
y -= 1;
@@ -138,15 +130,12 @@ debug_chr (int x, int y, char c)
{
printf ("character(%i, %i):%c\n", x, y, c);
y--;
x--;
lcd.framebuf[(y * lcd.wid) + x] = c;
}
void
debug_contrast (int contrast)
{
@@ -203,7 +192,6 @@ debug_vbar (int x, int len)
printf ("Vbar(%i, %i)\n", x, len);
for (y = lcd.hgt; y > 0 && len > 0; y--) {
debug_chr (x, y, '|');
@@ -220,7 +208,6 @@ debug_hbar (int x, int y, int len)
{
printf ("Hbar(%i, %i, %i)\n", x, y, len);
for (; x < lcd.wid && len > 0; x++) {
debug_chr (x, y, '-');
@@ -229,7 +216,6 @@ debug_hbar (int x, int y, int len)
}
/////////////////////////////////////////////////////////////////
// Sets character 0 to an icon...
//
@@ -239,18 +225,15 @@ debug_icon (int which, char dest)
printf ("Char %i is icon %i\n", dest, which);
}
void
debug_flush_box (int lft, int top, int rgt, int bot)
{
printf ("Flush Box(%i, %i)-(%i, %i)\n", lft, top, rgt, bot);
debug_flush ();
}
void
debug_draw_frame (char *dat)
{
@@ -260,7 +243,6 @@ debug_draw_frame (char *dat)
printf ("draw_frame()\n");
if (!dat)
return;
@@ -272,7 +254,6 @@ debug_draw_frame (char *dat)
out[lcd.wid] = 0;
printf ("+%s+\n", out);
for (i = 0; i < lcd.hgt; i++) {
for (j = 0; j < lcd.wid; j++) {
out[j] = dat[j + (i * lcd.wid)];
@@ -290,7 +271,6 @@ debug_draw_frame (char *dat)
}
char
debug_getkey ()
{
-2
View File
@@ -1,7 +1,6 @@
#ifndef LCD_DEBUG_H
#define LCD_DEBUG_H
int debug_init (struct lcd_logical_driver *driver, char *args);
void debug_close ();
void debug_clear ();
@@ -22,5 +21,4 @@ void debug_flush_box (int lft, int top, int rgt, int bot);
void debug_draw_frame (char *dat);
char debug_getkey ();
#endif
-10
View File
@@ -9,7 +9,6 @@
#include "lcd.h"
#include "drv_base.h"
//////////////////////////////////////////////////////////////////////////
////////////////////// Base "class" to derive from ///////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -18,7 +17,6 @@ lcd_logical_driver *drv_base;
// TODO: Get lcd.framebuf to properly work as whatever driver is running...
////////////////////////////////////////////////////////////
// init() should set up any device-specific stuff, and
// point all the function pointers.
@@ -71,11 +69,9 @@ drv_base_init (struct lcd_logical_driver *driver, char *args)
driver->getkey = drv_base_getkey;
return 200; // 200 is arbitrary. (must be 1 or more)
}
// Below here, you may use either lcd.framebuf or driver->framebuf..
// lcd.framebuf will be set to the appropriate buffer before calling
// your driver.
@@ -99,7 +95,6 @@ drv_base_clear ()
}
//////////////////////////////////////////////////////////////////
// Flushes all output to the lcd...
//
@@ -109,7 +104,6 @@ drv_base_flush ()
//lcd.draw_frame(lcd.framebuf);
}
/////////////////////////////////////////////////////////////////
// Prints a string on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -143,7 +137,6 @@ drv_base_chr (int x, int y, char c)
lcd.framebuf[(y * lcd.wid) + x] = c;
}
//////////////////////////////////////////////////////////////////////
// Sets the contrast of the display. Value is 0-255, where 140 is
// what I consider "just right".
@@ -247,7 +240,6 @@ drv_base_hbar (int x, int y, int len)
}
/////////////////////////////////////////////////////////////////
// Sets character 0 to an icon...
//
@@ -257,7 +249,6 @@ drv_base_icon (int which, char dest)
// printf("Char %i set to icon %i\n", dest, which);
}
//////////////////////////////////////////////////////////////////////
// Send a rectangular area to the display.
//
@@ -314,7 +305,6 @@ drv_base_draw_frame (char *dat)
*/
}
//////////////////////////////////////////////////////////////////////
// Tries to read a character from an input device...
//
-2
View File
@@ -46,7 +46,6 @@
7. Add your driver to the Makefile, and Makefile.config, in the same
style as the existing ones.
Notes:
Don't call lcd.whatever() functions within your driver. This causes
@@ -115,5 +114,4 @@ void drv_base_flush_box (int lft, int top, int rgt, int bot);
void drv_base_draw_frame (char *dat);
char drv_base_getkey ();
#endif
-2
View File
@@ -51,7 +51,6 @@
void lcdstat_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch);
#define RS 0x10
#define RW 0x20
#define EN1 0x40
@@ -138,7 +137,6 @@ hd_init_4bit (HD44780_functions * hd44780_functions, lcd_logical_driver * driver
return 0;
}
// lcdstat_HD44780_senddata
void
lcdstat_HD44780_senddata (unsigned char displayID, unsigned char iflags, unsigned char ch)
-3
View File
@@ -45,7 +45,6 @@
void lcdtime_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch);
#define nRS nSTRB
#define nRW nLF
#define EN1 INIT
@@ -58,7 +57,6 @@ void lcdtime_HD44780_senddata (unsigned char displayID, unsigned char flags, uns
static unsigned int lptPort;
static int semid;
// initialise the driver
int
hd_init_ext8bit (HD44780_functions * hd44780_functions, lcd_logical_driver * driver, char *args, unsigned int port)
@@ -77,7 +75,6 @@ hd_init_ext8bit (HD44780_functions * hd44780_functions, lcd_logical_driver * dri
return 0;
}
// lcdtime_HD44780_senddata
void
lcdtime_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch)
-2
View File
@@ -35,7 +35,6 @@ extern HD44780_functions *hd44780_functions;
#define RS_DATA 0x00
#define RS_INSTR 0x01
#define CLEAR 0x01
#define HOMECURSOR 0x02
@@ -72,7 +71,6 @@ extern HD44780_functions *hd44780_functions;
#define POSITION 0x80
// Parallel port pin definitions
// Output lines
#define nSTRB 0x01 /* negative logic */
-3
View File
@@ -43,11 +43,9 @@ void shiftreg (unsigned char displayID, unsigned char r);
#define EN1 4
#define EN2 32
static unsigned int lp;
static char lastkey = 0;
// Initialisation
int
hd_init_serialLpt (HD44780_functions * hd44780_functions, lcd_logical_driver * driver, char *args, unsigned int port)
@@ -86,7 +84,6 @@ hd_init_serialLpt (HD44780_functions * hd44780_functions, lcd_logical_driver * d
return 0;
}
void
lcdserLpt_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch)
{
-2
View File
@@ -49,7 +49,6 @@ static int EnMaskSize = sizeof (EnMask) / sizeof (unsigned char);
static unsigned int lptPort;
static int extIF = 0; // non-zero if extended interface
// initialise the driver
int
hd_init_winamp (HD44780_functions * hd44780_functions, lcd_logical_driver * driver, char *args, unsigned int port)
@@ -78,7 +77,6 @@ hd_init_winamp (HD44780_functions * hd44780_functions, lcd_logical_driver * driv
return 0;
}
// lcdwinamp_HD44780_senddata
void
lcdwinamp_HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch)
-16
View File
@@ -42,7 +42,6 @@
#include "hd44780-low.h"
#include "hd44780-drivers.h"
// default parallel port address
#ifndef LPTPORT
#define LPTPORT 0x378
@@ -50,7 +49,6 @@
unsigned int port = LPTPORT;
lcd_logical_driver *HD44780;
HD44780_functions *hd44780_functions;
@@ -71,7 +69,6 @@ static int numDisplays = 0;
// input span list but is kept to save some cpu cycles.
static int *dispSizes = NULL;
// function declarations
void HD44780_flush ();
void HD44780_flush_box (int lft, int top, int rgt, int bot);
@@ -225,7 +222,6 @@ HD44780_init (lcd_logical_driver * driver, char *args)
//HD44780_close();
return -1;
}
// Set the functions the driver supports...
// These are the default HD44780 functions
driver->clear = (void *) -1;
@@ -303,7 +299,6 @@ uPause (int delayCalls)
//TODO: put in option for nanosleep rather than dummy I/O call
}
// displayID - ID of display to use (0 = all displays)
static void
HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch)
@@ -312,7 +307,6 @@ HD44780_senddata (unsigned char displayID, unsigned char flags, unsigned char ch
hd44780_functions->uPause (40);
}
/////////////////////////////////////////////////////////////////
// Clean-up
//
@@ -358,7 +352,6 @@ HD44780_flush ()
HD44780_draw_frame (lcd.framebuf);
}
void
HD44780_flush_box (int lft, int top, int rgt, int bot)
{
@@ -377,7 +370,6 @@ HD44780_flush_box (int lft, int top, int rgt, int bot)
}
/////////////////////////////////////////////////////////////////
// Changes screen contrast (0-255; 140 seems good)
//
@@ -396,7 +388,6 @@ HD44780_backlight (int on)
{
}
/////////////////////////////////////////////////////////////////
// Toggle the built-in linewrapping feature
//
@@ -421,7 +412,6 @@ common_autoscroll (int on)
hd44780_functions->uPause (1600);
}
/////////////////////////////////////////////////////////////////
// Sets up for vertical bars. Call before lcd.vbar()
//
@@ -602,7 +592,6 @@ HD44780_hbar (int x, int y, int len)
}
}
/////////////////////////////////////////////////////////////////
// Sets up for big numbers.
//
@@ -614,7 +603,6 @@ HD44780_init_num ()
//write(fd, out, 2);
}
/////////////////////////////////////////////////////////////////
// Writes a big number.
//
@@ -626,7 +614,6 @@ HD44780_num (int x, int num)
//write(fd, out, 4);
}
/////////////////////////////////////////////////////////////////
// Sets a custom character from 0-7...
//
@@ -657,7 +644,6 @@ HD44780_set_char (int n, char *dat)
}
}
void
HD44780_icon (int which, char dest)
{
@@ -697,11 +683,9 @@ HD44780_icon (int which, char dest)
};
HD44780_set_char (dest, &icons[which][0]);
}
/////////////////////////////////////////////////////////////
// Blasts a single frame onscreen, to the lcd...
//
-7
View File
@@ -14,11 +14,9 @@
#include <sys/types.h>
#include <errno.h>
#define __u32 unsigned int
#define __u8 unsigned char
#include "../../shared/debug.h"
#include "../../shared/str.h"
@@ -28,7 +26,6 @@
#include "irmanin.h"
#include "../../../libirman-0.4.1b/irman.h"
char *progname = "irmanin";
char *codes[] = {
@@ -62,8 +59,6 @@ char *codes[] = {
/* end */ NULL
};
//////////////////////////////////////////////////////////////////////////
////////////////////// Base "class" to derive from ///////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -162,7 +157,6 @@ irmanin_init (struct lcd_logical_driver *driver, char *args)
return 1; // 200 is arbitrary. (must be 1 or more)
}
void
irmanin_close ()
{
@@ -175,7 +169,6 @@ irmanin_close ()
ir_finish ();
}
//////////////////////////////////////////////////////////////////////
// Tries to read a character from an input device...
//
-2
View File
@@ -1,12 +1,10 @@
#ifndef LCD_IRMANIN__H
#define LCD_IRMANIN_H
extern lcd_logical_driver *joy;
int irmanin_init (struct lcd_logical_driver *driver, char *args);
void irmanin_close ();
char irmanin_getkey ();
#endif
-16
View File
@@ -8,24 +8,18 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#define __u32 unsigned int
#define __u8 unsigned char
#include <linux/joystick.h>
#include "../../shared/debug.h"
#include "../../shared/str.h"
#define NAME_LENGTH 128
#include "lcd.h"
#include "joy.h"
//////////////////////////////////////////////////////////////////////////
////////////////////// Base "class" to derive from ///////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -44,12 +38,10 @@ char jsname[NAME_LENGTH] = "Unknown";
int *axis;
int *button;
// Configured for a Gravis Gamepad (2 axis, 4 button)
char *axismap = "EFGHIJKLMNOPQRST";
char *buttonmap = "BDACEFGHIJKLMNOP";
////////////////////////////////////////////////////////////
// init() should set up any device-specific stuff, and
// point all the function pointers.
@@ -62,7 +54,6 @@ joy_init (struct lcd_logical_driver *driver, char *args)
joy = driver;
strcpy (device, "/dev/js0");
argc = get_args (argv, args, 64);
@@ -96,14 +87,9 @@ joy_init (struct lcd_logical_driver *driver, char *args)
}
driver->getkey = joy_getkey;
driver->close = joy_close;
/* FIXME: This crashes!
if(args)
{
@@ -131,7 +117,6 @@ joy_init (struct lcd_logical_driver *driver, char *args)
return fd; // 200 is arbitrary. (must be 1 or more)
}
void
joy_close ()
{
@@ -147,7 +132,6 @@ joy_close ()
}
//////////////////////////////////////////////////////////////////////
// Tries to read a character from an input device...
//
-2
View File
@@ -1,12 +1,10 @@
#ifndef LCD_JOY_H
#define LCD_JOY_H
extern lcd_logical_driver *joy;
int joy_init (struct lcd_logical_driver *driver, char *args);
void joy_close ();
char joy_getkey ();
#endif
-18
View File
@@ -58,7 +58,6 @@
// TODO: Make a Windows server, and clients...?
lcd_logical_driver lcd;
lcd_physical_driver drivers[] = {
@@ -140,7 +139,6 @@ lcd_init (char *args)
}
// TODO: lcd_remove_driver()
int
@@ -198,7 +196,6 @@ lcd_shutdown ()
{
lcd_logical_driver *driver;
LL_Rewind (list);
do {
driver = (lcd_logical_driver *) LL_Get (list);
@@ -223,8 +220,6 @@ lcd_shutdown ()
return 0;
}
int
lcd_drv_init (struct lcd_logical_driver *driver, char *args)
{
@@ -275,12 +270,9 @@ lcd_drv_init (struct lcd_logical_driver *driver, char *args)
lcd.getkey = lcd_drv_getkey;
return 1; // 1 is arbitrary. (must be 1 or more)
}
//////////////////////////////////////////////////////////////////////
// All functions below here call their respective driver functions...
//
@@ -296,7 +288,6 @@ lcd_drv_init (struct lcd_logical_driver *driver, char *args)
// driver->func() == -1 means it should call the generic driver.
//////////////////////////////////////////////////////////////////////
void
lcd_drv_close ()
{
@@ -342,7 +333,6 @@ lcd_drv_clear ()
}
void
lcd_drv_flush ()
{
@@ -363,7 +353,6 @@ lcd_drv_flush ()
} while (LL_Next (list) == 0);
}
void
lcd_drv_string (int x, int y, char string[])
{
@@ -404,8 +393,6 @@ lcd_drv_chr (int x, int y, char c)
} while (LL_Next (list) == 0);
}
int
lcd_drv_contrast (int contrast)
{
@@ -474,7 +461,6 @@ lcd_drv_output (int on)
} while (LL_Next (list) == 0);
}
void
lcd_drv_init_vbar ()
{
@@ -615,7 +601,6 @@ lcd_drv_hbar (int x, int y, int len)
} while (LL_Next (list) == 0);
}
void
lcd_drv_icon (int which, char dest)
{
@@ -636,7 +621,6 @@ lcd_drv_icon (int which, char dest)
} while (LL_Next (list) == 0);
}
void
lcd_drv_flush_box (int lft, int top, int rgt, int bot)
{
@@ -658,7 +642,6 @@ lcd_drv_flush_box (int lft, int top, int rgt, int bot)
}
// TODO: Check whether lcd.draw_frame() should really take a framebuffer
// TODO: as an argument, or if it should always use lcd.framebuf
void
@@ -682,7 +665,6 @@ lcd_drv_draw_frame (char *dat)
}
char
lcd_drv_getkey ()
{
-5
View File
@@ -7,13 +7,10 @@
#define LCD_MAX_HGT 256
#define LCD_MAX_HEIGHT 256
int lcd_init (char *args);
int lcd_add_driver (char *driver, char *args);
int lcd_shutdown ();
/////////////////////////////////////////////////////////////////
// Driver functions / info held here...
//
@@ -64,10 +61,8 @@ typedef struct lcd_physical_driver {
int (*init) (struct lcd_logical_driver * driver, char *device);
} lcd_physical_driver;
extern lcd_logical_driver lcd;
int lcd_drv_init (lcd_logical_driver * driver, char *args);
void lcd_drv_close ();
void lcd_drv_clear ();
-6
View File
@@ -17,7 +17,6 @@
#define __u32 unsigned int
#define __u8 unsigned char
#include "../../shared/debug.h"
#include "../../shared/str.h"
@@ -26,7 +25,6 @@
#include "lcd.h"
#include "lircin.h"
char *progname = "lircin";
int fd;
@@ -35,7 +33,6 @@ struct sockaddr_un addr;
static struct lirc_config *config;
//////////////////////////////////////////////////////////////////////////
////////////////////// Base "class" to derive from ///////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -56,7 +53,6 @@ lircin_close ()
lirc_deinit ();
}
//////////////////////////////////////////////////////////////////////
// Tries to read a character from an input device...
//
@@ -84,7 +80,6 @@ lircin_getkey ()
return 0;
}
////////////////////////////////////////////////////////////
// init() should set up any device-specific stuff, and
// point all the function pointers.
@@ -101,7 +96,6 @@ lircin_init (struct lcd_logical_driver *driver, char *args)
/* open socket to lirc */
if (-1 == (fd = lirc_init ("lcdd", 1))) {
fprintf (stderr, "no infrared remote support available\n");
return -1;
-2
View File
@@ -1,12 +1,10 @@
#ifndef LCD_LIRCIN_H
#define LCD_LIRCIN_H
extern lcd_logical_driver *lircin;
int lircin_init (struct lcd_logical_driver *driver, char *args);
void lircin_close ();
char lircin_getkey ();
#endif
-22
View File
@@ -15,7 +15,6 @@
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -33,8 +32,6 @@
#include "svgalib_drv.h"
#include "drv_base.h"
/* Small font */
const unsigned char simple_font5x7[] = {
@@ -168,14 +165,11 @@ const unsigned char simple_font5x7[] = {
/* ascii '126' (~) */ 31, 27, 23, 0, 23, 27, 31
};
// <start user definable!!!>
#define SVGALIB_FONT_VER 10 /* vertical spacing between lines (pixels) */
#define SVGALIB_Y_OFFSET 40 /* distance from the top of the screen (pixels) */
// <end user defineable!!!>
// No, I don't understand SVGALIB key mappings or a neat way of doing this
// Cursor keys manifest themselves as 3 byte excapes in svgalib: 27,91
// followed by one of the codes below.
@@ -193,7 +187,6 @@ void *SVGALIB_font; /* normal font */
void *SVGALIB_highfont; /* highlighted font (not used yet) */
void *SVGALIB_warnfont; /* warning font (not used yet) */
/*
Setting SVGALIB_figure_mappings will trap all keypresses and write the
vga_getkey() codes out to a file. You can then mod the getkey() function
@@ -208,10 +201,6 @@ int SVGALIB_figure_mappings = 0;
////////////////////// For Output on SVGALIB screen //////////////////////
//////////////////////////////////////////////////////////////////////////
void
ExpandGroovyFont (int w, int ht, unsigned char col, const unsigned char *fnt, unsigned char *ptr)
// Expand groovy 5x7 font into an area of memory
@@ -239,7 +228,6 @@ ExpandGroovyFont (int w, int ht, unsigned char col, const unsigned char *fnt, un
}
void
spaced_gl_writen (int x, int y, int count, char *text)
//
@@ -252,10 +240,8 @@ spaced_gl_writen (int x, int y, int count, char *text)
}
}
static char icon_char = '@';
int
svgalib_drv_init (struct lcd_logical_driver *driver, char *args)
{
@@ -291,7 +277,6 @@ svgalib_drv_init (struct lcd_logical_driver *driver, char *args)
gl_clearscreen (gl_rgbcolor (0, 0, 0));
// Override output functions...
driver->clear = svgalib_drv_clear;
driver->string = svgalib_drv_string;
@@ -337,7 +322,6 @@ svgalib_drv_clear ()
gl_clearscreen (gl_rgbcolor (0, 0, 0));
}
/////////////////////////////////////////////////////////////////
// Prints a string on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -408,7 +392,6 @@ svgalib_drv_num (int x, int num)
svgalib_drv_chr (x + dx, y, c);
}
/////////////////////////////////////////////////////////////////
// Draws a vertical bar; erases entire column onscreen.
//
@@ -444,7 +427,6 @@ svgalib_drv_hbar (int x, int y, int len)
}
}
/////////////////////////////////////////////////////////////////
// Sets character 0 to an icon...
//
@@ -465,25 +447,21 @@ svgalib_drv_icon (int which, char dest)
}
}
void
svgalib_drv_flush ()
{
}
void
svgalib_drv_flush_box (int lft, int top, int rgt, int bot)
{
}
void
svgalib_drv_draw_frame (char *dat)
{
}
char
svgalib_drv_getkey ()
{
-2
View File
@@ -1,7 +1,6 @@
#ifndef LCD_SVGALIB_H
#define LCD_SVGALIB_H
extern lcd_logical_driver *vgalib_drv;
int svgalib_drv_init (struct lcd_logical_driver *driver, char *args);
@@ -20,5 +19,4 @@ char svgalib_drv_getkey ();
void svgalib_drv_init_num ();
void svgalib_drv_num (int x, int num);
#endif
-10
View File
@@ -10,7 +10,6 @@
#include "text.h"
#include "drv_base.h"
lcd_logical_driver *text;
//////////////////////////////////////////////////////////////////////////
@@ -27,7 +26,6 @@ text_init (lcd_logical_driver * driver, char *args)
return -1;
}
driver->wid = 20;
driver->hgt = 4;
driver->cellwid = 5;
@@ -55,7 +53,6 @@ text_init (lcd_logical_driver * driver, char *args)
driver->getkey = NULL;
return 200; // 200 is arbitrary. (must be 1 or more)
}
@@ -75,7 +72,6 @@ text_clear ()
}
//////////////////////////////////////////////////////////////////
// Flushes all output to the lcd...
//
@@ -85,7 +81,6 @@ text_flush ()
text_draw_frame (lcd.framebuf);
}
/////////////////////////////////////////////////////////////////
// Prints a string on the lcd display, at position (x,y). The
// upper-left is (1,1), and the lower right should be (20,4).
@@ -116,8 +111,6 @@ text_chr (int x, int y, char c)
lcd.framebuf[(y * lcd.wid) + x] = c;
}
int
text_contrast (int contrast)
{
@@ -199,7 +192,6 @@ text_hbar (int x, int y, int len)
}
void
text_flush_box (int lft, int top, int rgt, int bot)
{
@@ -207,7 +199,6 @@ text_flush_box (int lft, int top, int rgt, int bot)
}
void
text_draw_frame (char *dat)
{
@@ -226,7 +217,6 @@ text_draw_frame (char *dat)
out[lcd.wid] = 0;
printf ("+%s+\n", out);
for (i = 0; i < lcd.hgt; i++) {
for (j = 0; j < lcd.wid; j++) {
out[j] = dat[j + (i * lcd.wid)];
-1
View File
@@ -21,5 +21,4 @@ void text_set_char (int n, char *dat);
void text_flush_box (int lft, int top, int rgt, int bot);
void text_draw_frame (char *dat);
#endif
-11
View File
@@ -128,7 +128,6 @@ sli_init (lcd_logical_driver * driver, char *args)
out[1] = 0x001; /* Clear LCD, not sure if this belongs here */
write (fd, out, 2);
if (!driver->framebuf) {
fprintf (stderr, "sli_init: No frame buffer.\n");
driver->close ();
@@ -140,7 +139,6 @@ sli_init (lcd_logical_driver * driver, char *args)
driver->wid = 15;
driver->hgt = 2;
// Set the functions the driver supports...
driver->clear = (void *) -1;
@@ -168,7 +166,6 @@ sli_init (lcd_logical_driver * driver, char *args)
return fd;
}
/* Clean-up */
void
sli_close ()
@@ -181,14 +178,12 @@ sli_close ()
sli->framebuf = NULL;
}
void
sli_flush ()
{
sli_draw_frame (lcd.framebuf);
}
/* no bounds checking is done in MtxOrb.c (which I shamelessly ripped)
this is bad imho, so I added it.. may remove later
speed is not a huge issue though, this isnt a
@@ -218,7 +213,6 @@ sli_flush_box (int lft, int top, int rgt, int bot)
write (fd, lcd.framebuf + (y * lcd.wid) + lft, rgt - lft + 1);
}
}
/////////////////////////////////////////////////////////////////
@@ -234,7 +228,6 @@ sli_chr (int x, int y, char c)
lcd.framebuf[(y * lcd.wid) + x] = c;
}
/////////////////////////////////////////////////////////////////
// Sets up for vertical bars. Call before lcd.vbar()
//
@@ -405,7 +398,6 @@ sli_vbar (int x, int len)
{
char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 };
int y;
for (y = lcd.hgt; y > 0 && len > 0; y--) {
if (len >= lcd.cellhgt)
@@ -438,7 +430,6 @@ sli_hbar (int x, int y, int len)
}
/////////////////////////////////////////////////////////////////
// Sets a custom character from 0-7...
//
@@ -480,7 +471,6 @@ sli_set_char (int n, char *dat)
write (fd, out, 2);
}
void
sli_icon (int which, char dest)
{
@@ -525,7 +515,6 @@ sli_icon (int which, char dest)
sli_set_char (dest, &icons[which][0]);
}
/////////////////////////////////////////////////////////////
// Blasts a single frame onscreen, to the lcd...
//
-3
View File
@@ -7,7 +7,6 @@
#ifndef SLI_H
#define SLI_H
extern lcd_logical_driver *sli;
int sli_init (lcd_logical_driver * driver, char *device);
@@ -28,6 +27,4 @@ void sli_icon (int which, char dest);
void sli_draw_frame (char *dat);
char sli_getkey ();
#endif