
#ifndef _VDP_H_
#define _VDP_H_



/* Global data */
extern vuint16 *vdp1_vram;
extern vuint16 *vdp1_fb;
extern vuint16 *vdp2_vram;
extern vuint16 *vdp2_cram;

/* Function prototypes */
void vdp_init(void);
void vdp_shutdown();
void wait_hblank(void);
void wait_hblank_in(void);
void wait_hblank_out(void);
void wait_vblank_in(void);
void wait_vblank_out(void);
void wait_vblank(void);


/* Create a 5:5:5 RGB color with the MSB set */
#define COLOR(r,g,b) (((r)&0x1F)|((g)&0x1F)<<5|((b)&0x1F)<<10|0x8000)
#define TRANSCOLOR   0x0000


/**********************************************************************
 * VDP1 Commands stuff                                               *
**********************************************************************/
uint16 vdp1_list_get_index(void);
void vdp1_list_set_index(uint16 i);
void vdp1_list_start(void);
void vdp1_mesh(int n);

void vdp1_start(int buffer_count, int commands_count);
unsigned long vdp1_flip(void);


void vdp1_add_system_clip(int16 x, int16 y);
void vdp1_add_user_clip(int16 x1, int16 y1, int16 x2, int16 y2);
void vdp1_add_local_coords(int16 x, int16 y);
void vdp1_add_polyline(int16 x1, int16 y1, int16 x2, int16 y2, int16 x3, int16 y3, int16 x4, int16 y4, uint16 color);
void vdp1_add_polygon(int16 x1, int16 y1, int16 x2, int16 y2, int16 x3, int16 y3, int16 x4, int16 y4, uint16 color, uint32 grda);
void vdp1_add_distorted_sprite(int16 x1, int16 y1, int16 x2, int16 y2, int16 x3, int16 y3, int16 x4, int16 y4, uint32 source, int w, int h);



#endif /* _VDP_H_ */

