MSX Screen 2 .SC2 files

Page 1/2
| 2

By RealHuman

Supporter (15)

RealHuman's picture

27-07-2018, 17:23

Does anybody know how .SC2 are made?
Here's an example one:
http://tomseditor.com/gallery/__temp/3ANGRYX2.SC2

I tried googling and experimented with different options but with no luck.
Please correct me. I am sure I am wrong somewhere because I tried writing a reader and it simply doesn't work.

This is 256x192 image with 1 bit per pixel (so that's 6144 bytes). First 7 bytes are a header, then we have the pixels.
Pixels are grouped into 8x8 blocks. And after the image we have a palette. For every 8x8 block there are 2 colors in the palette, each color needs 4 bits so there are 2 colors in 1 byte.
Since there are 32x24 blocks there must be 768 entries in the palette which is 384 bytes.
The palette starts right after the image. Since the image starts at 7th byte and is 6144 bytes long then the palette must start at offset 6151.

Login or register to post comments

By Jipe

Paragon (1366)

Jipe's picture

27-07-2018, 19:07

By RealHuman

Supporter (15)

RealHuman's picture

27-07-2018, 19:15

@Jipe It looks this is just a compiled exe. Thanks, but I don't need any viewer to open the images- I want to write my own.

By ARTRAG

Enlighted (6278)

ARTRAG's picture

27-07-2018, 19:20

Scr2 are a vram dump. After the 7 bytes of header there are 3*256*8 bytes of shapes of 8x8 characters.
After there are 3*256 bytes of pattern name table, usually to be ignored as characters are ordered from 0 to 255 for 3 times
After, at 8192+7 there are 3*256*8 bytes of colors
Each byte gives color to a 8x1 strip of pixels in the corresponding character, the upper nibble to 1s,the lower nibble to 0s

By RealHuman

Supporter (15)

RealHuman's picture

27-07-2018, 19:25

@ARTRAG That is very helpful, thank you very much!

By RealHuman

Supporter (15)

RealHuman's picture

27-07-2018, 20:35

@ARTRAG
May I ask you about Screen 3 .SC3 files? They are 64x48 pixels. Are they also divided into 8x8 blocks? I tried decoding the images and I think they don't have additional palette. Every pixel just needs 4 bit and uses standard MSX palette, right?

By sd_snatcher

Prophet (3092)

sd_snatcher's picture

27-07-2018, 21:39

@RealHuman

Note: in the MSX Pixel Art Collection there are many SC2 images with nonstandard name tables, and also images that make heavy use of sprites. So it's important to decode those too.

Tip1: You can find a good description of the MSX video modes in this document.

Tip2: Reinventing the wheel might cost you quite some time. Maybe you could join forces with the author of the RECOIL library? I'm sure he could use some help, and more formats could be supported much quicker.

He already implemented very advanced support for most of the MSX image formats, including sprite support and some obscure modes of the MAG file.

By RealHuman

Supporter (15)

RealHuman's picture

27-07-2018, 23:42

@sd_snatcher
Thanks for the link. I used these 2 for now:
https://www.msx.org/wiki/SCREEN
http://www.msx-plaza.eu/home.php?page=mccm/mccm72/schermen_eng

I already have support for non-sprited:
.SC2, SC3, .SC5, .SC6, .SC8, SC10 and SC12.

I like implementing the algorithms by myself. Already have 200 of them:
http://tomseditor.com/blog/viewer
The more formats I code the more I know about formats in general. And since some ideas used in one format are often used by other formats it's just quicker for me to add more formats later.
And while RECOIL is a nice program I think it's good to have an alternative which does things a bit differently :)

By sd_snatcher

Prophet (3092)

sd_snatcher's picture

28-07-2018, 00:59

Quote:

I like implementing the algorithms by myself. Already have 200 of them:
http://tomseditor.com/blog/viewer

Ok, it's your hobby. Keep up the good work! :)

If you need, you can test your rendering against RECOIL's. I helped them with the Japanese PCs decoders development: with documentation and doing a lot of testing to make sure that the images would be properly rendered. You can even grab the stress-test images I created, and some difficult-to-read files I found from their sourceforge bug tracking page.

By RealHuman

Supporter (15)

RealHuman's picture

28-07-2018, 01:17

@sd_snatcher
You mean this thread https://sourceforge.net/p/recoil/bugs/12/ ?
Lots of sample files there, yummy! Thanks :D

By sd_snatcher

Prophet (3092)

sd_snatcher's picture

28-07-2018, 01:35

Well, this one and a whole bunch of other tickets. Smile

Many are already closed, and some are still open.

Page 1/2
| 2