Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - bmp2tile.exe fails to work with PNG file format

Reply to topic
Author Message
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
bmp2tile.exe fails to work with PNG file format
Post Posted: Wed Feb 12, 2020 4:33 pm
I'm testing out some tutorials from over at https://www.elotrolado.net/hilo_tutorial-muy-basico-de-c-para-master-system_2208...

I have my environment setup and wanted to pack some tile data so I copied the example png image into a 'gfx' folder, added bmp2tile to my path and added the following line to my batch script:

bmp2tile.exe ..\gfx\SegaMasterSystemTitleScreen.png -savetiles .\bank1\backgroundtiles.psgcompr -mirror -removedupes -savepalette .\bank1\backgroundpalette.bin -savetilemap .\bank1\backgroundtilemap.bin -exit


For some unknown reason, it just reports back that png is unsupported which seems like something incorrect to me. Has anyone had a similar issue and been able to resolve it?

Many thanks
format_not_supported.PNG (97.94 KB)
Format unsupported error
format_not_supported.PNG

  View user's profile Send private message Visit poster's website
  • Joined: 04 Jul 2010
  • Posts: 539
  • Location: Angers, France
Reply with quote
Post Posted: Wed Feb 12, 2020 6:42 pm
24bits ?
  View user's profile Send private message
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Wed Feb 12, 2020 9:52 pm
ichigobankai wrote
24bits ?


Actually, I just saved the same image from the example website. It's 32 bit.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Wed Feb 12, 2020 10:08 pm
Perhaps some de-optimization for the web. BMP2Tile expects you to manage the palette manually, ie to only give it images with 16 or fewer colours.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Wed Feb 12, 2020 10:46 pm
Maxim wrote
Perhaps some de-optimization for the web. BMP2Tile expects you to manage the palette manually, ie to only give it images with 16 or fewer colours.


Ahh yeah, cool. Worked. I have no idea why a demo would provide an image that doesn't actually work :/ Well, I reduced the colours in Paint Shop Pro and it's now working fine. Cheers
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Thu Feb 13, 2020 9:36 am
Hi! Original tutorial author here!

I just downloaded the image I linked on the tutorial, and it has the right palette:


How have you downloaded it? Remember that you have to press open-download from the dropbox web interface otherwise, you're downloading the preview image that they're generating.

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14687
  • Location: London
Reply with quote
Post Posted: Thu Feb 13, 2020 10:14 am
Side note: the newer rewrite of BMP2Tile is more command line friendly and may give a better error here.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Thu Feb 13, 2020 8:44 pm
kusfo wrote
Hi! Original tutorial author here!

I just downloaded the image I linked on the tutorial, and it has the right palette:


How have you downloaded it? Remember that you have to press open-download from the dropbox web interface otherwise, you're downloading the preview image that they're generating.


I'm not sure, perhaps I just dragged the image and that was my problem. I guess that there is something that dropbox is doing to the preview image. It's working great now anyway and thanks for the rest of the tutorial which is great :)
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Thu Feb 13, 2020 9:42 pm
:)
Capture.PNG (176.55 KB)
Capture.PNG

  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Fri Feb 14, 2020 7:19 am
It looks amazing! :-D
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3761
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Feb 14, 2020 11:05 am
you don't even need to call
SMS_init()
as the crt0 code already does it for you :)

also, I'd load the palette, tiles and tilemap before turning screen on, unless you love the way it progressively appears on screen (barely noticeable, anyway)
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Sat Feb 15, 2020 9:38 am
sverx wrote
you don't even need to call
SMS_init()
as the crt0 code already does it for you :)

also, I'd load the palette, tiles and tilemap before turning screen on, unless you love the way it progressively appears on screen (barely noticeable, anyway)


Cheers for the advice. Actually, I had discovered that I can remove that line but added it back for completeness before I later go in an evaluate each function asm. Great points and I'm taking it all in and will edit according to your feedback :D -

kusfo Many thanks for your tutorial, it's a great resource. :)

  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 879
  • Location: Spain
Reply with quote
Post Posted: Sat Feb 15, 2020 2:44 pm
Great! :-D

The tutorial is a bit outdated, but I think it's quite a good starting point :-D
  View user's profile Send private message
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Sat Feb 15, 2020 8:42 pm
kusfo wrote
Great! :-D

The tutorial is a bit outdated, but I think it's quite a good starting point :-D


I decided to attempt to convert a psg file https://www.smspower.org/Music/BatmanReturns-SMS

Stage 1.

I used vgm2psg with:
> vgm2psg batman.vgm music.psg 23

in an attempt to retrieve all channels? I then set up the PSG by calling both:

PSGPlay(music_psg);
PSGSFXPlay(music_psg, 0x01|0x02);

...

PSGFrame();
PSGSFXFrame();


However, I can clearly hear that there is a missing channel. I also tried with another track, Title Screen from Alien 3. That also seemed to be missing a channel. Any ideas why this might occur?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3761
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sat Feb 15, 2020 9:36 pm
to convert background music, you should NOT specify any channel on the command line, so you just need to do:
vgm2psg batman.vgm music.psg


then you need just PSGPlay and PSGFrame, not the SFX functions.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2005
  • Posts: 37
  • Location: Manchester, UK
Reply with quote
Post Posted: Sat Feb 15, 2020 9:56 pm
sverx wrote
to convert background music, you should NOT specify any channel on the command line, so you just need to do:
vgm2psg batman.vgm music.psg


then you need just PSGPlay and PSGFrame, not the SFX functions.


Sorry, yeah, I was showing both options that I'd tried (I wasn't trying simultaniously), and I was sure that I tried your option first with Alien 3 title screen, but clearly I didn't since I just tried again and it's working perfectly for Batman. lol

Many thanks
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!