THUNDER FORCE2/Tutorials

From Data Crystal
Jump to navigation Jump to search

Music Hacking for Thunder Force 2 or any Techno Soft Games for Sega Genesis

BGM Header format

00: b	Number of channels (always must be 09h = 6 FM + 3 PSG)
01: b	Volume (99 = max, 0 = min)
02: b	Tempo modifier
03: b	Pitch modifier
04: w	Volume table pointer
06: w	Channel tracks table pointer
08: w	Patterns table pointer
0A: w	FM Voices bank pointer
0C: w	PSG Voices bank pointer
0E: w	End of file offset

Credits goes to vladikcomper for the info on this. Thanks!

Sharp X68000 Version
00: w ?
02: w Pointer to instrument ?
04: w ?
06: w ?

Research is still in progress!

Volume Controll for each channel

10: Channel Volume

Channel tracks table stores offset for all 9 sound channels used by driver in the following order:
		FM1, FM2, FM3, FM4, FM5, FM6, PSG1, PSG2, PSG3
	Channel tracks cannot be skipped -- if the channel is unused, corresponding track should start with byte 0FFh (end of track marker).

	Each FM/PSG track refers to patterns from patterns table by table entry number. Both tracks and patterns can execute coordinate flags.


10: Volume for channel 1
11: Volume for channel 2
12: Volume for channel 3
13: Volume for channel 4
14: Volume for channel 5
15: Volume for channel 6
16: Volume for PSG 1
17: Volume for PSG 2
18: Volume for PSG 3

Sharp X68000 Version
D2: Channel Volume

Channel tracks table stores offset for all 9 sound channels used by driver in the following order:
		channel 1, channel 2, channel 3, channel 4, channel 5, channel 6, channel 7, channel 8, channel 9
                channel 10, channel 11, channel 12, channel 13, channel 14, channel 15, channel 16
	Channel tracks cannot be skipped -- if the channel is unused, corresponding track should start with byte 0FFh (end of track marker).

	Each FMtrack refers to patterns from patterns table by table entry number. Both tracks and patterns can execute coordinate flags.

D2: Volume for channel 1
D3: Volume for channel 2
D4: Volume for channel 3
D5: Volume for channel 4
D6: Volume for channel 5
D7: Volume for channel 6
D8: Volume for channel 7
D9: Volume for channel 8
DA: Volume for channel 9
DB: Volume for channel 10
DC: Volume for channel 11
DD: Volume for channel 12
DE: Volume for channel 13
DF: Volume for channel 14
E0: Volume for channel 15
E1: Volume for channel 16

Channel Tracks Table

19: Pointer to channel 0
1B: Pointer to channel 1
1D: Pointer to channel 2
1F: Pointer to channel 3
21: Pointer to channel 4
23: Pointer to channel 5
25: Pointer to PSG 1
27: Pointer to PSG 2

I just learned on how to repeat a pattern. The set up looks like this:
Note: this part is from asm from scratch.

Channel_0:
          db repeat_pattern, 000h

If the number sets to $00, then it will repeat pattern_0. If the number sets to $10, then it will repeat pattern_10 like this:
 
Channel_0:
          db repeat_pattern, 010h

Still in progress right now.


Sharp X68000 Version
The Channel Track Pointer starts at $01D2

E2: Might be the setup or something. It's different than the Genesis version.


$01D2: w ?
$01D4: w Pointer to channel

Value Definitions

$80-$DF Notes - Same as the Sharp X68000 Version.
$E0-$FF Coordination flags - Same As the Sharp X68000 Version but it might be different.

Music Notes Value

Same as the Sharp X68000 Version.

C-1: 80
C#1: 81
D-1: 82
D#1: 83
E-1: 84
F-1: 85
F#1: 86
G-1: 87
G#1: 88
A-1: 89
A#1: 8A
B-1: 8B

C-2: 8C
C#2: 8D
D-2: 8E
D#2: 8F
E-2: 90
F-2: 91
F#2: 92
G-2: 93
G#2: 94
A-2: 95
A#2: 96
B-2: 97

C-3: 98
C#3: 99
D-3: 9A
D#3: 9B
E-3: 9C
F-3: 9D
F#3: 9E
G-3: 9F
G#3: A0
A-3: A1
A#3: A2
B-3: A3

C-4: A4
C#4: A5
D-4: A6
D#4: A7
E-4: A8
F-4: A9
F#4: AA
G-4: AB
G#4: AC
A-4: AD
A#4: AE
B-4: AF

C-5: B0
C#5: B1
D-5: B2
D#5: B3
E-5: B4
F-5: B5
F#5: B6
G-5: B7
G#5: B8
A-5: B9
A#5: BA
B-5: BB

C-6: BC
C#6: BD
D-6: BE
D#6: BF
E-6: C0
F-6: C1
F#6: C2
G-6: C3
G#6: C4
A-6: C5
A#6: C6
B-6: C7

C-7: C8
C#7: C9
D-7: CA
D#7: CB
E-7: CC
F-7: CD
F#7: CE
G-7: CF
G#7: D0
A-7: D1
A#7: D2
B-7: D3

C-8: D4
C#8: D5
D-8: D6
D#8: D7
E-8: D8
F-8: D9
F#8: DA
G-8: DB
G#8: DC
A-8: DD
A#8: DE
B-8: DF

Coordination flags

Might be the same as the Sharp X68000 Version.

E0 - LoadInstrument
E1 - SetPan
E2 - PSGEffect
E3 - SetSlideSpeed
E4 - AMS_FMS_Speed
E5 - SkipPatterns_or_Sync
E6 - SetArgument
E7 - AlterArgument
E8 - AlterNote
E9 - AlterVolume
EA - AlterTempo
EB - SetFreqDisplacement
EC - SetRepeat
ED - SetFadeSpeed

F0 - DisableAMS_FMS
F1 - EnableAMS_FMS
F2 - DisablePSGNoise
F3 - EnablePSGNoise
F4 - SetPortamentoMode0
F5 - SetPortamentoMode1
F6 - SetPortamentoMode2
F7 - SetPortamentoMode3
FD - repeat_pattern

Credits goes to vladikcomper for the info on this. Thanks!