X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fpico_int.h;h=48d8e294f2d05e5555ece8eb97239f6ea0f101c4;hb=07e5dbab71684189f10227108c1e71e2d002a734;hp=90731bd7be9049eda45ae7843746d322fe342a5b;hpb=679af8a3f466a2a4a20f58e4181a231fb73e9836;p=picodrive.git diff --git a/pico/pico_int.h b/pico/pico_int.h index 90731bd..48d8e29 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -229,12 +229,6 @@ extern int z80_scanline_cycles; /* cycles done until z80_scanline */ #define cycles_68k_to_z80(x) ((x)*957 >> 11) -#define Z80_MEM_SHIFT 13 -extern unsigned long z80_read_map [0x10000 >> Z80_MEM_SHIFT]; -extern unsigned long z80_write_map[0x10000 >> Z80_MEM_SHIFT]; -typedef unsigned char (z80_read_f)(unsigned short a); -typedef void (z80_write_f)(unsigned int a, unsigned char data); - // ----------------------- SH2 CPU ----------------------- #include "cpu/sh2/sh2.h" @@ -259,7 +253,7 @@ extern SH2 sh2s[2]; #define sh2_reg(c, x) (c) ? ssh2.r[x] : msh2.r[x] #define sh2_gbr(c) (c) ? ssh2.gbr : msh2.gbr #define sh2_vbr(c) (c) ? ssh2.vbr : msh2.vbr -#define sh2_sr(c) (c) ? ssh2.sr : msh2.sr +#define sh2_sr(c) (((c) ? ssh2.sr : msh2.sr) & 0xfff) #define sh2_set_gbr(c, v) \ { if (c) ssh2.gbr = v; else msh2.gbr = v; } @@ -443,6 +437,8 @@ typedef struct #define P32XV_PRI (1<< 7) #define P32XV_Mx (3<< 0) // display mode mask +#define P32XV_SFT (1<< 0) + #define P32XV_VBLK (1<<15) #define P32XV_HBLK (1<<14) #define P32XV_PEN (1<<13) @@ -472,11 +468,16 @@ typedef struct #define DMAC_FIFO_LEN (4*4) #define PWM_BUFF_LEN 1024 // in one channel samples +#define SH2_DRCBLK_RAM_SHIFT 1 +#define SH2_DRCBLK_DA_SHIFT 1 + +#define SH2_WRITE_SHIFT 25 + struct Pico32x { unsigned short regs[0x20]; - unsigned short vdp_regs[0x10]; - unsigned short sh2_regs[3]; + unsigned short vdp_regs[0x10]; // 0x40 + unsigned short sh2_regs[3]; // 0x60 unsigned char pending_fb; unsigned char dirty_pal; unsigned int emu_flags; @@ -491,9 +492,15 @@ struct Pico32x struct Pico32xMem { unsigned char sdram[0x40000]; +#ifdef DRC_SH2 + unsigned short drcblk_ram[1 << (18 - SH2_DRCBLK_RAM_SHIFT)]; +#endif unsigned short dram[2][0x20000/2]; // AKA fb unsigned char m68k_rom[0x10000]; // 0x100; using M68K_BANK_SIZE unsigned char data_array[2][0x1000]; // cache in SH2s (can be used as RAM) +#ifdef DRC_SH2 + unsigned short drcblk_da[2][1 << (12 - SH2_DRCBLK_DA_SHIFT)]; +#endif unsigned char sh2_rom_m[0x800]; unsigned char sh2_rom_s[0x400]; unsigned short pal[0x100]; @@ -542,10 +549,12 @@ int CM_compareRun(int cyc, int is_sub); PICO_INTERNAL void PicoFrameStart(void); void PicoDrawSync(int to, int blank_last_line); void BackFill(int reg7, int sh); -void FinalizeLineRGB555(int sh, int line); +void FinalizeLine555(int sh, int line); extern int DrawScanline; #define MAX_LINE_SPRITES 29 extern unsigned char HighLnSpr[240][3 + MAX_LINE_SPRITES]; +extern void *DrawLineDestBase; +extern int DrawLineDestIncrement; // draw2.c PICO_INTERNAL void PicoFrameFull(); @@ -554,7 +563,7 @@ PICO_INTERNAL void PicoFrameFull(); void PicoFrameStartMode4(void); void PicoLineMode4(int line); void PicoDoHighPal555M4(void); -void PicoDrawSetColorFormatMode4(int which); +void PicoDrawSetOutputMode4(pdso_t which); // memory.c PICO_INTERNAL void PicoMemSetup(void); @@ -712,6 +721,8 @@ void p32x_poll_event(int cpu_mask, int is_vdp); // 32x/draw.c void FinalizeLine32xRGB555(int sh, int line); +void PicoDraw32xLayer(int offs, int lines, int mdbg); +extern int Pico32xDrawMode; // 32x/pwm.c unsigned int p32x_pwm_read16(unsigned int a); @@ -727,6 +738,10 @@ static __inline int isspace_(int c) return (0x09 <= c && c <= 0x0d) || c == ' '; } +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#endif + // emulation event logging #ifndef EL_LOGMASK #define EL_LOGMASK 0 @@ -770,16 +785,28 @@ extern void lprintf(const char *fmt, ...); #define elprintf(w,f,...) #endif +// profiling +#ifdef PPROF +#include +#else +#define pprof_init() +#define pprof_finish() +#define pprof_start(x) +#define pprof_end(...) +#define pprof_end_sub(...) +#endif + +// misc #ifdef _MSC_VER #define cdprintf #else #define cdprintf(x...) #endif -#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 -#define MEMH_FUNC __attribute__((aligned(4))) +#ifdef __i386__ +#define REGPARM(x) __attribute__((regparm(x))) #else -#define MEMH_FUNC +#define REGPARM(x) #endif #ifdef __GNUC__