mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
audio fixes for overdrive demo
This commit is contained in:
parent
43e1401008
commit
7aab476859
5 changed files with 15 additions and 11 deletions
|
@ -278,7 +278,8 @@ Cz80_Check_Interrupt:
|
||||||
CPU->ICount -= CPU->ExtraCycles;
|
CPU->ICount -= CPU->ExtraCycles;
|
||||||
CPU->ExtraCycles = 0;
|
CPU->ExtraCycles = 0;
|
||||||
}
|
}
|
||||||
goto Cz80_Exec;
|
if (!CPU->HaltState)
|
||||||
|
goto Cz80_Exec;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else CPU->ICount = 0;
|
else CPU->ICount = 0;
|
||||||
|
|
|
@ -687,7 +687,6 @@ OP_CCF:
|
||||||
OP(0x76): // HALT
|
OP(0x76): // HALT
|
||||||
OP_HALT:
|
OP_HALT:
|
||||||
CPU->HaltState = 1;
|
CPU->HaltState = 1;
|
||||||
// CPU->ICount = 0;
|
|
||||||
goto Cz80_Check_Interrupt;
|
goto Cz80_Check_Interrupt;
|
||||||
|
|
||||||
OP(0xf3): // DI
|
OP(0xf3): // DI
|
||||||
|
|
|
@ -733,8 +733,10 @@ static void PicoWrite8_vdp(u32 a, u32 d)
|
||||||
|
|
||||||
static void PicoWrite16_vdp(u32 a, u32 d)
|
static void PicoWrite16_vdp(u32 a, u32 d)
|
||||||
{
|
{
|
||||||
if ((a & 0x00f9) == 0x0010) // PSG Sound
|
if ((a & 0x00f9) == 0x0010) { // PSG Sound
|
||||||
psg_write_68k(d);
|
psg_write_68k(d);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((a & 0x00e0) == 0x0000) {
|
if ((a & 0x00e0) == 0x0000) {
|
||||||
PicoVideoWrite(a, d);
|
PicoVideoWrite(a, d);
|
||||||
return;
|
return;
|
||||||
|
@ -898,10 +900,10 @@ void ym2612_sync_timers(int z80_cycles, int mode_old, int mode_new)
|
||||||
int xcycles = z80_cycles << 8;
|
int xcycles = z80_cycles << 8;
|
||||||
|
|
||||||
/* check for overflows */
|
/* check for overflows */
|
||||||
if ((mode_old & 4) && xcycles > Pico.t.timer_a_next_oflow)
|
if ((mode_old & 4) && xcycles >= Pico.t.timer_a_next_oflow)
|
||||||
ym2612.OPN.ST.status |= 1;
|
ym2612.OPN.ST.status |= 1;
|
||||||
|
|
||||||
if ((mode_old & 8) && xcycles > Pico.t.timer_b_next_oflow)
|
if ((mode_old & 8) && xcycles >= Pico.t.timer_b_next_oflow)
|
||||||
ym2612.OPN.ST.status |= 2;
|
ym2612.OPN.ST.status |= 2;
|
||||||
|
|
||||||
/* update timer a */
|
/* update timer a */
|
||||||
|
|
|
@ -822,10 +822,10 @@ void ym2612_pack_state(void);
|
||||||
void ym2612_unpack_state(void);
|
void ym2612_unpack_state(void);
|
||||||
|
|
||||||
#define TIMER_NO_OFLOW 0x70000000
|
#define TIMER_NO_OFLOW 0x70000000
|
||||||
// tA = 72 * (1024 - NA) / M
|
// tA = 72 * (1024 - NA) / M, with M = mclock/2 -> tick = 72 * 2/mclock
|
||||||
#define TIMER_A_TICK_ZCYCLES 17203
|
#define TIMER_A_TICK_ZCYCLES 17203 // zcycles = Q8*tick*zclock = Q8*77*2*7/15
|
||||||
// tB = 1152 * (256 - NA) / M
|
// tB = 1152 * (256 - NA) / M,
|
||||||
#define TIMER_B_TICK_ZCYCLES 262800 // 275251 broken, see Dai Makaimura
|
#define TIMER_B_TICK_ZCYCLES 275251 // zcycles = Q8*1152*2*7/15
|
||||||
|
|
||||||
#define timers_cycle() \
|
#define timers_cycle() \
|
||||||
if (Pico.t.timer_a_next_oflow > 0 && Pico.t.timer_a_next_oflow < TIMER_NO_OFLOW) \
|
if (Pico.t.timer_a_next_oflow > 0 && Pico.t.timer_a_next_oflow < TIMER_NO_OFLOW) \
|
||||||
|
@ -837,7 +837,8 @@ void ym2612_unpack_state(void);
|
||||||
#define timers_reset() \
|
#define timers_reset() \
|
||||||
Pico.t.timer_a_next_oflow = Pico.t.timer_b_next_oflow = TIMER_NO_OFLOW; \
|
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_a_step = TIMER_A_TICK_ZCYCLES * 1024; \
|
||||||
Pico.t.timer_b_step = TIMER_B_TICK_ZCYCLES * 256;
|
Pico.t.timer_b_step = TIMER_B_TICK_ZCYCLES * 256; \
|
||||||
|
ym2612.OPN.ST.status &= ~3;
|
||||||
|
|
||||||
|
|
||||||
// videoport.c
|
// videoport.c
|
||||||
|
|
|
@ -206,8 +206,9 @@
|
||||||
.macro update_ssg_eg
|
.macro update_ssg_eg
|
||||||
ldrh r0, [r5,#0x30] @ ssg+ssgn
|
ldrh r0, [r5,#0x30] @ ssg+ssgn
|
||||||
ldrb r2, [r5,#0x17] @ state
|
ldrb r2, [r5,#0x17] @ state
|
||||||
|
and r3, r0, #0x08
|
||||||
|
cmp r3, #0x08 @ ssg enabled &&
|
||||||
ldrh r3, [r5,#0x1a] @ volume
|
ldrh r3, [r5,#0x1a] @ volume
|
||||||
cmp r0, #0x08 @ ssg enabled &&
|
|
||||||
cmpge r2, #EG_REL+1 @ state > EG_REL &&
|
cmpge r2, #EG_REL+1 @ state > EG_REL &&
|
||||||
cmpge r3, #0x200 @ volume >= 0x200?
|
cmpge r3, #0x200 @ volume >= 0x200?
|
||||||
blt 9f
|
blt 9f
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue