Yoshins Arcade GFX Stitcher

Started by Yoshin222, September 01, 2022, 08:48:28 PM

Previous topic - Next topic

Yoshin222

After a while of bashing my head in to a wall, finally feel comfortable showing this off properly!
For a long time i've wanted to rip arcade accurate sprites, and even to edit them. To that end, made this script that takes the de-interleaved ROMs of any given Neo-Geo game (pre-99) and any CPS2 game and outputs it as tiles that the game itself would read. Ya can then open this data in Tile Molester in order to not only rip the exact tiles, but even edit them!

-----DOWNLOAD----------
https://www.mediafire.com/file/h1hpj35rtjlpjis/Yoshins+ARCADE+GFX+Stitcher.zip/file
REV 1.1 - CPS1 Support!
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-1.1
REV 1.2 - Program Data interleaving!
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-1.2
REV 1.3 - Program Data improvement!
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-1.3
REV 1.4 - Reworked CPS1, added CPS3 PRG Interleaving for SIMM files
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-14
REV 1.5 - True CPS1 Support!
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-1.5
REV 1.6 - Cleanup + CPS1/2 SCR1/3 Support via GFX_MAP!
https://github.com/Yoshin2222/Yoshins-Arcade-GFX-Stitcher/tree/REV-1.6
    Example of SCR3 tiles being edited in VSAVs QSound screen
    https://bsky.app/profile/yoshinpixels.bsky.social/post/3lrprkgi53s2m


YOSHINS PALETTE FLIPPER
Used in conjunction with the Stitcher and Palmod so you can open palettes right from you CPS1/2 game of choice in TM and have arcade accurate tiles!
https://github.com/Yoshin2222/Yoshins-Palette-Flipper



SF6 if it was made in 1991


Captain Americas tiles from Marvel Superheroes


Terrys Raw tiles from Garou:Mark of the Wolves (prototype)

-----HOW TO USE----------
Spoiler (click to show)

1)Python
The script was made with Python 3.10.6, so that version or above is required. Google should prove satisfactory

2)Palmod
Palmod is a really dope program that allows you to edit the pallete data of an arcade game. It has support for tons of games for the CPS1/2/3, Neo-Geo, IGS PGM, SNES, etc etc. With it ya can rip the exact pallete of whatver you're ripping. It's also just genuinely cool so i'd suggest it anyway
DL: https://zachd.com/palmod/releases/

3)Tile Molestor
Charming name i know. This program allows you to open the interleaved data in a way an actual person would care for. I'll link the one i use, which has an additional extension to load .act files. This in conjunction with Palmod is where the magic happens
Comes with the script, but being a Java application, Java needs to be installed for it to work. Simple enough to do

With those pre-requisites, here's how you would use it!

Assuming you installed Python correctly, you should be able to run the script as is. Place the unzipped folder of the ROM of your choice in to the roms folder and run it
You should be greeted with this



If your game is not supported, consult the readme and lemme know if there's anything i can do to help should you find my wording strange. If it is, sick! Just write the name of whatever game ya want. In this case, we'll go with KOF98



It should be noted it really doesn't matter if you type in upper or lower case. As long as the name is right, it'll work just fine. Assuming our ROM is in the right place, we can go ahead and enter 1 to interleave the data



Once that's done, there should now be a new folder name interleaved gfx. Inside is the GFX file we want to edit. Run runtm and open this file by switching the open type as "all files"
View > Codec > 4bpp Planar
Row Interleaved
Hold shift and press the right arrow key 16 times to give yourself a bit of wriggle room, and explore away!
As stated, the extension lets us import and act file directly in to Palmod. Look up how to find Pallete addresses should there be none for your game of choice. Seeing as KOF98 has support, we can simply open Palmod, load KOF98, and save an act file of our choice. Since i dig him, we're going with Kim. Once this is saved, in Tile Molestor, navigate to pallete > import from > another file, and load in the act file
To have the best view, go to view > block size, and turn off full canvas. The Neo-Geo loads tiles in strips, and these tiles are 16 by 16, so gp tp view > custom and change the width to 2
After a lil searching, we found Kims tiles!


