2 // -------------------- Pico Library --------------------
\r
4 // Pico Library - Header File
\r
6 // (c) Copyright 2004 Dave, All rights reserved.
\r
7 // (c) Copyright 2006-2007 notaz, All rights reserved.
\r
8 // Free for non-commercial use.
\r
10 // For commercial use, separate licencing terms must be obtained.
\r
17 // port-specific compile-time settings
\r
18 #include <port_config.h>
\r
24 // external funcs for Sega/Mega CD
\r
25 int mp3_get_bitrate(FILE *f, int size);
\r
26 void mp3_start_play(FILE *f, int pos);
\r
27 int mp3_get_offset(void); // 0-1023
\r
28 void mp3_update(int *buffer, int length, int stereo);
\r
32 // PicoOpt bits LSb->MSb:
\r
33 // enable_ym2612&dac, enable_sn76496, enable_z80, stereo_sound,
\r
34 // alt_renderer, 6button_gamepad, accurate_timing, accurate_sprites,
\r
35 // draw_no_32col_border, external_ym2612, enable_cd_pcm, enable_cd_cdda
\r
36 // enable_cd_gfx, cd_perfect_sync, soft_32col_scaling, enable_cd_ramcart
\r
39 extern int PicoSkipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff
\r
40 extern int PicoRegionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe
\r
41 extern int PicoAutoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP
\r
43 void PicoExit(void);
\r
44 int PicoReset(int hard);
\r
45 int PicoFrame(void);
\r
46 void PicoFrameDrawOnly(void);
\r
47 extern int PicoPad[2]; // Joypads, format is MXYZ SACB RLDU
\r
48 extern void (*PicoWriteSound)(int len); // called once per frame at the best time to send sound buffer (PsndOut) to hardware
\r
49 extern void (*PicoMessage)(const char *msg); // callback to output text message from emu
\r
52 extern void (*PicoMCDopenTray)(void);
\r
53 extern int (*PicoMCDcloseTray)(void);
\r
54 extern int PicoCDBuffers;
\r
57 typedef size_t (arearw)(void *p, size_t _size, size_t _n, void *file);
\r
58 typedef size_t (areaeof)(void *file);
\r
59 typedef int (areaseek)(void *file, long offset, int whence);
\r
60 typedef int (areaclose)(void *file);
\r
61 // Save or load the state from PmovFile:
\r
62 int PmovState(int PmovAction, void *PmovFile); // &1=for reading &2=for writing &4=volatile &8=non-volatile
\r
63 extern arearw *areaRead; // external read and write function pointers for
\r
64 extern arearw *areaWrite; // gzip save state ability
\r
65 extern areaeof *areaEof;
\r
66 extern areaseek *areaSeek;
\r
67 extern areaclose *areaClose;
\r
68 extern void (*PicoStateProgressCB)(const char *str);
\r
71 int PicoCdLoadStateGfx(void *file);
\r
74 void PicoCDBufferInit(void);
\r
75 void PicoCDBufferFree(void);
\r
78 int Insert_CD(char *iso_name, int is_bin);
\r
79 void Stop_CD(void); // releases all resources taken when CD game was started.
\r
84 PMT_UNCOMPRESSED = 0,
\r
89 void *file; /* file handle */
\r
90 void *param; /* additional file related field */
\r
91 unsigned int size; /* size */
\r
94 pm_file *pm_open(const char *path);
\r
95 size_t pm_read(void *ptr, size_t bytes, pm_file *stream);
\r
96 int pm_seek(pm_file *stream, long offset, int whence);
\r
97 int pm_close(pm_file *fp);
\r
98 int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize);
\r
99 int PicoCartInsert(unsigned char *rom,unsigned int romsize);
\r
100 void Byteswap(unsigned char *data,int len);
\r
102 int PicoUnloadCart(unsigned char* romdata);
\r
103 extern void (*PicoCartLoadProgressCB)(int percent);
\r
106 void PicoDrawSetColorFormat(int which); // 0=BGR444, 1=RGB555, 2=8bit(HighPal pal)
\r
107 extern void *DrawLineDest;
\r
108 extern int (*PicoScan)(unsigned int num, void *data);
\r
110 extern unsigned short HighPal[0x100];
\r
111 extern int rendstatus;
\r
114 void *blockcpy(void *dst, const void *src, size_t n);
\r
116 #define blockcpy memcpy
\r
120 // stuff below is optional
\r
121 extern unsigned char *PicoDraw2FB; // buffer for fasr renderer in format (8+320)x(8+224+8) (eights for borders)
\r
122 extern unsigned short *PicoCramHigh; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)
\r
123 extern void (*PicoPrepareCram)(); // prepares PicoCramHigh for renderer to use
\r
126 extern int PsndRate,PsndLen;
\r
127 extern short *PsndOut;
\r
128 void sound_rerate(int preserve_state);
\r
131 extern int PicuAnd;
\r
132 int PicuQuick(unsigned short *dest,unsigned short *src);
\r
133 int PicuShrink(unsigned short *dest,int destLen,unsigned short *src,int srcLen);
\r
134 int PicuShrinkReverse(unsigned short *dest,int destLen,unsigned short *src,int srcLen);
\r
135 int PicuMerge(unsigned short *dest,int destLen,unsigned short *src,int srcLen);
\r
138 } // End of extern "C"
\r