============================================================================== Mod2PSG V1.8 by Martin Konrad (mkon@gmx.de) ============================================================================== ============== Introduction ============== Mod2PSG converts ProTracker modules into a format that can be played by the Sega Master System/Game Gear PSG sound chip. The engine for this is reusable and easy to use. Of course PSG modules don't sound as good as ProTracker modules because the PSG is not good enough. A big problem for example is the noise channel because it usually has only 3 possible frequencies. Another problem is that the 4 PSG can't play any samples. If you use this program, then please send me a nice eMail. ========= Options ========= *** Sample volumes *** Here you can define the volume of each sample. This represents the volume of the sampledata. *** Periodic/white noise *** Here you can define whether a sample shall use periodic or white noise when it's played by the noise channel. *** Noise channel channels *** Here you can define which channel of the source MOD the noise channel should play for each pattern. The noise channel should be used for drums. *** Noise channel frequencies *** The noise channel can only produce 3 different frequencies or match the frequency of channel 2. You have the following options for each pattern: 1: use standard frequencies Tones with high frequency will be played at 7800Hz Tones with middle frequency will be played at 3900Hz Tones with low frequency will be played at 1950Hz 2: use channel 2 frequencies The frequency is taken from channel 2. If there's no tone on channel 2 then there will be no tone on the noise channel, too. 3: use relative frequencies If the frequency is higher than that of the last tone, the high frequency (7800Hz) is used. If the frequency is the same as that of the last tone, the middle frequency (3900Hz) is used. If the frequency is lower than that of the last tone, the low frequency (1950Hz) is used. *** Output options *** 1: (don't) Create VDP code to clear VRAM This is self-explaining. 2: 1. Call PSG MOD routines in a loop 2. Call PSG MOD routines in VBlank IRQ handler This is self-explaining, too. 3: (don't) Change equal volumes at start of new tones If two samples are directly played after each other in a ProTracker module you hear this because the sample is started again from the beginning. But on the SMS/GG PSG you can't hear this. If you enable this option and if there are two tones directly after each other with the same frequency and the same volume, the volume of the second one is decreased by one. 4: Enable/Disable long tones for noise channel Long tones played by the noise channel sometimes sound bad. You might try to use some periodic noise in this case, too. 5: 1. Enable Game Gear stereo sound 2. Disable Game Gear stereo sound If Game Gear stereo sound is enabled it will set the stereo mask before the song starts. 6: Game Gear stereo sound mask Here you can set the stereo mask. Bits 7-4 are used for the right channel and bits 3-0 for the left channel. If a bit is set it will enable sound for the specified channel. Bits 7 and 3 are used for channel 3 (the noise channel), bit 6 and 2 for channel 2 etc.... ================== The source codes ================== The example source codes created by Mod2PSG can be compiled using the Table Assembler. The names of the variables, labels etc. of the PSG module engine all start with 'PSGMOD'. If you want to have more than only one PSG module in your programs you just have to include all of them somewhere in your code. You can play them like in the example file. The song data starts at the label PSGMOD_SONG. But be careful with the PSG MOD variables. You shouldn't use the same addresses for your own variables. That's why they're declared in the example source codes and not in the file called PSGMOD.INC (actually they are, but only as comments). That makes it easier for you to change the addresses to your own requirements. While playing the song you can press button 1 to toggle the sound on or off. The size of the compiled files is set to 64k ('.org $10000' at the end). Memory mapping isn't used so the maximum size of the song and the other data is 48k. You can calculate the size of a PSG MOD song using the following formular: size = 129 + patterns * 512 (bytes) Pattern numbers more than 127 are not allowed. They will be set to 127. The routines you should use are described in the include file called PSGMOD.INC. The other routines are internal. A playback routine looks like: .include PSGMOD.INC ld hl, PSGMOD_SONG ; HL = address of PSGMOD song call PSGMOD_INITIATE_NEW_SONG ; initiate all required variables ei ; enable VBlank IRQ SONG_LOOP: ld d, 1 ; wait one VBlank call VWAIT call PSGMOD_PLAY_NEXT_NOTE ; play next note jr SONG_LOOP You can also put it into your VBlank IRQ handler: .org $38 ... call PSGMOD_PLAY_NEXT_NOTE ... reti ================ Included files ================ The following files are included in this archive: MOD2PSG.EXE -- MOD to PSG converter PSGMOD.INC -- PSG MOD engine include file README.TXT -- This file MONKEY.GG -- Monkey Island theme example BEAST.GG -- Shadow of the Beast example ======================== Supported MOD features ======================== The following MOD features are currently supported: - linear sample volume - song end jump position The following MOD effects are currently supported: $5: (tone portamento +) volume slide only volume slide is supported (like effect $A) $6: (vibrato +) volume slide only volume slide is supported (like effect $A) $A: volume slide there's no real slide; the volume of the division after this effect is changed $C: Set volume changes the volume $D: Pattern break the additional position to jump to is not supported $F: Set Speed no BPM $EA: fine volume slide up $EB: fine volume slide down If a sample has a loop a long tone is produced that is played until the end of the pattern. The whole tone has the same volume then. (Or the volume is reduced a bit before the start; See the 'Options' section. Mod2PSG doesn't care of Sampledata that has different volumes at different parts.) ========= Changes ========= [V1.8] - improved converting - fixed some bugs - optimised PSG MOD engine - Genesis support is almost working perfectly now, mail me if you want to have it (thanks to Charles Mac Donald) - added SDSC ROM Header by Eric Quinn (www.smspower.org/dev) [V1.7] - changed and improved 'Change volume before start of new tone' into 'Change equal volumes at start of new tones' - fixed some things again - fixed text color at shutdown - improved effect $A (volume slide) support - added support for effect $5 ((tone portamento +) volume slide) - added support for effect $6 ((vibrato +) volume slide) - added support for effect $EA (fine volume slide up) - added support for effect $EB (fine volume slide down) [V1.6] - added support for effect $A (volume slide) - added a window that shows some infos about the conversion - fixed some things - added support for Game Gear stereo sound (thanks to Zoop) - added a warning when a new config file already exists