If you want to rip stuff, great, we're done! If you want to edit them, the best way imo is to export the tiles in to another program, edit them using the colours of the pallete and shoot them back. Go to edit > copy to in order to export the current view. Open the PNG in a program of your choice, make the changes, and then edit > paste from it back in. Press ESC to apply the change, and CTRL+S to save. Run the Stitcher again, KOF98, 2, and ya done! The change should now be applied to the GFX ROMs proper. Simply load the ROMs back in to your game of choice. For the sake of this example, drew a lil face on Kims pants


Slightly outdated, but a decent vid showing the process for Neo-Geo


This process is identical for the CPS2, only real difference is it's tiles aren't strips so ya shouldn't need to adjust the block size. A vid reference in case ya still curious



Lemme know if there's anything i can do to help if ya struggling, and please leave ya thoughts on what can be done next! Consult the readme for any initial questions regarding adding new games

--SUPPORTED GAMES: 1.4
Spoiler (click to show)

         3countb - 3 Count Bout/Fire Suplex (Program Data+GFX)
         aodk - Aggressors of Dark Kombat (Program Data+GFX)
         aof - Art of Fighting (GFX)
         aof2 - Art of Fighting 2 (GFX)
         aof3 - Art of Fighting 3 (GFX)
         armwar - Armoured Warriors (GFX)
         asurabus - Asura Buster (Program Data)
         avengrgs - Avengers in Galactic Storm (Program Data)
         avsp = Alien VS Predator (GFX)
         breakrev - Breakers Revenge (GFX)
         btlkroad - Battle K Road (Program Data)
         cybots - Cyberbots: Fullmetal Madness (GFX)
         dankuga - Dan-Ku-Ga (Program Data)
         ddsom - Dungeons & Dragons: Shadow Over Mystara (GFX)
         ddtod - Dungeons & Dragons: Tower of Doom (GFX)
         dino - Caddilacs and Dinosaurs (Program Data+GFX)
         dinorex - Dino Rex (Program Data)
         doubledr - Double Dragon (Neo-Geo) (GFX)
         dstlk - Darkstalkers: The Night Warriors (GFX)
         fightfev - Fight Fever (Program Data+GFX)
         ffight - Final Fight (Program Data+GFX)
         forgottn - Forgotten Worlds (Program Data+GFX)
         galaxyfg - Galaxy Fight: Universal Warriors (GFX)
         garoup - Garou: Mark of the Wolves (prototype) (Program Data+GFX)
         ghouls - Ghouls 'N Ghosts (Program Data+GFX)
         gowcaizr - Voltage Fighter Gowcaizer (GFX)
         jchan - Jackie Chan: The Kung Fu Master
         jojoban - Jojos Bizzare Adventure - Heritage for the Future (Program Data)
         kizuna - Kizuna Encounter (GFX)
         knights - Knights of the Round (Program Data+GFX)
         kod - King of Dragons (Program Data+GFX)
         kof94 - King of Fighters 94 (GFX)
         kof95 - King of Fighters 95 (GFX)
         kof96 - King of Fighters 96 (GFX)
         kof97 - King of Fighters 97 (GFX)
         kof98 - King of Fighters 98 (GFX)
         lastbld2 - Last Blade 2 (GFX)
         magdrop3 - Magical Drop 3 (GFX)
         megaman - Mega Man: The Power Battle (Program Data+GFX)
         megaman2 - Mega Man 2: The Power Fighters (GFX)
         mmaulers - Monster Maulers (Program Data)
         mk2 - Mortal Kombat 2 (Program Data)
         msh - Marvel SuperHeroes (GFX)
         mshvsf - Marvel Superheroes VS Street Fighter (GFX)
         mslug - Metal Slug (GFX)
         mvsc - Marvel VS Capcom: Clash of Superheroes (GFX)
         mwarr - Mighty Warriors (Program Data)
         nwarr - Night Warriors: Darkstalkers Revenge (GFX)
         punisher - The Punisher (Program Data+GFX)
         rbff2 - Real Bout: Fatal Fury 2 (GFX)
         redearth - Red Earth  (Program Data)
         ringdest - Ring of Destruction/SlamMasters 2
         rotd - Rage of the Dragons (Program Data)
         samsho - Samurai Shodown/Samurai Spirits (GFX)
         samsho2 - Samurai Shodown 2 (GFX)
         samsho3 - Samurai Shodown 3 (GFX)
         samsho4 - Samurai Shodown 4 (GFX)
         sf - Street Fighter (Program Data)
         sf2 - Street Fighter 2: The World Warrior (Program Data+GFX)
         sfa - Street Fighter Alpha (GFX)
         sfa2 - Street Fighter Alpha 2 (GFX)
         sfa3 - Street Fighter Alpha 3 (GFX)
         sgemf - Super Gem Fighter (GFX)
         sfiii - Street Fighter 3- New Generation  (Program Data)
         sfiii2 - Street Fighter 3- Second Impact  (Program Data)
         sfiii2n - Street Fighter 3-  Second Impact  (Program Data)
         sfiii3 - Street Fighter 3-  Third Strike  (Program Data)
         sfiii3n - Street Fighter 3-  Third Strike  (Program Data)
         sfiii4n - Street Fighter 3-  Four-d Strike  (Program Data)
         slammast - Saturday Night SlamMasters
         ssf2t - Super Street Fighter 2 Turbo (GFX)
         strider - Strider (Program Data+GFX)
         umk3 - Ultimate Mortal Kombat 3 (Program Data)
         vhunt2 - Vampire Hunter 2 (GFX)
         vsav - Vampire Saviour: The Lord of Vampire (GFX)
         vsav2 - Vampire Saviour 2: The Lord of Vampire (GFX)
         wakuwak7 - Waku Waku 7 (GFX)
         wh1 - World Heroes 1 (GFX)
         xmcota - X-Men: Children of the Atom (GFX)
         xmvsf - X-Men VS Street Fighter (GFX)
         mvsc - Marvel VS Capcom: Clash of Superheroes (GFX)
         mwarr - Mighty Warriors (Program Data)
         nwarr - Night Warriors: Darkstalkers Revenge (GFX)
         punisher - The Punisher (GFX+Program Data)
         rbff2 - Real Bout: Fatal Fury 2 (GFX)
         redearth - Red Earth  (Program Data)
         ringdest - Ring of Destruction/SlamMasters 2
         samsho - Samurai Shodown/Samurai Spirits (GFX)
         samsho2 - Samurai Shodown 2 (GFX)
         samsho3 - Samurai Shodown 3 (GFX)
         samsho4 - Samurai Shodown 4 (GFX)
         sf - Street Fighter (Program Data)
         sf2 - Street Fighter 2: The World Warrior (GFX+Program Data)
         sfa - Street Fighter Alpha (GFX)
         sfa2 - Street Fighter Alpha 2 (GFX)
         sfa3 - Street Fighter Alpha 3 (GFX)
         sgemf - Super Gem Fighter (GFX)
         sfiii - Street Fighter 3- New Generation  (Program Data)
         sfiii2 - Street Fighter 3- Second Impact  (Program Data)
         sfiii2n - Street Fighter 3-  Second Impact  (Program Data)
         sfiii3 - Street Fighter 3-  Third Strike  (Program Data)
         sfiii3n - Street Fighter 3-  Third Strike  (Program Data)
         sfiii4n - Street Fighter 3-  Four-d Strike  (Program Data)
         slammast - Saturday Night SlamMasters
         ssf2t - Super Street Fighter 2 Turbo (GFX)
         strider - Strider (GFX+Program Data)
         vhunt2 - Vampire Hunter 2 (GFX)
         vsav - Vampire Saviour: The Lord of Vampire (GFX)
         vsav2 - Vampire Saviour 2: The Lord of Vampire (GFX)
         wakuwak7 - Waku Waku 7 (GFX)
         wh1 - World Heroes 1 (GFX)
         xmcota - X-Men: Children of the Atom (GFX)
         xmvsf - X-Men VS Street Fighter (GFX)


