English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   project.CARE (https://eab.abime.net/forumdisplay.php?f=58)
-   -   MAME + tile saving edition (https://eab.abime.net/showthread.php?t=41610)

hitchhikr 26 December 2008 03:40

MAME + tile saving edition
 
I modified MAME v0.128 (debug version) to allow to save the tiles and palettes:

http://pagesperso-orange.fr/franck.charlet/mamed_ts.zip

In the palette view using 'S' key will create a directory (if necessary) with the current game name & save the current palette into it as a .pal file.

In the tiles view using 'S' key will create a directory (if necessary) with the current game name & save all the tiles with all the possible palettes.

I also added a 'windowzoom' option in mame.ini to allow to magnify the window when it's not maximized or in full screen mode, this can be used to obtain a bigger window without the distorted pixels.

Here is an example with tiles and sprites from the game Side Arms (converted to .png):

http://pagesperso-orange.fr/franck.charlet/sidearms.zip

As you can see, all different possibilities are saved side by side as .bmp format (files are optimized during saving but can become pretty big anyway, so beware), the layout (number of tiles/row) follows the one chosen by the user.

Notice that the files can be saved several times during a session without the older ones being overwritten (new ones will be created with different numbers), i implemented it that way because sometimes it's necessary due to changes in the palette (mostly between game levels).

What's left is to spot in games which tiles or sprites are used with what palette and to keep the right ones, it's not perfect but it makes ripping gfx from arcade games it a lot easier than before.

dlfrsilver 26 December 2008 15:06

absolutely great !!! thank you very much !!!!

dlfrsilver 27 December 2008 05:52

hi again, could it be possible for you to modify a bit this mame custom ?

In order to make a save PER palette change made ?

This would make editable tiles ;)

hitchhikr 27 December 2008 10:14

What do you mean ?

dlfrsilver 27 December 2008 15:30

the files are huge, because all series of sprites are put in the files with all palettes possibilities.......

I asked if you could make this mame version save each paletted series of sprites apart
instead of having them in the same file ?

it would make it easier to get the tiles :)

hitchhikr 27 December 2008 17:53

Separate files are what i did at first but after some considerations i opted for that grouped solution as browsing through all the tiles scattered in multiple files to find the one with the right palette can really be a pain.

Note that if you're dealing with games that are bigger than 2 megabytes it may be very hard to correctly rip the tiles & sprites as there probably will be too many of them anyway.

I'll consider re-introducing the option, tho.

hitchhikr 29 December 2008 23:07

'Left Shift'+'S' added to save tiles as several files. Also 'G' key support added to turn the gap between tiles on/off. See readme.txt for more infos.

musashi9 02 January 2009 01:06

Excellent new feature !
I must say keeping the Shift + S options was a good idea
(Pang gave me a 400mb Bitmap file without it ) :P


BTW I get an error when trying to save the tiles from Street Fighter II The World Warrior
I guess this is because the game is bigger than 2MB ?

------------------------------------------------
Exception at EIP=00B3AB77: ACCESS VIOLATION
While attempting to read memory at 07194000
------------------------------------------------
EAX=7191000 EBX=7194000 ECX=00000000 EDX=FFFF2244
ESI=7191000 EDI=00000000 EBP=0022EF88 ESP=0022EAA0

hitchhikr 03 January 2009 12:44

Nope, it's because there's a bug in MAME's tiles viewer itself if you try the left arrow when in palette 0 it will crash in some games. It occurs in the regular MAME too when the debugger is available (mamed).

hitchhikr 03 January 2009 14:25

There, it should be fixed now (same url). I also added a couple of commands:

'LEFT CONTROL'+'S' to save the current page of tiles with all the possible palettes within a single big (sometimes huge) file.

'LEFT CONTROL'+'LEFT SHIFT'+'S' to save the current page of tiles with all the possible palettes scattered as many files as there are possible palettes.

Photon 03 January 2009 18:27

Some interesting stuff you have there. Consider your webpage bookmarked. :)

hitchhikr 08 January 2009 22:38

Adapted my modifications to mame v0.129, same url.

jotd 09 January 2009 22:21

Excellent stuff! Be careful: the bastards from Orange have a tendency to disable webpages when files are not referenced in the index.html start page (or recursively).
It happened to me, I thought I should warn you. Just put the link on your tool on your main page if not already done.

zambot3 11 April 2015 18:29

Don't works! The .pal file can't recognized!

Cerno_b 13 April 2020 17:56

I just signed to tell you that you rock for writing this mod!

This improves the ripping process tremendously. Do you think this is going to be part of MAMEs master branch? I think it is very useful.

I have a question:

From testing the tool it seems that whenever I save the palette, that's the one single palette currently active in the game's current frame. If I save the sprite sheet, then the tool creates all versions with all palettes. What I don't really understand is how I can find out which of the sprite sheets uses the current pallete, except for trial and error. Do you think it would be possible to encode the palette id in the palette filename? That way it would be possible to quickly find the appropriate style sheets. Or maybe I missed something and there is an easy way to know which stylesheet uses the current palette.

Another question:

The pal format of the written palette is not recognised by Aseprite. Is this a different format with the same name? Can you name a tool that is able to read this format?


Again, awesome work, thanks man!

hitchhikr 22 April 2020 16:31

Hi,

Quote:

This improves the ripping process tremendously. Do you think this is going to be part of MAMEs master branch? I think it is very useful.
I had a look but in newer mame they changed the way to visualize the tiles: they only decode the ones that are currently viewed.

