#ifndef _SDK_
#define _SDK_

enum {
    buf_video_up_0= 0,
    buf_video_up_1,
    buf_video_down_0,
    buf_video_down_1,
    buf_audio_0,
    buf_audio_1,
    buf_c0_set,
    buf_max_num
};

struct buf_st
{
    unsigned int isused;
    unsigned int offset;
    unsigned int len;
    unsigned int use_len;
    unsigned int nds_max_len;
    unsigned int nds_cmd;
    unsigned int type;
    
//    unsigned int cpuaddr;//added in ds2sdk_v0.13beta
};

struct _rtc{
    volatile unsigned char year;        //add 2000 to get 4 digit year
    volatile unsigned char month;        //1 to 12
    volatile unsigned char day;        //1 to (days in month)

    volatile unsigned char weekday;    // day of week
    volatile unsigned char hours;        //0 to 11 for AM, 52 to 63 for PM
    volatile unsigned char minutes;    //0 to 59
    volatile unsigned char seconds;    //0 to 59
};

struct _key_buf
{
    unsigned short int key;
    unsigned short int x;
    unsigned short int y;
};

struct main_buf
{
    unsigned int key_buf_offset;  
    unsigned int key_buf_len;
    unsigned int key_write_num;
    unsigned int key_read_num;

    struct buf_st buf_st_list[0x10];
    unsigned int tempbuff;
    unsigned int tempbuff_len;

    unsigned int nds_video_up_w;
    unsigned int nds_video_up_r;
    unsigned int nds_video_down_w;
    unsigned int nds_video_down_r;
    unsigned int nds_audio_w;
    unsigned int nds_audio_r;
    struct _rtc nds_rtc;

    unsigned int nds_iqe_list_c0[0x10][512/4];
};

extern void BAG_FlipScreen(enum SCREEN_ID screen_num);
extern void BAG_ClearAllScreenMemory(void);

#endif
