Using a2x for manpages now, still adjustments to come

This commit is contained in:
Thomas Touhey 2016-07-18 14:17:23 +02:00
parent 3b21fd122e
commit 3e52e2507d
76 changed files with 1292 additions and 398 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/Makefile.cfg
/obj
/libmonochrome.a
/man

View File

@ -22,43 +22,74 @@ define \n
endef
# RULES
## Make everything (default)
## General
## - Make everything (default)
all: lib$(NAME).a
## Make the object directory
## Library related
## - Make the object directory
$(OBJDIR):
$(MKDIR) $@
$(MD) $@
## Make an object file out of a C source file
## - Make an object file out of a C source file
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(ALLINC)
$(CC) -c -o $@ $< $(CFLAGS)
## Make the library
## - Make the library
lib$(NAME).a: $(OBJDIR) $(ALLOBJ)
$(AR) rc $@ $(ALLOBJ)
$(RANLIB) $@
## Clean the object files
## - Clean the object files
clean:
$(RM) $(ALLOBJ)
## Clean the object files and the binary
## - Clean the object files and the binary
fclean: clean
$(RM) lib$(NAME).a
## Remake the project
## - Remake the library
re: fclean all
## Install project
## - Install library and includes
install:
$(INST) -D -m 644 lib$(NAME).a $(ILIBDIR)/lib$(NAME).a
$(foreach inc, $(INCPUB), \
$(INST) -D -m 644 $(INCDIR)/$(inc).h $(IINCDIR)/$(inc).h$(\n))
## Documentation related
## - Make man directories
define make-mandir-rule
$(MANDIR)/man$1:
$(MD) $$@
endef
$(foreach section,$(MAN_SECTS), \
$(eval $(call make-mandir-rule,$(section))))
## - Make-A-Manpage
define make-manpage-rule
$(MANDIR)/man$1/$2.$1: $(DOCDIR)/$2.$1.txt | $(MANDIR)/man$1
$(A2X) -f manpage -D $$| $$<
endef
$(foreach section,$(MAN_SECTS), \
$(foreach page,$(MAN_$(section)), \
$(eval $(call make-manpage-rule,$(section),$(page)))))
## - Make all manpages
all-doc: $(foreach section,$(MAN_SECTS),$(MAN_$(section):%=$(MANDIR)/man$(section)/%.$(section)))
## - Clean all manpages
clean-doc:
$(RM) $(foreach section,$(MAN_SECTS),$(MAN_$(section):%=$(MANDIR)/man$(section)/%.$(section)))
## Install doc
install-doc:
$(foreach man, $(MAN), \
$(INST) -D -m 644 $(MANDIR)/$(man) $(IMANDIR)/$(man)$(\n))
$(GZIP) $(MAN:%=$(IMANDIR)/%)
## Doz rulz are phunny
.PHONY: all clean fclean re install
.PHONY: all-doc install-doc
# END OF FILE

View File

@ -13,9 +13,15 @@ NAME = monochrome
VERSION = 1.1
# PROJECT DIRECTORIES
# - Includes directory
INCDIR = ./include
# - Sources directory
SRCDIR = ./src
# - Objects directory
OBJDIR = ./obj
# - Documentation directory
DOCDIR = ./doc
# - Manpages directory
MANDIR = ./man
# SOURCE FILES
@ -39,21 +45,14 @@ INCPUB = monochrome
INCINT = monochrome/internals
# MANPAGES
MAN3 = ml_bmp ml_bmp_8_and ml_bmp_8_or ml_bmp_8_xor \
ml_bmp_8_and_cl ml_bmp_8_or_cl ml_bmp_8_xor_cl \
ml_bmp_16_and ml_bmp_16_or ml_bmp_16_xor \
ml_bmp_16_and_cl ml_bmp_16_or_cl ml_bmp_16_xor_cl \
ml_bmp_and ml_bmp_or ml_bmp_xor \
ml_bmp_and_cl ml_bmp_or_cl ml_bmp_xor_cl \
ml_line ml_horizontal_line ml_vertical_line \
ml_circle ml_filled_circle \
ml_ellipse ml_filled_ellipse \
ml_ellipse_in_rect ml_filled_ellipse_in_rect \
ml_polygon ml_filled_polygon \
ml_scroll ml_vertical_scroll ml_horizontal_scroll \
ml_vram ml_vram_adress ml_clear_screen ml_clear_vram \
ml_display_vram ml_contrast ml_get_contrast ml_set_contrast
MAN = $(MAN3:%=man3/%.3)
## SECTIONS
MAN_SECTS = 3
## SECTIONS CONTENT
## - Third
MAN_3 = libmonochrome ML_bmp ML_circle ML_color \
ML_contrast ML_ellipse ML_line ML_pixel \
ML_point ML_polygon ML_rectangle ML_scroll \
ML_VRAM
# BIN UTILITIES
## Platform
@ -67,11 +66,13 @@ AR = $(PLATFORM)ar
## Ranlib
RANLIB = $(PLATFORM)ranlib
## Directory creator
MKDIR = mkdir -p
MD = mkdir -p
## File remover
RM = rm -f
## Compressor
GZIP = gzip -f
## Documentation maker
A2X = a2x
## Installer
INST = /usr/bin/install

