From 284f0ced684f2d42c30eba70a600a347f9793343 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 23 Apr 2024 14:43:38 -0500 Subject: [PATCH] fix .mod import and update doc --- doc/3-pattern/effects.md | 19 +++++++++++++++++-- src/engine/fileOps/mod.cpp | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/3-pattern/effects.md b/doc/3-pattern/effects.md index dca26d21b..8fe6e6ef4 100644 --- a/doc/3-pattern/effects.md +++ b/doc/3-pattern/effects.md @@ -93,10 +93,25 @@ not all chips support these effects. - `FCxx`: **Note release.** releases current note after `xx` ticks. this releases macros and triggers key off in FM/hardware envelope chips. - `E7xx`: **Macro release.** releases macros after `xx` ticks. this does not trigger key off. +## sample offset + +these effects make the current playing sample on the channel jump to a specific position. +only some chips support this effect. + +sample offset is a 24-bit (3 byte) number. + +- `90xx`: **Set sample offset (first byte).** +- `91xx`: **Set sample offset (second byte).** +- `92xx`: **Set sample offset (third byte).** + +you may use these effects simultaneously in a row. + +if you do not set a byte, its last value will be used. + +in previous versions of Furnace a `9xxx` effect existed which set the sample position to `$xxx00` (`xxx` was effectively multiplied by 256). this maps to `920x 91xx` in current Furnace. + ## other -- `9xxx`: **Set sample position.** jumps current sample to position `xxx * 0x100`. - - not all chips support this effect. - `EBxx`: **Set LEGACY sample mode bank.** selects sample bank. used only for compatibility. - does not apply on Amiga. - `EExx`: **Send external command.** diff --git a/src/engine/fileOps/mod.cpp b/src/engine/fileOps/mod.cpp index 02cecc9fd..9aa72e444 100644 --- a/src/engine/fileOps/mod.cpp +++ b/src/engine/fileOps/mod.cpp @@ -322,7 +322,7 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) { setEffectState[3]=fxVal; break; case 9: // set offset - writeFxCol(0x90,fxVal); + writeFxCol(0x91,fxVal); break; case 10: // vol slide effectState[4]=fxVal;