mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 13:24:01 +02:00
Added simple pixel graphics
Signed-off-by: Cestmir Houska <czestmyr@gmail.com>
This commit is contained in:
parent
a251f6682c
commit
4d23ff7e7a
3 changed files with 51 additions and 2 deletions
4
Makefile
4
Makefile
|
@ -1,9 +1,9 @@
|
||||||
CC=bcc
|
CC=bcc
|
||||||
CFLAGS=-Md -W
|
CFLAGS=-Md -W -O
|
||||||
|
|
||||||
all: brmbar.c
|
all: brmbar.c
|
||||||
# gcc -Wall brmbar.c dataio.c -o brmbar
|
# gcc -Wall brmbar.c dataio.c -o brmbar
|
||||||
bcc -Md -W brmbar.c dataio.c -o brmbar.com
|
bcc $(CFLAGS) brmbar.c dataio.c gfx.c -o brmbar.com
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f brmbar.com brmbar barcodes.svg
|
rm -f brmbar.com brmbar barcodes.svg
|
||||||
|
|
35
gfx.c
Normal file
35
gfx.c
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#include "gfx.h"
|
||||||
|
|
||||||
|
void init_graphics() {
|
||||||
|
#asm
|
||||||
|
mov al, #0x13
|
||||||
|
mov ah, #0x0
|
||||||
|
int 0x10
|
||||||
|
#endasm
|
||||||
|
}
|
||||||
|
|
||||||
|
void put_pixel(x, y, color)
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
char color;
|
||||||
|
{
|
||||||
|
x = x + y*320;
|
||||||
|
#asm
|
||||||
|
mov ax, #0xa000
|
||||||
|
mov es, ax
|
||||||
|
mov al, _put_pixel.color[bp]
|
||||||
|
mov di, _put_pixel.x[bp]
|
||||||
|
seg es
|
||||||
|
mov [di], al
|
||||||
|
#endasm
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void deinit_graphics() {
|
||||||
|
#asm
|
||||||
|
mov al, #0x12
|
||||||
|
mov ah, #0x0
|
||||||
|
int 0x10
|
||||||
|
#endasm
|
||||||
|
}
|
||||||
|
|
14
gfx.h
Normal file
14
gfx.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef _BRMBAR_GRAPHIX_H_
|
||||||
|
#define _BRMBAR_GRAPHIX_H_
|
||||||
|
|
||||||
|
#define COL_WHITE 15
|
||||||
|
#define COL_BLACK 0
|
||||||
|
|
||||||
|
extern void init_graphics();
|
||||||
|
|
||||||
|
extern void put_pixel(x, y, color);
|
||||||
|
|
||||||
|
extern void deinit_graphics();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue