PDA

View Full Version : JJ2 Music Player


UNKNOWNFILE
Feb 18, 2006, 04:59 PM
For no reason whatsoever, I used my 1337 45m skillz and hacked JJ2 into just playing music on bootup.

http://img462.imageshack.us/img462/1159/jj2mplay0xh.jpg

Laugh as you may, it works. The access violation was purposefully inserted to prevent a huge CPU loop from eating up the system's resources.

Here is the ASM code to get the player working:

Insert this into 0048C681.
/*
Jazz Jackrabbit 2 Music Player
uses an actual copy of JJ2
*/

.text:0048C681 push offset 4D2950 ; song filename
.text:0048C686 call loc_465370
.text:0048C68B add esp, 4
.text:0048C68E call near ptr unk_4791A0
.text:0048C693 nop
.text:0048C694 retn ; Causes an access violation, but the music plays! ;)


You'll also need to patch the volume controller up. The offset it is in in Jazz2.exe is 0xA1CA0, but I can't remember the offset in memory. Patch 0xC39090 to this offset.

To load a file, you will need to set 0x4D2950 to whatever you want. If it is a J2B file, DO NOT INCLUDE THE EXTENSION.
J2B2IT, move over! :)

UNKNOWNFILE
Feb 19, 2006, 12:45 PM
Here's an example of the music player. (http://rapidshare.de/files/13661136/jj2mplay.zip.html) It doesn't need any of the required JJ2 files, as the calls have been inserted before the file loads go about their business.

The music is (c) Necros.

To change the music file, change 0xD1150 in the EXE to the music file's name. Remember, if it's J2b, do not include the .j2b extention. And remember to end the filename string with an 0x00.

Doubble Dutch
Feb 19, 2006, 06:02 PM
O.o!

Yays!

Now all we need is to make it into an application!

UNKNOWNFILE
Feb 19, 2006, 06:12 PM
Now all we need is to make it into an application!

With March Break on the horizon, OK then. Todo's are:

1) make music load as an argument
2) remove unneeded code
3) try to handle CPU usage as sanely as possible without causing program errors

Stijn
Feb 20, 2006, 06:12 AM
Or just use xmplay.

UNKNOWNFILE
Feb 20, 2006, 07:48 AM
This is useful in the job of parsing J2b's because it is (-) faster than using j2b2it, plus it converts the samples correctly.

Xobim
Feb 20, 2006, 07:58 AM
I argee with Stijn, isn't it possible to convert the code so you can choose a song?

UNKNOWNFILE
Feb 20, 2006, 08:10 AM
I'm pretty sure it is from the command prompt. but now I must go to classes =(

Erik
Feb 20, 2006, 08:31 AM
2 reasons not to use XMPlay:

XMPlay can't handle:

-- fake pwm effect in chiptunes
-- j2bs

la la la

UNKNOWNFILE
Feb 20, 2006, 05:34 PM
Command prompt stuff added. A new version should be up once I test this stuff with my registry editor.

EDIT: It is done! However, the thing will hate you if you use quotes to load a module file. This will often happen with the shell's built-in file association. To fix this, you'll need to do some registry tweaking:

Change something like:

C:\games\jazz2\jj2mplay.exe "%1"

To:

C:\games\jazz2\jj2mplay.exe %1

That should fix issues.

Version 2 of the player is up, with a j2b, at this lovely little rapidshare page. =) Hey hey hey! I'm fat albert! (http://rapidshare.de/files/13757344/jj2mplay_v2.zip.html)

Haze
Feb 21, 2006, 01:08 AM
XMPlay can't handle:

-- fake pwm effect in chiptunes

la la la

If XMPlay can't handle the effects... most likely your tracker has implemented it wrong then. :P If you believe otherwise submit the tune to Ian himself via ftp://ftp.un4seen.com/incoming/.
And tried fiddling around with the settings?

Erik
Feb 21, 2006, 08:01 AM
um haze, it's not really an effect, it looks more like this:

C-4 1
2
3
4
5
6
7
8
7
6
5
4
3
2
1

to make it sound like a sweep.

Odin
Feb 21, 2006, 10:48 AM
The main advantage of J2B2IT is that .it files can be read and edited in a tracker, such as Modplug Tracker. Therefore, if you want to make a remix of a Jazz 2 song or if you need a melody, you don't have to copy it by ear.

UNKNOWNFILE
Feb 21, 2006, 12:37 PM
The main advantage of J2B2IT is that .it files can be read and edited in a tracker, such as Modplug Tracker. Therefore, if you want to make a remix of a Jazz 2 song or if you need a melody, you don't have to copy it by ear.

http://jazz.madskills.org/music/Jazz2Mods-LC/

UNKNOWNFILE
Feb 22, 2006, 08:30 AM
I disabled registry reads and the splash screen. I also disabled winsock from starting up. The last thing I have to do is to get an error screen that says, "Music started successfully from $esi" where $esi is the parameters used.

UNKNOWNFILE
Feb 22, 2006, 02:08 PM
Newest version released. This time, I put it on J2o. Download or I shall summon Ninja to go kung-fu on your worthless behinds. (http://www.jazz2online.com/J2Ov2/downloads/info.php?levelID=4029)