Advertising (This ad goes away for registered users. You can Login or Register)

Injecting roms to official Turbografx-16 emulator for PSP II

All the Help you need is here
User avatar
reprep
Posts: 1074
Joined: Tue Dec 17, 2013 4:38 pm

Injecting roms to official Turbografx-16 emulator for PSP II

Post by reprep » Mon Feb 02, 2015 7:23 pm

Here is the promised PART II of "Injecting roms to official Turbografx-16 emulator for PSP" tutorial. This time we will use PC Engine/Turbografx-16 classics psn releases. http://en.wikipedia.org/wiki/List_of_Pl ... x-16_games

It would be great if you could have a look at this at first to see what to expect. viewtopic.php?f=24&t=41108

Turbografx-16/PCEngine HuCard games injecting

1-First get the pkg link of your legally purchased turbografx-16/PC Engine Classics PSN game. you can use a packet sniffer while downloading to your PSP/Vita/PS3.
2-Use this great tool by Leecherman to decrypt the pkg. https://sites.google.com/site/theleeche ... -extractor
3-You will get an iso file and 3 files within a directory named with title id. these files are CONTENT.DAT, PARAM.PBP and PSP-KEY.EDAT
4-Get the files i attached here or from the link. They need python 2.7. https://drive.google.com/file/d/0B6I815 ... sp=sharing
5-Put the PSP-KEY.EDAT to the keys folder and CONTENT.DAT in encrypted folder.
6-Run the decrypt.py and wait for some time. Decrypted files will be in decrypt/files folder.
7-For now, we are interested in a file called xxx.PCE. Replace this file with a rom you want, be sure the filename stays the same. There is no size limit etc, just be sure it is not a CD game, it is a hucard game. CD games are possible to be replaced too, but it will be explained a bit later.
8-Run the encrypt.py and wait for some time. You will find the new CONTENT.DAT in final folder.
9-Copy the game iso to ISO folder on your PSP and PARAM.PBP,PSP-KEY.EDAT and new CONTENT.DAT in PSP/GAME/"titleid" folder.
10-Be sure to use a CFW with noDRM option enabled or NPloader plugin.
11-Have fun, i would love a compatilibity list if anyone has time. though from what i see, only slowdowns i get are in the real system too.

Turbografx-16/PCEngine CD games injecting

It is a complicated process but worth the effort. First we should have an idea about the CD layout of PCE CD games. PCE CD games have 1 or 2 Data tracks which have the game code within them and rest of the tracks are audio tracks. So far no CD games were released for us/eu psns. These are only for Japan PSN. For example YS series (I&2, 3, 4) on Japanese PSN are PCE CD games.

You can decrypt the PCE CD games with the same PCE py tool above. The process will take a longer time due to the increased file sizes. After it is done, files you will see in decrypted/files folder will be different from HuCard games. Let's have a look at them one by one.
"titleid".HCD: it is the TOC of the CD. it tells at which sectors data and audio tracks begin, how sectors long they are etc. first 2 lines of HCD9009.HCD file for example:
"track01,audio,HCD9009_01.at3,000150,003365
track02,code ,HCD9009_02.bin,003745,008405"

track01 tells the file name to look for. In our example it will look for HCD9009_01.at3. audio means it is an audio track. 150 is the sector start and 3365 sector length. if, after track number, there is code instead of audio, it means it is game data. in our example, game will look for HCD9009_02.bin. this goes on for 43 tracks in the rest of the file which is meaningless to show here.

Rest of the different files are .bin and .at3 files which we have to replace and the SYSCARD3P.PCE file which is the CD-ROM bios and we should never touch it.

So, for injecting our own CD-ROM games, first we have to replace the TOC file (.hcd), then we have to replace the game data binary files (.bin) and the audio files (.at3). Here we go.

