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 acting up

Reply to topic
Author Message
  • Joined: 08 Mar 2019
  • Posts: 4
Reply with quote
BMP2Tile acting up
Post Posted: Fri Mar 08, 2019 2:07 pm
Hello.

I'm new to the homebrew scene around, and I've done already a few tests with the display and such: simple things, I presume.

That being said, I'm trying to start working on something that hopefully will become a real, interactive game-like program. Yet, I'm already running into problems: I'm using Phantasy Star compression for my program, and I've debugged the program to check if it works for a set of player graphics.

It does, but the first 4 tiles are completety blank.

Given that all the other tiles have been loaded up correctly, I assume the problem lies in the compression process of the original image done by BMP2Tile. I'd like to ask whether anyone has come across a similar problem and if there's a possible fix to it.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Mar 08, 2019 2:10 pm
You mean 'Phantasy Star Gaiden' compression? Which decompressor are you using?
Also, are you sure you're calling the function with correct parameters?
  View user's profile Send private message Visit poster's website
  • Joined: 08 Mar 2019
  • Posts: 4
Reply with quote
Post Posted: Fri Mar 08, 2019 2:18 pm
I'm somewhat sure I'm doing it right. I'm using standard .pscompr files, so it's "Phantasy Star" compressed. Copied the "LoadTiles4BitRLE" routine straight from the .inc file with the decompression functions. HL's pointing straight to the beginning of the file, DE to the beginning of VRAM.

If it helps, I'm sending a screenshot of MEKA with the tile viewer visible.
output-01.png (14.03 KB)
output-01.png

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Mar 08, 2019 2:29 pm
mmm... you might be overwriting VRAM contents afterwards? Try setting a breakpoint right after the call to the LoadTiles4BitRLE routine, check the tile viewer then.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Mar 2019
  • Posts: 4
Reply with quote
Post Posted: Fri Mar 08, 2019 2:33 pm
Breakpoint after decompression routine.

...well, those 00s really do stick out.
output-02.png (16.38 KB)
output-02.png

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Mar 08, 2019 2:48 pm
OK, I really have no idea - also, I never ever used PScomp, always favored PSGcomp... if it's a bug in BMP2Tile (you're using the latest version, right?) it's a previously unnoticed one :|

edit: width and height of your original image? are tiles 'missing' or just offset by 4?
  View user's profile Send private message Visit poster's website
  • Joined: 08 Mar 2019
  • Posts: 4
Reply with quote
Post Posted: Fri Mar 08, 2019 3:14 pm
Turns out I was 0.02 versions behind, so I got the new version, tried again, aaaaaaaaaand no luck. Time to switch compression methods, I guess.

The original file is right here (in .png format).

Sidenote: you use PSGcomp becaue it's the overall best method or...?

Update: switching to PSGcompr seems to fix it. Thank you for your time.


the sidenote still stands tho
twe.png (1.22 KB)
twe.png

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Fri Mar 08, 2019 3:28 pm
TWE wrote
Sidenote: you use PSGcomp becaue it's the overall best method or...?


just that it *usually* compresses better, still being quite fast in decompression (as it isn't reading back from VRAM, as some other LZ* based compressors do...)

edit: good it works now. bad we have a problem in the PS compressor code :|
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14726
  • Location: London
Reply with quote
Post Posted: Fri Mar 08, 2019 11:24 pm
I loaded up your PNG and saved it out as pscompr + palette and injected it into my bmp2tile test code, and it works fine... screenshot and file attached.

I am mostly just using zx7 these days as it tends to do better compression and faster loads. On your PNG file PS compression compresses to 721 bytes but zx7 gets down to 423. Make sure to grab the latest compressors and decompressors from https://github.com/maxim-zhao/bmp2tilecompressors/releases .

Edit: actually I ought to release some thing newer there, I guess I'll set up an appveyor build for it shortly to cover that in future,

Edit 2: now done, get latest builds at https://github.com/maxim-zhao/bmp2tilecompressors/releases
demo-01.png (4.93 KB)
demo-01.png
test (tiles).zip (671 B)

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sun Mar 10, 2019 10:30 am
Maxim wrote
I loaded up your PNG and saved it out as pscompr + palette and injected it into my bmp2tile test code, and it works fine... screenshot and file attached.


oh, good. TWE, you might want to check if you were using an old compressor/decompressor code... if you're interested to find out why it wasn't working.
  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!