aboutsummaryrefslogtreecommitdiff
path: root/splib.h
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-05-03 08:21:10 +0100
committerJuan J. Martinez <jjm@usebox.net>2021-05-03 10:00:00 +0100
commitc3b0fa04a663fe233765b83d3be41a42aa08c25d (patch)
tree0befda349001ef6ce306b39378f9c70ad917363e /splib.h
downloadreturn-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.tar.gz
return-of-traxtor-cpc-c3b0fa04a663fe233765b83d3be41a42aa08c25d.zip
Initial import for public releaseHEADmain
Diffstat (limited to 'splib.h')
-rw-r--r--splib.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/splib.h b/splib.h
new file mode 100644
index 0000000..7a063b5
--- /dev/null
+++ b/splib.h
@@ -0,0 +1,64 @@
+/*
+ The Return of Traxtor (Amstrad CPC)
+ Copyright (C) 2015 Juan J. Martinez <jjm@usebox.net>
+
+ This program 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.
+
+ This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+#ifndef _SPLIB_H
+#define _SPLIB_H
+
+#include <stdint.h>
+
+// CONFIGURE **
+// this is ; 84x180 pixels tiles
+#define TMW 7
+#define TMH 20
+
+#define TW 12
+#define TH 9
+
+#define BUFF_ADDR 0x0100
+// CONFIGURE **
+
+struct st_tile
+{
+ uint8_t *t;
+ uint16_t saddr;
+ uint16_t baddr;
+ uint8_t dirty;
+ struct st_tile *n;
+};
+
+void init_tiles();
+void update_screen();
+void validate_screen();
+void invalidate_screen();
+
+void invalidate_tile(struct st_tile *st);
+void invalidate_tile_xy(uint8_t x, uint8_t y);
+
+void erase_tile(struct st_tile *st);
+void erase_tile_xy(uint8_t x, uint8_t y);
+
+void put_tile(uint8_t *t, uint8_t x, uint8_t y);
+
+// misc
+uint16_t screen_addr(uint16_t x, uint16_t y);
+void wait_vsync();
+void set_hw_mode(uint8_t m);
+void set_hw_border(uint8_t c);
+void set_hw_ink(uint8_t ink, uint8_t c);
+void pad_numbers(uint8_t *s, uint8_t limit, uint16_t number);
+
+#endif // _SPLIB_H