TO-DO:
CPS1 Support?
CPS2 32x32 Tile output
IGS PGM?







Momotaro

This is absolutely crazy!
If I understand well it works a bit like the sprute editor "YY-CHR" ??

I tried it a bit with GB games some time ago.

I'm affraid this one is more complicated, but I'm very impressed and want to try my luck with it...
I will try to follow the steps!

Yoshin222

#2
In truth i mostly use TM as a way or exporting the tiles i wanna edit in a program i like. YY-CHR can technically do the job too but i think showing how ya can mess with the tiles in external programs more comfortable for artists, least i think so

Hope ya find it useful! Lemme know if ya have any issues

      Posted: September 02, 2022, 01:50:55 PM
Slight update: Seems i forgot to properly update magdrop3. Now works properly. While i was at it, added a couple more games
vsav2 - Vampire Saviour 2: The Lord of Vampire
vhunt2 - Vampire Hunter 2
galaxyfg - Galaxy Fight: Universal Warriors
Simply redownload the stitcher. Also updated the bundled Tile Molestor so there shouldn't be any weirdness now

Yoshin222

GOOD NEWS EVERYONE!
After some trial and error, the Stitcher is now compatible with CPS1 titles! Check the first post for the latest revision


What's New
Spoiler (click to show)

--------21/09/2022: Rev 1.1--------
CPS1 SUPPORT!
   After bashing against that wall for a while, the stitcher
   is now compatible with most CPS1 Games! There are fringe cases
   like Forgotten Worlds where the Stitcher isn't suitable, but by
   and large still usable with the majority of CPS1 games i've seen.
   The only real distinction between adding a CPS1 game as opposed to
   CPS2 is that there are a couple new vars to accomodate varying Group
   Sizes, and how many bytes to interleave per group
   For example, Final Fight is setup like this:
   
   gfx_prefix = ["ff-5m.7a", "ff-7m.9a", "ff-1m.3a", "ff-3m.5a"]

   group_size = [4]
   group_collec_size = [2]

   #Total size of each ROM group
   rsize0 = 2 << 18 #524288 bytes, or 512KB
   rsize1 = 2 << 19 #1048576 bytes, or 1MB
   rsize2 = 2 << 20 #2097152 bytes, or 2MB
   rsize3 = 2 << 21 #4194304 bytes, or 4MB
   rsize4 = 2 << 22 #8388608 bytes, or 8MB
   gfx_romsize = [rsize0]
   
   This will probably be adjusted at some point to accomodate games like
   Forgotten Worlds, but should still prove useful, i hope.
   To see the size of groups for ya game, make sure to check Mames cps1.cpp

