Keen 4 confusing and annoying music problems

Anything related to Keen Modding.
Post Reply
User avatar
szemigi
Posts: 716
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Keen 4 confusing and annoying music problems

Post by szemigi »

Hello!

Maybe not a surprising problem, but it's strange and wanna ask, too, because my head is about explode.

So:


1. In my list.txt file besides SOUNDS folder here is my imf list:

IMF music:
151: SND1-151.IMF
152: SND1-152.IMF
153: SND1-153.IMF
154: SND1-154.IMF
155: SND1-155.IMF
156: SND1-156.IMF
157: SND1-157.IMF
158: SND1-158.IMF
159: SND1-159.IMF
160: SND1-160.IMF
161: SND1-161.IMF

2. I used the extra level and music patch code of course, that's why you can see number 151 to 161 in the imf list:

#Allow 24 levels in Keen 4 v1.4:
#First increase the number of levels we can access from the map to maximum (+6)
%patch $DF5D $18 #Number of levels enterable ($18 = 24)

#Give extra levels valid stuff:
#Level name pointers:
%patch $30764 $1F040000RL #Map
$1F050000RL #Level 1
$1F060000RL #Level 2
$1F070000RL #Level 3
$1F090000RL #Level 4...
$1F0B0000RL
$1F0C0000RL
$1F0D0000RL
$1F0E0000RL
$1F0F0000RL
$1F100000RL
$1F110000RL
$1F130000RL
$1F150000RL
$1F180000RL
$1F1A0000RL
$1F1B0000RL
$1F1C0000RL
$1F1D0000RL #Bwb Rocket
$1F1C0000RL #Hall of fame
$1F1C0000RL
$1F1C0000RL
$1F1C0000RL
$1F1C0000RL
$1F1C0000RL

#Level entrance text pointers
%patch $307C8 $1F1F0000RL #Map
$1F210000RL #Level 1
$1F240000RL #Level 2
$1F260000RL #Level 3...
$1F290000RL
$1F2D0000RL
$1F300000RL
$1F330000RL
$1F350000RL
$1F380000RL
$1F3A0000RL
$1F3D0000RL
$1F400000RL
$1F430000RL
$1F470000RL
$1F4B0000RL
$1F4E0000RL
$1F510000RL
$1F540000RL #Bwb Rocket
$1F510000RL #Hall of fame
$1F510000RL
$1F510000RL
$1F510000RL
$1F510000RL
$1F510000RL

#This is the music played in each level:
# VALUE LEVEL MUSIC PLAYED LEVEL No
%patch $2F206 $0000W #Map (Shadowlands) 0
$0004W #Border Village (Kick in the Pants) 1
$0003W #Slug Village (Slug Village) 2
$0003W #Perilous Pit (Slug Village) 3
$0002W #Cave of Descendants (Too Hot) 4
$0002W #Chasm of Chills (Too Hot) 5
$0004W #Crystalus (Kick in the Pants) 6
$0003W #Hiliville (Slug Village) 7
$0001W #Sand Yego (Eat your Veggies) 8
$0001W #Miragia (Eat your Veggies) 9
$0001W #Lifwater Oasis (Eat your Veggies) 10
$0002W #Pyramid of Moons (Too Hot) 11
$0002W #Pyramid of Shadows (Too Hot) 12
$0002W #Pyramid of Ancients (Too Hot) 13
$0002W #Pyramid of Forbidden (Too Hot) 14
$0002W #Isle of Tar (Too Hot) 15
$0002W #Isle of Fire (Too Hot) 16
$0001W #Well of Wishes (Eat your Veggies) 17
$0003W #Bwb Megarocket (Slug Village) 18
$FFFFW #High scores (No music, "Fanfare") 19
$FFFFW #Extra level 1 (No music, "Fanfare") 20
$FFFFW #Extra level 2 (No music, "Fanfare") 21
$FFFFW #Extra level 3 (No music, "Fanfare") 22
$FFFFW #Extra level 4 (No music, "Fanfare") 23
$FFFFW #Extra level 5 (No music, "Fanfare") 24

#Level names:
%patch $1F040 "Shadowlands " $00
%patch $1F050 "Border Village " $00
%patch $1F060 "Slug Village " $00
%patch $1F0B0 "Chasm of Chills" $00
%patch $1F0C0 "Crystalus " $00
%patch $1F0D0 "Hillville " $00
%patch $1F0E0 "Sand Yego " $00
%patch $1F0F0 "Miragia " $00
%patch $1F100 "Lifewater Oasis" $00
%patch $1F1A0 "Isle of Tar " $00
%patch $1F1B0 "Isle of Fire " $00
%patch $1F1C0 "Well of Wishes " $00
%patch $1F1D0 "Bean-with-Bacon" $0A
"Megarocket " $00
%patch $1F070 "The Perilous Pit " $00
%patch $1F090 "Cave of the Descendents " $00
%patch $1F110 "Pyramid of the Moons " $00
%patch $1F130 "Pyramid of Shadows " $00
%patch $1F150 "Pyramid of the" $0A
"Gnosticene Ancients " $00
%patch $1F180 "Pyramid of the Forbidden " $00

