mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
bugfixes, state load for new mode
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@468 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
538a6098d4
commit
453d2a6eda
9 changed files with 32 additions and 44 deletions
|
@ -883,14 +883,13 @@ int ym2612_write_local(u32 a, u32 d, int is_from_z80)
|
|||
return YM2612Write_(a, d);
|
||||
}
|
||||
|
||||
// TODO: savestates
|
||||
|
||||
#define ym2612_read_local() \
|
||||
if (xcycles >= timer_a_next_oflow) \
|
||||
ym2612.OPN.ST.status |= (ym2612.OPN.ST.mode >> 2) & 1; \
|
||||
if (xcycles >= timer_b_next_oflow) \
|
||||
ym2612.OPN.ST.status |= (ym2612.OPN.ST.mode >> 2) & 2
|
||||
|
||||
|
||||
u32 ym2612_read_local_z80(void)
|
||||
{
|
||||
int xcycles = z80_cyclesDone() << 8;
|
||||
|
@ -913,6 +912,23 @@ u32 ym2612_read_local_68k(void)
|
|||
return ym2612.OPN.ST.status;
|
||||
}
|
||||
|
||||
// TODO: new ym2612 savestates
|
||||
void ym2612_unpack_state(void)
|
||||
{
|
||||
int i;
|
||||
YM2612PicoStateLoad();
|
||||
|
||||
// feed all the registers and update internal state
|
||||
for (i = 0x20; i < 0xC0; i++) {
|
||||
ym2612_write_local(0, i, 0);
|
||||
ym2612_write_local(1, ym2612.REGS[i], 0);
|
||||
}
|
||||
for (i = 0x30; i < 0xC0; i++) {
|
||||
ym2612_write_local(2, i, 0);
|
||||
ym2612_write_local(3, ym2612.REGS[i|0x100], 0);
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// z80 memhandlers
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue