Apply requested changes

- Use sample->init() instead
- Implement set Hz by tempo effect and move from C4xx to F0xx
- Add "SAMPLE_POS" to cmdName
This commit is contained in:
Natt Akuma 2022-03-15 03:59:42 +07:00
parent 91e856c61e
commit 54da047b5a
4 changed files with 17 additions and 12 deletions

View File

@ -72,7 +72,7 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan) {
case 0x0f:
return "0Fxx: Set speed 2";
case 0xc0: case 0xc1: case 0xc2: case 0xc3:
return "Cxxx: Set tick rate";
return "Cxxx: Set tick rate (hz)";
case 0xe0:
return "E0xx: Set arp speed";
case 0xe1:
@ -97,14 +97,16 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan) {
return "EExx: Send external command";
case 0xef:
return "EFxx: Set global tuning (quirky!)";
case 0xf0:
return "F0xx: Set tick rate (bpm)";
case 0xf1:
return "F1xx: Single note slide up";
return "F1xx: Single tick note slide up";
case 0xf2:
return "F2xx: Single note slide down";
return "F2xx: Single tick note slide down";
case 0xf8:
return "F8xx: Single volume slide up";
return "F8xx: Single tick volume slide up";
case 0xf9:
return "F9xx: Single volume slide down";
return "F9xx: Single tick volume slide down";
case 0xfa:
return "FAxx: Fast volume slide (0y: down; x0: up)";
case 0xff:

View File

@ -1285,8 +1285,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
if(loopEnd<slen) slen=loopEnd;
sample->loopStart=loopStart;
}
sample->samples=slen;
sample->data8=new signed char[slen];
sample->init(slen);
ds.sample.push_back(sample);
}
// orders
@ -1456,7 +1455,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) {
case 15: // set speed
// TODO somehow handle VBlank tunes
if (fxVal>=0x20) {
writeFxCol(0xc0,(fxVal*2+2)/5);
writeFxCol(0xf0,fxVal);
} else {
writeFxCol(0x09,fxVal);
writeFxCol(0x0f,fxVal);

View File

@ -62,6 +62,7 @@ const char* cmdName[DIV_CMD_MAX]={
"SAMPLE_MODE",
"SAMPLE_FREQ",
"SAMPLE_BANK",
"SAMPLE_POS",
"FM_LFO",
"FM_LFO_WAVE",
@ -872,9 +873,6 @@ void DivEngine::processRow(int i, bool afterDelay) {
cycles=((int)(got.rate)<<MASTER_CLOCK_PREC)/divider;
clockDrift=0;
break;
case 0xc4: // set Hz by tempo
// TODO
break;
case 0xe0: // arp speed
if (effectVal>0) {
song.arpLen=effectVal;
@ -947,6 +945,12 @@ void DivEngine::processRow(int i, bool afterDelay) {
case 0xef: // global pitch
globalPitch+=(signed char)(effectVal-0x80);
break;
case 0xf0: // set Hz by tempo
divider=(effectVal*2+2)/5;
if (divider<10) divider=10;
cycles=((int)(got.rate)<<MASTER_CLOCK_PREC)/divider;
clockDrift=0;
break;
case 0xf1: // single pitch ramp up
case 0xf2: // single pitch ramp down
if (effect==0xf1) {

View File

@ -62,7 +62,7 @@ const FurnaceGUIColors extFxColors[32]={
GUI_COLOR_PATTERN_EFFECT_TIME, // ED
GUI_COLOR_PATTERN_EFFECT_SONG, // EE
GUI_COLOR_PATTERN_EFFECT_SONG, // EF
GUI_COLOR_PATTERN_EFFECT_INVALID, // F0
GUI_COLOR_PATTERN_EFFECT_SPEED, // F0
GUI_COLOR_PATTERN_EFFECT_PITCH, // F1
GUI_COLOR_PATTERN_EFFECT_PITCH, // F2
GUI_COLOR_PATTERN_EFFECT_INVALID, // F3