#ifndef __PCFX_KING_H
#define __PCFX_KING_H

#include "vdc.h"

void KING_RunFrame(fx_vdc_t **, uint32 *pXBuf, MDFN_Rect *LineWidths, uint32 *, MDFN_Rect *, int skip);
void KING_SetPixelFormat(int rshift, int gshift, int bshift);
uint8 FXVCE_Read8(uint32 A);
void FXVCE_Write8(uint32 A, uint8 V);

uint8 KING_Read8(uint32 A);
uint16 KING_Read16(uint32 A);
uint32 KING_Read32(uint32 A);

void KING_Write8(uint32 A, uint8 V);
void KING_Write16(uint32 A, uint16 V);
void KING_Write32(uint32 A, uint32 V);
bool KING_Init(void);

uint16 KING_GetADPCMHalfWord(int ch);

uint8 KING_MemPeek(uint32 A);

uint8 KING_RB_Fetch();

bool KING_ToggleLayer(int which);

void KING_SetNextPADTime(int32 zetime);

void KING_CDIRQ(void);

int KING_StateAction(StateMem *sm, int load, int data_only);

bool KING_GetRegister(const std::string &name, uint32 &value, std::string *special);
void KING_SetGraphicsDecode(int line, int which, int w, int h, int xscroll, int yscroll, int pbn);
uint32 *KING_GetGraphicsDecodeBuffer(void);

void KING_NotifyOfBPE(bool read, bool write);

#endif
