Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

THUNDER FORCE2/Tutorials: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(Created page with "{{rommap|game=Thunder Force II (GEN)}} <pre> Music are located in Z80 Bank $78000 Music Z80 Pointer Song Name 01 Music 00 $0100 Knights of Legend 02 Music 01 $10E7 Exceed 03...")
 
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{rommap|game=Thunder Force II (GEN)}}
{{Tutorials}}


==Music Hacking for Thunder Force 2 or any Techno Soft Games for Sega Genesis==
===BGM Header format===
<pre>
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!
</pre>
===Volume Controll for each channel===
<pre>
<pre>
Music are located in Z80 Bank $78000
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.
 


Music Z80 Pointer Song Name
10: Volume for channel 1
01 Music 00 $0100 Knights of Legend
11: Volume for channel 2
02 Music 01 $10E7 Exceed
12: Volume for channel 3
03 Music 02 $175F Take Strict Precautions
13: Volume for channel 4
04 Music 03 $1B24 Illusion
14: Volume for channel 5
05 Music 04 $22AB Irrevocable Dream
15: Volume for channel 6
06 Music 05 $2A5C A Ray of Hope
16: Volume for PSG 1
07 Music 06 $3100 Cruise Control
17: Volume for PSG 2
08 Music 07 $340C Cloud of Dust
18: Volume for PSG 3
09 Music 08 $391C Death Face's
10 Music 09 $4259 Big na Okata 1
11 Music 0A $467B Big na Okata 2
12 Music 0B $4914 Big na Okata 3
13 Music 0C $4CB7 Big na Okata 5
14 Music 0D $4F39 Big na Okata 6
15 Music 0E $5326 The Wind Blew All Day Long
16 Music 0F $586B Mission 2
17 Music 10 $5C23 Stage Clear
18 Music 11 $5DF9 Game Over
19 Music 12 $6011 Take Off One's Gloves (Ending Theme)
20 Music 13 $6E1C Tan Tan Ta Ta Ta Tan
21 Music 14 $708F Big na Okata 4
--------------------------------------------------------------------------------------------------------
Voices are located in Z80 Bank $70000


Voices from $0000-$0046
Sharp X68000 Version
D2: Channel Volume


Voice 1 Example
Channel tracks table stores offset for all 9 sound channels used by driver in the following order:
Z80 Pointer - $0000
channel 1, channel 2, channel 3, channel 4, channel 5, channel 6, channel 7, channel 8, channel 9
Pointer of the voice - $0100 - ? $0D7F - ? $002B
                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
