summaryrefslogtreecommitdiff
path: root/blastem.h
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-06-25 19:20:39 -0700
committerMike Pavone <pavone@retrodev.com>2013-06-25 19:20:39 -0700
commit3caaed844a05a897e44df0685abfcbd1b162f862 (patch)
tree89596787e001cc65b41cb3b826e82350fd8d8ee2 /blastem.h
parentf8296ee1fa057adc180ed4d6a2066a841dbe74c4 (diff)
Move IO code to a separate file and do a tiny bit of refactoring
Diffstat (limited to 'blastem.h')
-rw-r--r--blastem.h27
1 files changed, 6 insertions, 21 deletions
diff --git a/blastem.h b/blastem.h
index 3688ea9..63571d2 100644
--- a/blastem.h
+++ b/blastem.h
@@ -7,19 +7,14 @@
#include "ym2612.h"
#include "vdp.h"
#include "psg.h"
-
-typedef struct {
- uint32_t th_counter;
- uint32_t timeout_cycle;
- uint8_t output;
- uint8_t control;
- uint8_t input[3];
-} io_port;
+#include "io.h"
#define RAM_FLAG_ODD 0x1800
#define RAM_FLAG_EVEN 0x1000
#define RAM_FLAG_BOTH 0x0000
+#define CYCLE_NEVER 0xFFFFFFFF
+
typedef struct {
m68k_context *m68k;
z80_context *z80;
@@ -30,24 +25,14 @@ typedef struct {
uint32_t save_ram_mask;
uint32_t save_flags;
uint8_t bank_regs[8];
+ io_port ports[3];
} genesis_context;
-#define GAMEPAD_TH0 0
-#define GAMEPAD_TH1 1
-#define GAMEPAD_EXTRA 2
-#define GAMEPAD_NONE 0xF
-
-extern io_port gamepad_1;
-extern io_port gamepad_2;
+extern genesis_context * genesis;
+extern int break_on_sync;
-void io_adjust_cycles(io_port * pad, uint32_t current_cycle, uint32_t deduction);
uint16_t read_dma_value(uint32_t address);
m68k_context * debugger(m68k_context * context, uint32_t address);
-void handle_keydown(int keycode);
-void handle_keyup(int keycode);
-void handle_joydown(int joystick, int button);
-void handle_joyup(int joystick, int button);
-void handle_joy_dpad(int joystick, int dpad, uint8_t state);
#endif //BLASTEM_H_