Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modifying the bgm-array?
#1
? 
I'm a huge fan of tons of different music in LF2, so I added quite a few additional wma's that are incorporated inside of stage.dat. The only problem I have is that there are now more files than LF2 supports in the music-selection of VS-mode. That's why I'd like to enlarge the current array (or, if it's easier, create a new array which can be adjusted accordingly).

On my searches throughout the exe, I stumbled upon these snippets which I suspect to be related to the whole bgm-stuff:
    ASM-Code:
0040216C  |> 837C24 10 00   CMP DWORD PTR SS:[ESP+10],0
00402171  |. 8B0D 8CF14400  MOV ECX,DWORD PTR DS:[44F18C]	; Display
00402177  |. 74 08          JE SHORT LF2.00402181
00402179  |. 03CE           ADD ECX,ESI				; ESI = 1
0040217B  |. 890D 8CF14400  MOV DWORD PTR DS:[44F18C],ECX	; Player pressed Right
00402181  |> 83F9 08        CMP ECX,8				; Limit: 8
00402184  |. 7E 09          JLE SHORT LF2.0040218F		; inside the limit? Goto 0040218F
00402186  |. 83C9 FF        OR ECX,FFFFFFFF			; ECX = -1
00402189  |. 890D 8CF14400  MOV DWORD PTR DS:[44F18C],ECX
0040218F  |> 837C24 0C 00   CMP DWORD PTR SS:[ESP+C],0		;
00402194  |. 74 08          JE SHORT LF2.0040219E		;
00402196  |. 2BCE           SUB ECX,ESI				; ESI = 1
00402198  |. 890D 8CF14400  MOV DWORD PTR DS:[44F18C],ECX	; Player pressed Left
 
0040219E  |> 83F9 FF        CMP ECX,-1				; Music off? (CE displays "4294967295")
004021A1  |. 7D 3C          JGE SHORT LF2.004021DF		; 
004021A3  |. B9 08000000    MOV ECX,8				; Limit: 8
004021A8  |. 890D 8CF14400  MOV DWORD PTR DS:[44F18C],ECX	;
004021AE  |. E9 3E010000    JMP LF2.004022F1		;
 
00402556  |> 68 28F14400    PUSH LF2.0044F128                   ; /<%s> = "OFF"
0040255B  |. 68 C0764400    PUSH LF2.004476C0                   ; |format = "Music: %s"
00402560  |. 68 60F04400    PUSH LF2.0044F060                   ; |s = LF2.0044F060
00402565  |. FF15 70714400  CALL DWORD PTR DS:[<&MSVCR80.sprintf>]   ; \sprintf
0040256B  |. 8B7424 20      MOV ESI,DWORD PTR SS:[ESP+20]
0040256F  |. 6A 03          PUSH 3
00402571  |. 68 5B020000    PUSH 25B
00402576  |. 68 5A77D800    PUSH 0D8775A
0040257B  |. 6A 00          PUSH 0
0040257D  |. 68 60F04400    PUSH LF2.0044F060                   ;  ASCII "Music: OFF"
00402582  |. 56             PUSH ESI
00402583  |. E8 08EDFFFF    CALL LF2.00401290
00402588  |. 6A 14          PUSH 14
0040258A  |. 68 5B020000    PUSH 25B
0040258F  |. 68 223FA000    PUSH 0A03F22
00402594  |. 6A 00          PUSH 0
00402596  |. 68 A0764400    PUSH LF2.004476A0                   ;  ASCII "(Press Left/Right to change)"
0040259B  |. 56             PUSH ESI
0040259C  |. E8 EFECFFFF    CALL LF2.00401290
004025A1  |. 83C4 3C        ADD ESP,3C
004025A4  |. 5E             POP ESI
004025A5  \. C3             RETN

What I couldn't find are the linkings to the actual wma-files + their names that are displayed in the selection menu.

So, I wanted to ask how (I presume it's possible) to, with a JmpPatch/CallPatch of the DLL-framework, have a choice between, let's say, 24 instead of 8 files. Thanks in advance!
Silverthorn / Blue Phoenix
~ Breaking LFE since 2008 ~

"Freeze, you're under vrest!" - Mark, probably.

» Gallery | » Sprites | » DeviantArt
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)