44
doc/ML_VRAM.3.txt Normal file
View File

@ -0,0 +1,44 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_VRAM(3)
==========
NAME
----
ML_VRAM - Video RAM and Display Driver management functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
char* ML_vram_address();
void ML_clear_vram();
void ML_clear_screen();
void ML_display_vram();
----
DESCRIPTION
-----------
libmonochrome uses natively a double-buffering technique : the user program
draws on a working space, the VRAM, and when he finished drawing the frame,
this frame is sent to the Display Driver so it can appear on the screen.
ML_vram_adress is a system call that returns the address of the VRAM allocated
by the system. It is mainly meant for internal purposes, but if you want to use
the VRAM directly, you can use it.
ML_clear_screen sends a bunch of zeros to the Display Driver so the screen
content gets erased, but the VRAM stays as it is. ML_clear_vram does the
opposite : it clears the VRAM content while leaving the screen's one.
ML_display_vram sends the VRAM content to the Display Driver, so it can appear
on the screen.
SEE ALSO
--------
libmonochrome(3)

70
doc/ML_bmp.3.txt Normal file
View File

@ -0,0 +1,70 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_BMP(3)
=========
NAME
----
ML_bmp - BMP drawing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_bmp_or(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_and(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_xor(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_or_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_and_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_xor_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_8_or(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_and(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_xor(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_or_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_and_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_xor_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_16_or(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_and(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_xor(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_or_cl(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_and_cl(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_xor_cl(const unsigned short *bmp,
int x, int y);
----
DESCRIPTION
-----------
Those functions are meant to draw monochrome with fill bits bitmaps -- like game sprites -- on the VRAM.
Functions starting with the ML_bmp_8 draw 8*8 bitmaps. Functions starting with ML_bmp_16 draw 16*16 bitmaps. All other images must be drawn with the the other functions.
Function with the _cl suffix are functions using clipping, which means they are able to draw sprites even if they aren't completely on screen. Other functions only draw the bitmap if it is in the screen -- which makes them a little faster.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3)

33
doc/ML_circle.3.txt Normal file
View File

@ -0,0 +1,33 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_CIRCLE(3)
============
NAME
----
ML_circle - Circles drawing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_circle(int x, int y, int radius,
ML_Color color);
void ML_filled_circle(int x, int y,
int radius, ML_Color color);
----
DESCRIPTION
-----------
Those functions draw a circle on the VRAM.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

View File

@ -1,11 +1,20 @@
.TH ML_Color 3
.SH NAME
ML_Color - Colors from libmonochrome
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.in n
.nf
ML_COLOR(3)
===========
NAME
----
ML_color - Colors from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
typedef enum {
ML_TRANSPARENT = -1,
@ -14,18 +23,17 @@ typedef enum {
ML_XOR,
ML_CHECKER
} ML_Color;
.fi
----
.SH DESCRIPTION
DESCRIPTION
-----------
ML_Color is an enumeration of the different colors used by libmonochrome.
ML_XOR reverses the color of drawn-on pixels in the VRAM.
ML_CHECKER is a "checker" color. It renders a pixel white or black according to the following rule : if (x and y are even) or (x and y are odd), then the pixel becomes black, otherwise it becomes white.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3)

33
doc/ML_contrast.3.txt Normal file
View File

@ -0,0 +1,33 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_CONTRAST(3)
==============
NAME
----
ML_contrast - Screen contrast setting functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
#define ML_CONTRAST_MIN 130
#define ML_CONTRAST_NORMAL 168
#define ML_CONTRAST_MAX 190
void ML_set_contrast(unsigned char contrast);
unsigned char ML_get_contrast();
----
DESCRIPTION
-----------
Those functions set the contrast of the screen. This contrast must be greater
than ML_CONTRAST_MIN and lesser then ML_CONTRAST_MAX.
SEE ALSO
--------
libmonochrome(3)

37
doc/ML_ellipse.3.txt Normal file
View File

@ -0,0 +1,37 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_ELLIPSE(3)
=============
NAME
----
ML_ellipse - Ellipses drawing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_ellipse(int x, int y, int radius1,
int radius2, ML_Color color);
void ML_filled_ellipse(int x, int y,
int radius1, int radius2, ML_Color color);
void ML_ellipse_in_rect(int x1, int y1,
int x2, int y2, ML_Color color);
void ML_filled_ellipse_in_rect(int x, int y,
int radius1, int radius2, ML_Color color);
----
DESCRIPTION
-----------
These functions draw an ellipse in the VRAM.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

38
doc/ML_line.3.txt Normal file
View File

@ -0,0 +1,38 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_LINE(3)
==========
NAME
----
ML_line - Line drawing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_line(int x1, int y1, int x2,
int y2, ML_Color color);
void ML_horizontal_line(int y, int x1,
int x2, ML_Color color);
void ML_vertical_line(int x, int y1,
int y2, ML_Color color);
----
DESCRIPTION
-----------
These functions draw lines on the VRAM.
For horizontal line drawing, the ML_horizontal_line function is faster than
ML_line, which has a general algorithm (the Bresenham algorithm).
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

34
doc/ML_pixel.3.txt Normal file
View File

@ -0,0 +1,34 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_PIXEL(3)
===========
NAME
----
ML_pixel - Pixel setting and testing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_pixel(int x, int y, ML_Color color);
ML_Color ML_pixel_test(int x, int y);
----
DESCRIPTION
-----------
Sets or test (get) a pixel's state/color.
For ML_pixel_test, if the asked pixel is out of the screen, the returned color
will be ML_TRANSPARENT.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

30
doc/ML_point.3.txt Normal file
View File

@ -0,0 +1,30 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_POINT(3)
===========
NAME
----
ML_point - Point drawing function from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_point(int x, int y, int width, ML_Color color);
----
DESCRIPTION
-----------
Draws a (square) point on the VRAM.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

36
doc/ML_polygon.3.txt Normal file
View File

@ -0,0 +1,36 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_POLYGON(3)
=============
NAME
----
ML_polygon - Polygon drawing functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_polygon(const int *x, const int *y,
int nb_vertices, ML_Color color);
void ML_filled_polygon(const int *x, const int *y,
int nb_vertices, ML_Color color);
----
DESCRIPTION
-----------
Draws a polygon on the VRAM. This function needs as parameter 2 arrays,
containing abscissa and ordinates of the polygon vertices. Parameter nb_vertices
should be the number of data to read in arrays. This function draws a line
between each vertices in the polygon.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

32
doc/ML_rectangle.3.txt Normal file
View File

@ -0,0 +1,32 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_RECTANGLE(3)
===============
NAME
----
ML_rectangle - Rectangle drawing function from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_rectangle(int x1, int y1, int x2, int y2,
int border_width, ML_Color border_color,
ML_Color fill_color);
----
DESCRIPTION
-----------
Draws a rectangle with or without border on the VRAM.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

35
doc/ML_scroll.3.txt Normal file
View File

@ -0,0 +1,35 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
ML_SCROLL(3)
============
NAME
----
ML_scroll - VRAM scrolling functions from libmonochrome
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
void ML_horizontal_scroll(int scroll);
void ML_vertical_scroll(int scroll);
----
DESCRIPTION
-----------
Shifts all the pixels of the VRAM from left to right or from top to bottom.
If scroll's value is negative, the pixels will be shifted from right to left
or from bottom to top.
When pixels reach screen boundaries, they are moved to the other side.
SEE ALSO
--------
libmonochrome(3),
ML_VRAM(3),
ML_Color(3)

43
doc/libmonochrome.3.txt Normal file
View File

@ -0,0 +1,43 @@
:Author: Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libmonochrome
:man manual: libmonochrome
LIBMONOCHROME(3)
================
NAME
----
libmonochrome - fast and efficient drawing library for CASIO monochrome calculators
SYNOPSIS
--------
[source,c]
----
#include <monochrome.h>
ML_clear_vram();
ML_line(0, 0, 127, 63);
ML_line(127, 0, 0, 63);
ML_display_vram();
----
DESCRIPTION
-----------
libmonochrome provides tools to work with the VRAM and the Display Driver.
SEE ALSO
--------
ML_vram(3),
ML_contrast(3),
ML_Color(3),
ML_pixel(3),
ML_point(3),
ML_line(3),
ML_rectangle(3),
ML_polygon(3),
ML_circle(3),
ML_ellipse(3),
ML_scroll(3),
ML_bmp(3)

59
man/man3/ML_VRAM.3 Normal file
View File

@ -0,0 +1,59 @@
'\" t
.\" Title: ml_vram
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_VRAM" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_VRAM \- Video RAM and Display Driver management functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
char* ML_vram_address();
void ML_clear_vram();
void ML_clear_screen();
void ML_display_vram();
.fi
.SH "DESCRIPTION"
.sp
libmonochrome uses natively a double\-buffering technique : the user program draws on a working space, the VRAM, and when he finished drawing the frame, this frame is sent to the Display Driver so it can appear on the screen\&.
.sp
ML_vram_adress is a system call that returns the address of the VRAM allocated by the system\&. It is mainly meant for internal purposes, but if you want to use the VRAM directly, you can use it\&.
.sp
ML_clear_screen sends a bunch of zeros to the Display Driver so the screen content gets erased, but the VRAM stays as it is\&. ML_clear_vram does the opposite : it clears the VRAM content while leaving the screen\(cqs one\&.
.sp
ML_display_vram sends the VRAM content to the Display Driver, so it can appear on the screen\&.
.SH "SEE ALSO"
.sp
libmonochrome(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

91
man/man3/ML_bmp.3 Normal file
View File

@ -0,0 +1,91 @@
'\" t
.\" Title: ml_bmp
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_BMP" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_bmp \- BMP drawing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_bmp_or(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_and(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_xor(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_or_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_and_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_xor_cl(const unsigned char *bmp,
int x, int y, int width, int height);
void ML_bmp_8_or(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_and(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_xor(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_or_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_and_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_8_xor_cl(const unsigned char *bmp,
int x, int y);
void ML_bmp_16_or(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_and(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_xor(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_or_cl(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_and_cl(const unsigned short *bmp,
int x, int y);
void ML_bmp_16_xor_cl(const unsigned short *bmp,
int x, int y);
.fi
.SH "DESCRIPTION"
.sp
Those functions are meant to draw monochrome with fill bits bitmaps \(em like game sprites \(em on the VRAM\&.
.sp
Functions starting with the ML_bmp_8 draw 8*8 bitmaps\&. Functions starting with ML_bmp_16 draw 16*16 bitmaps\&. All other images must be drawn with the the other functions\&.
.sp
Function with the _cl suffix are functions using clipping, which means they are able to draw sprites even if they aren\(cqt completely on screen\&. Other functions only draw the bitmap if it is in the screen \(em which makes them a little faster\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

53
man/man3/ML_circle.3 Normal file
View File

@ -0,0 +1,53 @@
'\" t
.\" Title: ml_circle
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_CIRCLE" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_circle \- Circles drawing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_circle(int x, int y, int radius,
ML_Color color);
void ML_filled_circle(int x, int y,
int radius, ML_Color color);
.fi
.SH "DESCRIPTION"
.sp
Those functions draw a circle on the VRAM\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

60
man/man3/ML_color.3 Normal file
View File

@ -0,0 +1,60 @@
'\" t
.\" Title: ml_color
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_COLOR" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_color \- Colors from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
typedef enum {
ML_TRANSPARENT = \-1,
ML_WHITE,
ML_BLACK,
ML_XOR,
ML_CHECKER
} ML_Color;
.fi
.SH "DESCRIPTION"
.sp
ML_Color is an enumeration of the different colors used by libmonochrome\&.
.sp
ML_XOR reverses the color of drawn\-on pixels in the VRAM\&.
.sp
ML_CHECKER is a "checker" color\&. It renders a pixel white or black according to the following rule : if (x and y are even) or (x and y are odd), then the pixel becomes black, otherwise it becomes white\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

54
man/man3/ML_contrast.3 Normal file
View File

@ -0,0 +1,54 @@
'\" t
.\" Title: ml_contrast
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_CONTRAST" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_contrast \- Screen contrast setting functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
#define ML_CONTRAST_MIN 130
#define ML_CONTRAST_NORMAL 168
#define ML_CONTRAST_MAX 190
void ML_set_contrast(unsigned char contrast);
unsigned char ML_get_contrast();
.fi
.SH "DESCRIPTION"
.sp
Those functions set the contrast of the screen\&. This contrast must be greater than ML_CONTRAST_MIN and lesser then ML_CONTRAST_MAX\&.
.SH "SEE ALSO"
.sp
libmonochrome(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

57
man/man3/ML_ellipse.3 Normal file
View File

@ -0,0 +1,57 @@
'\" t
.\" Title: ml_ellipse
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_ELLIPSE" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_ellipse \- Ellipses drawing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_ellipse(int x, int y, int radius1,
int radius2, ML_Color color);
void ML_filled_ellipse(int x, int y,
int radius1, int radius2, ML_Color color);
void ML_ellipse_in_rect(int x1, int y1,
int x2, int y2, ML_Color color);
void ML_filled_ellipse_in_rect(int x, int y,
int radius1, int radius2, ML_Color color);
.fi
.SH "DESCRIPTION"
.sp
These functions draw an ellipse in the VRAM\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

57
man/man3/ML_line.3 Normal file
View File

@ -0,0 +1,57 @@
'\" t
.\" Title: ml_line
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_LINE" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_line \- Line drawing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_line(int x1, int y1, int x2,
int y2, ML_Color color);
void ML_horizontal_line(int y, int x1,
int x2, ML_Color color);
void ML_vertical_line(int x, int y1,
int y2, ML_Color color);
.fi
.SH "DESCRIPTION"
.sp
These functions draw lines on the VRAM\&.
.sp
For horizontal line drawing, the ML_horizontal_line function is faster than ML_line, which has a general algorithm (the Bresenham algorithm)\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

53
man/man3/ML_pixel.3 Normal file
View File

@ -0,0 +1,53 @@
'\" t
.\" Title: ml_pixel
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_PIXEL" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_pixel \- Pixel setting and testing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_pixel(int x, int y, ML_Color color);
ML_Color ML_pixel_test(int x, int y);
.fi
.SH "DESCRIPTION"
.sp
Sets or test (get) a pixel\(cqs state/color\&.
.sp
For ML_pixel_test, if the asked pixel is out of the screen, the returned color will be ML_TRANSPARENT\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

50
man/man3/ML_point.3 Normal file
View File

@ -0,0 +1,50 @@
'\" t
.\" Title: ml_point
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_POINT" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_point \- Point drawing function from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_point(int x, int y, int width, ML_Color color);
.fi
.SH "DESCRIPTION"
.sp
Draws a (square) point on the VRAM\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

53
man/man3/ML_polygon.3 Normal file
View File

@ -0,0 +1,53 @@
'\" t
.\" Title: ml_polygon
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_POLYGON" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_polygon \- Polygon drawing functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_polygon(const int *x, const int *y,
int nb_vertices, ML_Color color);
void ML_filled_polygon(const int *x, const int *y,
int nb_vertices, ML_Color color);
.fi
.SH "DESCRIPTION"
.sp
Draws a polygon on the VRAM\&. This function needs as parameter 2 arrays, containing abscissa and ordinates of the polygon vertices\&. Parameter nb_vertices should be the number of data to read in arrays\&. This function draws a line between each vertices in the polygon\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

52
man/man3/ML_rectangle.3 Normal file
View File

@ -0,0 +1,52 @@
'\" t
.\" Title: ml_rectangle
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_RECTANGLE" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_rectangle \- Rectangle drawing function from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_rectangle(int x1, int y1, int x2, int y2,
int border_width, ML_Color border_color,
ML_Color fill_color);
.fi
.SH "DESCRIPTION"
.sp
Draws a rectangle with or without border on the VRAM\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

53
man/man3/ML_scroll.3 Normal file
View File

@ -0,0 +1,53 @@
'\" t
.\" Title: ml_scroll
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome
.\" Language: English
.\"
.TH "ML_SCROLL" "3" "07/18/2016" "libmonochrome" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ML_scroll \- VRAM scrolling functions from libmonochrome
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
void ML_horizontal_scroll(int scroll);
void ML_vertical_scroll(int scroll);
.fi
.SH "DESCRIPTION"
.sp
Shifts all the pixels of the VRAM from left to right or from top to bottom\&. If scroll\(cqs value is negative, the pixels will be shifted from right to left or from bottom to top\&.
.sp
When pixels reach screen boundaries, they are moved to the other side\&.
.SH "SEE ALSO"
.sp
libmonochrome(3), ML_VRAM(3), ML_Color(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

View File

@ -1,34 +1,53 @@
.TH libmonochrome 3
.SH NAME
libmonochrome - fast and efficient drawing library for CASIO monochrome calculators
'\" t
.\" Title: libmonochrome
.\" Author: Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/18/2016
.\" Manual: libmonochrome
.\" Source: libmonochrome 1.0
.\" Language: English
.\"
.TH "LIBMONOCHROME" "3" "07/18/2016" "libmonochrome 1\&.0" "libmonochrome"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
libmonochrome \- fast and efficient drawing library for CASIO monochrome calculators
.SH "SYNOPSIS"
.sp
.nf
#include <monochrome\&.h>
.SH SYNOPSIS
.B #include <monochrome.h>
.B ML_clear_vram();
.B ML_line(0, 0, 127, 63);
.B ML_line(127, 0, 0, 63);
.B ML_display_vram();
.SH DESCRIPTION
libmonochrome provides tools to work with the VRAM and the Display Driver.
.SH SEE ALSO
.BR ML_vram(3),
.BR ML_contrast(3),
.BR ML_Color(3),
.BR ML_pixel(3),
.BR ML_point(3),
.BR ML_line(3),
.BR ML_rectangle(3),
.BR ML_polygon(3),
.BR ML_circle(3),
.BR ML_ellipse(3),
.BR ML_scroll(3),
.BR ML_bmp(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.
ML_clear_vram();
ML_line(0, 0, 127, 63);
ML_line(127, 0, 0, 63);
ML_display_vram();
.fi
.SH "DESCRIPTION"
.sp
libmonochrome provides tools to work with the VRAM and the Display Driver\&.
.SH "SEE ALSO"
.sp
ML_vram(3), ML_contrast(3), ML_Color(3), ML_pixel(3), ML_point(3), ML_line(3), ML_rectangle(3), ML_polygon(3), ML_circle(3), ML_ellipse(3), ML_scroll(3), ML_bmp(3)
.SH "AUTHOR"
.PP
\fBThomas "Cakeisalie5" Touhey\fR <\&thomas@touhey\&.fr\&>
.RS 4
Author.
.RE

View File

@ -1,58 +0,0 @@
.TH ML_bmp 3
.SH NAME
ML_bmp - BMP drawing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_bmp_or(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_and(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_xor(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_or_cl(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_and_cl(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_xor_cl(const unsigned char *bmp, int x, int y, int width, int height);
.B void ML_bmp_8_or(const unsigned char *bmp, int x, int y);
.B void ML_bmp_8_and(const unsigned char *bmp, int x, int y);
.B void ML_bmp_8_xor(const unsigned char *bmp, int x, int y);
.B void ML_bmp_8_or_cl(const unsigned char *bmp, int x, int y);
.B void ML_bmp_8_and_cl(const unsigned char *bmp, int x, int y);
.B void ML_bmp_8_xor_cl(const unsigned char *bmp, int x, int y);
.B void ML_bmp_16_or(const unsigned short *bmp, int x, int y);
.B void ML_bmp_16_and(const unsigned short *bmp, int x, int y);
.B void ML_bmp_16_xor(const unsigned short *bmp, int x, int y);
.B void ML_bmp_16_or_cl(const unsigned short *bmp, int x, int y);
.B void ML_bmp_16_and_cl(const unsigned short *bmp, int x, int y);
.B void ML_bmp_16_xor_cl(const unsigned short *bmp, int x, int y);
.SH DESCRIPTION
Those functions are meant to draw monochrome with fill bits bitmaps -- like game sprites -- on the VRAM.
Functions starting with the ML_bmp_8 draw 8*8 bitmaps. Functions starting with ML_bmp_16 draw 16*16 bitmaps. All other images must be drawn with the the other functions.
Function with the _cl suffix are functions using clipping, which means they are able to draw sprites even if they aren't completely on screen. Other functions only draw the bitmap if it is in the screen -- which makes them a little faster.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1 +0,0 @@
ml_bmp.3

View File

@ -1,21 +0,0 @@
.TH ML_circle 3
.SH NAME
ML_circle - Circles drawing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_circle(int x, int y, int radius, ML_Color color);
.B void ML_filled_circle(int x, int y, int radius, ML_Color color);
.SH DESCRIPTION
Those functions draw a circle on the VRAM.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_vram.3

View File

@ -1 +0,0 @@
ml_vram.3

View File

@ -1,25 +0,0 @@
.TH ML_Contrast 3
.SH NAME
ML_Contrast - Screen contrast setting functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B #define ML_CONTRAST_MIN 130
.B #define ML_CONTRAST_NORMAL 168
.B #define ML_CONTRAST_MAX 190
.B void ML_set_contrast(unsigned char contrast);
.B unsigned char ML_get_contrast();
.SH DESCRIPTION
Those functions set the contrast of the screen. This contrast must be greater than ML_CONTRAST_MIN and lesser then ML_CONTRAST_MAX.
.SH SEE ALSO
.BR libmonochrome(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_vram.3

View File

@ -1,25 +0,0 @@
.TH ML_ellipse 3
.SH NAME
ML_ellipse - Ellipses drawing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
.B void ML_filled_ellipse(int x, int y, int radius1, int radius2, ML_Color color);
.B void ML_ellipse_in_rect(int x1, int y1, int x2, int y2, ML_Color color);
.B void ML_filled_ellipse_in_rect(int x, int y, int radius1, int radius2, ML_Color color);
.SH DESCRIPTION
These functions draw an ellipse in the VRAM.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_ellipse.3

View File

@ -1 +0,0 @@
ml_circle.3

View File

@ -1 +0,0 @@
ml_ellipse.3

View File

@ -1 +0,0 @@
ml_ellipse.3

View File

@ -1 +0,0 @@
ml_polygon.3

View File

@ -1 +0,0 @@
ml_contrast.3

View File

@ -1 +0,0 @@
ml_line.3

View File

@ -1 +0,0 @@
ml_scroll.3

View File

@ -1,25 +0,0 @@
.TH ML_line 3
.SH NAME
ML_line - Line drawing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_line(int x1, int y1, int x2, int y2, ML_Color color);
.B void ML_horizontal_line(int y, int x1, int x2, ML_Color color);
.B void ML_vertical_line(int x, int y1, int y2, ML_Color color);
.SH DESCRIPTION
These functions draw lines on the VRAM.
For horizontal line drawing, the ML_horizontal_line function is faster than ML_line, which has a general algorithm (the Bresenham algorithm).
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1,23 +0,0 @@
.TH ML_pixel 3
.SH NAME
ML_pixel - Pixel setting and testing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_pixel(int x, int y, ML_Color color);
.B ML_Color ML_pixel_test(int x, int y);
.SH DESCRIPTION
Sets or test (get) a pixel's state/color.
For ML_pixel_test, if the asked pixel is out of the screen, the returned color will be ML_TRANSPARENT.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_pixel.3

View File

@ -1,19 +0,0 @@
.TH ML_point 3
.SH NAME
ML_point - Point drawing function from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_point(int x, int y, int width, ML_Color color);
.SH DESCRIPTION
Draws a (square) point on the VRAM.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1,21 +0,0 @@
.TH ML_polygon 3
.SH NAME
ML_polygon - Polygon drawing functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_polygon(const int *x, const int *y, int nb_vertices, ML_Color color);
.B void ML_filled_polygon(const int *x, const int *y, int nb_vertices, ML_Color color);
.SH DESCRIPTION
Draws a polygon on the VRAM. This function needs as parameter 2 arrays, containing abscissa and ordinates of the polygon vertices. Parameter nb_vertices should be the number of data to read in arrays. This function draws a line between each vertices in the polygon.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1,19 +0,0 @@
.TH ML_rectangle 3
.SH NAME
ML_rectangle - Rectangle drawing function from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_rectangle(int x1, int y1, int x2, int y2, int border_width, ML_Color border_color, ML_Color fill_color);
.SH DESCRIPTION
Draws a rectangle with or without border on the VRAM.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_vram.3

View File

@ -1,23 +0,0 @@
.TH ML_scroll 3
.SH NAME
ML_scroll - VRAM scrolling functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B void ML_horizontal_scroll(int scroll);
.B void ML_vertical_scroll(int scroll);
.SH DESCRIPTION
Shifts all the pixels of the VRAM from left to right or from top to bottom. If scroll's value is negative, the pixels will be shifted from right to left or from bottom to top.
When pixels reach screen boundaries, they are moved to the other side.
.SH SEE ALSO
.BR libmonochrome(3),
.BR ML_VRAM(3),
.BR ML_Color(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_contrast.3

View File

@ -1 +0,0 @@
ml_line.3

View File

@ -1 +0,0 @@
ml_scroll.3

View File

@ -1,29 +0,0 @@
.TH ML_VRAM 3
.SH NAME
ML_VRAM - Video RAM and Display Driver management functions from libmonochrome
.SH SYNOPSIS
.B #include <monochrome.h>
.B char* ML_vram_adress();
.B void ML_clear_vram();
.B void ML_clear_screen();
.B void ML_display_vram();
.SH DESCRIPTION
libmonochrome uses natively a double-buffering technique : the user program draws on a working space, the VRAM, and when he finished drawing the frame, this frame is sent to the Display Driver so it can appear on the screen.
ML_vram_adress is a system call that returns the address of the VRAM allocated by the system. It is mainly meant for internal purposes, but if you want to use the VRAM directly, you can use it.
ML_clear_screen sends a bunch of zeros to the Display Driver so the screen content gets erased, but the VRAM stays as it is. ML_clear_vram does the opposite : it clears the VRAM content while leaving the screen's one.
ML_display_vram sends the VRAM content to the Display Driver, so it can appear on the screen.
.SH SEE ALSO
.BR libmonochrome(3)
.SH AUTHOR
Copyright (C) 2016 by Thomas "CakeIsALie5" Touhey.

View File

@ -1 +0,0 @@
ml_vram.3

View File

@ -10,7 +10,7 @@
#include <monochrome/internals.h>
static void ML_bmp_line(unsigned char *vram, const unsigned char *b,
static inline void ML_bmp_line(unsigned char *vram, const unsigned char *b,
int width, int offset, ML_Mode mode);
static inline void ML_bmp_byte(unsigned char *v, int b, int offset, int width,
ML_Mode mode);
@ -58,7 +58,7 @@ void ML_bmp(const void *bmp, int x, int y, int width, int height, ML_Mode mode)
}
}
static void ML_bmp_line(unsigned char *vram, const unsigned char *b,
static inline void ML_bmp_line(unsigned char *vram, const unsigned char *b,
int width, int offset, ML_Mode mode)
{
while (1) {