#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
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
\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