Doubt about SCREEN 7 image files (.s70 and .s71)

Page 1/2
| 2

By albs_br

Champion (445)

albs_br's picture

03-08-2022, 17:01

Hi guys, I was playing around with Screen 7 (512x212 16 colors), in interlaced mode (424 lines), but I'm strugling with the .S70 and .S71 files generated by the BMPtoMSX program.

How these files are supposed to be used? My naive understanding was that the first file (.s70) should be placed on page 0 (0x00000) and the second (.s71) on the page 1 (0x10000). Of course the 7 bytes header should be ignored.

Is that correct? The VRAM on interlaced mode works this way? Even lines on page 0 and odd lines on page 1?

Login or register to post comments

By Manuel

Ascended (19053)

Manuel's picture

03-08-2022, 18:23

Have you tried it?

By aoineko

Paladin (685)

aoineko's picture

03-08-2022, 18:33

This is the way.
See chapter 6 of V9938 programmer guide.

By sdsnatcher73

Prophet (3656)

sdsnatcher73's picture

03-08-2022, 18:53

You have to understand that an interlaced image is “written” on the (CRT) screen in that way. First the odd lines are written, then the beam goes back up and the even lines are written. So to make this process efficient (from a VDP perspective) this makes a lot of sense.

By albs_br

Champion (445)

albs_br's picture

03-08-2022, 18:53

Yes I tried.

Updating: I tried again using other conversion tool, MIFui, it generates 3 files, palette and 2 bitmaps. Besides the extension being different, it looks it's the same data as the BMP2MSX files.

With MIFui files, the result is the same:

On non interlaced mode, image shows perfectly, with pixels stretched vertically, as expected.

But when I set the interlaced mode, the image keeps the same, and the screen flickers.
Tested on OpenMSX with Sony XDJ and panasonic WSX machines.

By albs_br

Champion (445)

albs_br's picture

03-08-2022, 18:56

Code is here:

https://github.com/albs-br/msx-tests/blob/master/show-image-...

Specifically the part that sets interlaced mode is this:

SetInterlacedMode:
    ; set IL (bit 3) and EO (bit 2) flags of R#9
    ld      a, (REG9SAV)
    or      0000 1100 b
    ld      b, a
    ld      c, 9            ; register #
    call    BIOS_WRTVDP
    ret

I should be missing something, but what?

By albs_br

Champion (445)

albs_br's picture

03-08-2022, 19:40

I'm aware that the bitmaps are larger than the MegaROM pages, but this is not an issue for openMSX (and the problem persists even after I cut the files to 16kb)

By Parn

Paladin (809)

Parn's picture

03-08-2022, 22:51

10 SCREEN 7,,,,,3
20 SET PAGE 0,0
30 BLOAD "titan.si7",S
40 SET PAGE 1,1
50 BLOAD "titan.sj7",S
60 BLOAD "titan.pi7",S
70 COLOR=RESTORE
80 I$=INPUT$(1)

I used this program to display a 512x424 image in SCREEN 7. I'm not sure how this would translate to ASM, but it's important to set interlace mode 3 to ensure interlace is on and pages 0 and 1 are alternating, and leave page 1 visible. If you set page 0 visible the effect doesn't work.

EDIT: The above works exactly the same for any interlaced screen mode.

By Manuel

Ascended (19053)

Manuel's picture

03-08-2022, 23:07

Keep in mind that you may have the deinterlace function in openMSX enabled. That eliminates the flickering between the 2 pages.

By albs_br

Champion (445)

albs_br's picture

04-08-2022, 16:33

Parn wrote:
10 SCREEN 7,,,,,3
20 SET PAGE 0,0
30 BLOAD "titan.si7",S
40 SET PAGE 1,1
50 BLOAD "titan.sj7",S
60 BLOAD "titan.pi7",S
70 COLOR=RESTORE
80 I$=INPUT$(1)

I used this program to display a 512x424 image in SCREEN 7. I'm not sure how this would translate to ASM, but it's important to set interlace mode 3 to ensure interlace is on and pages 0 and 1 are alternating, and leave page 1 visible. If you set page 0 visible the effect doesn't work.

EDIT: The above works exactly the same for any interlaced screen mode.

Just tried it now on WebMSX and it works perfectly. Is there a way to see the values of the VDP registers on WebMSX?

By albs_br

Champion (445)

albs_br's picture

04-08-2022, 17:00

Done the same procedure on openMSX and get all VDP registers with openMSX debugger:

Page 1/2
| 2