X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FPicoInt.h;h=58d37d09606d0c8dc65facab8ff12db61cbd264f;hb=0af33fe0ef24a3e3b65217ad0d7aa2db03d16fc1;hp=6caff4825c69e9fa5fa22fc83006c2b618ce1e7f;hpb=7a1f6e45c9f6a11152f62303b0203475a9fd431a;p=picodrive.git diff --git a/Pico/PicoInt.h b/Pico/PicoInt.h index 6caff48..58d37d0 100644 --- a/Pico/PicoInt.h +++ b/Pico/PicoInt.h @@ -1,7 +1,7 @@ // Pico Library - Header File // (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006 notaz, All rights reserved. +// (c) Copyright 2006,2007 Grazvydas "notaz" Ignotas, all rights reserved. // Free for non-commercial use. // For commercial use, separate licencing terms must be obtained. @@ -12,6 +12,9 @@ #include #include "Pico.h" +// +#define USE_POLL_DETECT + // to select core, define EMU_C68K, EMU_M68K or EMU_A68K in your makefile or project @@ -35,8 +38,8 @@ extern struct Cyclone PicoCpu, PicoCpuS68k; } #define SekPc (PicoCpu.pc-PicoCpu.membase) #define SekPcS68k (PicoCpuS68k.pc-PicoCpuS68k.membase) -#define SekSetStop(x) { PicoCpu.stopped=x; if (x) PicoCpu.cycles=0; } -#define SekSetStopS68k(x) { PicoCpuS68k.stopped=x; if (x) PicoCpuS68k.cycles=0; } +#define SekSetStop(x) { PicoCpu.state_flags&=~1; if (x) { PicoCpu.state_flags|=1; PicoCpu.cycles=0; } } +#define SekSetStopS68k(x) { PicoCpuS68k.state_flags&=~1; if (x) { PicoCpuS68k.state_flags|=1; PicoCpuS68k.cycles=0; } } #endif #ifdef EMU_A68K @@ -107,8 +110,17 @@ extern int SekCycleAimS68k; #define SekCyclesResetS68k() {SekCycleCntS68k=SekCycleAimS68k=0;} #define SekCyclesDoneS68k() (SekCycleAimS68k-SekCyclesLeftS68k) -// does not work as expected -//extern int z80ExtraCycles; // extra z80 cycles, used when z80 is [en|dis]abled +// debug cyclone +#if defined(EMU_C68K) && defined(EMU_M68K) +#undef SekSetCyclesLeftNoMCD +#undef SekSetCyclesLeft +#undef SekCyclesBurn +#undef SekEndRun +#define SekSetCyclesLeftNoMCD(c) +#define SekSetCyclesLeft(c) +#define SekCyclesBurn(c) c +#define SekEndRun(c) +#endif extern int PicoMCD; @@ -139,7 +151,7 @@ struct PicoMisc char dirtyPal; // Is the palette dirty (1 - change @ this frame, 2 - some time before) unsigned char hardware; // Hardware value for country unsigned char pal; // 1=PAL 0=NTSC - unsigned char sram_reg; // SRAM mode register. bit0: allow read? bit1: deny write? bit2: EEPROM? + unsigned char sram_reg; // SRAM mode register. bit0: allow read? bit1: deny write? bit2: EEPROM? bit4: detected? (header or by access) unsigned short z80_bank68k; unsigned short z80_lastaddr; // this is for Z80 faking unsigned char z80_fakeval; @@ -148,7 +160,7 @@ struct PicoMisc unsigned short sram_addr; // EEPROM address register unsigned char sram_cycle; // EEPROM SRAM cycle number unsigned char sram_slave; // EEPROM slave word for X24C02 and better SRAMs - unsigned char prot_bytes[2]; // simple protection fakeing + unsigned char prot_bytes[2]; // simple protection faking unsigned short dma_bytes; // unsigned char pad[2]; unsigned int frame_count; // mainly for movies @@ -210,14 +222,17 @@ struct mcd_misc unsigned short hint_vector; unsigned char busreq; unsigned char s68k_pend_ints; - unsigned int state_flags; // 04: emu state: reset_pending, + unsigned int state_flags; // 04: emu state: reset_pending, dmna_pending unsigned int counter75hz; unsigned short audio_offset; // 0c: for savestates: play pointer offset (0-1023) unsigned char audio_track; // playing audio track # (zero based) - char pad1; + char pad1; int timer_int3; // 10 unsigned int timer_stopwatch; - int pad[10]; + unsigned char bcram_reg; // 18: battery-backed RAM cart register + unsigned char pad2; + unsigned short pad3; + int pad[9]; }; typedef struct @@ -296,6 +311,7 @@ void PicoWriteCD32(unsigned int a, unsigned int d); extern struct Pico Pico; extern struct PicoSRAM SRam; extern int emustatus; +extern int z80startCycle, z80stopCycle; // in 68k cycles int CheckDMA(void); // cd/Pico.c @@ -308,6 +324,7 @@ int SekInit(void); int SekReset(void); int SekInterrupt(int irq); void SekState(unsigned char *data); +void SekSetRealTAS(int use_real); // cd/Sek.c int SekInitS68k(void); @@ -328,7 +345,7 @@ unsigned int SRAMReadEEPROM(); void SRAMUpdPending(unsigned int a, unsigned int d); void memcpy16(unsigned short *dest, unsigned short *src, int count); void memcpy16bswap(unsigned short *dest, void *src, int count); -void memcpy32(int *dest, int *src, int count); +void memcpy32(int *dest, int *src, int count); // 32bit word count void memset32(int *dest, int c, int count); // cd/Misc.c