DaDither - another one Img2Msx tool

Page 2/8
1 | | 3 | 4 | 5 | 6 | 7

By Grauw

Ascended (10768)

Grauw's picture

23-12-2020, 00:08

Dec wrote:
Quote:

Maybe it's also an idea to add the possiblity to automaticly create and MSX2 palette for Screen2?

I was thinking palette for Screen 2 is always fixed. Am i wrong? Is there any docs describes this feature?

An .sc2 file loaded with BLOAD,S can also include palette. After loading you can update the palette in Basic with COLOR=RESTORE.

Although if the target is MSX2, using screen 4 (bitmap layout identical to screen 2) makes more sense.

By Dec

Resident (38)

Dec's picture

23-12-2020, 00:35

Grauw wrote:

An .sc2 file loaded with BLOAD,S can also include palette. After loading you can update the palette in Basic with COLOR=RESTORE.

So even if I add adaptive palette into sc2 file there should be additional command executed in any case?

Grauw wrote:

Although if the target is MSX2, using screen 4 (bitmap layout identical to screen 2) makes more sense.

Could you explain more?

By Grauw

Ascended (10768)

Grauw's picture

23-12-2020, 01:01

Dec wrote:
Grauw wrote:

An .sc2 file loaded with BLOAD,S can also include palette. After loading you can update the palette in Basic with COLOR=RESTORE.

So even if I add adaptive palette into sc2 file there should be additional command executed in any case?

Yes, BLOAD"IMAGE.SC2",S:COLOR=RESTORE.

It’s not specific to screen 2 with MSX2 palette, when loading e.g. screen 5 you always do it as well.

Dec wrote:
Grauw wrote:

Although if the target is MSX2, using screen 4 (bitmap layout identical to screen 2) makes more sense.

Could you explain more?

On the MSX2 VDP they added screen 4 which is identical to screen 2, but using sprite mode 2 (8 sprites / line, multi-color, etc.). So on MSX2 you would generally use that unless you wanted to be compatible with MSX1. To be clear, the palette feature (as well as 212 lines) works in any mode, even the ones inherited from MSX1. The only real function of screen 4 is to select sprite mode 2.

By Dec

Resident (38)

Dec's picture

23-12-2020, 01:05

Does loading of SC4 also needs COLOR=RESTORE in case of adaptive palette? How programs that can show SCx files detect the presents of adaptive palette in SC2/SC4 files? Or there is no any standard?

By Grauw

Ascended (10768)

Grauw's picture

23-12-2020, 01:30

The MSX1 VDP does not support palette so the COLOR=RESTORE command is not available in MSX-BASIC 1.0 and screen 0-3 files saved on an MSX1 don’t contain a palette.

When saved on MSX2, all screen modes will contain a copy of the palette in VRAM. Any VRAM dump with a palette included, no matter the screen mode, needs COLOR=RESTORE. This command copies the palette mirror in VRAM to the palette registers of the VDP.

Dec wrote:

How programs that can show SCx files detect the presents of adaptive palette in SC2/SC4 files? Or there is no any standard?

Generally I would expect any file for screen 4-12 to contain a palette. For screen 0-3 I would not expect one to be present. Which is why I suggested to save as .sc4 instead of .sc2 if a palette is included. In terms of bitmap format it does not make a difference, but it is the most intuitive way to signal the presence of a palette to the user.

Alternatively I reckon you could also rely on the file size. If the load buffer is initialised with the default palette, if the VRAM dump contains a palette it will be a bit bigger and overwrite it, otherwise it will leave it untouched.

By Dec

Resident (38)

Dec's picture

23-12-2020, 01:16

If I understand everything correctly it is better to add creation of sc4 files with adaptive palette instead of addition options for sc2 file.

By Grauw

Ascended (10768)

Grauw's picture

23-12-2020, 01:18

That would be my suggestion yes.

By Dec

Resident (38)

Dec's picture

23-12-2020, 01:35

Grauw wrote:

That would be my suggestion yes.

Ok, I will do it.
Maybe you know where can I find specifications of 10/11/12 modes?

By Grauw

Ascended (10768)

Grauw's picture

23-12-2020, 02:20

The MSX2+ screens 10-12, or more precisely the YJK and YJK+YAE modes, are described in the V9958 application manual pages 8-10. It’s similar to YUV, involving a bit of math and attribute clash between 4 horizontally adjacent pixels, but can show up to 19268 colours.

For more novice-friendly reading, there’s the MSX 2+ screens article by Alex Wulms. I’m also writing an elaborate article for the MSX Assembly Page, but it’s not done yet so that doesn’t do you any good. There’s also some discussion on more advanced encoding considerations in this forum thread.

By Dec

Resident (38)

Dec's picture

23-12-2020, 03:26

Question about palette placement inside sc4 file. According to this doc palette should start at 1E80(+7), but according to wiki palette should start at 1B80(+7). What is right offset?

Page 2/8
1 | | 3 | 4 | 5 | 6 | 7