mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
core, implement ym2612 busy flag
This commit is contained in:
parent
c066c40ba9
commit
83025d7abe
2 changed files with 12 additions and 5 deletions
|
@ -457,6 +457,7 @@ struct PicoTiming
|
|||
|
||||
int timer_a_next_oflow, timer_a_step; // in z80 cycles
|
||||
int timer_b_next_oflow, timer_b_step;
|
||||
int ym2612_busy;
|
||||
|
||||
int vcnt_wrap, vcnt_adj;
|
||||
};
|
||||
|
@ -897,6 +898,8 @@ void ym2612_unpack_state(void);
|
|||
#define TIMER_B_TICK_ZCYCLES cycles_68k_to_z80(256LL*16*72*2) // Q8
|
||||
|
||||
#define timers_cycle(ticks) \
|
||||
if (Pico.t.ym2612_busy > 0) \
|
||||
Pico.t.ym2612_busy -= ticks << 8; \
|
||||
if (Pico.t.timer_a_next_oflow < TIMER_NO_OFLOW) \
|
||||
Pico.t.timer_a_next_oflow -= ticks << 8; \
|
||||
if (Pico.t.timer_b_next_oflow < TIMER_NO_OFLOW) \
|
||||
|
@ -904,6 +907,7 @@ void ym2612_unpack_state(void);
|
|||
ym2612_sync_timers(0, ym2612.OPN.ST.mode, ym2612.OPN.ST.mode);
|
||||
|
||||
#define timers_reset() \
|
||||
Pico.t.ym2612_busy = 0; \
|
||||
Pico.t.timer_a_next_oflow = Pico.t.timer_b_next_oflow = TIMER_NO_OFLOW; \
|
||||
Pico.t.timer_a_step = TIMER_A_TICK_ZCYCLES * 1024; \
|
||||
Pico.t.timer_b_step = TIMER_B_TICK_ZCYCLES * 256; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue