X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=pico%2Fpico_int.h;h=d73041ef90ecaea7d52485460ab8a03b88c91c0a;hb=266c6afa84bde8d77a54d61ced8f227480247e24;hp=013ce2c2b5caf145e8ce49428d866a69f92b800a;hpb=5e49c3a88d1c3ece302a40d8c3a32285d3199ab6;p=picodrive.git diff --git a/pico/pico_int.h b/pico/pico_int.h index 013ce2c..d73041e 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -226,6 +226,20 @@ 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/sh2mame/sh2.h" + +SH2 msh2, ssh2; +#define ash2_pc() msh2.ppc +#define ash2_end_run(after) sh2_icount = after + +#define msh2_pc() msh2.ppc +#define ssh2_pc() ssh2.ppc + +#define msh2_reg(x) msh2.r[x] +#define ssh2_reg(x) ssh2.r[x] + // --------------------------------------------------------- // main oscillator clock which controls timing @@ -259,7 +273,7 @@ struct PicoMisc unsigned short z80_bank68k; // 0a unsigned short pad0; unsigned char pad1; - unsigned char z80_reset; // z80 reset held + unsigned char z80_reset; // 0f z80 reset held unsigned char padDelay[2]; // 10 gamepad phase time outs, so we count a delay unsigned short eeprom_addr; // EEPROM address register unsigned char eeprom_cycle; // EEPROM cycle number @@ -389,15 +403,22 @@ typedef struct #define Pico_mcd ((mcd_state *)Pico.rom) // 32X -#define P32XV_nPAL (1<<15) -#define P32XV_PRI (1<< 7) -#define P32XV_Mx (3<< 0) +#define P32XS_FM (1<<15) +#define P32XS2_ADEN (1<< 9) -#define P32XV_VBLK (1<<15) -#define P32XV_HBLK (1<<14) -#define P32XV_PEN (1<<13) -#define P32XV_nFEN (1<< 1) -#define P32XV_FS (1<< 0) +#define P32XV_nPAL (1<<15) +#define P32XV_PRI (1<< 7) +#define P32XV_Mx (3<< 0) + +#define P32XV_VBLK (1<<15) +#define P32XV_HBLK (1<<14) +#define P32XV_PEN (1<<13) +#define P32XV_nFEN (1<< 1) +#define P32XV_FS (1<< 0) + +#define P32XF_68KPOLL (1 << 0) +#define P32XF_MSH2POLL (1 << 1) +#define P32XF_SSH2POLL (1 << 2) struct Pico32x { @@ -406,6 +427,7 @@ struct Pico32x unsigned char pending_fb; unsigned char dirty_pal; unsigned char pad[2]; + unsigned int emu_flags; }; struct Pico32xMem @@ -413,6 +435,8 @@ struct Pico32xMem unsigned char sdram[0x40000]; unsigned short dram[2][0x20000/2]; // AKA fb unsigned char m68k_rom[0x10000]; // 0x100; using M68K_BANK_SIZE + unsigned char sh2_rom_m[0x800]; + unsigned char sh2_rom_s[0x400]; unsigned short pal[0x100]; unsigned short pal_native[0x100]; // converted to native (for renderer) }; @@ -471,8 +495,6 @@ void PicoDoHighPal555M4(void); void PicoDrawSetColorFormatMode4(int which); // memory.c -PICO_INTERNAL void PicoInitPc(unsigned int pc); -PICO_INTERNAL unsigned int PicoCheckPc(unsigned int pc); PICO_INTERNAL void PicoMemSetup(void); unsigned int PicoRead8_io(unsigned int a); unsigned int PicoRead16_io(unsigned int a); @@ -484,8 +506,7 @@ PICO_INTERNAL void PicoMemSetupPico(void); // cd/memory.c PICO_INTERNAL void PicoMemSetupCD(void); -PICO_INTERNAL_ASM void PicoMemRemapCD(int r3); -PICO_INTERNAL_ASM void PicoMemResetCDdecode(int r3); +void PicoMemStateLoaded(void); // pico.c extern struct Pico Pico; @@ -686,6 +707,12 @@ extern void lprintf(const char *fmt, ...); #define MEMH_FUNC #endif +#ifdef __GNUC__ +#define NOINLINE __attribute__((noinline)) +#else +#define NOINLINE +#endif + #ifdef __cplusplus } // End of extern "C" #endif