diff blastem.h @ 421:d0cacb4ade0b

Move IO code to a separate file and do a tiny bit of refactoring
author Mike Pavone <pavone@retrodev.com>
date Tue, 25 Jun 2013 19:20:39 -0700
parents dbf4e1c86f3c
children 7f84090ab1cd
line wrap: on
line diff
--- a/blastem.h	Mon Jun 24 21:32:25 2013 -0700
+++ b/blastem.h	Tue Jun 25 19:20:39 2013 -0700
@@ -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 @@
 	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 genesis_context * genesis;
+extern int break_on_sync;
 
-extern io_port gamepad_1;
-extern io_port gamepad_2;
-
-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_