From 3caaed844a05a897e44df0685abfcbd1b162f862 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Tue, 25 Jun 2013 19:20:39 -0700 Subject: Move IO code to a separate file and do a tiny bit of refactoring --- blastem.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'blastem.h') 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_ -- cgit v1.2.3