Even though you can create your own .hcd files, it is hard to do by hand. I am pretty sure there must be many tools for creating .hcd files from cd images but the one i used is bincuesplit.exe it gives near perfect results. i couldn't find a stand-alone release, it is included in the source of WiiEngine, go get it. http://wii.nintendomax.com/Homebrews/Em ... engine.rar First get your CD game in .bin .cue format. IMGBurn and some other software can rip your CDs to this format. After that put the .cue/.bin file and bincuesplit.exe in the same directory. Run "bincuesplit.exe game.cue hcd" hcd option is very important. After it does your job, it will output a .hcd file in the same directory and various .ogg/.iso files in a sub-directory with the cue file's name. What we are interested is the .hcd file and the .iso files. It outputs audio tracks in .ogg format, but that is useless unless you want to use them as base for audio converting. I do not recommend this as the ogg files are 64 kbps and using them as audio base will hurt the quality a lot. Anyways after we get the .hcd file we have to do some editing to it. First change the name to "titleid".hcd, I will use HCD9009 as titleid from now on, change it with whatever titleid you are using. after making it HCD9009.hcd, open it with a text editor, change the "track01.ogg" to "HCD9009_01.at3" and repeat it for all the audio tracks like that (03,04,05 etc). for code tracks rename "track02.iso" to "HCD9009_02.bin" and repeat the process if there is another code track. If the game you are converting is an Arcade CD game, Put "arcade,1" without brackets in the last line of hcd file.Congratulations we are done with .hcd file.

Now let's do the audio files. Official release have 128 kbps atrac3plus audio with the .at3 extension. The problem is only available non-commercial atrac3 codec encodes in atrac3, not atrac3plus. And the game locks if it detects atrac3 audio. So we have to either use a workaround to be able to use atrac3 audio or use a commercial software for atrac3plus encoding. Let's do the non-commercial part first.

Goldwave can encode in atrac3 if you have the codecs installed. Here is a quick guide for you if you are too lazy to google. http://www.goldwave.ca/forums/viewtopic.php?t=3056 After you get the codecs installed, mount your .bin/.cue cd image (or use your official game cd). Rip the audio tracks via Goldwave with atrac3, codec. Remember to rip only the audio tracks, your .hcd file can show them. Goldwave stores the atrac3 audio in .wav extension. Change the extension to .at3. If you followed this way, you have to enable the atrac3_pce_patch.prx plugin i attached for the game not to lock up when it detects the audio as atrac3. of course don't forget to rename your audio files according to the .hcd file.

SoundForge 9.0 and some other Sony products can encode atrac3plus. Though SoundForge outputs atrac3plus as .aa3 files. you have to use Atrac3plus_tool.exe i attached to convert it to .at3 files. Rename your files according to the .hcd file you created. If you followed this way, no need for enabling any plugin. Also sony states atrac3plus can compress audio 20:1 where atrac3 can compress 10:1, even though i believe this 20/10 compressing ratio is very exaggerated, it still doesn't change the fact that atrac3plus is more efficient in compressing.

Anyways let's get to the last part, the data tracks. If you followed everything you should now have one or two .iso files which bincuetool.exe outputted. You should compress them to compatible .bin files, use the attached comp.py file to compress the .iso files to .bin files. Then rename them according to the .hcd file you created.

That is all. Check your .hcd file, .at3 files and .bin files. Make sure .at3/.bin filenames are renamed according to the .hcd file. After that, replace the files in your decrypted/files directory, remember to delete the .at3/.bin files from the previous game if there is any left. Then run the encrypt.py and transfer the CONTENT.DAT in the final folder just as you do with HuCard games. If you did everything right, it should boot.


Customization

As we can now have any PCE game as a stand-alone item in XMB, how about some customization? Let's do it.

First open the .iso file you got from the pkg. Open it with UMDGEN. at PSP_GAME folder, you will see ICON0.PNG and PIC0.PNG. you can change ICON0.PNG with a 80x80 png and PIC0.PNG with 310x180 png. No need for further explanation as you should see the result in XMB immediately after rebuilding and transferring the iso.

Also after you decrypt the CONTENT.DAT with Qwikrazor87's tools, one of the files is SAVEDATA.PNG. you can change it again with a 80x80 PNG. This is how your savedata picture will look.

Last but not least you can also customize some of the emulator options. again open the iso with UMDGEN and go to PSP_GAME/USRDIR directory. there you will see a CONFIG.PSP file. as the name suggests, it is the configuration file of the emulator. extract it and open it with notepad etc. Here at SAVEDATA section, you can change the TITLE_ID to stop multiple games interfering with each other's save files. You can also change the SYS_TITLE_US to change the name of the title of the savedata.

at ROM section, you can change the name of the rom you injected in the first place. you can also change the ROM_PATH to look for the CONTENT.DAT. for example i made it "ms0:/PSP/GAME/ImageFight" for my Image Fight game.