NEO-GEO: PREFIX_OVERRIDE
   In order to accomodate Samurai Shodown 1, adjusted the code
   so now you can define a prefix_override array to read files of
   varying cx prefixes. In the case of Samsho 1, it's prefix_override
   looks like this

   prefix_override = [1,2,3,4,51,61]

   This indicates to the stitcher to read, in order,
   c1.c1
   c2.c2
   c3.c3
   c4.c4
   c51.c5
   c61.c6

NEWLY SUPPORTED GAMES
   ffight - Final Fight
   ghouls - Ghouls 'N Ghosts
   knights - Knights of the Round
   samsho - Samurai Shodown/Samurai Spirits
   sf2 - Street Fighter 2: The World Warrior
   sfa - Street Fighter Alpha
   strider - Strider


Momotaro

#4
impressive project! Thanks for the update and for your reply.

I have not tested it yet.
I'm affraid to get into one more thing that can be time consuming and that I cannot complete.

But I want to give it a try.

      Posted: September 28, 2022, 07:44:21 AM
Quote from: Yoshin222 on September 01, 2022, 08:48:28 PM
3)Tile Molestor
Charming name i know. This program allows you to open the interleaved data in a way an actual person would care for. I'll link the one i use, which has an additional extension to load .act files. This in conjunction with Palmod is where the magic happens
Comes with the script, but being a Java application, Java needs to be installed for it to work. Simple enough to do

