X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fym2612.h;h=a2921b2222f82bc64ebf7daaa0a59a5eac94f050;hb=93f9619ed819dee07948416c98ca2f1c70a22666;hp=f5e98a05786508e859bf3650d5a803613fb91e31;hpb=1cfc5cc4ce06642b9bc45ca3b9d32793718e9455;p=picodrive.git diff --git a/pico/sound/ym2612.h b/pico/sound/ym2612.h index f5e98a0..a2921b2 100644 --- a/pico/sound/ym2612.h +++ b/pico/sound/ym2612.h @@ -43,10 +43,16 @@ typedef struct INT16 volume; /* #0x1a envelope counter | need_save */ UINT32 sl; /* #0x1c sustain level:sl_table[SL] */ - UINT32 eg_pack_ar; /* #0x20 (attack state) */ - UINT32 eg_pack_d1r; /* #0x24 (decay state) */ - UINT32 eg_pack_d2r; /* #0x28 (sustain state) */ - UINT32 eg_pack_rr; /* #0x2c (release state) */ + /* asm relies on this order: */ + union { + struct { + UINT32 eg_pack_rr; /* #0x20 1 (release state) */ + UINT32 eg_pack_d2r; /* #0x24 2 (sustain state) */ + UINT32 eg_pack_d1r; /* #0x28 3 (decay state) */ + UINT32 eg_pack_ar; /* #0x2c 4 (attack state) */ + }; + UINT32 eg_pack[4]; + }; } FM_SLOT; @@ -170,20 +176,20 @@ int YM2612PicoStateLoad2(int *tat, int *tbt); #else /* GP2X specific */ #include "../../platform/gp2x/940ctl.h" -extern int PicoOpt; +extern int PicoIn.opt; #define YM2612Init(baseclock,rate) { \ - if (PicoOpt&0x200) YM2612Init_940(baseclock, rate); \ + if (PicoIn.opt&0x200) YM2612Init_940(baseclock, rate); \ else YM2612Init_(baseclock, rate); \ } #define YM2612ResetChip() { \ - if (PicoOpt&0x200) YM2612ResetChip_940(); \ + if (PicoIn.opt&0x200) YM2612ResetChip_940(); \ else YM2612ResetChip_(); \ } #define YM2612UpdateOne(buffer,length,stereo,is_buf_empty) \ - (PicoOpt&0x200) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) : \ + (PicoIn.opt&0x200) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) : \ YM2612UpdateOne_(buffer, length, stereo, is_buf_empty); #define YM2612PicoStateLoad() { \ - if (PicoOpt&0x200) YM2612PicoStateLoad_940(); \ + if (PicoIn.opt&0x200) YM2612PicoStateLoad_940(); \ else YM2612PicoStateLoad_(); \ } #endif /* __GP2X__ */