#ifndef __PSX_IOP_H__
#define __PSX_IOP_H__
#include "emuconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
#define IOP_EVENT_REG_STORE (0)
#define IOP_EVENT_REG_LOAD (1)
#define IOP_EVENT_INTR_SIGNAL (2)
#define IOP_EVENT_DMA_TRANSFER (3)
#define IOP_EVENT_VIRTUAL_IO (4)
#define IOP_EVENT_MAX (5)
#define IOP_AUDIT_UNUSED (0)
#define IOP_AUDIT_READ (1)
#define IOP_AUDIT_WRITE (2)
sint32 EMU_CALL iop_init(void);
uint32 EMU_CALL iop_get_state_size(int version);
void EMU_CALL iop_clear_state(void *state, int version);
void* EMU_CALL iop_get_r3000_state(void *state);
void* EMU_CALL iop_get_spu_state(void *state);
uint32 EMU_CALL iop_getword(void *state, uint32 a);
void EMU_CALL iop_setword(void *state, uint32 a, uint32 d);
void EMU_CALL iop_upload_to_ram(void *state, uint32 address, const void *src, uint32 len);
uint64 EMU_CALL iop_get_odometer(void *state);
void EMU_CALL iop_clear_events(void *state);
uint32 EMU_CALL iop_get_event_count(void *state);
void EMU_CALL iop_get_event(void *state, uint64 *time, uint32 *type, char **fmt, uint32 *arg);
void EMU_CALL iop_dismiss_event(void *state);
void EMU_CALL iop_set_event_mask(void *state, uint64 mask);
void EMU_CALL iop_register_map_for_auditing(void *state, uint8 *map);
uint32 EMU_CALL iop_get_bytes_used_in_audit(void *state);
void EMU_CALL iop_set_refresh(void *state, uint32 refresh);
sint32 EMU_CALL iop_execute(
void *state,
void *psx_state,
sint32 cycles,
sint16 *sound_buf,
uint32 *sound_samples,
uint32 event_mask
);
#define IOP_COMPAT_DEFAULT (0)
#define IOP_COMPAT_HARSH (1)
#define IOP_COMPAT_FRIENDLY (2)
void EMU_CALL iop_set_compat(void *state, uint8 compat);
void EMU_CALL iop_set_cycles_per_sample(void *state, uint32 cycles_per_sample);
#ifdef __cplusplus
}
#endif
#endif