#Keen entering levels
%patch $1F1F0 "Keen enters the" $0A "Shadowlands " $00
%patch $1F240 "Keen slips into" $0A "Slug Village " $00
%patch $1F330 "Keen stumbles upon" $0A "Hillville " $00
%patch $1F380 "Keen disappears into" $0A "Miragia " $00
%patch $1F210 "Keen makes a run for" $0A "the Border Village " $00
%patch $1F260 "Keen plummets into" $0A "the The Perilous Pit " $00
%patch $1F2D0 "Keen shivers along" $0A "the Chasm of Chills " $00
%patch $1F300 "Keen reflects upon" $0A "entering Crystalus " $00
%patch $1F350 "Keen grits his teeth" $0A "and enters Sand Yego " $00
%patch $1F3A0 "Keen crawls into" $0A "Lifewater Oasis " $00
%patch $1F3D0 "Keen backs into the" $0A "Pyramid of the Moons " $00
%patch $1F400 "Keen move silently in" $0A "the Pyramid of Shadows " $00
%patch $1F4B0 "Keen mucks along the" $0A "Isle of Tar " $00
%patch $1F4E0 "Keen blazes across the" $0A "Isle of Fire " $00
%patch $1F510 "Keen hopefully enters" $0A "the Well of Wishes " $00
%patch $1F290 "Keen plods down into" $0A "the Cave of the Descendents " $00
%patch $1F430 "Keen reverently enters" $0A "the Pyramid of the" $0A "Gnosticene Ancients " $00
%patch $1F470 "Keen hesitantly crosses" $0A "into the Pyramid of the" $0A "Forbidden " $00
%patch $1F540 "Keen launches into the" $0A "Bean-with-Bacon" $0A "Megarocket " $00

2. And here is the extra music:

%patch $8CCD $96 $03 #$2F206

#Change number of songs:
#%patch $8CEF $9B $00
#%patch $8C75 $C891W
#%patch $8C83 $C891W
#%patch $8D83 $C891W

%patch $8CA4 $1A #Number of level song entries (24)- the example on the wiki should be 19 not 18.

#Add new music
#Index of first music chunk within audio chunks:
%patch $8CEF $0097W # 98 is hex for 152- the number of the first song in my list.txt. originally $009CW

#Start address of music chunks
#reduce start address by 2x that of "First Audio Entry"
%patch $8C75 $C88BW # clear_music()- originally C895W
%patch $8C83 $C88BW # clear_music()
%patch $8D83 $C88BW # StartMusic()
%patch $8C91 $11 # Total Number of Songs

#Other music played: (Values here is number of LEVELS whose music is used)
%patch $9CD7 $000FW #Ending Sequence (Slug Village)
%patch $F4CA $000EW #Talking to Ancient (Ancient)

As you can see, I have 11 songs (6 + 5 additional). I tested the extra music thing, but when I wanted to enter a level, it is silent (The level/levels, where I use the extra songs in). So after loading the level it loads a little bit longer and then there is no music (silence) concretely.

3. How come I receive MM_SetPurge: Block not found! error when I enter or warp to any level? Because I receive this error additionally?




Help me, because I'm confused!
User avatar
Fleexy
Site Admin
Posts: 490
Joined: Fri Dec 12, 2008 1:33 am
Location: Bloogton Tower

Re: Keen 4 confusing and annoying music problems

Post by Fleexy »

I believe your primary problem is here:
szemigi wrote:%patch $8C91 $11 # Total Number of Songs
In hex, 11 (your number of songs), is $0B. $11 means 17. That's probably causing inconsistencies in the game's memory management.

Also note that while "number of levels enterable" is set to 24 ($18), you have a level numbered 24, so there are actually 25.
szemigi wrote:%patch $8CA4 $1A #Number of level song entries (24)- the example on the wiki should be 19 not 18.
So this should be $19 (25).

I will also take a moment of shameless self-promotion to point out that Abiathar's Music Mappings feature can do all music-related patches for you, including the insertion of extra songs and their mappings to higher-numbered levels. It even has a fancy GUI to do the level song assignment and song management. :)
User avatar
szemigi
Posts: 716
Joined: Fri Jan 23, 2009 8:06 pm
Location: Hungary
Contact:

Re: Keen 4 confusing and annoying music problems

Post by szemigi »

What is the exact extra music patch code if I have 10 songs in total?
Because I want 10 songs and I don't know which values should be edited concretely.

My list.txt from KeenWave:

IMF music:
152: SND1-152.IMF
153: SND1-153.IMF
154: SND1-154.IMF
155: SND1-155.IMF
156: SND1-156.IMF
157: SND1-157.IMF
158: SND1-158.IMF
159: SND1-159.IMF
160: SND1-160.IMF
161: SND1-161.IMF

Help me, Fleexy.
Post Reply