-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphics.h
65 lines (58 loc) · 1.69 KB
/
graphics.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright Jacques Deschênes 2018, 2019
* This file is part of BP_CHIPCON.
*
* BP_CHIPCON is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BP_CHIPCON is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BP_CHIPCON. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Description: SUPER CHIPCON game console on BLUE PILL.
*
* Auteur: PICATOUT
* Date: 2019-05-01
* Copyright Jacques Deschênes, 2019
* Licence: GPLv3
* revisions:
*
*/
/*
graphics functions interface
*/
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <stdint.h>
typedef enum BLIT_OP{
BIT_OR,
BIT_AND,
BIT_XOR,
BIT_INVERT,
BIT_SET,
} blit_op_t;
typedef enum BIT_PER_PIXEL{
ONE_BPP,
TWO_BPP,
FOUR_BPP,
}bits_per_pixel_t;
extern const uint8_t DEFAULT_PALETTE[4];
extern bits_per_pixel_t sprite_bpp;
void set_palette(const uint8_t palette[4]);
//void gfx_plot (int x,int y,uint8_t color);
void gfx_cls();
void gfx_scroll_up(uint8_t n);
void gfx_scroll_down(uint8_t n);
void gfx_scroll_left(uint8_t n);
void gfx_scroll_right(uint8_t n);
int gfx_blit(int x, int t, uint8_t color, blit_op_t op);
uint8_t gfx_get_pixel(int x, int y);
int gfx_sprite(int x, int y, uint8_t width, uint8_t height,const uint8_t *sprite);
#endif