Where can I find This edited version of this software?

(I still have not tested the full process... ^^; )

Also, I'm not sure to understand wich step will make the sprites looking complete, instead of "interleaved" ?

My limitations with english can be the problem.

Yoshin222

The edited version is in the latest revision
I'm not sure i understand the other question

Yoshin222

Yet another update! The Stitcher has undergone some retooling, and can now interleave/append program data! This makes editing code/values much simpler! Alongside that, the script now displays the status of your ROMs files, as well as if you have interleaved GFX/PRG data already, hopefully making it more clear what ya can and can't do at any given time. Lastly, quite a few games have been added, such as Ghouls 'n Ghosts, Caddilacs and Dinosaurs, Alien VS Predator, among others! Check the first post for the Github revision 1.2! Refer to readme.txt and what's new.txt for more info!



Momotaro

#7
Quote from: Yoshin222 on September 28, 2022, 02:26:58 PM
The edited version is in the latest revision
I'm not sure i understand the other question

sorry, I'll try to ask my question again.

which step of work will make the sprites correctly extracted ? (Instead of having then cut in many parts "tiles")


I tried to understand the tutorial, but still seems very complex for me.
I think I'll have to concentrate on it for a full day or week end to be sure to understand the process.

I would love some other games to be added to the compatibility list. (just a whish list)
Not sure some of these non Capcom system can be added

Titles with stars (***) I really hope they cna become compatible.

Agressors Of Dark Kombat
3 count bout
Muscle Bomber/ring of destruction games.
The Punisher***

IGS PGM :
Martial Masters***

Various :
64th Street
Karate Blazers
Night Slashers
Silent Dragon
Vendetta
Violent Storm***
Blazing Tornado
Wrestle War

Again, just a whish list.
I think it will be a pain in the ass to make all these systems compatible ^^;


Also, I'm curious if there is already a way to replace sounds (I suppose it depends on the system and compression of data etc.)

Yoshin222

Sorry for the late response, i get sidetracked easily lol
Anyway, most of those games are easy to enough to add yaself. Simply add a resource file with the needed info and ya good. If it's CPS1/2 or Neo-Geo that is
Haven't really delved in to PGM yet, and those other games store GFX in different ways i don't really think i care enough to learn about tbh

In regards to the whole sprite thing, there is no bit. Ya get the raw tiles, you'd have to combine em yourself. Ya could study how games assemble sprites to get that exact data or whatnot but still

Of course it's possible, but most sound files are raw so the stitcher isn't needed for em. That's another field i want to study eventually but not rn

Yoshin222

Small update! Adds a little flexibility to importing Program data, and adds support for a couple more games. That makes 65 games so far!

--------11/01/2023: Rev 1.3--------
######################### Improved PRG Interleaving! #########################
   The script has become more flexible by introducing import parameters. They work
   much and such the same as append, only they load the data to the start of the file
   as opposed to slapping it on the end. This allows games like Saturday Night Slam-Masters
   to have all it's program data properly read. Admittedly a bit slap dash but should get the job
   done. Let me know if any bugs spring up
   EXAMPLE:

   #Import this data first before we interleave anything
   prg_import = ["mbe_23e.8f",0x80000]
   import_swapendian = 2 #Swap the endian. 2 Indicates a length of 16-bits, so every 2 bytes

   ######################### NEWLY SUPPORTED GAMES #########################
   ---Graphics Data ----
   ringdest - Ring of Destruction/SlamMasters 2

   ---Program Data ----   
   forgottn - Forgotten Worlds
   
   ---Graphics and Program Data ----
   3countb - 3 Count Bout/Fire Suplex
   aodk - Aggressors of Dark Kombat
   punisher - The Punisher
   slammast - Saturday Night SlamMasters

Momotaro

#10
Quote from: Yoshin222 on January 12, 2023, 01:26:08 AM
Small update! Adds a little flexibility to importing Program data, and adds support for a couple more games. That makes 65 games so far!