at PC ENGINE section, there are emulation settings. If PCE_ENABLE_6BUTTON is 1, it enables the 6 button layout for some fighting games, if 0 it uses the default 2 button controller. I haven't messed much with other settings, but it is sure that they are needed for some games. I remember reading some games need PCE_ENABLE_ADJUST_RASTER_TIMING for another emulator example. We need a lot of trial&error and a compatibility list. Though from what i tested, most games work fine without messing with these.

Miscellaneous

It seems this stand-alone releases use a slightly different emulator than the one in soldier blade collection (and other 2 PCengine UMD collections). It might be best to try a game on both if you encounter any problems. For example Double Dragon II stuck at level 2 on psn emulator where it worked fine on soldier blade collection emulator. Also some CD games have loop problems, they don't loop when it is needed. I don't know how to solve this.

Even though bincuesplit.exe does a good job creating .hcd files, it is still different from the official releases. For example here are the first 3 lines of the .hcd file of the same game. First one created by bincuesplit.exe, second one extracted from psn release.
"track01,audio,track01.ogg,000150,003371
track02,code ,track02.iso,003746,024728
track03,audio,track03.ogg,028474,002049"

"track01,audio,HCD0015_01.at3,000150,003596
track02,code ,HCD0015_02.bin,003746,024728
track03,audio,HCD0015_03.at3,028624,001899"

Rest is the same. Differences in track01 doesn't matter much as it just contains a warning about it being a game etc. but track 03 always differs between psn releases and bincuesplit ones. In bincuesplit.exe created .hcd file track beginning is always 150 less than the psn one and track length is always 150 more than the psn one. At least that was so about 3-4 psn releases and CD images i checked. So it might be wise to do the correction to the track 03 in .hcd file after you created it. I didn't notice any difference but i can't say i tested extensively.

Also you can directly inject the .hcd/.at3/.bin files you created here to one of these games: Tengai Makyou Collection, Ginga Ojousama Densetsu Collection, Soldier Blade Collection. Unfortunately they are japanese UMD releases only.

Credits

Decryption/Encryption algorithm of CONTENT.DAT of psn Turbografx-16/PCEngine games was found out by qwikrazor87. PCE CD tools, PCE py tools and atrac3_pce_patch.prx plugin are all coded by him. This wouldn't be possible without him.
Also i would like to thank to the authors for the great PSNPKGDecryptor&Extractor and Atrac3plus_tool.exe. I couldn't find a good working link for Atrac3plus_tool.exe so i just included it in the PCE CD tools in the attachments to help people having a hard time finding it.

This tutorial is dedicated to Hudson Soft. We will never forget the great PC Engine and the unforgettable games you gave us. Even though Hudson Soft is no more, we will always remember the bee.
Advertising
Attachments
PCE CD tools.zip
Files needed for CD conversion
(163.4 KiB) Downloaded 247 times
PCE_py_tool.zip
Files needed for encrypting/decrypting CONTENT.DAT
(3 KiB) Downloaded 386 times
Last edited by reprep on Mon Mar 02, 2015 9:55 am, edited 12 times in total.

Kaliki
Posts: 103
Joined: Tue Jan 11, 2011 12:30 am

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by Kaliki » Sun Feb 08, 2015 10:12 am

