NTRQ .SAV File Layout --------------------- Correct for NTRQ Version 1.6 onwards. Last updated 8th August 2010. SRAM Memory Map Overview ------------------------ SRAM Address is $6000 to $7FFF "START" is offset from load address. Load address is $6000 for SRAM. All data is relative (e.g. pattern pointer addresses are based on an origin of $0000) so to allow relocation. FIELD START END SIZE DESCRIPTION SONG_HEADER $0000 $0007 $0008 Contains global setup information VOICE_STATUS $0008 $000F $0008 Contains bit-encoded mute/solo for each song SPEED_INDEXES $0010 $0017 $0018 Contains startin Speed Table entry for each song SPEED_TABLE $0018 $003F $0028 Speed Table SONG_START $0040 $0047 $0008 Starting index for each song SONG_END $0048 $003F $0008 Ending index for each song SONG_TABLE $0050 $054F $0500 Song tracks MASTER_TRACK $0550 $05CF $0080 Master track PATTERN_PTR_LO $05D0 $064F $0080 Lower 8 bits of pointer to each Pattern PATTERN_PTR_HI $0650 $06CF $0080 Upper 8 bits of pointer to each Pattern PATTERN_TABLE $06D0 $1E0F $1740 Patterns INSTRUMENTS $1E10 $1ECF $00C0 Instruments PITCH_TABLE $1ED0 $1F4F $0080 Pitch Table (e.g. arpeggios) PITCH_FX_TABLE $1F50 $1F8F $0040 Pitch FX Table (e.g. vibrato, pitch sweep, echo) DUTY_TABLE $1F90 $1FCF $0040 Duty table ATTACK_TABLE $1FD0 $1FDF $0010 Global values for ADSR Attack DECAY_TABLE $1FE0 $1FEF $0010 Global values for ADSR Decay RELEASE_TABLE $1FF0 $1FFF $0010 Global values for ADSR Release SONG_HEADER ------------ 00-03 "NTRQ" 04 Version number, $Mx = major version digit, $xM= minor version digit. E.g. $16 = version 1.6 05 Steps per pattern 06 Number of patterns 07 Bit-encoded editor options VOICE_STATUS ------------ Lower 5 bits of each byte tells whether voice(track) is enabled or disabled for each song. 0%---EDCBA If bit is set (1), voice/track is enabled. SPEED_INDEXES ------------- Each byte points to starting index into Speed Table for each song. SPEED_TABLE ----------- 2 bytes per entry. First byte is speed setting, second byte is next Speed Table entry to jump to. * SONG CONSTRUCTION * ---------------------- For each track (A, B, C, D, E and Master Track), there are $80 steps shared between each song. e.g. If Song 00 has $40 steps only $40 steps remain to share between Songs 01 to 07. SONG_START ---------- Starting index for each Song SONG_END -------- End index for each Song SONG_TABLE ---------- For each Track (A/B/C/D/E), $80 steps, 2 bytes per step. First byte is the pattern number for that step, second byte is the transpose value For transpose, $40 = center i,e no transpose. Higher numbers = positive transpose, lower = negative. MASTER_TRACK ------------ $80 entries, 1 byte per entry. Probably best to see NTRQ Manual for description of commands. PATTERN_PTR_LO -------------- $80 entries, one for each possible pattern This is the lower 8 bits of the 16-bit address of each pattern. Address is not absolute but is relative to the start of the SRAM file (i.e. $0000). PATTERN_PTR_HI -------------- Same as above but the upper 8 bits of each pattern address. In addition to this, if the value has bit 7 set, this tells NTRQ that the pattern is used somewhere in the Song(s). PATTERN_TABLE ------------- Contains data for all patterns. Individual pattern addresses are found in PATTER_PTR_LO/HI Pattern length (in steps) is found in SONG_HEADER Pattern addresses are dynamic as it depends on the global length of each pattern. The shorter the global pattern length, the more patterns are available and vice versa. Pattern data is 2 bytes per step. First byte is the note, second byte is the command for each pattern step. INSTRUMENTS ----------- $20 instruments, 6 bytes per instrument. See NTRQ manual for each byte meaning. PITCH_TABLE ----------- $40 entries, 2 bytes per entry. See NTRQ Manual for each byte meaning. PITCH_FX_TABLE -------------- $20 entries, 2 bytes per entry. See NTRQ Manual for each byte meaning. DUTY_TABLE ---------- $20 entries, 2 bytes per entry. See NTRQ Manual for each byte meaning. ATTACK_TABLE ------------ $10 entries, 1 byte per entry. See NTRQ Manual for explanation. DECAY_TABLE ----------- $10 entries, 1 byte per entry. See NTRQ Manual for explanation. RELEASE_TABLE ------------- $10 entries, 1 byte per entry. See NTRQ Manual for explanation. Some General Information ------------------------ Number of Songs = $08 Tracks per Pattern = $05 Tracks per Song = $06 (song contains extra track, "Master Track") Maximum Song Steps = $80 Speed Steps = $14 Maximum Patterns = $7C Instruments = $20 Pitch Table Steps = $40 Pitch FX = $20 Duty Table Steps = $20