Index: apps/codecs/libgme/emu2413.c =================================================================== --- apps/codecs/libgme/emu2413.c (Revision 30282) +++ apps/codecs/libgme/emu2413.c (Arbeitskopie) @@ -210,7 +210,7 @@ static e_uint32 dphaseDRTable[16][16]; /* KSL + TL Table */ -static e_uint32 tllTable[16][8][1 << TL_BITS][4]; +static e_uint8 tllTable[16][8][1 << TL_BITS][4]; static e_int32 rksTable[2][8][2]; /* We may not have too much SRAM in rockbox */ @@ -389,6 +389,16 @@ else tllTable[fnum][block][TL][KL] = (e_uint32) ((tmp >> (3 - KL)) / EG_STEP) + TL2EG (TL); } + /* + { + static int max = 0; + if (tllTable[fnum][block][TL][KL] > max) + { + max = tllTable[fnum][block][TL][KL]; + printf("emu2413 max = %d\n", max); + } + } + */ } } Index: apps/codecs/libgme/emu8950.c =================================================================== --- apps/codecs/libgme/emu8950.c (Revision 30282) +++ apps/codecs/libgme/emu8950.c (Arbeitskopie) @@ -36,7 +36,7 @@ /** Phase incr table for Decay and Release. */ static unsigned int dphaseDRTable[16][16]; /** KSL + TL Table. */ -static int tllTable[16][8][1<> 1; } else { int tmp = kltable[fnum] - dB2(3.000) * (7 - block); if (tmp <= 0) - tllTable[fnum][block][TL][KL] = ALIGN(TL, TL_STEP, EG_STEP); + tllTable[fnum][block][TL][KL] = (ALIGN(TL, TL_STEP, EG_STEP) + 1) >> 1; else - tllTable[fnum][block][TL][KL] = (int)((tmp>>(3-KL))/EG_STEP) + ALIGN(TL, TL_STEP, EG_STEP); + tllTable[fnum][block][TL][KL] = ((int)((tmp>>(3-KL))/EG_STEP) + ALIGN(TL, TL_STEP, EG_STEP) + 1) >> 1; } + /* + { + static int max = 0; + if (tllTable[fnum][block][TL][KL] > max) + { + max = tllTable[fnum][block][TL][KL]; + printf("emu8950 max = %d\n", max); + } + } + */ } } @@ -313,7 +323,7 @@ static inline void slotUpdateTLL(struct Slot* slot) { - slot->tll = tllTable[slot->fnum>>6][slot->block][slot->patch.TL][slot->patch.KL]; + slot->tll = (int)(tllTable[slot->fnum>>6][slot->block][slot->patch.TL][slot->patch.KL]) << 1; } static inline void slotUpdateRKS(struct Slot* slot) Index: apps/codecs/SOURCES =================================================================== --- apps/codecs/SOURCES (Revision 30282) +++ apps/codecs/SOURCES (Arbeitskopie) @@ -35,9 +35,9 @@ ay.c gbs.c hes.c -#if MEMORYSIZE > 2 nsf.c sgc.c +#if MEMORYSIZE > 2 vgm.c kss.c #endif