mirror of
https://codeberg.org/hkzlab/TK2048.git
synced 2025-12-27 13:32:16 +11:00
Import empty project
This commit is contained in:
parent
dddb278e87
commit
384d9b3fd1
15 changed files with 496 additions and 0 deletions
26
src/utility.h
Normal file
26
src/utility.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef _UTILITY_HEADER_
|
||||
#define _UTILITY_HEADER_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define SCREEN_HEIGHT 192
|
||||
#define SCREEN_WIDTH_BYTES 128
|
||||
#define BYTES_PER_LINE 40
|
||||
|
||||
#define PEEKZ(a) (*(volatile uint8_t* __attribute__((zpage)))(a))
|
||||
#define POKEZ(a, b) ((*(volatile uint8_t* __attribute__((zpage)))(a)) = b)
|
||||
|
||||
#define PEEK(a) (*(volatile uint8_t*)(a))
|
||||
#define POKE(a, b) ((*(volatile uint8_t*)(a)) = b)
|
||||
|
||||
#define PEEKW(a) (*(volatile uint16_t*)(a))
|
||||
#define POKEW(a, b) ((*(volatile uint16_t*)(a)) = b)
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
uint8_t bit_count(uint8_t b);
|
||||
void clear_box(uint8_t w, uint8_t h, uint8_t off_x, uint8_t off_y, uint8_t *disp_buf);
|
||||
void draw_pic(uint16_t w, uint8_t h, uint8_t off_x, uint8_t off_y, const uint8_t *data, uint8_t *disp_buf);
|
||||
void print_line(const char* line, uint8_t off_x, uint8_t off_y);
|
||||
|
||||
#endif /* _UTILITY_HEADER_ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue