Aidyn Chronicles - The First Mage
(c) 2000 THQ, H20 Entertainment

Rip by Ugetab on 10/26/09

My first attempt to rip this failed due to a lack of experience in
finding how music could be inited, and understanding code flow.

The second attempt went quite a bit faster, because I was willing to be less conventional.
I ended up tracing from the 'Volume Init' used for the intro music, and found the song init
so quickly that it's almost embarrassing.
I found the volume init during my first attempt to rip the game.
Music volume has been set to the max of FF for the initial init. I think it starts out at A8 normally.

Threads don't want to die without taking out all execution, but the init code is above the thread loop point.
By setting the first line of code run in a thread to JR RA, followed by a NOP, the threads never even started.
Music init worked very well, even without the unused threads

C:\gshi\emulate\n64\USFRipping\Save\AIDYN_CHRONICLES.pj1
8001A764
C:\gshi\emulate\n64\USFRipping\Aidyn\
8001A76B

00-60

8001A600 - 8001A780 = Clear

Prevent Thread Execution on Restart
8001A84C = JR RA
80091344 = JR RA

8001B108 = Default Volume (Use 00FF for max)

8001A77C = 0C006C2C 00000000

8001A784 = Self Loop

Need a minor amount of recoding, and it should work

????????:
00000000
240400??= ADDIU A0, R0, 0x00?? (Load A0) (0-max)
3C0580??= LUI A1, 0x80?? (Load A1 with initial upper address)
24A5????= ADDIU A1, A1, 0x???? (Load A1 with initial lower address)
00042080= SLL A0, A0, 0x2 (Quadruple A for 4 byte marker)
00852820= ADD A1, A0, A1 (Add amount to song data start address)
0C??????= Music data init
00000000= NOP
end:
(Continue normal coding from here)

Data Style:
01020304 05060708

8001B0E0, 8001B0E4 = 8CA40000 for music track load

A1 is clean in the sound init routine, so you can move the load to there
---

8009D440 = Song Init (A0)

054F?
05B8
05BD
05D9
0601 (00 00 1F F0 00 36 AB E0 00 0C 00 02 00 00 21 E8)
0608 (00 00 3E C8 00 38 21 40 00 0C 00 02 00 00 01 B8)
0632
073D?
072D?
072E?
073B?
0740 = SFX
0741?
074D?
074E?
37BB

e4900 

1FC17C8

Getting Valid Song/Sound Values:
(1F89C18 + (song number * 0x10) up to 38F9 as base song):
If (Address) = 000C0002(33557504), then it should be a playable song
000C0002 = Playable

00080000 = Unplayable
00080002 = Unplayable
000B0002 = Unplayable

for I = 1F89C18 to 1F89C18 + 38F90 step 16

---
80044280 = a SFX value init
(8001B0E8 = Music Init's Song Init)
---
8001B1B8 = Sound Init, essentially

8001B1B8
DAE90
1B7938
80099090

7BAB40FF
7AF05670
25bee8 = in-game music data?
25694c = more music data, different routine

8009d440 = Music Init 1(A0 = Music Selection (0601, 0632))
800907A4 = Music Init(values at 1E1338 for opening?)
(A3=Volume)

e0718 = Start of music init data

800539E0 = Intro music init coding (checks for an equals)

Threads:
800BE97C

800BE860 = Thread Entry/Switch

Keep:
8008FCC8 = Music (A0=800DAA40, S2=800E41A4) B4F60 = Thread Init?
8001A784 = Self Loop
800C82A0 (800C8140) = Non-run = kills execution
800C1D40 (800C1C98) = Non-run = kills execution

Check:(Crash on init by exiting at top of routine)

8001AC74 (8001A84C)
80091418 (80091344)



Sound and Music
Steve Sim
Rob Plotnikoff
Max Arnason

---

8009D440 = Song Init (A0) (Can't seem to remove looping, but no issue. Not going to rip SFX, if avoidable)

B001BCE0 = 24 04 05 D9 24 04 06 32

For entries with a "-" in front, an attempt to rip them was made, but they crashed execution.
This accounted for 4 or so tracks, with a fifth 'silent' track accidentally included in my original estimate.
Aside from what's in 'Keep', you'll notice quite a number of sound effects, and some in 'keep' as well.
See above for how I determined what could potentially be valid. The method was greatly effective, though not perfect.

Keep: (0x00-0x65)
0000054F
00000551
00000568
00000575
0000057F
00000584
0000058F
00000590
00000592
00000593
00000595
00000597
00000599
000005A5
000005AB
000005B4
000005B8
000005B9
000005BD
000005C3
000005C9
000005CD
000005CE
000005D2
000005D4
000005D5
000005D7
000005D9
000005DA
000005DB
000005DC
000005DD
000005DE
000005DF
000005E0
000005E2
000005E3
000005E4
000005E5
000005EA
000005EB
000005ED
000005EE
000005EF
000005F0
000005F1
000005F2
000005F5
000005F6
000005F7
000005FB
000005FC
000005FD

Video Themes:
00000601
00000608
0000060B
0000060C
0000060E
00000610
00000612
00000613
00000615
00000617
00000619
0000061A
0000061B
0000061C
0000061D
0000061E
00000621
00000622
00000627
00000628
00000629
0000062B
0000062C
0000062D
0000062E
0000062F
00000630
00000632
00000633

Other Stuff:
00000704
00000719
0000071B
00000722
00000723
00000789
0000078A
0000078B
0000078C
0000078D
0000078E
00000790
000038DE
000038DF

---





---
Ignore:

Single Sound Ambience:
00000553
00000555
00000557
00000558
0000055A
0000055B
0000055C
0000055D
0000055F
00000561
00000562
00000564
00000566
0000056A
0000056C
0000056D
0000056E
0000056F
00000573
00000576
00000577
00000578
0000057A
0000057C
0000057E
00000581
00000583
-00000585
00000587
00000588
0000058A
0000058C
0000058D
-00000594
0000059B
0000059C
0000059E
0000059F

Skip
000005CB
000005E7
000005E8
-00000616
00000626
0000062A

SFX:
00000634
00000635
00000636
00000637
00000638
00000639
0000063A
0000063B
0000063C
0000063D
0000063E
0000063F
00000640
00000641
00000644
00000645
00000646
00000647
00000649
0000064A
0000064B
0000064C
0000064E
0000064F
00000650
00000651
00000652
00000653
00000654
00000655
00000657
00000658
00000659
0000065A
0000065C
0000065D
0000065E
0000065F
00000660
00000661
00000662
00000663
00000664
00000665
00000666
00000667
00000668
00000669
0000066A
0000066B
0000066D
0000066E
0000066F
00000670
00000671
00000672
00000673
00000674
00000675
00000676
00000677
00000678
00000679
0000067A
0000067B
0000067C
0000067E
0000067F
00000680
00000681
00000682
00000683
00000684
00000685
00000686
00000687
00000688
00000689
0000068A
0000068B
0000068C
0000068D
0000068E
0000068F
00000690
00000691
00000692
00000693
00000694
00000695
00000696
00000697
00000698
00000699
0000069B
0000069C
0000069D
0000069E
0000069F
000006A0
000006A1
000006A2
000006A3
000006A4
000006A5
000006A6
000006A7
000006A8
000006A9
000006AA
000006AC
000006AD
000006AE
000006B0
000006B1
000006B2
000006B3
000006B4
000006B5
000006B6
000006B7
000006B8
000006B9
000006BB
000006BC
000006BD
000006BF
000006C0
000006C1
000006C2
000006C3
000006C4
000006C5
000006C6
000006C8
000006C9
000006CB
000006CC
000006CD
000006CE
000006CF
000006D0
000006D1
000006D2
000006D3
000006D4
000006D5
000006D6
000006D7
000006D8
000006D9
000006DA
000006DB
000006DC
000006DD
000006DE
000006DF
000006E1
000006E2
000006E3
000006E4
000006E5
000006E6
000006E7
000006E8
000006E9
000006EA
000006EB
000006EC
000006ED
000006EE
000006EF
000006F0
000006F1
000006F2
000006F3
000006F5
000006F6
000006F7
000006F8
000006F9
000006FA
000006FB
000006FC
000006FD
000006FE
000006FF
00000700
00000701
00000702
00000705
00000706
00000707
00000708
00000709
0000070A
0000070B
0000070C
0000070D
0000070E
0000070F
00000710
00000711
00000712
00000713
00000714
00000715
00000717
-00000718
0000071C
0000071D
0000071E
0000071F
00000720
00000721
00000724
00000725
00000727
00000728
00000729
0000072A
0000072B
0000072C
0000072D
0000072E
0000072F
00000730
00000732
00000733
00000734
00000735
00000736
00000737
00000738
00000739
0000073B
0000073D
0000073E
0000073F
00000740
00000741
00000742
00000743
00000744
00000745
00000746
00000747
00000748
00000749
0000074B
0000074D
0000074E
0000074F
00000751
00000752
00000753
00000755
00000756
00000757
00000759
0000075A
0000075B
0000075C
0000075D
0000075E
0000075F
00000760
00000761
00000762
00000763
00000764
00000765
00000766
00000767
00000768
00000769
0000076A
0000076B
0000076C
0000076D
0000076E
0000076F
00000770
00000771
00000772
00000773
00000774
00000775
00000776
00000777
00000778
00000779
0000077A
0000077B
0000077C
0000077D
0000077E
0000077F
00000780
00000781
00000782
00000783
00000784
00000785
00000786
00000787
00000788
-0000078F
000037BB
000037DF
000037E0
00003831
00003832
00003833
00003834
00003835
00003836
00003837
00003838
00003839
0000383A
0000383B
0000383C
0000383D
0000383E
0000383F
00003840
0000388C
0000388D
0000388E
0000388F
00003890
00003891
00003892
00003893
00003894
