Behavior of BASIC graphics commands in Screen 12?

By asiga

Rookie (21)

asiga's picture

04-10-2021, 18:07

Hi!

I've been searching for a reference of MSX-BASIC 3.0 and it seems it doesn't exist (I suppose it will exist at least in Japanese, but I wasn't able to find any MSX2+ manual OCR'ed in Japanese -the closest I found is the MSX2+ BASIC manual for the Sanyo Wavy, but it's not OCR'ed, so I cannot use Google Translate on it).

Anyway, what I'm most interested in, is the behaviour of graphics commands in Screen 12. I found some pages explaining it a bit, but they only explain when you draw in RGB mode (Screen 10/11), not what happens in Screen 12.

For example, the color for drawings commands seems to be specified in the 0-255 range when in YJK mode... but... what exactly you do define with that 0-255 range? Or maybe it just behaves as a brute force VPOKE into whatever byte the pixel resides?

And what about the COPY command? How does it behave if the source/destination X coordinate is not 4-pixel aligned?

Thanks!

Login or register to post comments

By Grauw

Ascended (10158)

Grauw's picture

04-10-2021, 21:30

You can use Google Translate’s camera function on your phone, I’m using that fairly regularly on Japanese manuals and manual scans on my screen and it works pretty well.

In screen mode 12 (YJK) the VDP command engine behaves as it does in screen mode 8. This means that the commands operate on bytes laid out in a 256x512 coordinate system. The same applies to the MSX-BASIC draw commands. The YJK encoding of neighbouring 4 bytes is not handled in any way. You will need to take care of this yourself, by copying only regions aligned to 4 bytes (4 pixels horizontally), and when you PSET a pixel it will affect the YJK attributes of that specific byte in the 4-byte YJK block.

The layout of the YJK attributes as well as the colour conversion formulas are described in the V9958 application manual. I’ve also written an article about it on the MAP.

p.s. There’ve been a couple of YJK mode questions the past few days, it seems people are looking at making MSX2+ content, nice! :)

By asiga

Rookie (21)

asiga's picture

05-10-2021, 19:54

Grauw wrote:

You can use Google Translate’s camera function on your phone, I’m using that fairly regularly on Japanese manuals and manual scans on my screen and it works pretty well.

Great, didn't know that!

Grauw wrote:

In screen mode 12 (YJK) the VDP command engine behaves as it does in screen mode 8. This means that the commands operate on bytes laid out in a 256x512 coordinate system. The same applies to the MSX-BASIC draw commands. The YJK encoding of neighbouring 4 bytes is not handled in any way. You will need to take care of this yourself, by copying only regions aligned to 4 bytes (4 pixels horizontally), and when you PSET a pixel it will affect the YJK attributes of that specific byte in the 4-byte YJK block.

This clearly shows that Turbo-R was a tragedy, because V9958 is nice as a quick way of increasing the number of colors from the MSX2, but it's sort of a hack (if it wasn't, at least VDP commands would be YJK-aware). Not having the next VDP finished at the time of releasing Turbo-R and thus having to continue using the V9958 was tragic.

Grauw wrote:

The layout of the YJK attributes as well as the colour conversion formulas are described in the V9958 application manual. I’ve also written an article about it on the MAP.

Yes, your article, and your realtime YJK/RGB widget helped me a lot to understand how these screen modes work.

Grauw wrote:

p.s. There’ve been a couple of YJK mode questions the past few days, it seems people are looking at making MSX2+ content, nice! :)

I don't know why, but I find Screen 8 and Screen 12 graphics very nice. I mean, nicer than 16bit 32K/64K colors and 24bit (or deeper) color. The fact that something feels close to a photograph but still looks like graphics has some charm in it. I'm not able to forget the magic of the NMS8280... :-)