summaryrefslogtreecommitdiff
path: root/blastem.h
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2012-12-20 00:44:59 -0800
committerMike Pavone <pavone@retrodev.com>2012-12-20 00:44:59 -0800
commit45779ee397097f3249eb1a1a858c0f0ac02d3bba (patch)
tree01ee26e3746603d1077ba05b295498c0bde02cee /blastem.h
parenta8cc92ea4de90aed27a5163eabb46114f1e16e25 (diff)
Gamepad support
Diffstat (limited to 'blastem.h')
-rw-r--r--blastem.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/blastem.h b/blastem.h
new file mode 100644
index 0000000..e79c904
--- /dev/null
+++ b/blastem.h
@@ -0,0 +1,22 @@
+#ifndef BLASTEM_H_
+#define BLASTEM_H_
+
+typedef struct {
+ uint32_t th_counter;
+ uint32_t timeout_cycle;
+ uint8_t output;
+ uint8_t control;
+ uint8_t input[3];
+} io_port;
+
+#define GAMEPAD_TH0 0
+#define GAMEPAD_TH1 1
+#define GAMEPAD_EXTRA 2
+
+extern io_port gamepad_1;
+extern io_port gamepad_2;
+
+void io_adjust_cycles(io_port * pad, uint32_t current_cycle, uint32_t deduction);
+
+#endif //BLASTEM_H_
+