Audio-RaveMP

 view release on metacpan or  search on metacpan

ravemp.h  view on Meta::CPAN

#define STATUS_MASK (BUSY|ACK) /* These are the only valid bits in the status port */

static unsigned port=LPT1ADD;

#define CONTROL(x) (outb((x)^0x4,LPTCTL))	/* Note: Port hardware inverts all but bit 2 (0x4) */
#define STATUS() (inb(LPTSTAT)^0x80)		/* Note: Port hardware inverts bit 7 (0x80) */

/* Player device memory structures and sizes etc. Note that each
   "block" of player memory is split into a number of pages, and
   each page consists of a data area and a tag area. */

#define PAGE_SIZE 512	/* Size of data area */

#define TAG_SIZE 16		/* Size of tag area */

#define MAX_BLOCK_PAGES 32 /* Maximum pages per block (usually 16 or 32) */

#define PAGES_PER_BLOCK 32	/* Empirically determined as right value for internal RAM */

#define MAX_BLOCK_SIZE (MAX_BLOCK_PAGES*(PAGE_SIZE+TAG_SIZE)) /* Bytes per block */

#define DATA_SIZE (PAGES_PER_BLOCK*PAGE_SIZE)	/* Amount of data stored per block (i.e. exc. tags) */

#define TOTAL_BLOCKS 4096	/* Appropriate value for a 64MB Players */

/* The first 6 blocks are used for special purposes (we only need to
   bother with block 0, which containd the Allocation Table) */

#define MIN_DATA_BLOCK 6		/* Lowest block number used for data */

#define INVALID_BLOCK_NO 0xffff	/* Marker value used to indicate block number not valid */

/* Various timing and rety parameters */

#define DELAY_CYCLES 1	/* See iodelay() */

#define READ_RETRY_COUNT 4	/* Maximum retries for page/block read */

#define WRITE_RETRY_COUNT 4	/* Maximum retries for page/block write */

#define RETRY_PAUSE 3	/* Seconds to sleep after an error (not the best solution) */

/* Structure used when reading individual pages within a block */

struct page {
    unsigned char data[PAGE_SIZE];
    unsigned char tag[TAG_SIZE];
};

typedef struct {
    int number;
    char type;
} ravemp_slot;

/* Prototypes for local functions */

int ravemp_permitted(void);
int ravemp_check_idle(void);
ravemp_slot **ravemp_contents(unsigned listall, int *nslots);
char *ravemp_get_filename(unsigned sblock);
int ravemp_upload_file(char *fname, char *dest_name);
int ravemp_remove_file(unsigned firstblock);
int ravemp_download(unsigned firstblock, char *dest);
void ravemp_set_show_status(int status);

/* #define RAVEMP_DEBUG */
#ifdef RAVEMP_DEBUG
#define RMP_TRACE(a) a
#else
#define RMP_TRACE(a)
#endif



( run in 2.768 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )