X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico.h;h=43217dcc67485039a02a9e5b8cbb6c167474ec17;hb=89dbbf2b2fe885c9f443178c1f1350567e92160b;hp=6c6e7c5112eb30f274fb78f8bd69ee5d905f8591;hpb=2446536be520914616403876d7e49621ac6f4b95;p=picodrive.git diff --git a/pico/pico.h b/pico/pico.h index 6c6e7c5..43217dc 100644 --- a/pico/pico.h +++ b/pico/pico.h @@ -12,9 +12,6 @@ #include // size_t -// port-specific compile-time settings -#include - #ifdef __cplusplus extern "C" { #endif @@ -37,6 +34,7 @@ extern void cache_flush_d_inval_i(void *start_addr, void *end_addr); extern void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed); extern void *plat_mremap(void *ptr, size_t oldsize, size_t newsize); extern void plat_munmap(void *ptr, size_t size); +extern int plat_mem_set_exec(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); @@ -54,7 +52,7 @@ extern void *p32x_bios_g, *p32x_bios_m, *p32x_bios_s; #define POPT_EN_Z80 (1<< 2) #define POPT_EN_STEREO (1<< 3) #define POPT_ALT_RENDERER (1<< 4) // 00 00x0 -#define POPT_6BTN_PAD (1<< 5) +// unused (1<< 5) // unused (1<< 6) #define POPT_ACC_SPRITES (1<< 7) #define POPT_DIS_32C_BORDER (1<< 8) // 00 0x00 @@ -79,6 +77,10 @@ extern int PicoOpt; // bitfield #define PAHW_PICO (1<<3) #define PAHW_SMS (1<<4) extern int PicoAHW; // Pico active hw + +#define PQUIRK_FORCE_6BTN (1<<0) +extern int PicoQuirks; + extern int PicoSkipFrame; // skip rendering frame, but still do sound (if enabled) and emulation stuff extern int PicoRegionOverride; // override the region detection 0: auto, 1: Japan NTSC, 2: Japan PAL, 4: US, 8: Europe extern int PicoAutoRgnOrder; // packed priority list of regions, for example 0x148 means this detection order: EUR, USA, JAP @@ -97,7 +99,7 @@ typedef enum { PI_ROM, PI_ISPAL, PI_IS40_CELL, PI_IS240_LINES } pint_t; typedef union { int vint; void *vptr; } pint_ret_t; void PicoGetInternal(pint_t which, pint_ret_t *ret); -// cd/Pico.c +// cd/mcd.c extern void (*PicoMCDopenTray)(void); extern void (*PicoMCDcloseTray)(void); extern int PicoCDBuffers; @@ -170,7 +172,7 @@ typedef enum 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 PicoDrawSetOutFormat(pdso_t which, int use_32x_line_mode); void PicoDrawSetOutBuf(void *dest, int increment); void PicoDrawSetCallbacks(int (*begin)(unsigned int num), int (*end)(unsigned int num)); extern void *DrawLineDest; @@ -211,15 +213,20 @@ extern unsigned short *PicoCramHigh; // pointer to CRAM buff (0x40 shorts), conv extern void (*PicoPrepareCram)(); // prepares PicoCramHigh for renderer to use // pico.c (32x) -// multipliers against 68k clock -extern int p32x_msh2_multiplier; -extern int p32x_ssh2_multiplier; -#define SH2_MULTI_SHIFT 10 -#define MSH2_MULTI_DEFAULT ((1 << SH2_MULTI_SHIFT) * 21 / 10) -#define SSH2_MULTI_DEFAULT ((1 << SH2_MULTI_SHIFT) * 3 / 2) +#ifndef NO_32X + +void Pico32xSetClocks(int msh2_hz, int ssh2_hz); + +#else -// 32x/draw.c -void PicoDraw32xSetFrameMode(int is_on, int only_32x); +#define Pico32xSetClocks(msh2_khz, ssh2_khz) + +#endif + +// normally 68k clock (7670442) * 3, in reality but much lower +// because of high memory latencies +#define PICO_MSH2_HZ ((int)(7670442.0 * 2.4)) +#define PICO_SSH2_HZ ((int)(7670442.0 * 2.4)) // sound.c extern int PsndRate,PsndLen; @@ -245,6 +252,14 @@ int PicoCdCheck(const char *fname_in, int *pregion); extern unsigned char media_id_header[0x100]; +// memory.c +enum input_device { + PICO_INPUT_NOTHING, + PICO_INPUT_PAD_3BTN, + PICO_INPUT_PAD_6BTN, +}; +void PicoSetInputDevice(int port, enum input_device device); + #ifdef __cplusplus } // End of extern "C" #endif