</pre>
</pre>
===Channel Tracks Table===
<pre>
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
</pre>
===Value Definitions===
<pre>
$80-$DF Notes - Same as the Sharp X68000 Version.
$E0-$FF Coordination flags - Same As the Sharp X68000 Version but it might be different.
</pre>
===Note Editing===
<pre>
This is how the note is set up in the game:
nC0, x, y, z
nC0 or whatever
I'm not sure what x & y is but z is the Volume.
</pre>
===Music Notes Value===
<pre>
Same as the Sharp X68000 Version.
Example: "nC0 - C-0" and "nC0s - C#0".
nC0 080h
nC0s 081h
nD0 082h
nD0s 083h
nE0 084h
nF0 085h
nF0s 086h
nG0 087h
nG0s 088h
nA0 089h
nA0s 08ah
nB0 08bh
nC1 08ch
nC1s 08dh
nD1 08eh
nD1s 08fh
nE1 090h
nF1 091h
nF1s 092h
nG1 093h
nG1s 094h
nA1 095h
nA1s 096h
nB1 097h
nC2 098h
nC2s 099h
nD2 09ah
nD2s 09bh
nE2 09ch
nF2 09dh
nF2s 09eh
nG2 09fh
nG2s 0a0h
nA2 0a1h
nA2s 0a2h
nB2 0a3h
nC3 0a4h
nC3s 0a5h
nD3 0a6h
nD3s 0a7h
nE3 0a8h
nF3 0a9h
nF3s 0aah
nG3 0abh
nG3s 0ach
nA3 0adh
nA3s 0aeh
nB3 0afh
nC4 0b0h
nC4s 0b1h
nD4 0b2h
nD4s 0b3h
nE4 0b4h
nF4 0b5h
nF4s 0b6h
nG4 0b7h
nG4s 0b8h
nA4 0b9h
nA4s 0bah
nB4 0bbh
nC5 0bch
nC5s 0bdh
nD5 0beh
nD5s 0bfh
nE5 0c0h
nF5 0c1h
nF5s 0c2h
nG5 0c3h
nG5s 0c4h
nA5 0c5h
nA5s 0c6h
nB5 0c7h
nC6 0c8h
nC6s 0c9h
nD6 0cah
nD6s 0cbh
nE6 0cch
nF6 0cdh
nF6s 0ceh
nG6 0cfh
nG6s 0d0h
nA6 0d1h
nA6s 0d2h
nB6 0d3h
nC7 0d4h
nC7s 0d5h
nD7 0d7h
nD7s 0d8h
nE7 0d9h
nF7 0dah
nF7s 0dbh
nG7 0dch
nG7s 0ddh
nA7 0deh
nA7s 0dfh
</pre>
===Coordination flags===
<pre>
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!
</pre>
{{Internal Data}}

Latest revision as of 14:20, 24 January 2024

Chip tiny.png The following article is a Tutorial for THUNDER FORCE2.

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.

Note Editing

This is how the note is set up in the game:

nC0, x, y, z
nC0 or whatever

I'm not sure what x & y is but z is the Volume.


Music Notes Value

Same as the Sharp X68000 Version.
Example: "nC0 - C-0" and "nC0s - C#0".

nC0	080h
nC0s	081h
nD0	082h
nD0s	083h
nE0	084h
nF0	085h
nF0s	086h
nG0	087h
nG0s	088h
nA0	089h
nA0s	08ah
nB0	08bh

nC1	08ch
nC1s	08dh
nD1	08eh
nD1s	08fh
nE1	090h
nF1	091h
nF1s	092h
nG1	093h
nG1s	094h
nA1	095h
nA1s	096h
nB1	097h

nC2	098h
nC2s	099h
nD2	09ah
nD2s	09bh
nE2	09ch
nF2	09dh
nF2s	09eh
nG2	09fh
nG2s	0a0h
nA2	0a1h
nA2s	0a2h
nB2	0a3h

nC3	0a4h
nC3s	0a5h
nD3	0a6h
nD3s	0a7h
nE3	0a8h
nF3	0a9h
nF3s	0aah
nG3	0abh
nG3s	0ach
nA3	0adh
nA3s	0aeh
nB3	0afh

nC4	0b0h
nC4s	0b1h
nD4	0b2h
nD4s	0b3h
nE4	0b4h
nF4	0b5h
nF4s	0b6h
nG4	0b7h
nG4s	0b8h
nA4	0b9h
nA4s	0bah
nB4	0bbh

nC5	0bch
nC5s	0bdh
nD5	0beh
nD5s	0bfh
nE5	0c0h
nF5	0c1h
nF5s	0c2h
nG5	0c3h
nG5s	0c4h
nA5	0c5h
nA5s	0c6h
nB5	0c7h

nC6	0c8h
nC6s	0c9h
nD6	0cah
nD6s	0cbh
nE6	0cch
nF6	0cdh
nF6s	0ceh
nG6	0cfh
nG6s	0d0h
nA6	0d1h
nA6s	0d2h
nB6	0d3h

nC7	0d4h
nC7s	0d5h
nD7	0d7h
nD7s	0d8h
nE7	0d9h
nF7	0dah
nF7s	0dbh
nG7	0dch
nG7s	0ddh
nA7	0deh
nA7s	0dfh

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!