#define PICO_INTERNAL_INCLUDED\r
\r
#include <stdio.h>\r
-#include <stdlib.h>\r
#include <string.h>\r
#include "pico_port.h"\r
#include "pico.h"\r
}\r
#define SekIsStoppedM68k() (PicoCpuFM68k.execinfo&FM68K_HALTED)\r
#define SekIsStoppedS68k() (PicoCpuFS68k.execinfo&FM68K_HALTED)\r
-#define SekShouldInterrupt() fm68k_would_interrupt()\r
+#define SekShouldInterrupt() fm68k_would_interrupt(&PicoCpuFM68k)\r
\r
#define SekNotPolling PicoCpuFM68k.not_polling\r
#define SekNotPollingS68k PicoCpuFS68k.not_polling\r
unsigned char eeprom_cycle; // EEPROM cycle number\r
unsigned char eeprom_slave; // EEPROM slave word for X24C02 and better SRAMs\r
unsigned char eeprom_status;\r
- unsigned char pad2;\r
+ unsigned char status; // rapid_ym2612, multi_ym_updates\r
unsigned short dma_xfers; // 18\r
unsigned char eeprom_wb[2]; // EEPROM latch/write buffer\r
unsigned int frame_count; // 1c for movies and idle det\r
struct Pico *Pico;\r
void *PicoMem_vram;\r
void *PicoMem_cram;\r
- int *PicoOpt;\r
+ unsigned int *PicoOpt;\r
unsigned char *Draw2FB;\r
unsigned short HighPal[0x100];\r
};\r
unsigned int z80c_cnt; // z80 cycles done (this frame)\r
unsigned int z80c_aim;\r
int z80_scanline;\r
+\r
+ int timer_a_next_oflow, timer_a_step; // in z80 cycles\r
+ int timer_b_next_oflow, timer_b_step;\r
+};\r
+\r
+struct PicoSound\r
+{\r
+ short len; // number of mono samples\r
+ short len_use; // adjusted\r
+ int len_e_add; // for non-int samples/frame\r
+ int len_e_cnt;\r
+ short dac_line;\r
+ short psg_line;\r
};\r
\r
// run tools/mkoffsets pico/pico_int_o32.h if you change these\r
struct PicoMisc m;\r
struct PicoTiming t;\r
struct PicoCartSave sv;\r
+ struct PicoSound snd;\r
struct PicoEState est;\r
struct PicoMS ms;\r
\r
unsigned int dmac0_fifo_ptr;\r
unsigned short vdp_fbcr_fake;\r
unsigned short pad2;\r
- unsigned char comm_dirty_68k;\r
- unsigned char comm_dirty_sh2;\r
+ unsigned char comm_dirty;\r
+ unsigned char pad3; // was comm_dirty_sh2\r
unsigned char pwm_irq_cnt;\r
unsigned char pad1;\r
unsigned short pwm_p[2]; // pwm pos in fifo\r
// pico.c\r
extern struct Pico Pico;\r
extern struct PicoMem PicoMem;\r
-extern int PicoPadInt[2];\r
-extern int emustatus;\r
extern void (*PicoResetHook)(void);\r
extern void (*PicoLineHook)(void);\r
PICO_INTERNAL int CheckDMA(void);\r
\r
// sound/sound.c\r
extern short cdda_out_buffer[2*1152];\r
-extern int PsndLen_exc_cnt;\r
-extern int PsndLen_exc_add;\r
-extern int timer_a_next_oflow, timer_a_step; // in z80 cycles\r
-extern int timer_b_next_oflow, timer_b_step;\r
\r
void cdda_start_play(int lba_base, int lba_offset, int lb_len);\r
\r
#define TIMER_B_TICK_ZCYCLES 262800 // 275251 broken, see Dai Makaimura\r
\r
#define timers_cycle() \\r
- if (timer_a_next_oflow > 0 && timer_a_next_oflow < TIMER_NO_OFLOW) \\r
- timer_a_next_oflow -= Pico.m.pal ? 70938*256 : 59659*256; \\r
- if (timer_b_next_oflow > 0 && timer_b_next_oflow < TIMER_NO_OFLOW) \\r
- timer_b_next_oflow -= Pico.m.pal ? 70938*256 : 59659*256; \\r
+ if (Pico.t.timer_a_next_oflow > 0 && Pico.t.timer_a_next_oflow < TIMER_NO_OFLOW) \\r
+ Pico.t.timer_a_next_oflow -= Pico.m.pal ? 70938*256 : 59659*256; \\r
+ if (Pico.t.timer_b_next_oflow > 0 && Pico.t.timer_b_next_oflow < TIMER_NO_OFLOW) \\r
+ Pico.t.timer_b_next_oflow -= Pico.m.pal ? 70938*256 : 59659*256; \\r
ym2612_sync_timers(0, ym2612.OPN.ST.mode, ym2612.OPN.ST.mode);\r
\r
#define timers_reset() \\r
- timer_a_next_oflow = timer_b_next_oflow = TIMER_NO_OFLOW; \\r
- timer_a_step = TIMER_A_TICK_ZCYCLES * 1024; \\r
- timer_b_step = TIMER_B_TICK_ZCYCLES * 256;\r
+ Pico.t.timer_a_next_oflow = Pico.t.timer_b_next_oflow = TIMER_NO_OFLOW; \\r
+ Pico.t.timer_a_step = TIMER_A_TICK_ZCYCLES * 1024; \\r
+ Pico.t.timer_b_step = TIMER_B_TICK_ZCYCLES * 256;\r
\r
\r
// videoport.c\r
PICO_INTERNAL void PsndClear(void);\r
PICO_INTERNAL void PsndGetSamples(int y);\r
PICO_INTERNAL void PsndGetSamplesMS(void);\r
-extern int PsndDacLine, PsndPsgLine;\r
\r
// sms.c\r
#ifndef NO_SMS\r
// emulation event logging\r
#ifndef EL_LOGMASK\r
# ifdef __x86_64__ // HACK\r
-# define EL_LOGMASK (EL_STATUS|EL_IDLE|EL_ANOMALY)\r
+# define EL_LOGMASK (EL_STATUS|EL_ANOMALY)\r
# else\r
# define EL_LOGMASK (EL_STATUS)\r
# endif\r