CPCWiki forum

General Category => Programming => Topic started by: Octoate on 19:42, 24 July 12

Title: Screen compression with Exomizer
Post by: Octoate on 19:42, 24 July 12
Hi,
I am currently a bit stuck while playing a bit with Exomizer. Currently I just want to compress a screen with Exomizer (the official version from Exomizer 2 website (http://hem.bredband.net/magli143/exo/)), load the compressed file and decrunch it directly into the screen memory.
The compressed screen is loaded to &4000 and this is the small program to uncrunch it:


org &8000
write direct

di
ld hl, &4000
ld de, &C000
call deexo
ei
ret

read "deexo.asm"


To compress the image screen, I just type "exomizer test.scr -o test.exo". Well, but all I get is garbage on the screen.

Do you know what I am doing wrong?
Title: Re: Screen compression with Exomizer
Post by: TFM on 19:58, 24 July 12
Does your screen have a LOAD address of &C000 (or is it &4000 like all OCP screens have). I don't know exomizer, but this can be one source of problems.

Personally I use the OCP cruncher and decrunching is no problem.
Title: Re: Screen compression with Exomizer
Post by: Octoate on 20:08, 24 July 12
The image is not an OCP image. For testing purpose I just saved an image with "SAVE"screen.scr",b,&C000,&4000". I am not interested in on-CPC compression, but cross-platform development and Exomizer offers the best compression.
Title: Re: Screen compression with Exomizer
Post by: fano on 20:22, 24 July 12
Quote from: Octoate on 19:42, 24 July 12To compress the image screen, I just type "exomizer test.scr -o test.exo". Well, but all I get is garbage on the screen.
I think you need to use the -raw format ( exomizer raw test.scr -o test.exo ) , afaik this is the only one supported by the Z80 code (this is the one i use for my projects)
Title: Re: Screen compression with Exomizer
Post by: Octoate on 20:23, 24 July 12
Uuups... sorry, I forgot to include the "raw" in the command line above. Of course I used the raw compression and the raw decrunchers.
Title: Re: Screen compression with Exomizer
Post by: SyX on 20:25, 24 July 12
Have you used the version uploaded by Metalbrain here (http://www.cpcwiki.eu/forum/programming/exomizer-2-now-with-optimized-depackers/)? It's more update than the official version.

But if the decrunch fail again is much better idea to send the file to Metalbrain, in case there is a bug in the decruncher routine, he will glad to fix it.
Title: Re: Screen compression with Exomizer
Post by: Octoate on 20:39, 24 July 12
Thx SyX, I tested the version, but it seems that the official version is newer (released in march instead of january) and I also got the same result like with the official vesion :-(. I haven't used the optimised version, because I want to use it under Linux :).
Title: Re: Screen compression with Exomizer
Post by: SyX on 21:31, 24 July 12
I will take a look to the optimized version, i think works perfectly in wine, but i remember seeing the details of the optimized version a few years ago and it was nothing special (easily pythonable).

Send the file crunched and uncrunched to him, and he will confirm if it's a problem in the z80 decruncher.
Title: Re: Screen compression with Exomizer
Post by: TFM on 21:56, 24 July 12
@Octoate: Sorry for mentioning work on the CPC.
May you like to post a source screen (screen file) for testing purposes and tell how small you can crunch it (bytes)?
Title: Re: Screen compression with Exomizer
Post by: Octoate on 22:10, 24 July 12
Sorry, sounded a bit harsh - it wasn't meant so, but I am currently focusing on cross-development...
I've attached the screen and the compressed screen to this posting. The compressed size of the image is 1607 bytes.

@SyX: I sended a mail to him so let's see what I am doing wrong :).
Title: Re: Screen compression with Exomizer
Post by: Grim on 22:52, 24 July 12
It seems there's an incompatibilty between the exomizer and Z80 decruncher you are using. I replaced the decruncher routine (deexo.asm) in your example with another one (found on my hdd, dunno where it comes from exactly, see the attachment below) and it works.
Title: Re: Screen compression with Exomizer
Post by: Octoate on 09:16, 25 July 12
Thanks Grim. I will test it this evening at home. I just had a quick look at it and it seems that the version you posted here is the "older" decruncher (<= v2.0.2), which wasn't optimised by Antonio Villena (v2.0.3).

UPDATE: Ok, it works now. So it seems to be a problem with the new optimised version, which was introduced in the latest official version of Exomizer. But it is great that it works now, because I can finish a small example...
Title: Re: Screen compression with Exomizer
Post by: Metalbrain on 18:51, 25 July 12
Hi Octoate, I've seen your email, and another user also emailed me a while back with (probably) the same issue, but I didn't have much time back then and later forgot about it. From what I saw it was related with not detecting correctly the starting bit of the first byte after the initial table. If it works with the older decompression routine, it should be easy to check the differences and find the bug. As soon as I do it, I'll send the fixed version to Magnus Lind.
Quote from: Octoate on 20:39, 24 July 12

Thx SyX, I tested the version, but it seems that the official version is newer (released in march instead of january) and I also got the same result like with the official vesion :-(.
They should be the same, the official version was just released later, because Magnus takes his time to make his releases.
Quote from: Octoate on 20:39, 24 July 12I haven't used the optimised version, because I want to use it under Linux :) .
The optimized version can be used under Linux. I included the source code of the optimizator and it should be easy to compile it.
Title: Re: Screen compression with Exomizer
Post by: Metalbrain on 19:34, 25 July 12
Bug found:

exo_getindex: inc c
call exo_getbit
jr nc,exo_getindex
ld a,c ;C=index
bit 4, c


Remove the "ld a,c ;C=index" line.
It should be left as:

exo_getindex: inc c
call exo_getbit
jr nc,exo_getindex
bit 4, c

Only happens in normal, non simple version.

PD: Already fixed here:
http://www.speccy.org/metalbrain/exo_v4.zip (http://www.speccy.org/metalbrain/exo_v4.zip)
Title: Re: Screen compression with Exomizer
Post by: Octoate on 21:32, 25 July 12
Cool, that was fast. Thanks, it now works fine!
Powered by SMFPacks Menu Editor Mod