--------11/01/2023: Rev 1.3--------
######################### Improved PRG Interleaving! #########################
   The script has become more flexible by introducing import parameters. They work
   much and such the same as append, only they load the data to the start of the file
   as opposed to slapping it on the end. This allows games like Saturday Night Slam-Masters
   to have all it's program data properly read. Admittedly a bit slap dash but should get the job
   done. Let me know if any bugs spring up
   EXAMPLE:

   #Import this data first before we interleave anything
   prg_import = ["mbe_23e.8f",0x80000]
   import_swapendian = 2 #Swap the endian. 2 Indicates a length of 16-bits, so every 2 bytes

   ######################### NEWLY SUPPORTED GAMES #########################
   ---Graphics Data ----
   ringdest - Ring of Destruction/SlamMasters 2

   ---Program Data ----   
   forgottn - Forgotten Worlds
   
   ---Graphics and Program Data ----
   3countb - 3 Count Bout/Fire Suplex
   aodk - Aggressors of Dark Kombat
   punisher - The Punisher
   slammast - Saturday Night SlamMasters

Really glad to see one more update even if with my level of understanding of such softwares without user friendly process, I'm unable to use such a program.

Also, glad you included more compatibility.
Particularly for these games I listed before. :)

I wonder why no one seems to use your software?????
I thought it would be very useful...
Are there exemples of people making projects with it? I'm surprised...

Again, too me it still sounds too complicated, even if I'm pretty used to try many similar stuffs / modding etc...
But again, I don't see myself able of typing lines of codes in trial and error way to try to make game mods.

So many projects in mind. So short time. I just cannot allow myself to go deep into something so complex. Sadly.

Yoshin222

Not an update to the Stitcher, but definitely a useful sister script for it
A Palette flipper. Detailed in the CPS2 video, ya need to muck with .act files to get the tiles looking correct in TM. This script simply lets ya enter the name of the palette ya want flipped, and generates a proper version you can use!
Chucking the raw palette in to TM

VS the same palette but flipped by the script


Yoshin222

Finally came back to this, and finished some old business!
The Stitcher is now truly compatible with CPS1 Games! It supports Forgotten Worlds, SF2, King of Dragons, Knights of the Round, Megaman the Power Battle among others!
From what I can tell it works bug free, but please let me know if adding a new game introduces a new headache. In the meantime, enjoy!




joseupp

Quote from: Yoshin222 on March 12, 2024, 06:45:23 PM
Finally came back to this, and finished some old business!
The Stitcher is now truly compatible with CPS1 Games! It supports Forgotten Worlds, SF2, King of Dragons, Knights of the Round, Megaman the Power Battle among others!
From what I can tell it works bug free, but please let me know if adding a new game introduces a new headache. In the meantime, enjoy!





Hello, first of all, thank you very much for your work, it is fantastic.

Can you add support for the game Street Fighter 2 Turbo, Japanese version?
specifically this rom, sf2hfj.

I hope you can add it, thank you very much.


Yoshin222

Not needed, revisions like that typically only affect the Program Data, not the GFX data. Ya can see this in cases like multiple title screens per region, each ROM uses the same GFX ROMs, it's just the code/text that's different. Ya should be able to mess with SSF2T and all should be fine

Yoshin222

HUGE update!!!
The Stitcher now generates folders per game, and more importantly, CPS1/2 games have SCR1/3 support at last!
Ya need to map them via 2 new vars (look at the readme for info) but yeah! Ya can now edit any GFX in any CPS1/2 game if ya want it bad enough!
Update to first post includes the new version!

Momotaro

Great news.
I'm still very impressed by the project.
Any progress on something that would actually make it more less cryptic/complex to use...
Some actual user friendly GUI ?

Good luck.

Yoshin222

I'm not sure how, it's about as simple as it's gonna get
Run the script
Interleave ya game
Make edits in TM
De-interleave back

SimpliBand

this is a pain.
over two years I've been trying to get this to work.without any success.
I just wanted to modify the sprites of sf2,ww,ce,hf...
I'm exhausted,I give up.

Yoshin222

What part in particular is causing ya grief?
This thing is written terribly but I don't think it should be that hard lol