Wow. Just wow. This is an incredibly detailed and well-written tutorial. I'm especially grateful for the CD part. Thank you very much for taking the time to do this. Your win in the january tutorial contest was very much deserved :).
Advertising
Security guy of Sony says: "I lost my keys.... some one found my keys?" (as found on Hellcat's twitter)

007
Posts: 637
Joined: Tue Jan 03, 2012 4:59 am
Location: Canada

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by 007 » Mon Feb 09, 2015 2:50 am

Is it possible to change the title display in xmb not just icon?

does the config for emulator allow language change?

like I got the psn bonk 2 jpn i put usa rom in but emulator still shows jpn menu.

If I can change menu language this could be used to jpn to usa releases.
3 x PSP GO Pearl White 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin
1 x PSP GO Piano Black 6.20 PRO-C2-14-02-2015 qwikrazor87 Release PERMA + Langswapper 1.6 Plugin
1 x PSP 3000 Lilac 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin

User avatar
fate6
Big Beholder
Posts: 7599
Joined: Fri Mar 09, 2012 1:18 am
Location: [fate6@Canterlot ~]$

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by fate6 » Mon Feb 09, 2015 10:34 am

Just use a NA game as the base? Or did SCE/Hudson never release any? And yep just change it in the param.sfo.
Image
anon wrote:If you can't trust a 600 year old vampire in a prepubescent girl's body, who can you trust?

User avatar
reprep
Posts: 1074
Joined: Tue Dec 17, 2013 4:38 pm

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by reprep » Mon Feb 09, 2015 10:54 am

as fate said, you can simply change properties by editing the PARAM.SFO within the iso and injecting it back to the iso of your base game.
If you use NA games, your menu will be in English. You can do this for HuCard releases like Soldier Blade, New Adventure Island vs. I gave a wikipedia link above which lists all NA releases.

Problem is as there is no PC Engine/Turbografx-16 CD releases outside of Japan, if you want to inject a CD game, you have to use japanese for menus. Not difficult though, it is only about saving/loading etc. and i gave some hints about how to use it in Part I.

007
Posts: 637
Joined: Tue Jan 03, 2012 4:59 am
Location: Canada

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by 007 » Mon Feb 09, 2015 12:27 pm

My only reason for asking is to be able to display different title names in XMB.


Lets say I use Soldier Blade for 4 injects all 4 will be called soldier blade.

2 Games I plan to inject are Banks Revenge and Bonk 3. There was a JPN only release of these. If I inject over the JPN release and set menus to english I got a proper XMB entry and english menus (if possible)

If I lets say inject over soldier balde then soldier blade and my 2 injects will all have the same name right?
3 x PSP GO Pearl White 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin
1 x PSP GO Piano Black 6.20 PRO-C2-14-02-2015 qwikrazor87 Release PERMA + Langswapper 1.6 Plugin
1 x PSP 3000 Lilac 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin

007
Posts: 637
Joined: Tue Jan 03, 2012 4:59 am
Location: Canada

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by 007 » Mon Feb 09, 2015 1:43 pm

Hey so essentially. I can use what I just learned for alot!

Like lets say Darius Burst its a japan only release but it is english. The load save PSP driven menus go into japan mode. I can now set this to English?
3 x PSP GO Pearl White 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin
1 x PSP GO Piano Black 6.20 PRO-C2-14-02-2015 qwikrazor87 Release PERMA + Langswapper 1.6 Plugin
1 x PSP 3000 Lilac 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin

User avatar
reprep
Posts: 1074
Joined: Tue Dec 17, 2013 4:38 pm

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by reprep » Mon Feb 09, 2015 7:05 pm

The menus will be japanese if your base game is japanese and english if your base game is english. It is not about the rom injected at all. All that matters is the base game. So, use a NA game for base, then customize it as you wish (change the name with the PARAM.SFO trick, change pictures, rom name, rom path, savedata name, savedata id etc). It will be in English. I hope i am clear.

007
Posts: 637
Joined: Tue Jan 03, 2012 4:59 am
Location: Canada

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by 007 » Mon Feb 09, 2015 8:33 pm

ok so lets say base game is soldier blade.

now i inject rom, change save name change location and change title in sfo could both be loaded on the psp at once?

will be testing this.
3 x PSP GO Pearl White 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin
1 x PSP GO Piano Black 6.20 PRO-C2-14-02-2015 qwikrazor87 Release PERMA + Langswapper 1.6 Plugin
1 x PSP 3000 Lilac 6.20 PRO-B10.fix1 PERMA + Langswapper 1.6 Plugin

User avatar
reprep
Posts: 1074
Joined: Tue Dec 17, 2013 4:38 pm

Re: Injecting roms to official Turbografx-16 emulator for PS

Post by reprep » Mon Feb 09, 2015 8:59 pm

007 wrote:ok so lets say base game is soldier blade.

now i inject rom, change save name change location and change title in sfo could both be loaded on the psp at once?

will be testing this.
yes, exactly, but you do the editing to config.psp file in the iso. Change the location and id of savegame so that you can use multiple roms for one base game. That is what i do. Also like to change the pics too.

also no need for change title in sfo, it can stay the same. though be sure that you edited the config.psp so that every iso directs to different content.dat (and param.pbp in the same directory).

It is all in the customization section, read again please.

Post Reply

Return to “Tutorials”