--- np2/sound/opngenc.c 2004/02/03 08:24:40 1.9 +++ np2/sound/opngenc.c 2011/01/15 14:15:21 1.13 @@ -164,10 +164,10 @@ void opngen_initialize(UINT rate) { decaytable[i] = (long)(freq / OPM_DRRATE); #endif if (attacktable[i] >= EC_DECAY) { - TRACEOUT(("attacktable %d %d %d", i, attacktable[i], EC_DECAY)); + TRACEOUT(("attacktable %d %d %ld", i, attacktable[i], EC_DECAY)); } if (decaytable[i] >= EC_DECAY) { - TRACEOUT(("decaytable %d %d %d", i, decaytable[i], EC_DECAY)); + TRACEOUT(("decaytable %d %d %ld", i, decaytable[i], EC_DECAY)); } } attacktable[62] = EC_DECAY - 1; @@ -366,8 +366,8 @@ static void channleupdate(OPNCH *ch) { int i; UINT32 fc = ch->keynote[0]; // ver0.27 - BYTE kc = ch->kcode[0]; - BYTE evr; + UINT8 kc = ch->kcode[0]; + UINT evr; OPNSLOT *slot; int s; @@ -375,7 +375,7 @@ static void channleupdate(OPNCH *ch) { if (!(ch->extop)) { for (i=0; i<4; i++, slot++) { slot->freq_inc = (fc + slot->detune1[kc]) * slot->multiple; - evr = (BYTE)(kc >> slot->keyscale); + evr = kc >> slot->keyscale; if (slot->envratio != evr) { slot->envratio = evr; slot->env_inc_attack = slot->attack[evr]; @@ -390,7 +390,7 @@ static void channleupdate(OPNCH *ch) { s = extendslot[i]; slot->freq_inc = (ch->keynote[s] + slot->detune1[ch->kcode[s]]) * slot->multiple; - evr = (BYTE)(ch->kcode[s] >> slot->keyscale); + evr = ch->kcode[s] >> slot->keyscale; if (slot->envratio != evr) { slot->envratio = evr; slot->env_inc_attack = slot->attack[evr]; @@ -435,14 +435,14 @@ void opngen_reset(void) { ch++; } for (i=0x30; i<0xc0; i++) { - opngen_setreg(0, (REG8)i, 0xff); - opngen_setreg(3, (REG8)i, 0xff); - opngen_setreg(6, (REG8)i, 0xff); - opngen_setreg(9, (REG8)i, 0xff); + opngen_setreg(0, i, 0xff); + opngen_setreg(3, i, 0xff); + opngen_setreg(6, i, 0xff); + opngen_setreg(9, i, 0xff); } } -void opngen_setcfg(REG8 maxch, UINT flag) { +void opngen_setcfg(REG8 maxch, UINT32 flag) { OPNCH *ch; UINT i; @@ -477,13 +477,13 @@ void opngen_setextch(UINT chnum, REG8 da ch[chnum].extop = data; } -void opngen_setreg(REG8 chbase, REG8 reg, REG8 value) { +void opngen_setreg(REG8 chbase, UINT reg, REG8 value) { UINT chpos; OPNCH *ch; OPNSLOT *slot; UINT fn; - BYTE blk; + UINT8 blk; chpos = reg & 3; if (chpos == 3) { @@ -558,7 +558,7 @@ void opngen_setreg(REG8 chbase, REG8 reg break; case 0xb0: - ch->algorithm = (BYTE)(value & 7); + ch->algorithm = (UINT8)(value & 7); value = (value >> 3) & 7; if (value) { ch->feedback = 8 - value; @@ -570,7 +570,7 @@ void opngen_setreg(REG8 chbase, REG8 reg break; case 0xb4: - ch->pan = (BYTE)(value & 0xc0); + ch->pan = (UINT8)(value & 0xc0); set_algorithm(ch); break; } @@ -618,6 +618,6 @@ void opngen_keyon(UINT chnum, REG8 value slot++; bit <<= 1; } - keydisp_fmkeyon((BYTE)chnum, value); + keydisp_fmkeyon((UINT8)chnum, value); }