├── .classpath ├── .gitignore ├── .project ├── FinalFightAE-CPS2-Installer.jar ├── README.md ├── README_MAC_LINUX.md ├── RomMangler.jar ├── copy_and_zip_results.bat ├── copy_and_zip_results.sh ├── copy_combined_files.bat ├── copy_combined_files.sh ├── data ├── Final Fight AE CPS2 Patch.mra ├── NAME ├── key ├── phoenix.key └── sz3.11m ├── delete_work_directory.bat ├── delete_work_directory.sh ├── flips.linux ├── flips.macos ├── ips ├── ffae_cps2_audio_prg_patch.ips ├── ffae_cps2_gfx_patch.ips └── ffae_cps2_prg_patch.ips ├── liteips.exe ├── make_results_directory.bat ├── make_results_directory.sh ├── make_work_directory.bat ├── make_work_directory.sh ├── split_cfgs ├── darksoft │ ├── final_fight_cps2_darksoft_split.cfg │ ├── final_fight_gfx_cps2_darksoft_split.cfg │ └── final_fight_snd_prg_cps2_darksoft_split.cfg ├── final_fight_gfx_cps2_base_mister_split.cfg ├── final_fight_gfx_split.cfg ├── final_fight_recombine_gfx_cps2.cfg ├── final_fight_separate_gfx_layers_split.cfg ├── final_fight_split.cfg ├── mame │ ├── final_fight_cps2_mame_split.cfg │ ├── final_fight_gfx_cps2_mame_split.cfg │ └── final_fight_snd_prg_cps2_mame_split.cfg └── sfa3_audio_split.cfg ├── split_cfgs_mac ├── darksoft │ ├── final_fight_cps2_darksoft_split.cfg │ ├── final_fight_gfx_cps2_darksoft_split.cfg │ └── final_fight_snd_prg_cps2_darksoft_split.cfg ├── final_fight_gfx_cps2_base_mister_split.cfg ├── final_fight_gfx_split.cfg ├── final_fight_recombine_gfx_cps2.cfg ├── final_fight_separate_gfx_layers_split.cfg ├── final_fight_split.cfg ├── mame │ ├── final_fight_cps2_mame_split.cfg │ ├── final_fight_gfx_cps2_mame_split.cfg │ └── final_fight_snd_prg_cps2_mame_split.cfg └── sfa3_audio_split.cfg └── src └── com └── feverbrainstudios └── ffae_installer └── FFAEInstaller.java /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /build1234abcd 3 | /results 4 | /bin 5 | /*.zip 6 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ffae_installer 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /FinalFightAE-CPS2-Installer.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/FinalFightAE-CPS2-Installer.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FinalFightAE-CPS2-Installer 2 | 3 | **Windows** 4 | 1. Install jdk 17, copy the installer to a directory in the root of a drive for example c:\ffaeinstaller, double click FinalFightAE-CPS2-Installer.jar

5 | 6 | **MacOS** 7 | 1. Install jdk 17, copy the installer to a directory in your home drive, double click FinalFightAE-CPS2-Installer.jar

8 | 9 | **Linux** 10 | 1. Install jdk 17, copy the installer to a directory in your user folder for example ~/ffaeinstaller, double click FinalFightAE-CPS2-Installer.jar

11 | 12 | 2. Choose a Final Fight rom and Street Fighter Alpha 3 rom zip, merged or split roms should work, and click patch 13 | * If there is an issue with the roms you selected you should be alerted by the tool, if it reports ALL of the crcs being missing for a rom set it is because the zip file is not compatible with the java zip handling library 14 | * Rezip your Final Fight or street fighter alpha rom using the built in windows "send to compressed (zipped) folder" option of the file browser and try again 15 | 16 | 3. If the process is successful you will have a "results" folder in the installers directory with folders for each of the different targets, mame, mister and darksoft containing each rom 17 | 18 | For mister please copy the zips to your games\mame folder and the mra to your normal mra location for cps2 games. 19 | 20 | You need the lastest build of Jotego's cps2 core with decryption support. 21 | 22 | For Darksoft CPS2 Multi simply copy the FFAE directory to a freshly formatted SD Cards games directory. 23 | 24 | Enjoy! 25 | -------------------------------------------------------------------------------- /README_MAC_LINUX.md: -------------------------------------------------------------------------------- 1 | 2 | Changes: 3 | +:src/com/feverbrainstudios/ffae_installer/FFAEInstaller_MacOS.java 4 | +:src/com/feverbrainstudios/ffae_installer/FFAEInstaller_Linux.java 5 | Window frame updated to "FFAE Installer - MacOS" 6 | path updates 7 | +:flips.linux 8 | built as a static binary for portability 9 | +:flips.mac 10 | built as a standard macos binary 11 | liteips.exe replaced with flips.mac for MacOS and flips.linux for Linux 12 | src: https://github.com/Alcaro/Flips.git 13 | 14 | +:copy_and_zip_results.sh 15 | syntax+path updates 16 | RomManger ZIP function replaced with standard zip / info-zip www.info-zip.org 17 | 18 | +:delete_work_directory.sh 19 | syntax+path updates 20 | 21 | +:make_work_directory.sh 22 | syntax+path updates 23 | 24 | +:copy_combined_files.sh 25 | syntax+path updates 26 | 27 | +:make_results_directory.sh 28 | syntax+path updates 29 | 30 | +:split_cfgs_mac 31 | path updates 32 | -------------------------------------------------------------------------------- /RomMangler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/RomMangler.jar -------------------------------------------------------------------------------- /copy_and_zip_results.bat: -------------------------------------------------------------------------------- 1 | mkdir results 2 | mkdir results\mister 3 | mkdir results\darksoft 4 | mkdir results\darksoft\FFAE 5 | mkdir results\mame 6 | 7 | 8 | 9 | copy data\sz3.11m build1234abcd\mister\snd\ffae.11 10 | copy "data\Final Fight AE CPS2 Patch.mra" "results\mister\Final Fight AE CPS2 Patch.mra" 11 | 12 | java -jar RomMangler.jar zipdir build1234abcd\mister\gfx results\mister\ffightae_cps2_gfx.zip 13 | java -jar RomMangler.jar zipdir build1234abcd\mister\snd results\mister\ffightae_cps2_smp.zip 14 | 15 | 16 | copy data\sz3.11m build1234abcd\darksoft\ffae.03 17 | copy data\key build1234abcd\darksoft\key 18 | copy data\NAME build1234abcd\darksoft\NAME 19 | 20 | copy build1234abcd\darksoft\*.* results\darksoft\FFAE 21 | 22 | 23 | copy data\sz3.11m build1234abcd\mame\sz3.11m 24 | copy data\phoenix.key build1234abcd\mame\phoenix.key 25 | 26 | java -jar RomMangler.jar zipdir build1234abcd\mame results\mame\ffightae_cps2.zip 27 | -------------------------------------------------------------------------------- /copy_and_zip_results.sh: -------------------------------------------------------------------------------- 1 | mkdir -pv ./results/darksoft/FFAE 2 | mkdir -pv ./results/mister 3 | mkdir -pv ./results/mame 4 | 5 | cp -v ./data/sz3.11m ./build1234abcd/mister/snd/ffae.11 6 | cp -v "./data/Final Fight AE CPS2 Patch.mra" "./results/mister/Final Fight AE CPS2 Patch.mra" 7 | 8 | zip -v -j ./results/mister/ffightae_cps2_gfx.zip ./build1234abcd/mister/gfx/* 9 | zip -v -j ./results/mister/ffightae_cps2_smp.zip ./build1234abcd/mister/snd/* 10 | 11 | cp -v ./data/sz3.11m ./build1234abcd/darksoft/ffae.03 12 | cp -v ./data/key ./build1234abcd/darksoft/key 13 | cp -v ./data/NAME ./build1234abcd/darksoft/NAME 14 | 15 | cp -rv ./build1234abcd/darksoft/* ./results/darksoft/FFAE 16 | cp -v ./data/sz3.11m ./build1234abcd/mame/sz3.11m 17 | cp -v ./data/phoenix.key ./build1234abcd/mame/phoenix.key 18 | 19 | zip -v -j ./results/mame/ffightae_cps2.zip -v ./build1234abcd/mame/* 20 | -------------------------------------------------------------------------------- /copy_combined_files.bat: -------------------------------------------------------------------------------- 1 | copy build1234abcd\combined\cps2_gfx\ffight_gfx_cps2_base_shuffled.bin build1234abcd\combined_patched\ffight_gfx_cps2.bin 2 | copy build1234abcd\combined\ffight.bin build1234abcd\combined_patched\ffight.bin 3 | copy build1234abcd\combined\sfa3_audio.bin build1234abcd\combined_patched\ffight_audio.bin -------------------------------------------------------------------------------- /copy_combined_files.sh: -------------------------------------------------------------------------------- 1 | cp -v ./build1234abcd/combined/cps2_gfx/ffight_gfx_cps2_base_shuffled.bin ./build1234abcd/combined_patched/ffight_gfx_cps2.bin 2 | cp -v ./build1234abcd/combined/ffight.bin ./build1234abcd/combined_patched/ffight.bin 3 | cp -v ./build1234abcd/combined/sfa3_audio.bin ./build1234abcd/combined_patched/ffight_audio.bin 4 | -------------------------------------------------------------------------------- /data/NAME: -------------------------------------------------------------------------------- 1 | FFAE =U -------------------------------------------------------------------------------- /data/key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/data/key -------------------------------------------------------------------------------- /data/phoenix.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/data/phoenix.key -------------------------------------------------------------------------------- /data/sz3.11m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/data/sz3.11m -------------------------------------------------------------------------------- /delete_work_directory.bat: -------------------------------------------------------------------------------- 1 | rmdir /S /Q build1234abcd -------------------------------------------------------------------------------- /delete_work_directory.sh: -------------------------------------------------------------------------------- 1 | rm -rf ./build1234abcd 2 | -------------------------------------------------------------------------------- /flips.linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/flips.linux -------------------------------------------------------------------------------- /flips.macos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/flips.macos -------------------------------------------------------------------------------- /ips/ffae_cps2_audio_prg_patch.ips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/ips/ffae_cps2_audio_prg_patch.ips -------------------------------------------------------------------------------- /ips/ffae_cps2_gfx_patch.ips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/ips/ffae_cps2_gfx_patch.ips -------------------------------------------------------------------------------- /ips/ffae_cps2_prg_patch.ips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/ips/ffae_cps2_prg_patch.ips -------------------------------------------------------------------------------- /liteips.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/originalgrego/FinalFightAE-CPS2-Installer/be1fe5ab3631a0eb42b18069540a6172c3d21987/liteips.exe -------------------------------------------------------------------------------- /make_results_directory.bat: -------------------------------------------------------------------------------- 1 | mkdir mister 2 | mkdir darksoft 3 | mkdir mame 4 | -------------------------------------------------------------------------------- /make_results_directory.sh: -------------------------------------------------------------------------------- 1 | mkdir -pv mister 2 | mkdir -pv darksoft 3 | mkdir -pv mame 4 | -------------------------------------------------------------------------------- /make_work_directory.bat: -------------------------------------------------------------------------------- 1 | mkdir build1234abcd 2 | mkdir build1234abcd\combined 3 | mkdir build1234abcd\combined\cps2_gfx 4 | mkdir build1234abcd\combined_patched 5 | mkdir build1234abcd\mister 6 | mkdir build1234abcd\mister\gfx 7 | mkdir build1234abcd\mister\snd 8 | mkdir build1234abcd\darksoft 9 | mkdir build1234abcd\mame 10 | -------------------------------------------------------------------------------- /make_work_directory.sh: -------------------------------------------------------------------------------- 1 | mkdir -pv ./build1234abcd/combined/cps2_gfx 2 | mkdir -pv ./build1234abcd/combined_patched 3 | mkdir -pv ./build1234abcd/mister/gfx 4 | mkdir -pv ./build1234abcd/mister/snd 5 | mkdir -pv ./build1234abcd/darksoft 6 | mkdir -pv ./build1234abcd/mame 7 | -------------------------------------------------------------------------------- /split_cfgs/darksoft/final_fight_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | FILL,FF,0,400000 2 | ROM_LOAD16_WORD_SWAP,build1234abcd\combined_patched\ffight.bin,00000,100000 -------------------------------------------------------------------------------- /split_cfgs/darksoft/final_fight_gfx_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\darksoft\ffae.05,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\darksoft\ffae.07,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\darksoft\ffae.09,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\darksoft\ffae.11,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs/darksoft/final_fight_snd_prg_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,000000,40000 2 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,040000,40000 3 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,080000,40000 4 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,0C0000,40000 5 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,100000,40000 6 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,140000,40000 7 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,180000,40000 8 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,1c0000,40000 9 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,200000,40000 10 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,240000,40000 11 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,280000,40000 12 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,2c0000,40000 13 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,300000,40000 14 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,340000,40000 15 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,380000,40000 16 | ROM_LOAD,build1234abcd\combined_patched\ffight_audio.bin,3c0000,40000 17 | -------------------------------------------------------------------------------- /split_cfgs/final_fight_gfx_cps2_base_mister_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mister\gfx\ff-5m.7a,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mister\gfx\ff-7m.9a,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mister\gfx\ff-1m.3a,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mister\gfx\ff-3m.5a,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs/final_fight_gfx_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,.\build1234abcd\ff-5m.7a,000000,80000 2 | ROMX_LOAD_WORD_SKIP_6,.\build1234abcd\ff-7m.9a,000002,80000 3 | ROMX_LOAD_WORD_SKIP_6,.\build1234abcd\ff-1m.3a,000004,80000 4 | ROMX_LOAD_WORD_SKIP_6,.\build1234abcd\ff-3m.5a,000006,80000 5 | -------------------------------------------------------------------------------- /split_cfgs/final_fight_recombine_gfx_cps2.cfg: -------------------------------------------------------------------------------- 1 | FILL,FF,0,1000000 2 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_obj.bin,0,110000 3 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr1.bin,910000,20000 4 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr3.bin,930000,50000 5 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr2.bin,980000,80000 -------------------------------------------------------------------------------- /split_cfgs/final_fight_separate_gfx_layers_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_obj.bin,0,110000 2 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr1.bin,110000,20000 3 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr3.bin,130000,50000 4 | ROM_LOAD,build1234abcd\combined\cps2_gfx\ffight_gfx_scr2.bin,180000,80000 -------------------------------------------------------------------------------- /split_cfgs/final_fight_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD16_BYTE,.\build1234abcd\ff_36.11f,00000,20000 2 | ROM_LOAD16_BYTE,.\build1234abcd\ff_42.11h,00001,20000 3 | ROM_LOAD16_BYTE,.\build1234abcd\ff_37.12f,40000,20000 4 | ROM_LOAD16_BYTE,.\build1234abcd\ffe_43.12h,40001,20000 5 | ROM_LOAD16_WORD_SWAP,.\build1234abcd\ff-32m.8h,80000,80000 -------------------------------------------------------------------------------- /split_cfgs/mame/final_fight_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD16_WORD_SWAP,build1234abcd\mame\ff-23m.8h,00000,80000 2 | ROM_LOAD16_WORD_SWAP,build1234abcd\mame\ff-22m.7h,80000,80000 -------------------------------------------------------------------------------- /split_cfgs/mame/final_fight_gfx_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mame\ff-5m.7a,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mame\ff-7m.9a,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mame\ff-1m.3a,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,build1234abcd\mame\ff-3m.5a,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs/mame/final_fight_snd_prg_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,.\build1234abcd\mame\sz3.01,00000,20000 2 | ROM_LOAD,.\build1234abcd\mame\sz3.02,20000,20000 -------------------------------------------------------------------------------- /split_cfgs/sfa3_audio_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,.\build1234abcd\sz3.01,00000,20000 2 | ROM_LOAD,.\build1234abcd\sz3.02,20000,20000 -------------------------------------------------------------------------------- /split_cfgs_mac/darksoft/final_fight_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | FILL,FF,0,400000 2 | ROM_LOAD16_WORD_SWAP,./build1234abcd/combined_patched/ffight.bin,00000,100000 3 | -------------------------------------------------------------------------------- /split_cfgs_mac/darksoft/final_fight_gfx_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/darksoft/ffae.05,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/darksoft/ffae.07,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/darksoft/ffae.09,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/darksoft/ffae.11,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs_mac/darksoft/final_fight_snd_prg_cps2_darksoft_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,000000,40000 2 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,040000,40000 3 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,080000,40000 4 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,0C0000,40000 5 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,100000,40000 6 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,140000,40000 7 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,180000,40000 8 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,1c0000,40000 9 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,200000,40000 10 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,240000,40000 11 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,280000,40000 12 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,2c0000,40000 13 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,300000,40000 14 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,340000,40000 15 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,380000,40000 16 | ROM_LOAD,./build1234abcd/combined_patched/ffight_audio.bin,3c0000,40000 17 | -------------------------------------------------------------------------------- /split_cfgs_mac/final_fight_gfx_cps2_base_mister_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mister/gfx/ff-5m.7a,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mister/gfx/ff-7m.9a,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mister/gfx/ff-1m.3a,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mister/gfx/ff-3m.5a,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs_mac/final_fight_gfx_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/ff-5m.7a,000000,80000 2 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/ff-7m.9a,000002,80000 3 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/ff-1m.3a,000004,80000 4 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/ff-3m.5a,000006,80000 5 | -------------------------------------------------------------------------------- /split_cfgs_mac/final_fight_recombine_gfx_cps2.cfg: -------------------------------------------------------------------------------- 1 | FILL,FF,0,1000000 2 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_obj.bin,0,110000 3 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr1.bin,910000,20000 4 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr3.bin,930000,50000 5 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr2.bin,980000,80000 6 | -------------------------------------------------------------------------------- /split_cfgs_mac/final_fight_separate_gfx_layers_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_obj.bin,0,110000 2 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr1.bin,110000,20000 3 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr3.bin,130000,50000 4 | ROM_LOAD,./build1234abcd/combined/cps2_gfx/ffight_gfx_scr2.bin,180000,80000 5 | -------------------------------------------------------------------------------- /split_cfgs_mac/final_fight_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD16_BYTE,./build1234abcd/ff_36.11f,00000,20000 2 | ROM_LOAD16_BYTE,./build1234abcd/ff_42.11h,00001,20000 3 | ROM_LOAD16_BYTE,./build1234abcd/ff_37.12f,40000,20000 4 | ROM_LOAD16_BYTE,./build1234abcd/ffe_43.12h,40001,20000 5 | ROM_LOAD16_WORD_SWAP,./build1234abcd/ff-32m.8h,80000,80000 6 | -------------------------------------------------------------------------------- /split_cfgs_mac/mame/final_fight_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD16_WORD_SWAP,build1234abcd/mame/ff-23m.8h,00000,80000 2 | ROM_LOAD16_WORD_SWAP,build1234abcd/mame/ff-22m.7h,80000,80000 3 | -------------------------------------------------------------------------------- /split_cfgs_mac/mame/final_fight_gfx_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mame/ff-5m.7a,000000,400000 2 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mame/ff-7m.9a,000002,400000 3 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mame/ff-1m.3a,000004,400000 4 | ROMX_LOAD_WORD_SKIP_6,./build1234abcd/mame/ff-3m.5a,000006,400000 5 | -------------------------------------------------------------------------------- /split_cfgs_mac/mame/final_fight_snd_prg_cps2_mame_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,./build1234abcd/mame/sz3.01,00000,20000 2 | ROM_LOAD,./build1234abcd/mame/sz3.02,20000,20000 3 | -------------------------------------------------------------------------------- /split_cfgs_mac/sfa3_audio_split.cfg: -------------------------------------------------------------------------------- 1 | ROM_LOAD,./build1234abcd/sz3.01,00000,20000 2 | ROM_LOAD,./build1234abcd/sz3.02,20000,20000 3 | -------------------------------------------------------------------------------- /src/com/feverbrainstudios/ffae_installer/FFAEInstaller.java: -------------------------------------------------------------------------------- 1 | package com.feverbrainstudios.ffae_installer; 2 | 3 | import java.awt.GridLayout; 4 | import java.awt.event.ActionEvent; 5 | import java.awt.event.ActionListener; 6 | import java.awt.event.WindowEvent; 7 | import java.awt.event.WindowListener; 8 | import java.io.BufferedOutputStream; 9 | import java.io.BufferedReader; 10 | import java.io.File; 11 | import java.io.FileInputStream; 12 | import java.io.FileNotFoundException; 13 | import java.io.FileOutputStream; 14 | import java.io.IOException; 15 | import java.io.InputStreamReader; 16 | import java.io.PrintStream; 17 | import java.util.HashMap; 18 | import java.util.HashSet; 19 | import java.util.Map; 20 | import java.util.Set; 21 | import java.util.zip.ZipEntry; 22 | import java.util.zip.ZipInputStream; 23 | 24 | import javax.swing.JButton; 25 | import javax.swing.JFileChooser; 26 | import javax.swing.JFrame; 27 | import javax.swing.JOptionPane; 28 | import javax.swing.JPanel; 29 | import javax.swing.JTextField; 30 | import javax.swing.UIManager; 31 | import javax.swing.UnsupportedLookAndFeelException; 32 | import javax.swing.filechooser.FileFilter; 33 | 34 | public class FFAEInstaller { 35 | private static JFrame mainWindow; 36 | 37 | public static void main(String[] arg) { 38 | 39 | 40 | try { 41 | UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 42 | } catch (ClassNotFoundException e3) { 43 | e3.printStackTrace(); 44 | } catch (InstantiationException e3) { 45 | e3.printStackTrace(); 46 | } catch (IllegalAccessException e3) { 47 | e3.printStackTrace(); 48 | } catch (UnsupportedLookAndFeelException e3) { 49 | e3.printStackTrace(); 50 | } 51 | 52 | mainWindow = new JFrame("FFAE Installer"); 53 | mainWindow.setLayout(new GridLayout(1,2)); 54 | 55 | JPanel leftPanel = new JPanel(); 56 | leftPanel.setLayout(new GridLayout(2,2)); 57 | mainWindow.add(leftPanel); 58 | 59 | JPanel rightPanel = new JPanel(); 60 | rightPanel.setLayout(new GridLayout(2,2)); 61 | mainWindow.add(rightPanel); 62 | 63 | JTextField ffZipPathTextField = new JTextField(); 64 | ffZipPathTextField.setSize(460, 24); 65 | leftPanel.add(ffZipPathTextField); 66 | 67 | JTextField sfa3zipPathTextField = new JTextField(); 68 | sfa3zipPathTextField.setSize(460, 24); 69 | leftPanel.add(sfa3zipPathTextField); 70 | 71 | JButton selectFFZipButton = new JButton("Select FF Zip"); 72 | rightPanel.add(selectFFZipButton); 73 | 74 | JButton patchButton = new JButton("Patch"); 75 | rightPanel.add(patchButton); 76 | 77 | JButton selectSFA3ZipButton = new JButton("Select SFA3 Zip"); 78 | rightPanel.add(selectSFA3ZipButton); 79 | 80 | selectFFZipButton.addActionListener(new ZipFileChooserListener(ffZipPathTextField)); 81 | selectSFA3ZipButton.addActionListener(new ZipFileChooserListener(sfa3zipPathTextField)); 82 | 83 | patchButton.addActionListener(new ActionListener() { 84 | @Override 85 | public void actionPerformed(ActionEvent e) { 86 | File ffZipFile = new File(ffZipPathTextField.getText()); 87 | if (!ZIP_FILTER.accept(ffZipFile)) { 88 | JOptionPane.showMessageDialog(mainWindow, "Please select a valid Final Fight zip file."); 89 | return; 90 | } else if (!ffZipFile.exists()) { 91 | JOptionPane.showMessageDialog(mainWindow, "Final Fight zip file does not exist."); 92 | return; 93 | } 94 | 95 | File sfa3ZipFile = new File(sfa3zipPathTextField.getText()); 96 | if (!ZIP_FILTER.accept(sfa3ZipFile)) { 97 | JOptionPane.showMessageDialog(mainWindow, "Please select a valid Street Fighter Alpha 3 zip file."); 98 | return; 99 | } else if (!sfa3ZipFile.exists()) { 100 | JOptionPane.showMessageDialog(mainWindow, "Street Fighter Alpha 3 zip file does not exist."); 101 | return; 102 | } 103 | 104 | OSOperations osOps = OSOperations.getInstance(); 105 | osOps.performOperations(ffZipFile, sfa3ZipFile); 106 | } 107 | }); 108 | 109 | mainWindow.addWindowListener(new WindowListener() { 110 | @Override 111 | public void windowOpened(WindowEvent e) {} 112 | @Override 113 | public void windowIconified(WindowEvent e) {} 114 | @Override 115 | public void windowDeiconified(WindowEvent e) {} 116 | @Override 117 | public void windowDeactivated(WindowEvent e) {} 118 | @Override 119 | public void windowClosing(WindowEvent e) { System.exit(0); } 120 | @Override 121 | public void windowClosed(WindowEvent e) {} 122 | @Override 123 | public void windowActivated(WindowEvent e) {} 124 | }); 125 | 126 | mainWindow.setVisible(true); 127 | mainWindow.setSize(600, 112); 128 | mainWindow.setResizable(false); 129 | } 130 | 131 | private abstract static class OSOperations { 132 | abstract void performOperations(File ffZipFile, File sfa3ZipFile); 133 | 134 | public static OSOperations getInstance() { 135 | String os = System.getProperty("os.name", "generic").toLowerCase(); 136 | if (os.contains("mac") || os.contains("dar")) { 137 | return new MacOsOps(); 138 | } else if (os.contains("win")) { 139 | return new WindowOsOps(); 140 | } 141 | 142 | return new LinuxOsOps(); 143 | } 144 | } 145 | 146 | private static class LinuxOsOps extends OSOperations { 147 | @Override 148 | void performOperations(File ffZipFile, File sfa3ZipFile) { 149 | try { 150 | String workDir = System.getProperty("user.dir"); 151 | 152 | execAndPrintToConsole(workDir + "/make_work_directory.sh"); 153 | 154 | String workDirString = workDir + "/build1234abcd"; 155 | 156 | String invalidCrcs = unzipMatchingCRCS(ffZipFile.getAbsolutePath(), workDirString, FF_ROM_CRCS_SET, FF_ROM_CRCS_TO_NAMES); 157 | if (!invalidCrcs.isEmpty()) { 158 | JOptionPane.showMessageDialog(mainWindow, "The following Final Fight CRCs were not found:\r\n" + invalidCrcs); 159 | execAndPrintToConsole("./delete_work_directory.sh"); 160 | return; 161 | } 162 | 163 | invalidCrcs = unzipMatchingCRCS(sfa3ZipFile.getAbsolutePath(), workDirString, SFA3_ROM_CRCS_SET, SFA3_ROM_CRCS_TO_NAMES); 164 | if (!invalidCrcs.isEmpty()) { 165 | JOptionPane.showMessageDialog(mainWindow, "The following Street Fighter Alpha 3 CRCs were not found:\r\n" + invalidCrcs); 166 | execAndPrintToConsole("./delete_work_directory.sh"); 167 | return; 168 | } 169 | 170 | 171 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_split.cfg " + workDirString + "/combined/ffight.bin"); 172 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_gfx_split.cfg " + workDirString + "/combined/ffight_gfx.bin"); 173 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/sfa3_audio_split.cfg " + workDirString + "/combined/sfa3_audio.bin"); 174 | 175 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/final_fight_separate_gfx_layers_split.cfg " + workDirString + "/combined/ffight_gfx.bin"); 176 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_recombine_gfx_cps2.cfg " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base.bin"); 177 | 178 | execAndPrintToConsole("java -jar RomMangler.jar cps2_reshuffle " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base.bin " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base_shuffled.bin"); 179 | 180 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/final_fight_gfx_cps2_base_mister_split.cfg " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base_shuffled.bin"); 181 | 182 | execAndPrintToConsole(workDir + "/copy_combined_files.sh"); 183 | 184 | execAndPrintToConsole("./flips.linux -a -i ./ips/ffae_cps2_prg_patch.ips " + workDirString + "/combined_patched/ffight.bin"); 185 | execAndPrintToConsole("./flips.linux -a -i ./ips/ffae_cps2_gfx_patch.ips " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 186 | execAndPrintToConsole("./flips.linux -a -i ./ips/ffae_cps2_audio_prg_patch.ips " + workDirString + "/combined_patched/ffight_audio.bin"); 187 | 188 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight.bin"); 189 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_gfx_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 190 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_snd_prg_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight_audio.bin"); 191 | 192 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/darksoft/final_fight_cps2_darksoft_split.cfg " + workDirString + "/darksoft/ffae.02"); 193 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/darksoft/final_fight_gfx_cps2_darksoft_split.cfg " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 194 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/darksoft/final_fight_snd_prg_cps2_darksoft_split.cfg " + workDirString + "/darksoft/ffae.01"); 195 | 196 | execAndPrintToConsole(workDir + "/copy_and_zip_results.sh"); 197 | 198 | execAndPrintToConsole("./delete_work_directory.sh"); 199 | 200 | JOptionPane.showMessageDialog(mainWindow, "Roms created successfully!\r\n\r\nThe roms will be located in the results directory.\r\n"); 201 | } catch (IOException e1) { 202 | e1.printStackTrace(); 203 | JOptionPane.showMessageDialog(mainWindow, "There was an error, please check the console. \r\n" + e1.toString()); 204 | try { 205 | execAndPrintToConsole("./delete_work_directory.sh"); 206 | } catch (IOException e2) { 207 | // TODO Auto-generated catch block 208 | e2.printStackTrace(); 209 | } 210 | } 211 | } 212 | } 213 | 214 | private static class MacOsOps extends OSOperations { 215 | @Override 216 | void performOperations(File ffZipFile, File sfa3ZipFile) { 217 | try { 218 | String workDir = System.getProperty("user.dir"); 219 | 220 | execAndPrintToConsole(workDir + "/make_work_directory.sh"); 221 | 222 | String workDirString = workDir + "/build1234abcd"; 223 | 224 | String invalidCrcs = unzipMatchingCRCS(ffZipFile.getAbsolutePath(), workDirString, FF_ROM_CRCS_SET, FF_ROM_CRCS_TO_NAMES); 225 | if (!invalidCrcs.isEmpty()) { 226 | JOptionPane.showMessageDialog(mainWindow, "The following Final Fight CRCs were not found:\r\n" + invalidCrcs); 227 | execAndPrintToConsole("./delete_work_directory.sh"); 228 | return; 229 | } 230 | 231 | invalidCrcs = unzipMatchingCRCS(sfa3ZipFile.getAbsolutePath(), workDirString, SFA3_ROM_CRCS_SET, SFA3_ROM_CRCS_TO_NAMES); 232 | if (!invalidCrcs.isEmpty()) { 233 | JOptionPane.showMessageDialog(mainWindow, "The following Street Fighter Alpha 3 CRCs were not found:\r\n" + invalidCrcs); 234 | execAndPrintToConsole("./delete_work_directory.sh"); 235 | return; 236 | } 237 | 238 | 239 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_split.cfg " + workDirString + "/combined/ffight.bin"); 240 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_gfx_split.cfg " + workDirString + "/combined/ffight_gfx.bin"); 241 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/sfa3_audio_split.cfg " + workDirString + "/combined/sfa3_audio.bin"); 242 | 243 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/final_fight_separate_gfx_layers_split.cfg " + workDirString + "/combined/ffight_gfx.bin"); 244 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/final_fight_recombine_gfx_cps2.cfg " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base.bin"); 245 | 246 | execAndPrintToConsole("java -jar RomMangler.jar cps2_reshuffle " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base.bin " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base_shuffled.bin"); 247 | 248 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/final_fight_gfx_cps2_base_mister_split.cfg " + workDirString + "/combined/cps2_gfx/ffight_gfx_cps2_base_shuffled.bin"); 249 | 250 | execAndPrintToConsole(workDir + "/copy_combined_files.sh"); 251 | 252 | execAndPrintToConsole("./flips.macos -a -i ./ips/ffae_cps2_prg_patch.ips " + workDirString + "/combined_patched/ffight.bin"); 253 | execAndPrintToConsole("./flips.macos -a -i ./ips/ffae_cps2_gfx_patch.ips " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 254 | execAndPrintToConsole("./flips.macos -a -i ./ips/ffae_cps2_audio_prg_patch.ips " + workDirString + "/combined_patched/ffight_audio.bin"); 255 | 256 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight.bin"); 257 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_gfx_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 258 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/mame/final_fight_snd_prg_cps2_mame_split.cfg " + workDirString + "/combined_patched/ffight_audio.bin"); 259 | 260 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/darksoft/final_fight_cps2_darksoft_split.cfg " + workDirString + "/darksoft/ffae.02"); 261 | execAndPrintToConsole("java -jar RomMangler.jar split ./split_cfgs_mac/darksoft/final_fight_gfx_cps2_darksoft_split.cfg " + workDirString + "/combined_patched/ffight_gfx_cps2.bin"); 262 | execAndPrintToConsole("java -jar RomMangler.jar combine ./split_cfgs_mac/darksoft/final_fight_snd_prg_cps2_darksoft_split.cfg " + workDirString + "/darksoft/ffae.01"); 263 | 264 | execAndPrintToConsole(workDir + "/copy_and_zip_results.sh"); 265 | 266 | execAndPrintToConsole("./delete_work_directory.sh"); 267 | 268 | JOptionPane.showMessageDialog(mainWindow, "Roms created successfully!\r\n\r\nThe roms will be located in the results directory.\r\n"); 269 | } catch (IOException e1) { 270 | e1.printStackTrace(); 271 | JOptionPane.showMessageDialog(mainWindow, "There was an error, please check the console. \r\n" + e1.toString()); 272 | try { 273 | execAndPrintToConsole("./delete_work_directory.sh"); 274 | } catch (IOException e2) { 275 | // TODO Auto-generated catch block 276 | e2.printStackTrace(); 277 | } 278 | } 279 | } 280 | } 281 | 282 | private static class WindowOsOps extends OSOperations { 283 | @Override 284 | public void performOperations(File ffZipFile, File sfa3ZipFile) { 285 | try { 286 | String workDir = System.getProperty("user.dir"); 287 | 288 | execAndPrintToConsole(workDir + "\\make_work_directory.bat"); 289 | 290 | String workDirString = workDir + "\\build1234abcd\\"; 291 | 292 | String invalidCrcs = unzipMatchingCRCS(ffZipFile.getAbsolutePath(), workDirString, FF_ROM_CRCS_SET, FF_ROM_CRCS_TO_NAMES); 293 | if (!invalidCrcs.isEmpty()) { 294 | JOptionPane.showMessageDialog(mainWindow, "The following Final Fight CRCs were not found:\r\n" + invalidCrcs); 295 | execAndPrintToConsole("delete_work_directory.bat"); 296 | return; 297 | } 298 | 299 | invalidCrcs = unzipMatchingCRCS(sfa3ZipFile.getAbsolutePath(), workDirString, SFA3_ROM_CRCS_SET, SFA3_ROM_CRCS_TO_NAMES); 300 | if (!invalidCrcs.isEmpty()) { 301 | JOptionPane.showMessageDialog(mainWindow, "The following Street Fighter Alpha 3 CRCs were not found:\r\n" + invalidCrcs); 302 | execAndPrintToConsole("delete_work_directory.bat"); 303 | return; 304 | } 305 | 306 | 307 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\final_fight_split.cfg " + workDirString + "combined\\ffight.bin"); 308 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\final_fight_gfx_split.cfg " + workDirString + "combined\\ffight_gfx.bin"); 309 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\sfa3_audio_split.cfg " + workDirString + "combined\\sfa3_audio.bin"); 310 | 311 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\final_fight_separate_gfx_layers_split.cfg " + workDirString + "combined\\ffight_gfx.bin"); 312 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\final_fight_recombine_gfx_cps2.cfg " + workDirString + "combined\\cps2_gfx\\ffight_gfx_cps2_base.bin"); 313 | 314 | execAndPrintToConsole("java -jar RomMangler.jar cps2_reshuffle " + workDirString + "combined\\cps2_gfx\\ffight_gfx_cps2_base.bin " + workDirString + "combined\\cps2_gfx\\ffight_gfx_cps2_base_shuffled.bin"); 315 | 316 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\final_fight_gfx_cps2_base_mister_split.cfg " + workDirString + "combined\\cps2_gfx\\ffight_gfx_cps2_base_shuffled.bin"); 317 | 318 | execAndPrintToConsole(workDir + "\\copy_combined_files.bat"); 319 | 320 | execAndPrintToConsole("liteips.exe ips\\ffae_cps2_prg_patch.ips " + workDirString + "combined_patched\\ffight.bin"); 321 | execAndPrintToConsole("liteips.exe ips\\ffae_cps2_gfx_patch.ips " + workDirString + "combined_patched\\ffight_gfx_cps2.bin"); 322 | execAndPrintToConsole("liteips.exe ips\\ffae_cps2_audio_prg_patch.ips " + workDirString + "combined_patched\\ffight_audio.bin"); 323 | 324 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\mame\\final_fight_cps2_mame_split.cfg " + workDirString + "combined_patched\\ffight.bin"); 325 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\mame\\final_fight_gfx_cps2_mame_split.cfg " + workDirString + "combined_patched\\ffight_gfx_cps2.bin"); 326 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\mame\\final_fight_snd_prg_cps2_mame_split.cfg " + workDirString + "combined_patched\\ffight_audio.bin"); 327 | 328 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\darksoft\\final_fight_cps2_darksoft_split.cfg " + workDirString + "darksoft\\ffae.02"); 329 | execAndPrintToConsole("java -jar RomMangler.jar split split_cfgs\\darksoft\\final_fight_gfx_cps2_darksoft_split.cfg " + workDirString + "combined_patched\\ffight_gfx_cps2.bin"); 330 | execAndPrintToConsole("java -jar RomMangler.jar combine split_cfgs\\darksoft\\final_fight_snd_prg_cps2_darksoft_split.cfg " + workDirString + "darksoft\\ffae.01"); 331 | 332 | execAndPrintToConsole(workDir + "\\copy_and_zip_results.bat"); 333 | 334 | execAndPrintToConsole("delete_work_directory.bat"); 335 | 336 | JOptionPane.showMessageDialog(mainWindow, "Roms created successfully!\r\n\r\nThe roms will be located in the results directory.\r\n"); 337 | } catch (IOException e1) { 338 | e1.printStackTrace(); 339 | JOptionPane.showMessageDialog(mainWindow, "There was an error, please check the console. \r\n" + e1.toString()); 340 | try { 341 | execAndPrintToConsole("delete_work_directory.bat"); 342 | } catch (IOException e2) { 343 | // TODO Auto-generated catch block 344 | e2.printStackTrace(); 345 | } 346 | } 347 | } 348 | } 349 | 350 | 351 | private static String unzipMatchingCRCS(String zipFile, String path, Set crcsSet, Map crcsToNames) { 352 | String result = ""; 353 | int count = 0; 354 | path = new File(path).getAbsolutePath(); 355 | FileInputStream inputStream; 356 | Set crcSetCopy = new HashSet(); 357 | crcSetCopy.addAll(crcsSet); 358 | try { 359 | inputStream = new FileInputStream(zipFile); 360 | ZipInputStream zipStream = new ZipInputStream(inputStream); 361 | ZipEntry nextEntry = zipStream.getNextEntry(); 362 | while (nextEntry != null) { 363 | if (!nextEntry.isDirectory()) { 364 | String hexString = "0x" + String.format("%08X", nextEntry.getCrc()).toUpperCase(); 365 | if (crcsSet.contains(hexString)) { 366 | crcSetCopy.remove(hexString); 367 | File newFile = new File(path, crcsToNames.get(hexString)); 368 | extractFile(zipStream, newFile); 369 | count ++; 370 | } 371 | } 372 | zipStream.closeEntry(); 373 | nextEntry = zipStream.getNextEntry(); 374 | } 375 | zipStream.close(); 376 | inputStream.close(); 377 | } catch (FileNotFoundException e) { 378 | System.out.println(e.getLocalizedMessage()); 379 | e.printStackTrace(); 380 | } catch (IOException e) { 381 | System.out.println(e.getLocalizedMessage()); 382 | e.printStackTrace(); 383 | } 384 | 385 | for (String crc: crcSetCopy) { 386 | result += crc + "\r\n"; 387 | } 388 | 389 | return result; 390 | } 391 | 392 | private static void extractFile(ZipInputStream zipIn, File file) throws IOException { 393 | BufferedOutputStream outstream = new BufferedOutputStream(new FileOutputStream(file)); 394 | byte[] bytesIn = new byte[4096]; 395 | int read = 0; 396 | while ((read = zipIn.read(bytesIn)) != -1) { 397 | outstream.write(bytesIn, 0, read); 398 | } 399 | outstream.flush(); 400 | outstream.close(); 401 | } 402 | 403 | private static void execAndPrintToConsole(String command) throws IOException { 404 | Process exec = Runtime.getRuntime().exec(command); 405 | InputStreamReader reader = new InputStreamReader(exec.getInputStream()); 406 | BufferedReader buffReader = new BufferedReader(reader); 407 | String read = buffReader.readLine(); 408 | while(read != null) { 409 | System.out.println(read); 410 | read = buffReader.readLine(); 411 | } 412 | } 413 | 414 | private static String execAndReturn(String command) throws IOException { 415 | String results = ""; 416 | Process exec = Runtime.getRuntime().exec(command); 417 | InputStreamReader reader = new InputStreamReader(exec.getInputStream()); 418 | BufferedReader buffReader = new BufferedReader(reader); 419 | String read = buffReader.readLine(); 420 | while(read != null) { 421 | results += read; 422 | read = buffReader.readLine(); 423 | } 424 | return results; 425 | } 426 | 427 | private static final Map FF_ROM_CRCS_TO_NAMES = new HashMap() {{ 428 | // Program 429 | put("0xF9A5CE83","ff_36.11f"); 430 | put("0x65F11215","ff_42.11h"); 431 | put("0xE1033784","ff_37.12f"); 432 | put("0x995E968A","ffe_43.12h"); 433 | put("0xC747696E","ff-32m.8h"); 434 | 435 | // Graphics 436 | put("0x9C284108","ff-5m.7a"); 437 | put("0xA7584DFB","ff-7m.9a"); 438 | put("0x0B605E44","ff-1m.3a"); 439 | put("0x52291CD2","ff-3m.5a"); 440 | }}; 441 | 442 | private static final Set FF_ROM_CRCS_SET = new HashSet() {{ 443 | addAll(FF_ROM_CRCS_TO_NAMES.keySet()); 444 | }}; 445 | 446 | private static final Map SFA3_ROM_CRCS_TO_NAMES = new HashMap() {{ 447 | // Audio Program 448 | put("0xDE810084","sz3.01"); 449 | put("0x72445DC4","sz3.02"); 450 | }}; 451 | 452 | private static final Set SFA3_ROM_CRCS_SET = new HashSet() {{ 453 | addAll(SFA3_ROM_CRCS_TO_NAMES.keySet()); 454 | }}; 455 | 456 | private static FileFilter ZIP_FILTER = new FileFilter() { 457 | 458 | @Override 459 | public String getDescription() { 460 | // TODO Auto-generated method stub 461 | return "Zip File"; 462 | } 463 | 464 | @Override 465 | public boolean accept(File f) { 466 | return f.isDirectory() || f.getName().contains(".zip"); 467 | } 468 | }; 469 | 470 | private static class ZipFileChooserListener implements ActionListener { 471 | private JTextField textField; 472 | 473 | public ZipFileChooserListener(JTextField textField) { 474 | this.textField = textField; 475 | } 476 | 477 | public void actionPerformed(ActionEvent e) { 478 | JFileChooser zipChooser = new JFileChooser(); 479 | zipChooser.setFileFilter(ZIP_FILTER); 480 | int returnVal = zipChooser.showOpenDialog(mainWindow); 481 | if (returnVal == JFileChooser.APPROVE_OPTION) { 482 | File file = zipChooser.getSelectedFile(); 483 | textField.setText(file.getAbsolutePath()); 484 | } 485 | } 486 | } 487 | } 488 | --------------------------------------------------------------------------------