FileForums

FileForums (https://fileforums.com/index.php)
-   DC Games (https://fileforums.com/forumdisplay.php?f=8)
-   -   Guide to selfbooting 45000 LBA DATA/DATA images (https://fileforums.com/showthread.php?t=81685)

Xzyx987X 25-08-2007 19:16

Guide to selfbooting 45000 LBA DATA/DATA images
 
1 Attachment(s)
Ok, I'm creating this guide in response to the fact there don't seem to be any guides on making 45000 LBA DATA/DATA images that don't involve burning the game tracks to a disc as an intermediate step. There's really no reason this should be necessary, and it creates a lot of coasters if you don't get in right the first time. So, why not just build the images manually and save yourself the trouble?

Before we start though, just a heads up. If your game has CD audio tracks, you're out of luck for now. This guide doesn't cover games with CD audio, and adding them with this method would be less than trivial. If you are desperate, or have a good deal of technical knowledge, you can read about how it could be accomplished at the end.

First of all, here's what you'll need:
-WinHex (or any other capable hex editor)
-Daemon Tools (Used to read images and play them in emulators, since opening the nrg directly won't work. Tested with version 4.08.)
-ripped copies of the files from the game (this guide doesn't cover ripping)

You'll also need the following tools which I've uploaded here:
-mkisofs
-dummy
-binhack (to generate a bootable IP.BIN)
-ipins (not mandatory, you can also hex edit IP.BIN into your image)
-nrgheader (just a file, not a program)

To start off you're going to want to put all your ripped game files in a folder, and name it SESSION2. Now you'll need to make a copy of your 1ST_READ.BIN and IP.BIN file somewhere else, and use BINHACK on it with an msinfo value of 45000 to make them bootable IP.BIN. Then delete the 1ST_READ.BIN copy, as with this method 1ST_READ.BIN doesn't usually need patching, and binhacking it will only screw it up, if it does anything at all. The only expetion to this is if you're modifying a previously binhacked 1ST_READ.BIN, which had it's LBA modified to be used with a different selfboot method. You should replace the old 1ST_READ.BIN with the copy.

For WinCE games which require other methods to crack, you'll have to look up a method of generating an IP.BIN for those games on your own. I don't have any to test this on myself.

The 45000 LBA method requires you to have two data sessions, and if you don't have 65MB to spare on your disc, you are going to need to put some files on the smaller first session. Don't worry though, this doesn't complicate things much. Once the image is created, the Dreamcast (and your computer for that matter) will read both sessions as one. So, with the exception of 1ST_READ.bin, you're going to need to pick files from your ripped game totalling as close to 65MB as you can get, and cut and paste them into a new folder called SESSION1. The remaining files will be left where there are in the old folder, SESSION2. Note that the maximum size you will have for SESSION2 on an 80 minute CD-R is 610MB. If that's not enough space you'll need to use a bigger disc, downsample, or split the game across multiple discs. It's also worth mentioning it will not cause problems if you split up the contents of a folder between sessions, as long as the path to the files remains unchanged.

Now we can start to build the image. First, copy mkisofs to the folder above the one where your session folders are, and run it from the command line with the parameters used in the following example:

mkisofs -C 0,0 -V (GAME_TITLE) -l -o SESSION1.iso SESSION1

Replace (GAME_TITLE) with whatever you want the CDs label to be, it really doesn't matter what you use as long as it's all caps, uses only alphanumeric characters or underscores, and doesn't contain more than 11 characters. But other than that, the sky's the limit. :P

SESSION1.iso needs to be exactly 69,120,000 bytes for this to work, so you will need to right click on the file, select properties, and find out how big it actually ended up being. If it's more that 69,120,000 bytes you put too many files in it, and you're going to need to redo it. Assuming you have less than that, you will need to pad the file out to be the correct number of bytes. Run dummy from the included tools at the command line to create a file that is (69,120,000 - length of file) bytes long which we'll refer to as PAD2.

While we're at it we can also use dummy to create PAD1. This will always need to be 307,200 bytes, regardless of the size of anything else involved in this process.

Now we'll need to build the second session. The command for doing this will be:

mkisofs -M SESSION1.iso -C 0,45000 -V (GAME_TITLE) -l -o SESSION2.iso SESSION2

The only file we need now is nrgheader, which you can extract from the tools archive to the same folder as the iso images.

The last thing we do before building the image is to insert IP.BIN into the boot sector of SESSION2.iso. You can do this with either ipins from the command line, or by writing the contents of IP.BIN into the image at offset 0 with a hex editor.

Now, we can put everything together. Using the concatenate function of WinHex, or any other file concatenation tool you prefer, merge the files into a new file called GAME.nrg in the following order:

PAD1, SESSION1.iso, PAD2, SESSION2.iso, nrgheader

Yea, with NRG files the header goes at the end. I have a few theories as to why, but this guide is getting too long as it is. Anyway, we're almost done, but there's one last step. You'll need to open GAME.nrg in your hexeditor and scroll way down to the end. On the first line that starts with CUEX, make sure the offset it's on (usually displayed in the left collumn) ends with either 000 or 800. I'm pretty sure this will always be the case if you followed the guide correctly, but if it's not just insert some bytes with a value of 0 right before that line until the offset is corrected to end with one of those two values. Now, at both of the two locations where you can see the text says "HERE" on the ASCII text interpretter on the right, click on the "H". Then, starting from the location that became selected in the middle collumn, type the offset from the left collumn that is on the first first line that started with CUEX. The same one that had to end with either 000 or 800. Don't forget to type any 0's at the beggining, although usually with a files the size of iso's you won't have any.

And finally, the moment of truth. The ISO should theoretically be bootable at this point, but there's only one way to find out. Use Daemon tools and try to mount the image to a virtual drive. If there are no errors, try opening it with Windows Explorer and see if all the files from both sessions are displayed on the disc. If they are congratulations, your image is correctly formatted. This doesn't prove it's bootable, but at least it isn't the structure of the image itself isn't the problem, so you know you followed the guide correctly. If you want to know for sure it'll boot before wasting a disc, you can use a Dreamcast emulator such as NullDC or Chankast to test it. Just remember that you must play it from the virtual drive. Opening the image will not work. Even if the game isn't compatable, you should at least see the usual liscenced by Sega screen if the selfboot was successful. If it displays as it should, the game should work on a real Dreamcast. If it doesn't, something with your IP.BIN is screwed up, and you'll need to find another way to get one that works.

One last note, games with more advanced protection (such as Sonic Adventure 2) will not work without additional cracking. But, the vast majority of games, including a few notable games that require cracking to work with the old AUDIO/DATA method, should work perfectly with this method.

---

For those of you who have a more advanced level of knowledge, I present the following. In order to use this selfboot method, an nrg header is required, but just using the canned version I packaged with the guide will be useless for games with CD audio. To tackle these games a bit more effort is needed. Here is the only public documentation on the nrg file format I could find. If someone want to use this to program a tool to generate nrg headers with more complex layouts, and possibly expand it to automate this whole process, then be my guest. As it is, I've got so much backlog to get through with my programming projects, it may be years before I get around to it.

--=FamilyGuy=-- 03-09-2007 21:19

Wow, pretty interesting dude !

I think i'ma try to do my own Shenmue II rip now ...

Anybody knows how to do E's SOA-style compressed rips ?


-=FamilyGuy=-

Xzyx987X 04-09-2007 23:10

You'd have to hack the 1ST_READ.BIN and hook the Katana GD-ROM reading libraries with ones that have decompression support in order to do that. This would be less than trivial. In other words, if you have to ask how it was done, you're not going to be able to do it.

Darkfalz 11-09-2007 21:42

I recommend CDRWin for this purpose, I have an old hacked copy to work with my current CD burner.

Xzyx987X 13-09-2007 05:17

Well, the reason I think this method is superior is because you can actually understand the entire process from beginning to end. That way people can write their own tools to automate the process rather than relying on programs that haven't been updated in over 5 years and that probably won't work with newer configurations as PCs keep changing. You know what they say, knowledge is power.

Darkfalz 15-09-2007 05:18

Superior? You must be kidding. I was doing 45000 data/data games 4 years ago. My Shenmue II rip is a masterpiece.

Xiaopang 16-09-2007 13:45

lol@darkfalz and i'm sitting on my masterpiece right now. my aim of ripping no speech output whatsoever worked out for disc 1 and 4, but for 2 and 3 i'll have to resort to some other tricks.

anyway, the above guide is pretty cool and describes what i did so far, but i have an easier method. i use dj to create the image and hack in the ip.bin with a hexeditor. it's clean, fast and provides you with a valid cdi.

the mkisofs method however has the advantage of allowing the use of sorttxt-files, something that is crucial for games like d2. thanks for providing the nrg-header, Xzyx987X. i produced my own and also headers and footers for cdi-images, but the latter ones were quite buggy. no wonder everybody uses nrg for jobs like these

--=FamilyGuy=-- 17-09-2007 21:03

Quote:

Originally Posted by Xzyx987X (Post 345524)
You'd have to hack the 1ST_READ.BIN and hook the Katana GD-ROM reading libraries with ones that have decompression support in order to do that. This would be less than trivial. In other words, if you have to ask how it was done, you're not going to be able to do it.

Tell me how to do so and I'll do it...
I might not be the only-oneI know wishing to make a SOA-Style rip of ShenmueII and wich may really got the skillz do DO so, but not really to find how to ... got no free time ... (school ...)

I'd like if you elaborate a lil' more about bounding the reading bins of the 1st_read.bin to a bin with decompression in it, couldn't we simply create a new bootbin(a.k.a. cracktro) which would link the read request and the compressed files and uncompress the files on the fly before reading it? The files being compressed in a sh-4 based format ... for better performances
I always though *A certain group* did it this way...


-=FamilyGuy=-

Darkfalz 18-09-2007 21:37

It's not possible for SOA.

Xiaopang 19-09-2007 09:26

@darkfalz: i think you mean it's not possible for shenmue. i think so too, because of the sound samples it uses instead of streams. anyway, there's no need to go through the trouble inserting extra compression algorithms, because the game fits quite nicely on 99min discs

--=FamilyGuy=-- 19-09-2007 12:05

It fits if you keep only one language and downsample some sound I guess, but to fit it completely would've been cool, maybe compressing some files like menus and *useless* sounds, but I understand 504150 sectors of data are hard put fit in 360000 ones. (or like 445500 for 99min cd-r)

-=FamilyGuy=-

Xiaopang 19-09-2007 15:13

well, depends...i have ripped disc one (everything included) to 95mins and disc 4 (digest movie mono-ized and french and spanish language files kicked out) to 97,5mins. still, i could have optimized disc 4 to keep all language files and still keep it at 97,5mins. why 97,5mins? because thats the max my dc can read. may be other models can read more. would be cool, because i also mastered a sb-rip of spacechannel 5 which was 99:59 big. if a dc could read that far, that would provide me with 22MB more space. thats a huge amount for so highly stacked games like shenmue.

anyways, i still have to rip disc 2 and 3 of shenmue 2. disc 2 is 968MB in size, but i managed to downsize it to 870MB and still keeping all files. this would already be enough to burn that sucker without bootcode to a 99min disc, but that would only be useful for storing reasons. so for disc 2 and 3 the multiple language files would have to go. you can't downsample the sound though. as i already mentioned, shenmue doesn't use soundfiles, but only samples...tens of thousands of them and all are like 5-20kb each. to save a remarkable amount of data, you'd have to downsample thousands of samples, and even then i'd doubt that this would save enough to bring this baby down to 80min. i could also imagine that the sound player shenmue uses is so specialized, that downsampling the sound banks might break their playability for the player, but thats just a theory. compressing the menus wouldn't save you much space. the menu's size plus subtitles and discchanging screens is only 4,5MB. so there's not much to save there. i tried it though. the menu stuff is compressed with gzip, but they already used the best compression. you could try to replace the gzip files with 7z files and the gz-decoding algorithm with a 7z-decoding algorithm. that might downsize the menus a bit further, but that would also be kinda useless, because gzip is really only used for the menus

Xzyx987X 19-09-2007 15:23

Quote:

Originally Posted by Darkfalz (Post 346061)
Superior? You must be kidding. I was doing 45000 data/data games 4 years ago. My Shenmue II rip is a masterpiece.

The method for selfbooting has little to do with the quality of the finished rip, other than determining how easy it is to burn and which Dreamcast versions it's compatible with.

--=FamilyGuy=-- 20-09-2007 21:12

Quote:

Originally Posted by Xiaopang (Post 346278)
well, depends...i have ripped disc one (everything included) to 95mins and disc 4 (digest movie mono-ized and french and spanish language files kicked out) to 97,5mins. still, i could have optimized disc 4 to keep all language files and still keep it at 97,5mins. why 97,5mins? because thats the max my dc can read. may be other models can read more. would be cool, because i also mastered a sb-rip of spacechannel 5 which was 99:59 big. if a dc could read that far, that would provide me with 22MB more space. thats a huge amount for so highly stacked games like shenmue.

anyways, i still have to rip disc 2 and 3 of shenmue 2. disc 2 is 968MB in size, but i managed to downsize it to 870MB and still keeping all files. this would already be enough to burn that sucker without bootcode to a 99min disc, but that would only be useful for storing reasons. so for disc 2 and 3 the multiple language files would have to go. you can't downsample the sound though. as i already mentioned, shenmue doesn't use soundfiles, but only samples...tens of thousands of them and all are like 5-20kb each. to save a remarkable amount of data, you'd have to downsample thousands of samples, and even then i'd doubt that this would save enough to bring this baby down to 80min. i could also imagine that the sound player shenmue uses is so specialized, that downsampling the sound banks might break their playability for the player, but thats just a theory. compressing the menus wouldn't save you much space. the menu's size plus subtitles and discchanging screens is only 4,5MB. so there's not much to save there. i tried it though. the menu stuff is compressed with gzip, but they already used the best compression. you could try to replace the gzip files with 7z files and the gz-decoding algorithm with a 7z-decoding algorithm. that might downsize the menus a bit further, but that would also be kinda useless, because gzip is really only used for the menus

As far as I can tell, shenmue II speech files are in *.ahx, the ahx code is already know ( to play it, not encode) and it looks like *.adx there's softwares I don't get floating around that can create them. They are pretty much some high;y compressed adx files, wich can,t sound as good as adx for music, but wich are perfect for short speech, since there isn't a billion of notes in 2 or 3 sentences.

Maybe to resize/recompress some textures might aswell help.
My motherlanguage is french, so I wouldn't want to rip the french par of it :P

Xiaopang 20-09-2007 23:38

Quote:

Originally Posted by --=FamilyGuy=-- (Post 346312)
As far as I can tell, shenmue II speech files are in *.ahx, the ahx code is already know ( to play it, not encode) and it looks like *.adx there's softwares I don't get floating around that can create them. They are pretty much some high;y compressed adx files, wich can,t sound as good as adx for music, but wich are perfect for short speech, since there isn't a billion of notes in 2 or 3 sentences.

you didn't get my point. of course you can extract the adx from the ahx files. but the adx only contain samples of music and speech! yes even the speech is broken down into short samples as it seems. the file that contains the music is only 5MB in size. the rest is all speech and sfx. go ahead and extract free01.afs and you'll end up with 25,000 small sample files for the npc-speech. be my guest and downsample all of those :P


Quote:

Originally Posted by --=FamilyGuy=-- (Post 346312)
Maybe to resize/recompress some textures might aswell help.
My motherlanguage is french, so I wouldn't want to rip the french par of it :P

lol i'm german, but i still prefere playing this game in english ;)

anyway, i don't get while people try to cram this and other games on 80min discs. almost all new writers can go beyond 90 or even 95min. 99 and even 100min discs can be easily ordered online and they are dirt cheap!

--=FamilyGuy=-- 21-09-2007 08:20

Just to clarify, I meant AHX, not afs, AHX are highly compressed adx and can be even more compressed now with gamecube tools (sega games on GC use ahx and the quality is better fopr a lower bitrate, and someone I know amde a rip of SA2 using the GC files intead of the DC's one to save space)

Also, I think it would be easy to re-encode them all, simply extract hem all, then run like : ahxecoder *.ahx \encoded\*.ahx

Note: ahxencoder isn't a program which exist, it was just a exemple of how I actually often encode files in batch.

Xiaopang 21-09-2007 10:04

hmm, that sounds like a very cool idea now. especially the part with abusing the newer gc-version, but where does shenmue use ahx-files? i only found afs

--=FamilyGuy=-- 21-09-2007 16:34

ROOT:\SCENE\02\STREAM\*.afs

Theses afs are full of ahx files.
They are certainly not the only ones, but they are the only I've found so far.
It's 173 MB it might be compressed better.

-=FG=-

Xiaopang 21-09-2007 16:56

ah ok, i thought the afs-files extracted adx-files...i didn't work on shenmue for quite some time...btw, my free02.afs is 278MB. seems like you already have a downsized version o.O

--=FamilyGuy=-- 21-09-2007 17:47

Quote:

Originally Posted by Xiaopang (Post 346357)
ah ok, i thought the afs-files extracted adx-files...i didn't work on shenmue for quite some time...btw, my free02.afs is 278MB. seems like you already have a downsized version o.O

I don't talk about free02.afs, but a bunch of afs in ROOT:\SCENE\02\STREAM\

But I think they're blanked, most of them.

Xiaopang 22-09-2007 03:29

damn you're right. i don't know where i had my head...anyway, i checked back at the size and all of my afs-files (except for free02.afs) are 110MB combined in size, so you still seem to already have a downsized version.

one idea that you didn't seem to think of yet is to lba-link duplicate files. that saves about 30MB on disc 2

--=FamilyGuy=-- 22-09-2007 11:38

I don't have acess to unmodded/unripped files from ShenmueII, maybe that's why my filesize don't fit yours, I also know that many used afs-shrink that remove some part of the footer of the afs files to save space.

But to be able to fit every language files, and every speech sound (even if downsampled), I think we would have to downsample de AHX files (no tools to do so exist, avaiable to public at least), link duplicated files and run afs-shrink & use 80+ min cdrs.

-=FamilyGuy=-

Xiaopang 22-09-2007 13:14

here's what i'm gonna do:

i use darkfalz' afs compactor which saves about 70Mb per disc plus 30MB from the duplicate files and you are 100MB down without any loss of quality. i don't care for multilanguage files, because i play the game only in one language. if i have the space, i'll leave them though like in disc 1 and 4, but since i'm really short on space then why would i keep something unused like files for 3 other languages? anyway, killing of 3 languages gives me 13MB more space. i also planned on deleting or replacing the emulated games (harrier, afterburner and so on), because it's kinda dumb blowing your money on those games anyway. you only have to play them once to make them available in the main menu, so you can resort back to disc 1, where they all fit nicely, to play them. all in all you can save 122MB with this method while keeping full speech output and without downsampling them. that brings disc 2 (and most likely also disc 3) down to 847MB...enough to burn that game to a 99min disc and making it selfboot

if you don't have access to the unmodified source files what are you working with then? all rips that are floating around are downsized to 80min already. by the way, do you have afsshrink? it's totally impossible to find

--=FamilyGuy=-- 22-09-2007 19:16

I totally agree with emulated games deletion.

I'll look for afsshink when I'll be on my computer, I don't have acess to it right now.

I don't have the original ShenmueII files handy, but I'm just a rip aways of getting them, thus why I wanna understand clearly how to downsample it to keep my damned french files.

I still think htat to downsample AHX files would be the better thing to do.


Thank you!

Darkfalz 22-09-2007 20:22

Quote:

Originally Posted by Xzyx987X (Post 346279)
The method for selfbooting has little to do with the quality of the finished rip, other than determining how easy it is to burn and which Dreamcast versions it's compatible with.

It's nothing about a "method for selfbooting", it's using the additional space available in the first session for the best possible fit, as well as preserving sort order. Also making sure I kept in the important info files in the FREE0x.AFS and ripping only minimal speech.

Xiaopang 23-09-2007 02:12

@fanily guy: if it is possible to downsample the ahx-files without breaking their playability for the game, then i think i would definitely do that on some portions of the game, because it would be nice to keep the emu-games and the multilanguage files. all in all they only use 22MB, so downsizing the many speech files by that amount shouldn't be much of a problem.

still, some games are hard coded to use the audio files with a certain bitrate/samplerate/number of channels, so i'm excited to know if shenmue allows downsampling

Darkfalz 26-09-2007 00:04

Ripping out the arcade games = blasphemy.

Echelon originally downsampled the ahx files in the Japanese Shenmue I speech, but whatever tools they used are not publically available. Perhaps as a previous poster said there's something in the Sega Gamecube SDK, but I've ever seen the tool.

Remember, these are highly compressed mono-speech files - probably not so much room for downsampling. All Shenmue music is MIDI format.

Xiaopang 26-09-2007 01:25

Quote:

Originally Posted by Darkfalz (Post 346571)
Ripping out the arcade games = blasphemy.

lol they are already completely present on disc 1 and 4 and partially on the other two discs. so, not ripping out the arcade games if you're in need of space = waste of space


Quote:

Originally Posted by Darkfalz (Post 346571)
Remember, these are highly compressed mono-speech files - probably not so much room for downsampling.

i thought the same thing

Darkfalz 27-09-2007 03:26

I've got 5 days off working coming up, planning to play through Shenmue II again :) Already played through Shenmue I with aid of walkthrough to make sure I got every cutscene and easter egg :) I need to replay Shenmue II to see stuff like the Fei Ming birthday. I might actually play my originals, hehe.

Xiaopang 27-09-2007 04:40

uh...there's a birthday scene? wait, who's fei ming o.O? you should use your originals for the best experience ;)

Darkfalz 01-10-2007 21:00

Quote:

Originally Posted by Xiaopang (Post 346607)
uh...there's a birthday scene? wait, who's fei ming o.O? you should use your originals for the best experience ;)

I'm not too good with names. Actually I am buying an HD LCD in a month, might wait until then and play it on that via VGA :)

Xiaopang 01-10-2007 21:05

i hooked the console up to my hdtv via vga-box and it looks rather disappointing because of the low res textures they used. other dc-games looked much better, but still, have fun :)

Darkfalz 10-10-2007 01:05

Got my 40 inch HD LCD today, Sony Bravia D series. Dreamcast looks great on it (but it certainly does help it look dated compared to new consoles).

Darkfalz 12-10-2007 15:52

My new TV playing Soul Calibur via VGA :)

http://www.kiczek.com/darkfalz/bravia.jpg

Xiaopang 16-10-2007 00:37

looks great, even though sony is pure evil and deserves to die :P

what does the big "D" on the sticker on the very left mean?

Darkfalz 16-10-2007 01:28

D series with motionflow.


All times are GMT -7. The time now is 10:35.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com