\r
#include "../state.h"\r
\r
-#define SLOT_SIZE_MIN 46\r
+#define SLOT_SIZE_MIN 22\r
#define CH_SIZE_MIN 16\r
#define OTHER_SIZE_MIN 35\r
\r
save_u8_(buf, &b, slot->rr);\r
save_u8_(buf, &b, slot->mul);\r
save_u32(buf, &b, slot->phase);\r
- save_u32(buf, &b, slot->Incr);\r
save_u8_(buf, &b, slot->KSR);\r
- save_u8_(buf, &b, slot->ksr);\r
save_u8_(buf, &b, slot->key);\r
save_u8_(buf, &b, slot->state);\r
save_u8_(buf, &b, slot->tl >> (ENV_BITS-7));\r
save_u16(buf, &b, slot->volume);\r
save_u32(buf, &b, slot->sl);\r
- save_u32(buf, &b, slot->eg_pack_rr);\r
- save_u32(buf, &b, slot->eg_pack_d2r);\r
- save_u32(buf, &b, slot->eg_pack_d1r);\r
- save_u32(buf, &b, slot->eg_pack_ar);\r
save_u8_(buf, &b, slot->ssg);\r
save_u8_(buf, &b, slot->ssgn);\r
- save_u8_(buf, &b, slot->ar_ksr);\r
- save_u16(buf, &b, slot->vol_out);\r
\r
//printf("slot size: %zd\n", b);\r
assert(b >= SLOT_SIZE_MIN);\r
slot->rr = load_u8_(buf, &b);\r
slot->mul = load_u8_(buf, &b);\r
slot->phase = load_u32(buf, &b);\r
- slot->Incr = load_u32(buf, &b);\r
slot->KSR = load_u8_(buf, &b);\r
- slot->ksr = load_u8_(buf, &b);\r
slot->key = load_u8_(buf, &b);\r
slot->state = load_u8_(buf, &b);\r
slot->tl = load_u8_(buf, &b) << (ENV_BITS-7);\r
slot->volume = load_s16(buf, &b);\r
slot->sl = load_u32(buf, &b);\r
- slot->eg_pack_rr = load_u32(buf, &b);\r
- slot->eg_pack_d2r = load_u32(buf, &b);\r
- slot->eg_pack_d1r = load_u32(buf, &b);\r
- slot->eg_pack_ar = load_u32(buf, &b);\r
slot->ssg = load_u8_(buf, &b);\r
slot->ssgn = load_u8_(buf, &b);\r
- slot->ar_ksr = load_u8_(buf, &b);\r
- slot->vol_out = load_u16(buf, &b);\r
\r
assert(dt_reg < 8);\r
slot->DT = ym2612.OPN.ST.dt_tab[dt_reg & 7];\r
+ recalc_volout( slot );\r
+\r
+ // trigger a refresh\r
+ slot->Incr = -1;\r
+ slot->ksr = -1;\r
}\r
\r
static size_t save_channel(u8 *buf, const FM_CH *ch)\r