Quote:

From testing the tool it seems that whenever I save the palette, that's the one single palette currently active in the game's current frame. If I save the sprite sheet, then the tool creates all versions with all palettes. What I don't really understand is how I can find out which of the sprite sheets uses the current pallete, except for trial and error. Do you think it would be possible to encode the palette id in the palette filename? That way it would be possible to quickly find the appropriate style sheets. Or maybe I missed something and there is an easy way to know which stylesheet uses the current palette.
I don't think that's possible.

Quote:

The pal format of the written palette is not recognised by Aseprite. Is this a different format with the same name? Can you name a tool that is able to read this format?
The palette was saved in raw binary format, i changed it so they are saved in paint shop pro format (can be imported in gimp and probably other software aswell).

http://franck.charlet.pagesperso-orange.fr/mamed_ts.7z

Cerno_b 26 April 2020 19:53

Quote:

Originally Posted by hitchhikr (Post 1394056)
I had a look but in newer mame they changed the way to visualize the tiles: they only decode the ones that are currently viewed.

Ah, that's too bad. I really like to have the big image, but as long as I have your version, I'm safe ;)

Quote:

The palette was saved in raw binary format, i changed it so they are saved in paint shop pro format (can be imported in gimp and probably other software aswell).

http://franck.charlet.pagesperso-orange.fr/mamed_ts.7z
Alright, thanks. I was playing around with the format by myself and found out how to read the old palette format, but it's still very awesome that you made an update!

The reason I find your mod so helpful is that I am currently writing a tool that allows to create sprites from discrete 8x8 or 16x16 tiles based on the image your mod creates. This would theoretically allow to fairly quickly extract all the sprites including their animations without having to faff about with manual screengrabs or pixel-precise sprite cutouts. I dream of having a complete archive of all the old arcade game sprites, and since the lexicon is pretty patchy at the moment, I figured the only way to achieve this is by offering better tooling to the rippers.

One peculiarity about MAME games is giving me a headache though, and that is that each sprite seems to get assigned their own private palette from the set of available palettes which can easily range in the dozens. As you wrote, it does not seem to be possible to make the assignment from palette to sprite automatically, but I would at least like to give my tool a function that allows assigning each extracted sprite one of the available palettes manually.

I don't know if you see any merit in this but in order to do that, I would need two changes to your mod:

1) Save the sprite sheets as an indexed bmp instead of a RGB one. That way, I could just pick one of the sprite sheets and switch out the palette to get all the other sprite sheets. If possible, it would really help if the indices are compatible with all the palettes, e.g. a limited palette with only 4 colors will likely only save 4 pixel indices, whereas a larger palette would write more. So using the original sprite sheet indices would be very helpful here.
2) Instead of writing just the current palette, write all the palettes, which I would assume should be possible, since you already seem to apply all possible palettes when you write the sprite sheets currently.

Not sure you have the time for this or find this useful, though. Writing the sprite sheet as indexed would also reduce the file size to 1/3 according to a manual conversion I did as a test. So it may be a good improvement regardless of what I plan to do with the images.

If this plan failed, I could probably create what I need from the images your current mod produces, but if I wanted to release my tool if it gets finished, I wanted to make it as simple as possible for the users without having to run additional python scripts to set up everything. Ideally a user would be able to extract just a single sprite sheet image and a large bunch of palettes (instead of a lot of different images).

In any case, the current version of your mod is already a tremendous help for ripping sprites, especially once I get the palette thing to work. Thanks again for putting it out there.

Scrollkidd 17 September 2020 00:14

Hey there,

I already sent a private message to hitchhikr about a trouble I am encountering on his Mame build (hoping an answer),
but I better share my experience on the thread too.

Here the issue: right after launching a ROM with this specific build my keyboard don't respond anymore.
I relaunched all my others Mame versions, and all works fine, keyboard is 100% Ok on 5 others versions I got.

However my joypad is working fine, it stills possible to reach the F4 key (tiles viewer) by assignating it to my joypad buttons via the Mame configuration menu,
but impossible to assign the needed keys inputs to save tiles ('S' or 'LEFT SHIFT'+'S').

So capturing assets is impossible to perform for me.
I run it on a Windows 7 64bits PC, but it's exactly the same issue on a PC running Windows 10.

Tried numerous other things but nothing worked:

- use differents PS/2 and USB keyboards
- change USB ports
- uninstall keyboard, then reinstall
- recreated a proper ini file with de cmd "mamed_ts -cc"
- changed ini entry "multikeyboard" with "0" and "1"
- Trying lower the desktop resolution to 800x600 (some Mame users fixed that problem like it, yeah sounds crazy)

If anyone have a clue of what going on, you're welcome =)

Cheers!

hitchhikr 13 October 2020 23:07

Hi,

Never encountered such bug.

Here is the source code, if you can find why it bugs on your system, feel free to share your discoveries.

http://franck.charlet.pagesperso-ora...amed_ts_src.7z

Scrollkidd 14 October 2020 14:11

Quote:

Originally Posted by hitchhikr (Post 1434401)
Hi,

Never encountered such bug.

Here is the source code, if you can find why it bugs on your system, feel free to share your discoveries.

http://franck.charlet.pagesperso-ora...amed_ts_src.7z


I will let you know and give a feedback here if we can fix the problem we are encountering.

Thank you so much for the sharing :)


All times are GMT +2. The time now is 19:27.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.16990 seconds with 11 queries