#include "pcfx.h"

static uint8 data_out[2];

void FXPAD_SetInput(int port, int type, void *ptr, int attrib)
{

}

uint32 FXPAD_Read32(uint32 A)
{
 switch(A & 0xC0)
 {
  case 0x40: return(0xFF);
 }
 return(0);
}

uint16 FXPAD_Read16(uint32 A)
{
// return(rand());
 uint16 ret = 0;

 switch(A & 0xC0)
 {
  case 0x00: if(data_out[0] & 7) ret = 0x8; data_out[0] &= ~7; break;
  case 0x80: if(data_out[1] & 7) ret = 0x8; data_out[1] &= ~7; break;
 }
 return(ret);
}

void FXPAD_Write16(uint32 A, uint16 V)
{
 switch(A & 0xC0)
 {
  case 0x00: data_out[0] = V; break;
  case 0x80: data_out[1] = V; break;
 }
 //printf("Write16: %08x %04x\n", A, V);
}

void FXPAD_Write32(uint32 A, uint32 V)
{
 //printf("Write32: %08x %08x\n", A, V);
}

void FXPAD_Frame(void)
{


}

int FXPAD_StateAction(StateMem *sm, int load, int data_only)
{


}

