JazzJackrabbit Community Forums

JazzJackrabbit Community Forums (http://www.jazz2online.com/jcf/index.php)
-   General Jazz Jackrabbit Talk (http://www.jazz2online.com/jcf/forumdisplay.php?f=4)
-   -   JJ2 Music Player (http://www.jazz2online.com/jcf/showthread.php?t=14805)

UNKNOWNFILE Feb 18, 2006 05:59 PM

JJ2 Music Player
 
For no reason whatsoever, I used my 1337 45m skillz and hacked JJ2 into just playing music on bootup.

[img]http://img462.imageshack.us/img462/1159/jj2mplay0xh.jpg[/img]

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.
Code:

/*
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 01:45 PM

Here's an example of the music player. 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 07:02 PM

O.o!

Yays!

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

UNKNOWNFILE Feb 19, 2006 07:12 PM

Quote:

Originally Posted by Doubble Dutch
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 07:12 AM

Or just use xmplay.

UNKNOWNFILE Feb 20, 2006 08: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 08:58 AM

I argee with Stijn, isn't it possible to convert the code so you can choose a song?

UNKNOWNFILE Feb 20, 2006 09:10 AM

I'm pretty sure it is from the command prompt. but now I must go to classes =(

Erik Feb 20, 2006 09: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 06: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!

Haze Feb 21, 2006 02:08 AM

Quote:

Originally Posted by aegis
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 09:01 AM

um haze, it's not really an effect, it looks more like this:
Code:

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 11: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 01:37 PM

Quote:

Originally Posted by Odin
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 09: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 03: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.


All times are GMT -8. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
JCF © 2001-Infinity Jazz2Online