view blastem.h @ 103:a71544cd01ea

Don't pre-emptively translate code at interrupt vectors as some PD ROMs have these pointing at junk. Need some kind of heuristic for detecting garbage if I'm going to translate them ahead of time by default.
author Mike Pavone <pavone@retrodev.com>
date Thu, 27 Dec 2012 22:48:54 -0800
parents 108e587165c0
children 209a37eed3e7
line wrap: on
line source

#ifndef BLASTEM_H_
#define BLASTEM_H_

#include <stdint.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);
uint16_t read_dma_value(uint32_t address);

#endif //BLASTEM_H_