X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico.h;h=870444aef78e53bbab3125cc6b160412e6fc7fc1;hb=b4db550e41b2aa277f570d7bff890c8e8ee1831f;hp=05f9fab619c38d08c405b1f4ae42c3dc38e78aca;hpb=83ff19ec52ff47992b5d6ceda3900b914eda2123;p=picodrive.git diff --git a/pico/pico.h b/pico/pico.h index 05f9fab..870444a 100644 --- a/pico/pico.h +++ b/pico/pico.h @@ -28,13 +28,19 @@ extern void mp3_update(int *buffer, int length, int stereo); // this function should write-back d-cache and invalidate i-cache // on a mem region [start_addr, end_addr) -// used by SVP dynarec +// used by dynarecs extern void cache_flush_d_inval_i(const void *start_addr, const void *end_addr); +// attempt to alloc mem at specified address. +// alloc anywhere else if that fails (callers should handle that) +extern void *plat_mmap(unsigned long addr, size_t size); +extern void *plat_mremap(void *ptr, size_t oldsize, size_t newsize); +extern void plat_munmap(void *ptr, size_t size); + // this one should handle display mode changes extern void emu_video_mode_change(int start_line, int line_count, int is_32cols); -// this must switch to 32bpp mode +// this must switch to 16bpp mode extern void emu_32x_startup(void); // optional 32X BIOS, should be left NULL if not used @@ -114,12 +120,11 @@ extern picohw_state PicoPicohw; // area.c int PicoState(const char *fname, int is_save); -int PicoStateLoadVDP(const char *fname); +int PicoStateLoadGfx(const char *fname); +void *PicoTmpStateSave(void); +void PicoTmpStateRestore(void *data); extern void (*PicoStateProgressCB)(const char *str); -// cd/area.c -int PicoCdLoadStateGfx(void *file); - // cd/buffering.c void PicoCDBufferInit(void); void PicoCDBufferFree(void); @@ -149,19 +154,24 @@ size_t pm_read(void *ptr, size_t bytes, pm_file *stream); int pm_seek(pm_file *stream, long offset, int whence); int pm_close(pm_file *fp); int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize,int is_sms); -int PicoCartInsert(unsigned char *rom,unsigned int romsize); +int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_cfg); void PicoCartUnload(void); extern void (*PicoCartLoadProgressCB)(int percent); extern void (*PicoCDLoadProgressCB)(const char *fname, int percent); // Draw.c -void PicoDrawSetColorFormat(int which); // 0=BGR444, 1=RGB555, 2=8bit(HighPal pal) +// for line-based renderer, set conversion +// from internal 8 bit representation in 'HighCol' to: +typedef enum +{ + PDF_NONE = 0, // no conversion + PDF_RGB555, // RGB/BGR output, depends on compile options + PDF_8BIT, // 8-bit out (handles shadow/hilight mode, sonic water) +} pdso_t; +void PicoDrawSetOutFormat(pdso_t which, int allow_32x); +void PicoDrawSetOutBuf(void *dest, int increment); extern void *DrawLineDest; -#if OVERRIDE_HIGHCOL extern unsigned char *HighCol; -#else -extern unsigned char HighCol[8+320+8]; -#endif extern int (*PicoScanBegin)(unsigned int num); extern int (*PicoScanEnd)(unsigned int num); // utility @@ -184,16 +194,26 @@ extern int PicoDrawMask; #define PDRAW_SONIC_MODE (1<<5) // mid-frame palette changes for 8bit renderer #define PDRAW_PLANE_HI_PRIO (1<<6) // have layer with all hi prio tiles (mk3) #define PDRAW_SHHI_DONE (1<<7) // layer sh/hi already processed -#define PDRAW_240LINES (1<<8) // 240 line display (224 if not set) +#define PDRAW_32_COLS (1<<8) // 32 column mode extern int rendstatus, rendstatus_old; +extern int rendlines; extern unsigned short HighPal[0x100]; -// Draw2.c +// draw.c +void PicoDrawUpdateHighPal(void); +void PicoDrawSetInternalBuf(void *dest, int line_increment); + +// draw2.c // stuff below is optional extern unsigned char *PicoDraw2FB; // buffer for fast renderer in format (8+320)x(8+224+8) (eights for borders) extern unsigned short *PicoCramHigh; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now) extern void (*PicoPrepareCram)(); // prepares PicoCramHigh for renderer to use +// 32x/draw.c +void PicoDraw32xSetFrameMode(int is_on, int only_32x); +extern int (*PicoScan32xBegin)(unsigned int num); +extern int (*PicoScan32xEnd)(unsigned int num); + // sound.c extern int PsndRate,PsndLen; extern short *PsndOut;