Jump to content
IGNORED

Differentiate MyArt picture formats


Recommended Posts

I have added a quick view to the latest verrsion of Ti99Dir but now I found out that with some MyArt files Ti99Dir is wrong; It doesn't figure out correctly what the format/size is of the MyArt picture "256x212" or "512x212" pixels.

 

What I have found somewhere is (can't remember when or where):

/*
 * Format 256x212:
 * Byte 0:        Background color
 * Byte 1:        Flag 0 (=256x212)
 * Byte 2:        Colorcode GGGRRRBB
 * Byte 3:        Number of pixels
 * etc
 *
 * Format 512x212:
 * Byte 0:        Background color
 * Byte 1:        Flag 1 (=512x212)
 * Byte 2:        Color palette 16 colors: 0RRR0BBB
 * Byte 3:        Color palette 16 colors: 0???0GGG
 * Byte 34:        Colorcode: CCCC00LL index in palette, LSBits are MSBits length
 * Byte 35:        Length:    LLLLLLLL max length value is >0200
 * etc
 */

 

But byte 1 seems to be wrong or means something else.

 

For all the 512x212 MyArt pictures I have in my collection byte 1 has the value of >FA and that is the only byte that is checked to differentiate between these two picture formats. But recently I found on a Mame bootdisk I use some MyArt pictures of 256x212 pixels with also a byte 1 with a value of >FA. It is also possible that these pictures are wrong but I don't know for sure.

 

Does anybody now of a better method to distinguish between these two MyArt picture formats?

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Posted (edited)
16 hours ago, 9640News said:

Let me know if this helps you out.  This is some source code from the Geneve's ABASIC call to load a Myart Image. 

Thank's, I'll have a look into this.

 

And ... allready looked into that:

The ABASIC source code example is using the current screen mode set for determining how to display the picture, it doesn't care what the real type of the picture is. Screen mode 8 or 10: display as if it is a 512x212 pixel picture and reading color palette first. Screen mode 9: display as if it is a 256x212 pixel picture. If I remember correctly with MyArt; the user have to set the correct screen mode first before loading a picture.

 

But anyway, the first data bytes are confirmed:

BYTE
0    BACKGROUND COLOR
1    FLAG 0=256 MODE  0<>=512 MODE
 

Those Myart 256x212 Pictures I found on the Bootdisk I use are from some Basic game ((happens to be from the directory ABASIC/DEMO); I think it is correct to assume that byte 1 of these files are incorrectly set to >FA.

 

Edited by F.G. Kaal
  • Like 1
Link to comment
Share on other sites

15 hours ago, mizapf said:

In TIImageTool I'm actually simulating the rendering by reading all RLE data elements and checking whether I get a 512x212 or 256x212 result.

In Ti99Dir I'm only checking the first 256 bytes for determining what kind of data it is. I don't think it is an option to read a complete file when building a directory list. It is an option when displaying the picture though. I check TIImageTool how you handle this 🙂

 

Link to comment
Share on other sites

I'm doing it when actually opening the image; this is fast enough so you don't notice it. If you want to do it in the directory listing, I'd probably try and see how long it really takes. Even if you had 127 images, I can imagine it's only a fraction of a second until every file is checked.

  • Like 1
Link to comment
Share on other sites

3 hours ago, mizapf said:

I'm doing it when actually opening the image; ...

I see that TIImageTool is doing the same approach as Ti99Dir does but checks the complete file. A DIS/FIX 128 can be a Myart picture, a GIF picture, an Archive file a Forth file or something else.

 

This afternoon I came to the following method: I can simple determine if it is a GIF, Archive, Forth or maybe a Myart picture.

 

Before displaying a Myart picture; count the total number of pixels and horizontal lines of the picture fore both 256x212 and 512x212. Also for 512x212 check the MSByte of every COLOR/LENGTH word (CCCC00XL LLLLLLLL). If this value & 0x0F00 > 0x200 then it is an error in the length part. This should be > 0x0100 but I see MyArt pictures where sometimes a bit to much is set (here the X in CCCC00XL LLLLLLLL).

 

It is a 512x212 picture if byte 1 of record 0 is not 0 (usually 0xFA) and the number of pixels / number of horizontal lines == 512 and  number of length errors == 0.

It is a 256x212 picture if the number of pixels / number of horizontal lines == 256

If both checks are correct then it is a 512x212 picture

If both checks fails then it is a 256x212 picture (or some other kind of file)

 

For the few files I have checked so far these assumptions seems okay 🙂

 

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...